| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #if V8_TARGET_ARCH_ARM | 5 #if V8_TARGET_ARCH_ARM |
| 6 | 6 |
| 7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
| 8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
| 9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
| 10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
| (...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 // frame. | 768 // frame. |
| 769 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { | 769 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { |
| 770 // Open a frame scope to indicate that there is a frame on the stack. The | 770 // Open a frame scope to indicate that there is a frame on the stack. The |
| 771 // MANUAL indicates that the scope shouldn't actually generate code to set up | 771 // MANUAL indicates that the scope shouldn't actually generate code to set up |
| 772 // the frame (that is done below). | 772 // the frame (that is done below). |
| 773 FrameScope frame_scope(masm, StackFrame::MANUAL); | 773 FrameScope frame_scope(masm, StackFrame::MANUAL); |
| 774 __ PushFixedFrame(r1); | 774 __ PushFixedFrame(r1); |
| 775 __ add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); | 775 __ add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); |
| 776 __ push(r3); | 776 __ push(r3); |
| 777 | 777 |
| 778 // Push zero for bytecode array offset. |
| 779 __ mov(r0, Operand(0)); |
| 780 __ push(r0); |
| 781 |
| 778 // Get the bytecode array from the function object and load the pointer to the | 782 // Get the bytecode array from the function object and load the pointer to the |
| 779 // first entry into kInterpreterBytecodeRegister. | 783 // first entry into kInterpreterBytecodeRegister. |
| 780 __ ldr(r0, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); | 784 __ ldr(r0, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); |
| 781 __ ldr(kInterpreterBytecodeArrayRegister, | 785 __ ldr(kInterpreterBytecodeArrayRegister, |
| 782 FieldMemOperand(r0, SharedFunctionInfo::kFunctionDataOffset)); | 786 FieldMemOperand(r0, SharedFunctionInfo::kFunctionDataOffset)); |
| 783 | 787 |
| 784 if (FLAG_debug_code) { | 788 if (FLAG_debug_code) { |
| 785 // Check function data field is actually a BytecodeArray object. | 789 // Check function data field is actually a BytecodeArray object. |
| 786 __ SmiTst(kInterpreterBytecodeArrayRegister); | 790 __ SmiTst(kInterpreterBytecodeArrayRegister); |
| 787 __ Assert(ne, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry); | 791 __ Assert(ne, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 834 __ b(hs, &ok); | 838 __ b(hs, &ok); |
| 835 __ push(kInterpreterBytecodeArrayRegister); | 839 __ push(kInterpreterBytecodeArrayRegister); |
| 836 __ CallRuntime(Runtime::kStackGuard, 0); | 840 __ CallRuntime(Runtime::kStackGuard, 0); |
| 837 __ pop(kInterpreterBytecodeArrayRegister); | 841 __ pop(kInterpreterBytecodeArrayRegister); |
| 838 __ bind(&ok); | 842 __ bind(&ok); |
| 839 } | 843 } |
| 840 | 844 |
| 841 // Load accumulator, register file, bytecode offset, dispatch table into | 845 // Load accumulator, register file, bytecode offset, dispatch table into |
| 842 // registers. | 846 // registers. |
| 843 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); | 847 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); |
| 844 __ sub(kInterpreterRegisterFileRegister, fp, | 848 __ add(kInterpreterRegisterFileRegister, fp, |
| 845 Operand(2 * kPointerSize + | 849 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); |
| 846 StandardFrameConstants::kFixedFrameSizeFromFp)); | |
| 847 __ mov(kInterpreterBytecodeOffsetRegister, | 850 __ mov(kInterpreterBytecodeOffsetRegister, |
| 848 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); | 851 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); |
| 849 __ LoadRoot(kInterpreterDispatchTableRegister, | 852 __ LoadRoot(kInterpreterDispatchTableRegister, |
| 850 Heap::kInterpreterTableRootIndex); | 853 Heap::kInterpreterTableRootIndex); |
| 851 __ add(kInterpreterDispatchTableRegister, kInterpreterDispatchTableRegister, | 854 __ add(kInterpreterDispatchTableRegister, kInterpreterDispatchTableRegister, |
| 852 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); | 855 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
| 853 | 856 |
| 854 // Dispatch to the first bytecode handler for the function. | 857 // Dispatch to the first bytecode handler for the function. |
| 855 __ ldrb(r1, MemOperand(kInterpreterBytecodeArrayRegister, | 858 __ ldrb(r1, MemOperand(kInterpreterBytecodeArrayRegister, |
| 856 kInterpreterBytecodeOffsetRegister)); | 859 kInterpreterBytecodeOffsetRegister)); |
| (...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1951 } | 1954 } |
| 1952 } | 1955 } |
| 1953 | 1956 |
| 1954 | 1957 |
| 1955 #undef __ | 1958 #undef __ |
| 1956 | 1959 |
| 1957 } // namespace internal | 1960 } // namespace internal |
| 1958 } // namespace v8 | 1961 } // namespace v8 |
| 1959 | 1962 |
| 1960 #endif // V8_TARGET_ARCH_ARM | 1963 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |