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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 GenerateDeoptJumpTable() && | 77 GenerateDeoptJumpTable() && |
78 GenerateSafepointTable(); | 78 GenerateSafepointTable(); |
79 } | 79 } |
80 | 80 |
81 | 81 |
82 void LCodeGen::FinishCode(Handle<Code> code) { | 82 void LCodeGen::FinishCode(Handle<Code> code) { |
83 ASSERT(is_done()); | 83 ASSERT(is_done()); |
84 code->set_stack_slots(GetStackSlotCount()); | 84 code->set_stack_slots(GetStackSlotCount()); |
85 code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); | 85 code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); |
86 PopulateDeoptimizationData(code); | 86 PopulateDeoptimizationData(code); |
| 87 for (int i = 0 ; i < prototype_maps_.length(); i++) { |
| 88 prototype_maps_.at(i)->AddDependentCode( |
| 89 DependentCode::kPrototypeCheckGroup, code); |
| 90 } |
87 } | 91 } |
88 | 92 |
89 | 93 |
90 void LCodeGen::Abort(const char* reason) { | 94 void LCodeGen::Abort(const char* reason) { |
91 info()->set_bailout_reason(reason); | 95 info()->set_bailout_reason(reason); |
92 status_ = ABORTED; | 96 status_ = ABORTED; |
93 } | 97 } |
94 | 98 |
95 | 99 |
96 void LCodeGen::Comment(const char* format, ...) { | 100 void LCodeGen::Comment(const char* format, ...) { |
(...skipping 5377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5474 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { | 5478 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { |
5475 ASSERT(instr->temp()->Equals(instr->result())); | 5479 ASSERT(instr->temp()->Equals(instr->result())); |
5476 Register prototype_reg = ToRegister(instr->temp()); | 5480 Register prototype_reg = ToRegister(instr->temp()); |
5477 Register map_reg = ToRegister(instr->temp2()); | 5481 Register map_reg = ToRegister(instr->temp2()); |
5478 | 5482 |
5479 ZoneList<Handle<JSObject> >* prototypes = instr->prototypes(); | 5483 ZoneList<Handle<JSObject> >* prototypes = instr->prototypes(); |
5480 ZoneList<Handle<Map> >* maps = instr->maps(); | 5484 ZoneList<Handle<Map> >* maps = instr->maps(); |
5481 | 5485 |
5482 ASSERT(prototypes->length() == maps->length()); | 5486 ASSERT(prototypes->length() == maps->length()); |
5483 | 5487 |
5484 for (int i = 0; i < prototypes->length(); i++) { | 5488 if (instr->hydrogen()->CanOmitPrototypeChecks()) { |
5485 __ LoadHeapObject(prototype_reg, prototypes->at(i)); | 5489 for (int i = 0; i < maps->length(); i++) { |
5486 __ ldr(map_reg, FieldMemOperand(prototype_reg, HeapObject::kMapOffset)); | 5490 prototype_maps_.Add(maps->at(i), info()->zone()); |
5487 DoCheckMapCommon(map_reg, | 5491 } |
5488 maps->at(i), | 5492 __ LoadHeapObject(prototype_reg, |
5489 ALLOW_ELEMENT_TRANSITION_MAPS, | 5493 prototypes->at(prototypes->length() - 1)); |
5490 instr->environment()); | 5494 } else { |
| 5495 for (int i = 0; i < prototypes->length(); i++) { |
| 5496 __ LoadHeapObject(prototype_reg, prototypes->at(i)); |
| 5497 __ ldr(map_reg, FieldMemOperand(prototype_reg, HeapObject::kMapOffset)); |
| 5498 DoCheckMapCommon(map_reg, |
| 5499 maps->at(i), |
| 5500 ALLOW_ELEMENT_TRANSITION_MAPS, |
| 5501 instr->environment()); |
| 5502 } |
5491 } | 5503 } |
5492 } | 5504 } |
5493 | 5505 |
5494 | 5506 |
5495 void LCodeGen::DoAllocateObject(LAllocateObject* instr) { | 5507 void LCodeGen::DoAllocateObject(LAllocateObject* instr) { |
5496 class DeferredAllocateObject: public LDeferredCode { | 5508 class DeferredAllocateObject: public LDeferredCode { |
5497 public: | 5509 public: |
5498 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) | 5510 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) |
5499 : LDeferredCode(codegen), instr_(instr) { } | 5511 : LDeferredCode(codegen), instr_(instr) { } |
5500 virtual void Generate() { codegen()->DoDeferredAllocateObject(instr_); } | 5512 virtual void Generate() { codegen()->DoDeferredAllocateObject(instr_); } |
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6316 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); | 6328 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); |
6317 __ ldr(result, FieldMemOperand(scratch, | 6329 __ ldr(result, FieldMemOperand(scratch, |
6318 FixedArray::kHeaderSize - kPointerSize)); | 6330 FixedArray::kHeaderSize - kPointerSize)); |
6319 __ bind(&done); | 6331 __ bind(&done); |
6320 } | 6332 } |
6321 | 6333 |
6322 | 6334 |
6323 #undef __ | 6335 #undef __ |
6324 | 6336 |
6325 } } // namespace v8::internal | 6337 } } // namespace v8::internal |
OLD | NEW |