OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1120 LEnvironment* environment) { | 1120 LEnvironment* environment) { |
1121 Deoptimizer::BailoutType bailout_type = info()->IsStub() | 1121 Deoptimizer::BailoutType bailout_type = info()->IsStub() |
1122 ? Deoptimizer::LAZY | 1122 ? Deoptimizer::LAZY |
1123 : Deoptimizer::EAGER; | 1123 : Deoptimizer::EAGER; |
1124 DeoptimizeIf(cc, environment, bailout_type); | 1124 DeoptimizeIf(cc, environment, bailout_type); |
1125 } | 1125 } |
1126 | 1126 |
1127 | 1127 |
1128 void LCodeGen::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) { | 1128 void LCodeGen::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) { |
1129 ZoneList<Handle<Map> > maps(1, zone()); | 1129 ZoneList<Handle<Map> > maps(1, zone()); |
| 1130 ZoneList<Handle<JSObject> > objects(1, zone()); |
1130 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); | 1131 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
1131 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { | 1132 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { |
1132 RelocInfo::Mode mode = it.rinfo()->rmode(); | 1133 if (Code::IsWeakEmbeddedObject(code->kind(), it.rinfo()->target_object())) { |
1133 if (mode == RelocInfo::EMBEDDED_OBJECT && | 1134 if (it.rinfo()->target_object()->IsMap()) { |
1134 it.rinfo()->target_object()->IsMap()) { | 1135 Handle<Map> map(Map::cast(it.rinfo()->target_object())); |
1135 Handle<Map> map(Map::cast(it.rinfo()->target_object())); | |
1136 if (map->CanTransition()) { | |
1137 maps.Add(map, zone()); | 1136 maps.Add(map, zone()); |
| 1137 } else if (it.rinfo()->target_object()->IsJSObject()) { |
| 1138 Handle<JSObject> object(JSObject::cast(it.rinfo()->target_object())); |
| 1139 objects.Add(object, zone()); |
1138 } | 1140 } |
1139 } | 1141 } |
1140 } | 1142 } |
1141 #ifdef VERIFY_HEAP | 1143 #ifdef VERIFY_HEAP |
1142 // This disables verification of weak embedded maps after full GC. | 1144 // This disables verification of weak embedded objects after full GC. |
1143 // AddDependentCode can cause a GC, which would observe the state where | 1145 // AddDependentCode can cause a GC, which would observe the state where |
1144 // this code is not yet in the depended code lists of the embedded maps. | 1146 // this code is not yet in the depended code lists of the embedded maps. |
1145 NoWeakEmbeddedMapsVerificationScope disable_verification_of_embedded_maps; | 1147 NoWeakObjectVerificationScope disable_verification_of_embedded_objects; |
1146 #endif | 1148 #endif |
1147 for (int i = 0; i < maps.length(); i++) { | 1149 for (int i = 0; i < maps.length(); i++) { |
1148 maps.at(i)->AddDependentCode(DependentCode::kWeaklyEmbeddedGroup, code); | 1150 maps.at(i)->AddDependentCode(DependentCode::kWeaklyEmbeddedGroup, code); |
1149 } | 1151 } |
| 1152 for (int i = 0; i < objects.length(); i++) { |
| 1153 AddWeakObjectToCodeDependency(isolate()->heap(), objects.at(i), code); |
| 1154 } |
1150 } | 1155 } |
1151 | 1156 |
1152 | 1157 |
1153 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { | 1158 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { |
1154 int length = deoptimizations_.length(); | 1159 int length = deoptimizations_.length(); |
1155 if (length == 0) return; | 1160 if (length == 0) return; |
1156 Handle<DeoptimizationInputData> data = | 1161 Handle<DeoptimizationInputData> data = |
1157 factory()->NewDeoptimizationInputData(length, TENURED); | 1162 factory()->NewDeoptimizationInputData(length, TENURED); |
1158 | 1163 |
1159 Handle<ByteArray> translations = | 1164 Handle<ByteArray> translations = |
(...skipping 5194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6354 FixedArray::kHeaderSize - kPointerSize)); | 6359 FixedArray::kHeaderSize - kPointerSize)); |
6355 __ bind(&done); | 6360 __ bind(&done); |
6356 } | 6361 } |
6357 | 6362 |
6358 | 6363 |
6359 #undef __ | 6364 #undef __ |
6360 | 6365 |
6361 } } // namespace v8::internal | 6366 } } // namespace v8::internal |
6362 | 6367 |
6363 #endif // V8_TARGET_ARCH_IA32 | 6368 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |