Chromium Code Reviews| Index: src/ia32/lithium-codegen-ia32.cc |
| diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc |
| index dfced7c221335f060f7c333e02c0ec38bb7516d8..94bba205320002dff531c9356bd87a3d96e87310 100644 |
| --- a/src/ia32/lithium-codegen-ia32.cc |
| +++ b/src/ia32/lithium-codegen-ia32.cc |
| @@ -5332,9 +5332,21 @@ 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); |
| + bool can_ommit_checks = true; |
| + for (int i = 0; i < maps->length() && can_ommit_checks; i++) { |
| + if (maps->at(i)->HasTransitionArray()) can_ommit_checks = false; |
| + if (maps->at(i)->is_dictionary_map()) can_ommit_checks = false; |
|
Toon Verwaest
2013/02/11 12:23:45
This could should really go somewhere else; probab
ulan
2013/02/12 13:42:07
Done. After discussion with Jakob, I moved the loo
|
| + } |
| + if (can_ommit_checks) { |
| + 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); |
| + } |
| } |
| } |