Index: src/x64/lithium-codegen-x64.cc |
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc |
index 9913ee3a9f593bc518ca0afb86a5423acbadbc1f..0ad4e973b67aaef99af5707c7d304cefc8152edc 100644 |
--- a/src/x64/lithium-codegen-x64.cc |
+++ b/src/x64/lithium-codegen-x64.cc |
@@ -92,6 +92,10 @@ void LCodeGen::FinishCode(Handle<Code> code) { |
RegisterDependentCodeForEmbeddedMaps(code); |
} |
PopulateDeoptimizationData(code); |
+ for (int i = 0 ; i < prototype_maps_.length(); i++) { |
+ prototype_maps_.at(i)->AddDependentCode( |
+ DependentCode::kPrototypeCheckGroup, code); |
+ } |
} |
@@ -780,7 +784,7 @@ void LCodeGen::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) { |
NoWeakEmbeddedMapsVerificationScope disable_verification_of_embedded_maps; |
#endif |
for (int i = 0; i < maps.length(); i++) { |
- maps.at(i)->AddDependentCode(code); |
+ maps.at(i)->AddDependentCode(DependentCode::kWeaklyEmbeddedGroup, code); |
} |
} |
@@ -4922,9 +4926,16 @@ void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { |
ASSERT(prototypes->length() == maps->length()); |
- for (int i = 0; i < prototypes->length(); i++) { |
- __ LoadHeapObject(reg, prototypes->at(i)); |
- DoCheckMapCommon(reg, maps->at(i), ALLOW_ELEMENT_TRANSITION_MAPS, instr); |
+ if (instr->hydrogen()->CanOmitPrototypeChecks()) { |
+ for (int i = 0; i < maps->length(); i++) { |
+ prototype_maps_.Add(maps->at(i), info()->zone()); |
+ } |
+ __ LoadHeapObject(reg, prototypes->at(prototypes->length() - 1)); |
+ } else { |
+ for (int i = 0; i < prototypes->length(); i++) { |
+ __ LoadHeapObject(reg, prototypes->at(i)); |
+ DoCheckMapCommon(reg, maps->at(i), ALLOW_ELEMENT_TRANSITION_MAPS, instr); |
+ } |
} |
} |