| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
| 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 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 // | 859 // |
| 860 // The live registers are: | 860 // The live registers are: |
| 861 // o r4: the JS function object being called. | 861 // o r4: the JS function object being called. |
| 862 // o r6: the new target | 862 // o r6: the new target |
| 863 // o cp: our context | 863 // o cp: our context |
| 864 // o pp: the caller's constant pool pointer (if enabled) | 864 // o pp: the caller's constant pool pointer (if enabled) |
| 865 // o fp: the caller's frame pointer | 865 // o fp: the caller's frame pointer |
| 866 // o sp: stack pointer | 866 // o sp: stack pointer |
| 867 // o lr: return address | 867 // o lr: return address |
| 868 // | 868 // |
| 869 // The function builds a JS frame. Please see JavaScriptFrameConstants in | 869 // The function builds an interpreter frame. See InterpreterFrameConstants in |
| 870 // frames-ppc.h for its layout. | 870 // frames.h for its layout. |
| 871 // TODO(rmcilroy): We will need to include the current bytecode pointer in the | |
| 872 // frame. | |
| 873 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { | 871 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { |
| 874 // Open a frame scope to indicate that there is a frame on the stack. The | 872 // Open a frame scope to indicate that there is a frame on the stack. The |
| 875 // MANUAL indicates that the scope shouldn't actually generate code to set up | 873 // MANUAL indicates that the scope shouldn't actually generate code to set up |
| 876 // the frame (that is done below). | 874 // the frame (that is done below). |
| 877 FrameScope frame_scope(masm, StackFrame::MANUAL); | 875 FrameScope frame_scope(masm, StackFrame::MANUAL); |
| 878 __ PushFixedFrame(r4); | 876 __ PushFixedFrame(r4); |
| 879 __ addi(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); | 877 __ addi(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); |
| 880 __ push(r6); | 878 __ push(r6); |
| 881 | 879 |
| 882 // Push zero for bytecode array offset. | 880 // Push zero for bytecode array offset. |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 959 | 957 |
| 960 // Dispatch to the first bytecode handler for the function. | 958 // Dispatch to the first bytecode handler for the function. |
| 961 __ lbzx(r4, MemOperand(kInterpreterBytecodeArrayRegister, | 959 __ lbzx(r4, MemOperand(kInterpreterBytecodeArrayRegister, |
| 962 kInterpreterBytecodeOffsetRegister)); | 960 kInterpreterBytecodeOffsetRegister)); |
| 963 __ ShiftLeftImm(ip, r4, Operand(kPointerSizeLog2)); | 961 __ ShiftLeftImm(ip, r4, Operand(kPointerSizeLog2)); |
| 964 __ LoadPX(ip, MemOperand(kInterpreterDispatchTableRegister, ip)); | 962 __ LoadPX(ip, MemOperand(kInterpreterDispatchTableRegister, ip)); |
| 965 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging | 963 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging |
| 966 // and header removal. | 964 // and header removal. |
| 967 __ addi(ip, ip, Operand(Code::kHeaderSize - kHeapObjectTag)); | 965 __ addi(ip, ip, Operand(Code::kHeaderSize - kHeapObjectTag)); |
| 968 __ Call(ip); | 966 __ Call(ip); |
| 969 __ bkpt(0); // Does not return here. | 967 |
| 968 // Even though the first bytecode handler was called, we will never return. |
| 969 __ Abort(kUnexpectedReturnFromBytecodeHandler); |
| 970 } | 970 } |
| 971 | 971 |
| 972 | 972 |
| 973 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) { | 973 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) { |
| 974 // TODO(rmcilroy): List of things not currently dealt with here but done in | 974 // TODO(rmcilroy): List of things not currently dealt with here but done in |
| 975 // fullcodegen's EmitReturnSequence. | 975 // fullcodegen's EmitReturnSequence. |
| 976 // - Supporting FLAG_trace for Runtime::TraceExit. | 976 // - Supporting FLAG_trace for Runtime::TraceExit. |
| 977 // - Support profiler (specifically decrementing profiling_counter | 977 // - Support profiler (specifically decrementing profiling_counter |
| 978 // appropriately and calling out to HandleInterrupts if necessary). | 978 // appropriately and calling out to HandleInterrupts if necessary). |
| 979 | 979 |
| (...skipping 1688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2668 __ bkpt(0); | 2668 __ bkpt(0); |
| 2669 } | 2669 } |
| 2670 } | 2670 } |
| 2671 | 2671 |
| 2672 | 2672 |
| 2673 #undef __ | 2673 #undef __ |
| 2674 } // namespace internal | 2674 } // namespace internal |
| 2675 } // namespace v8 | 2675 } // namespace v8 |
| 2676 | 2676 |
| 2677 #endif // V8_TARGET_ARCH_PPC | 2677 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |