| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 if (FLAG_weak_embedded_maps_in_optimized_code) { | 86 if (FLAG_weak_embedded_maps_in_optimized_code) { |
| 87 RegisterDependentCodeForEmbeddedMaps(code); | 87 RegisterDependentCodeForEmbeddedMaps(code); |
| 88 } | 88 } |
| 89 PopulateDeoptimizationData(code); | 89 PopulateDeoptimizationData(code); |
| 90 for (int i = 0 ; i < prototype_maps_.length(); i++) { |
| 91 prototype_maps_.at(i)->AddDependentCode( |
| 92 DependentCode::kPrototypeCheckGroup, code); |
| 93 } |
| 90 } | 94 } |
| 91 | 95 |
| 92 | 96 |
| 93 void LCodeGen::Abort(const char* reason) { | 97 void LCodeGen::Abort(const char* reason) { |
| 94 info()->set_bailout_reason(reason); | 98 info()->set_bailout_reason(reason); |
| 95 status_ = ABORTED; | 99 status_ = ABORTED; |
| 96 } | 100 } |
| 97 | 101 |
| 98 | 102 |
| 99 void LCodeGen::Comment(const char* format, ...) { | 103 void LCodeGen::Comment(const char* format, ...) { |
| (...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 880 } | 884 } |
| 881 } | 885 } |
| 882 } | 886 } |
| 883 #ifdef VERIFY_HEAP | 887 #ifdef VERIFY_HEAP |
| 884 // This disables verification of weak embedded maps after full GC. | 888 // This disables verification of weak embedded maps after full GC. |
| 885 // AddDependentCode can cause a GC, which would observe the state where | 889 // AddDependentCode can cause a GC, which would observe the state where |
| 886 // this code is not yet in the depended code lists of the embedded maps. | 890 // this code is not yet in the depended code lists of the embedded maps. |
| 887 NoWeakEmbeddedMapsVerificationScope disable_verification_of_embedded_maps; | 891 NoWeakEmbeddedMapsVerificationScope disable_verification_of_embedded_maps; |
| 888 #endif | 892 #endif |
| 889 for (int i = 0; i < maps.length(); i++) { | 893 for (int i = 0; i < maps.length(); i++) { |
| 890 maps.at(i)->AddDependentCode(code); | 894 maps.at(i)->AddDependentCode(DependentCode::kWeaklyEmbeddedGroup, code); |
| 891 } | 895 } |
| 892 } | 896 } |
| 893 | 897 |
| 894 | 898 |
| 895 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { | 899 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { |
| 896 int length = deoptimizations_.length(); | 900 int length = deoptimizations_.length(); |
| 897 if (length == 0) return; | 901 if (length == 0) return; |
| 898 Handle<DeoptimizationInputData> data = | 902 Handle<DeoptimizationInputData> data = |
| 899 factory()->NewDeoptimizationInputData(length, TENURED); | 903 factory()->NewDeoptimizationInputData(length, TENURED); |
| 900 | 904 |
| (...skipping 4570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5471 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { | 5475 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { |
| 5472 ASSERT(instr->temp()->Equals(instr->result())); | 5476 ASSERT(instr->temp()->Equals(instr->result())); |
| 5473 Register prototype_reg = ToRegister(instr->temp()); | 5477 Register prototype_reg = ToRegister(instr->temp()); |
| 5474 Register map_reg = ToRegister(instr->temp2()); | 5478 Register map_reg = ToRegister(instr->temp2()); |
| 5475 | 5479 |
| 5476 ZoneList<Handle<JSObject> >* prototypes = instr->prototypes(); | 5480 ZoneList<Handle<JSObject> >* prototypes = instr->prototypes(); |
| 5477 ZoneList<Handle<Map> >* maps = instr->maps(); | 5481 ZoneList<Handle<Map> >* maps = instr->maps(); |
| 5478 | 5482 |
| 5479 ASSERT(prototypes->length() == maps->length()); | 5483 ASSERT(prototypes->length() == maps->length()); |
| 5480 | 5484 |
| 5481 for (int i = 0; i < prototypes->length(); i++) { | 5485 if (instr->hydrogen()->CanOmitPrototypeChecks()) { |
| 5482 __ LoadHeapObject(prototype_reg, prototypes->at(i)); | 5486 for (int i = 0; i < maps->length(); i++) { |
| 5483 __ ldr(map_reg, FieldMemOperand(prototype_reg, HeapObject::kMapOffset)); | 5487 prototype_maps_.Add(maps->at(i), info()->zone()); |
| 5484 DoCheckMapCommon(map_reg, | 5488 } |
| 5485 maps->at(i), | 5489 __ LoadHeapObject(prototype_reg, |
| 5486 ALLOW_ELEMENT_TRANSITION_MAPS, | 5490 prototypes->at(prototypes->length() - 1)); |
| 5487 instr->environment()); | 5491 } else { |
| 5492 for (int i = 0; i < prototypes->length(); i++) { |
| 5493 __ LoadHeapObject(prototype_reg, prototypes->at(i)); |
| 5494 __ ldr(map_reg, FieldMemOperand(prototype_reg, HeapObject::kMapOffset)); |
| 5495 DoCheckMapCommon(map_reg, |
| 5496 maps->at(i), |
| 5497 ALLOW_ELEMENT_TRANSITION_MAPS, |
| 5498 instr->environment()); |
| 5499 } |
| 5488 } | 5500 } |
| 5489 } | 5501 } |
| 5490 | 5502 |
| 5491 | 5503 |
| 5492 void LCodeGen::DoAllocateObject(LAllocateObject* instr) { | 5504 void LCodeGen::DoAllocateObject(LAllocateObject* instr) { |
| 5493 class DeferredAllocateObject: public LDeferredCode { | 5505 class DeferredAllocateObject: public LDeferredCode { |
| 5494 public: | 5506 public: |
| 5495 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) | 5507 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) |
| 5496 : LDeferredCode(codegen), instr_(instr) { } | 5508 : LDeferredCode(codegen), instr_(instr) { } |
| 5497 virtual void Generate() { codegen()->DoDeferredAllocateObject(instr_); } | 5509 virtual void Generate() { codegen()->DoDeferredAllocateObject(instr_); } |
| (...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6313 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); | 6325 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); |
| 6314 __ ldr(result, FieldMemOperand(scratch, | 6326 __ ldr(result, FieldMemOperand(scratch, |
| 6315 FixedArray::kHeaderSize - kPointerSize)); | 6327 FixedArray::kHeaderSize - kPointerSize)); |
| 6316 __ bind(&done); | 6328 __ bind(&done); |
| 6317 } | 6329 } |
| 6318 | 6330 |
| 6319 | 6331 |
| 6320 #undef __ | 6332 #undef __ |
| 6321 | 6333 |
| 6322 } } // namespace v8::internal | 6334 } } // namespace v8::internal |
| OLD | NEW |