OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 // can be patched to anything. | 569 // can be patched to anything. |
570 PatchInlinedLoad(address, Heap::null_value(), 0); | 570 PatchInlinedLoad(address, Heap::null_value(), 0); |
571 } | 571 } |
572 | 572 |
573 | 573 |
574 bool LoadIC::PatchInlinedLoad(Address address, Object* map, int offset) { | 574 bool LoadIC::PatchInlinedLoad(Address address, Object* map, int offset) { |
575 // If the instruction after the call site is not the pseudo instruction nop1 | 575 // If the instruction after the call site is not the pseudo instruction nop1 |
576 // then this is not related to an inlined in-object property load. The nop1 | 576 // then this is not related to an inlined in-object property load. The nop1 |
577 // instruction is located just after the call to the IC in the deferred code | 577 // instruction is located just after the call to the IC in the deferred code |
578 // handling the miss in the inlined code. After the nop1 instruction there is | 578 // handling the miss in the inlined code. After the nop1 instruction there is |
579 // a B instruction for jumping back from the deferred code. | 579 // a branch instruction for jumping back from the deferred code. |
580 Address address_after_call = address + Assembler::kCallTargetAddressOffset; | 580 Address address_after_call = address + Assembler::kCallTargetAddressOffset; |
581 Instr instr_after_call = Assembler::instr_at(address_after_call); | 581 Instr instr_after_call = Assembler::instr_at(address_after_call); |
582 if (!Assembler::IsNop(instr_after_call, NAMED_PROPERTY_LOAD_INLINED)) { | 582 if (!Assembler::IsNop(instr_after_call, NAMED_PROPERTY_LOAD_INLINED)) { |
583 return false; | 583 return false; |
584 } | 584 } |
585 ASSERT_EQ(0, RegisterAllocator::kNumRegisters); | 585 ASSERT_EQ(0, RegisterAllocator::kNumRegisters); |
586 Address address_after_nop1 = address_after_call + Assembler::kInstrSize; | 586 Address address_after_nop1 = address_after_call + Assembler::kInstrSize; |
587 Instr instr_after_nop1 = Assembler::instr_at(address_after_nop1); | 587 Instr instr_after_nop1 = Assembler::instr_at(address_after_nop1); |
588 ASSERT(Assembler::IsBranch(instr_after_nop1)); | 588 ASSERT(Assembler::IsBranch(instr_after_nop1)); |
589 | 589 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 | 702 |
703 // Get the elements array of the object. | 703 // Get the elements array of the object. |
704 __ ldr(r1, FieldMemOperand(r1, JSObject::kElementsOffset)); | 704 __ ldr(r1, FieldMemOperand(r1, JSObject::kElementsOffset)); |
705 // Check that the object is in fast mode (not dictionary). | 705 // Check that the object is in fast mode (not dictionary). |
706 __ ldr(r3, FieldMemOperand(r1, HeapObject::kMapOffset)); | 706 __ ldr(r3, FieldMemOperand(r1, HeapObject::kMapOffset)); |
707 __ LoadRoot(ip, Heap::kFixedArrayMapRootIndex); | 707 __ LoadRoot(ip, Heap::kFixedArrayMapRootIndex); |
708 __ cmp(r3, ip); | 708 __ cmp(r3, ip); |
709 __ b(ne, &check_pixel_array); | 709 __ b(ne, &check_pixel_array); |
710 // Check that the key (index) is within bounds. | 710 // Check that the key (index) is within bounds. |
711 __ ldr(r3, FieldMemOperand(r1, Array::kLengthOffset)); | 711 __ ldr(r3, FieldMemOperand(r1, Array::kLengthOffset)); |
712 __ cmp(r0, Operand(r3)); | 712 __ cmp(r0, r3); |
713 __ b(hs, &slow); | 713 __ b(hs, &slow); |
714 // Fast case: Do the load. | 714 // Fast case: Do the load. |
715 __ add(r3, r1, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); | 715 __ add(r3, r1, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
716 __ ldr(r0, MemOperand(r3, r0, LSL, kPointerSizeLog2)); | 716 __ ldr(r0, MemOperand(r3, r0, LSL, kPointerSizeLog2)); |
717 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); | 717 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
718 __ cmp(r0, ip); | 718 __ cmp(r0, ip); |
719 // In case the loaded value is the_hole we have to consult GetProperty | 719 // In case the loaded value is the_hole we have to consult GetProperty |
720 // to ensure the prototype chain is searched. | 720 // to ensure the prototype chain is searched. |
721 __ b(eq, &slow); | 721 __ b(eq, &slow); |
722 __ Ret(); | 722 __ Ret(); |
(...skipping 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1738 __ bind(&miss); | 1738 __ bind(&miss); |
1739 | 1739 |
1740 GenerateMiss(masm); | 1740 GenerateMiss(masm); |
1741 } | 1741 } |
1742 | 1742 |
1743 | 1743 |
1744 #undef __ | 1744 #undef __ |
1745 | 1745 |
1746 | 1746 |
1747 } } // namespace v8::internal | 1747 } } // namespace v8::internal |
OLD | NEW |