| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 93 |
| 94 | 94 |
| 95 void LCodeGen::FinishCode(Handle<Code> code) { | 95 void LCodeGen::FinishCode(Handle<Code> code) { |
| 96 ASSERT(is_done()); | 96 ASSERT(is_done()); |
| 97 code->set_stack_slots(GetStackSlotCount()); | 97 code->set_stack_slots(GetStackSlotCount()); |
| 98 code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); | 98 code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); |
| 99 PopulateDeoptimizationData(code); | 99 PopulateDeoptimizationData(code); |
| 100 if (!info()->IsStub()) { | 100 if (!info()->IsStub()) { |
| 101 Deoptimizer::EnsureRelocSpaceForLazyDeoptimization(code); | 101 Deoptimizer::EnsureRelocSpaceForLazyDeoptimization(code); |
| 102 } | 102 } |
| 103 for (int i = 0 ; i < prototype_maps_.length(); i++) { |
| 104 prototype_maps_.at(i)->AddDependentCode( |
| 105 DependentCode::kPrototypeCheckGroup, code); |
| 106 } |
| 103 } | 107 } |
| 104 | 108 |
| 105 | 109 |
| 106 void LCodeGen::Abort(const char* reason) { | 110 void LCodeGen::Abort(const char* reason) { |
| 107 info()->set_bailout_reason(reason); | 111 info()->set_bailout_reason(reason); |
| 108 status_ = ABORTED; | 112 status_ = ABORTED; |
| 109 } | 113 } |
| 110 | 114 |
| 111 | 115 |
| 112 void LCodeGen::Comment(const char* format, ...) { | 116 void LCodeGen::Comment(const char* format, ...) { |
| (...skipping 5212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5325 | 5329 |
| 5326 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { | 5330 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { |
| 5327 ASSERT(instr->temp()->Equals(instr->result())); | 5331 ASSERT(instr->temp()->Equals(instr->result())); |
| 5328 Register reg = ToRegister(instr->temp()); | 5332 Register reg = ToRegister(instr->temp()); |
| 5329 | 5333 |
| 5330 ZoneList<Handle<JSObject> >* prototypes = instr->prototypes(); | 5334 ZoneList<Handle<JSObject> >* prototypes = instr->prototypes(); |
| 5331 ZoneList<Handle<Map> >* maps = instr->maps(); | 5335 ZoneList<Handle<Map> >* maps = instr->maps(); |
| 5332 | 5336 |
| 5333 ASSERT(prototypes->length() == maps->length()); | 5337 ASSERT(prototypes->length() == maps->length()); |
| 5334 | 5338 |
| 5335 for (int i = 0; i < prototypes->length(); i++) { | 5339 if (instr->hydrogen()->CanOmitPrototypeChecks()) { |
| 5336 __ LoadHeapObject(reg, prototypes->at(i)); | 5340 for (int i = 0; i < maps->length(); i++) { |
| 5337 DoCheckMapCommon(reg, maps->at(i), ALLOW_ELEMENT_TRANSITION_MAPS, instr); | 5341 prototype_maps_.Add(maps->at(i), info()->zone()); |
| 5342 } |
| 5343 __ LoadHeapObject(reg, prototypes->at(prototypes->length() - 1)); |
| 5344 } else { |
| 5345 for (int i = 0; i < prototypes->length(); i++) { |
| 5346 __ LoadHeapObject(reg, prototypes->at(i)); |
| 5347 DoCheckMapCommon(reg, maps->at(i), ALLOW_ELEMENT_TRANSITION_MAPS, instr); |
| 5348 } |
| 5338 } | 5349 } |
| 5339 } | 5350 } |
| 5340 | 5351 |
| 5341 | 5352 |
| 5342 void LCodeGen::DoAllocateObject(LAllocateObject* instr) { | 5353 void LCodeGen::DoAllocateObject(LAllocateObject* instr) { |
| 5343 class DeferredAllocateObject: public LDeferredCode { | 5354 class DeferredAllocateObject: public LDeferredCode { |
| 5344 public: | 5355 public: |
| 5345 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) | 5356 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) |
| 5346 : LDeferredCode(codegen), instr_(instr) { } | 5357 : LDeferredCode(codegen), instr_(instr) { } |
| 5347 virtual void Generate() { codegen()->DoDeferredAllocateObject(instr_); } | 5358 virtual void Generate() { codegen()->DoDeferredAllocateObject(instr_); } |
| (...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6178 FixedArray::kHeaderSize - kPointerSize)); | 6189 FixedArray::kHeaderSize - kPointerSize)); |
| 6179 __ bind(&done); | 6190 __ bind(&done); |
| 6180 } | 6191 } |
| 6181 | 6192 |
| 6182 | 6193 |
| 6183 #undef __ | 6194 #undef __ |
| 6184 | 6195 |
| 6185 } } // namespace v8::internal | 6196 } } // namespace v8::internal |
| 6186 | 6197 |
| 6187 #endif // V8_TARGET_ARCH_IA32 | 6198 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |