Index: src/mips/lithium-codegen-mips.cc |
diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc |
index 13dd63ceaf40707bab47c2f6788e84b5e59d8614..d08ac229123ca867f50d1f390417cdc5af109ac2 100644 |
--- a/src/mips/lithium-codegen-mips.cc |
+++ b/src/mips/lithium-codegen-mips.cc |
@@ -85,6 +85,10 @@ void LCodeGen::FinishCode(Handle<Code> code) { |
code->set_stack_slots(GetStackSlotCount()); |
code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); |
PopulateDeoptimizationData(code); |
+ for (int i = 0 ; i < prototype_maps_.length(); i++) { |
+ prototype_maps_.at(i)->AddDependentCode( |
+ DependentCode::kPrototypeCheckGroup, code); |
+ } |
} |
@@ -5014,13 +5018,21 @@ void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { |
ASSERT(prototypes->length() == maps->length()); |
- for (int i = 0; i < prototypes->length(); i++) { |
- __ LoadHeapObject(prototype_reg, prototypes->at(i)); |
- __ lw(map_reg, FieldMemOperand(prototype_reg, HeapObject::kMapOffset)); |
- DoCheckMapCommon(map_reg, |
- maps->at(i), |
- ALLOW_ELEMENT_TRANSITION_MAPS, |
- instr->environment()); |
+ if (instr->hydrogen()->CanOmitPrototypeChecks()) { |
+ for (int i = 0; i < maps->length(); i++) { |
+ prototype_maps_.Add(maps->at(i), info()->zone()); |
+ } |
+ __ LoadHeapObject(prototype_reg, |
+ prototypes->at(prototypes->length() - 1)); |
+ } else { |
+ for (int i = 0; i < prototypes->length(); i++) { |
+ __ LoadHeapObject(prototype_reg, prototypes->at(i)); |
+ __ lw(map_reg, FieldMemOperand(prototype_reg, HeapObject::kMapOffset)); |
+ DoCheckMapCommon(map_reg, |
+ maps->at(i), |
+ ALLOW_ELEMENT_TRANSITION_MAPS, |
+ instr->environment()); |
+ } |
} |
} |