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 5314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5325 | 5325 |
5326 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { | 5326 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { |
5327 ASSERT(instr->temp()->Equals(instr->result())); | 5327 ASSERT(instr->temp()->Equals(instr->result())); |
5328 Register reg = ToRegister(instr->temp()); | 5328 Register reg = ToRegister(instr->temp()); |
5329 | 5329 |
5330 ZoneList<Handle<JSObject> >* prototypes = instr->prototypes(); | 5330 ZoneList<Handle<JSObject> >* prototypes = instr->prototypes(); |
5331 ZoneList<Handle<Map> >* maps = instr->maps(); | 5331 ZoneList<Handle<Map> >* maps = instr->maps(); |
5332 | 5332 |
5333 ASSERT(prototypes->length() == maps->length()); | 5333 ASSERT(prototypes->length() == maps->length()); |
5334 | 5334 |
5335 for (int i = 0; i < prototypes->length(); i++) { | 5335 bool can_ommit_checks = true; |
5336 __ LoadHeapObject(reg, prototypes->at(i)); | 5336 for (int i = 0; i < maps->length() && can_ommit_checks; i++) { |
5337 DoCheckMapCommon(reg, maps->at(i), ALLOW_ELEMENT_TRANSITION_MAPS, instr); | 5337 if (maps->at(i)->HasTransitionArray()) can_ommit_checks = false; |
5338 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
| |
5339 } | |
5340 if (can_ommit_checks) { | |
5341 for (int i = 0; i < maps->length(); i++) { | |
5342 prototype_maps_.Add(maps->at(i), info()->zone()); | |
5343 } | |
5344 __ LoadHeapObject(reg, prototypes->at(prototypes->length() - 1)); | |
5345 } else { | |
5346 for (int i = 0; i < prototypes->length(); i++) { | |
5347 __ LoadHeapObject(reg, prototypes->at(i)); | |
5348 DoCheckMapCommon(reg, maps->at(i), ALLOW_ELEMENT_TRANSITION_MAPS, instr); | |
5349 } | |
5338 } | 5350 } |
5339 } | 5351 } |
5340 | 5352 |
5341 | 5353 |
5342 void LCodeGen::DoAllocateObject(LAllocateObject* instr) { | 5354 void LCodeGen::DoAllocateObject(LAllocateObject* instr) { |
5343 class DeferredAllocateObject: public LDeferredCode { | 5355 class DeferredAllocateObject: public LDeferredCode { |
5344 public: | 5356 public: |
5345 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) | 5357 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) |
5346 : LDeferredCode(codegen), instr_(instr) { } | 5358 : LDeferredCode(codegen), instr_(instr) { } |
5347 virtual void Generate() { codegen()->DoDeferredAllocateObject(instr_); } | 5359 virtual void Generate() { codegen()->DoDeferredAllocateObject(instr_); } |
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6178 FixedArray::kHeaderSize - kPointerSize)); | 6190 FixedArray::kHeaderSize - kPointerSize)); |
6179 __ bind(&done); | 6191 __ bind(&done); |
6180 } | 6192 } |
6181 | 6193 |
6182 | 6194 |
6183 #undef __ | 6195 #undef __ |
6184 | 6196 |
6185 } } // namespace v8::internal | 6197 } } // namespace v8::internal |
6186 | 6198 |
6187 #endif // V8_TARGET_ARCH_IA32 | 6199 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |