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 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 // | 867 // |
868 // The live registers are: | 868 // The live registers are: |
869 // o r1: the JS function object being called. | 869 // o r1: the JS function object being called. |
870 // o r3: the new target | 870 // o r3: the new target |
871 // o cp: our context | 871 // o cp: our context |
872 // o pp: the caller's constant pool pointer (if enabled) | 872 // o pp: the caller's constant pool pointer (if enabled) |
873 // o fp: the caller's frame pointer | 873 // o fp: the caller's frame pointer |
874 // o sp: stack pointer | 874 // o sp: stack pointer |
875 // o lr: return address | 875 // o lr: return address |
876 // | 876 // |
877 // The function builds a JS frame. Please see JavaScriptFrameConstants in | 877 // The function builds an interpreter frame. See InterpreterFrameConstants in |
878 // frames-arm.h for its layout. | 878 // frames.h for its layout. |
879 // TODO(rmcilroy): We will need to include the current bytecode pointer in the | |
880 // frame. | |
881 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { | 879 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { |
882 // Open a frame scope to indicate that there is a frame on the stack. The | 880 // Open a frame scope to indicate that there is a frame on the stack. The |
883 // MANUAL indicates that the scope shouldn't actually generate code to set up | 881 // MANUAL indicates that the scope shouldn't actually generate code to set up |
884 // the frame (that is done below). | 882 // the frame (that is done below). |
885 FrameScope frame_scope(masm, StackFrame::MANUAL); | 883 FrameScope frame_scope(masm, StackFrame::MANUAL); |
886 __ PushFixedFrame(r1); | 884 __ PushFixedFrame(r1); |
887 __ add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); | 885 __ add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); |
888 __ push(r3); | 886 __ push(r3); |
889 | 887 |
890 // Push zero for bytecode array offset. | 888 // Push zero for bytecode array offset. |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
968 | 966 |
969 // Dispatch to the first bytecode handler for the function. | 967 // Dispatch to the first bytecode handler for the function. |
970 __ ldrb(r1, MemOperand(kInterpreterBytecodeArrayRegister, | 968 __ ldrb(r1, MemOperand(kInterpreterBytecodeArrayRegister, |
971 kInterpreterBytecodeOffsetRegister)); | 969 kInterpreterBytecodeOffsetRegister)); |
972 __ ldr(ip, MemOperand(kInterpreterDispatchTableRegister, r1, LSL, | 970 __ ldr(ip, MemOperand(kInterpreterDispatchTableRegister, r1, LSL, |
973 kPointerSizeLog2)); | 971 kPointerSizeLog2)); |
974 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging | 972 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging |
975 // and header removal. | 973 // and header removal. |
976 __ add(ip, ip, Operand(Code::kHeaderSize - kHeapObjectTag)); | 974 __ add(ip, ip, Operand(Code::kHeaderSize - kHeapObjectTag)); |
977 __ Call(ip); | 975 __ Call(ip); |
| 976 |
| 977 // Even though the first bytecode handler was called, we will never return. |
| 978 __ Abort(kUnexpectedReturnFromBytecodeHandler); |
978 } | 979 } |
979 | 980 |
980 | 981 |
981 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) { | 982 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) { |
982 // TODO(rmcilroy): List of things not currently dealt with here but done in | 983 // TODO(rmcilroy): List of things not currently dealt with here but done in |
983 // fullcodegen's EmitReturnSequence. | 984 // fullcodegen's EmitReturnSequence. |
984 // - Supporting FLAG_trace for Runtime::TraceExit. | 985 // - Supporting FLAG_trace for Runtime::TraceExit. |
985 // - Support profiler (specifically decrementing profiling_counter | 986 // - Support profiler (specifically decrementing profiling_counter |
986 // appropriately and calling out to HandleInterrupts if necessary). | 987 // appropriately and calling out to HandleInterrupts if necessary). |
987 | 988 |
(...skipping 1609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2597 } | 2598 } |
2598 } | 2599 } |
2599 | 2600 |
2600 | 2601 |
2601 #undef __ | 2602 #undef __ |
2602 | 2603 |
2603 } // namespace internal | 2604 } // namespace internal |
2604 } // namespace v8 | 2605 } // namespace v8 |
2605 | 2606 |
2606 #endif // V8_TARGET_ARCH_ARM | 2607 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |