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 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
971 // frames.h for its layout. | 971 // frames.h for its layout. |
972 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { | 972 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { |
973 // Open a frame scope to indicate that there is a frame on the stack. The | 973 // Open a frame scope to indicate that there is a frame on the stack. The |
974 // MANUAL indicates that the scope shouldn't actually generate code to set up | 974 // MANUAL indicates that the scope shouldn't actually generate code to set up |
975 // the frame (that is done below). | 975 // the frame (that is done below). |
976 FrameScope frame_scope(masm, StackFrame::MANUAL); | 976 FrameScope frame_scope(masm, StackFrame::MANUAL); |
977 __ PushFixedFrame(r4); | 977 __ PushFixedFrame(r4); |
978 __ addi(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); | 978 __ addi(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); |
979 __ push(r6); | 979 __ push(r6); |
980 | 980 |
| 981 // Push dispatch table pointer. |
| 982 __ mov(r3, Operand(ExternalReference::interpreter_dispatch_table_address( |
| 983 masm->isolate()))); |
| 984 __ push(r3); |
981 // Push zero for bytecode array offset. | 985 // Push zero for bytecode array offset. |
982 __ li(r3, Operand::Zero()); | 986 __ li(r3, Operand::Zero()); |
983 __ push(r3); | 987 __ push(r3); |
984 | 988 |
985 // Get the bytecode array from the function object and load the pointer to the | 989 // Get the bytecode array from the function object and load the pointer to the |
986 // first entry into kInterpreterBytecodeRegister. | 990 // first entry into kInterpreterBytecodeRegister. |
987 __ LoadP(r3, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); | 991 __ LoadP(r3, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); |
988 __ LoadP(kInterpreterBytecodeArrayRegister, | 992 __ LoadP(kInterpreterBytecodeArrayRegister, |
989 FieldMemOperand(r3, SharedFunctionInfo::kFunctionDataOffset)); | 993 FieldMemOperand(r3, SharedFunctionInfo::kFunctionDataOffset)); |
990 | 994 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 // - Call ProfileEntryHookStub when isolate has a function_entry_hook. | 1035 // - Call ProfileEntryHookStub when isolate has a function_entry_hook. |
1032 // - Code aging of the BytecodeArray object. | 1036 // - Code aging of the BytecodeArray object. |
1033 | 1037 |
1034 // Load accumulator, register file, bytecode offset, dispatch table into | 1038 // Load accumulator, register file, bytecode offset, dispatch table into |
1035 // registers. | 1039 // registers. |
1036 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); | 1040 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); |
1037 __ addi(kInterpreterRegisterFileRegister, fp, | 1041 __ addi(kInterpreterRegisterFileRegister, fp, |
1038 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); | 1042 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); |
1039 __ mov(kInterpreterBytecodeOffsetRegister, | 1043 __ mov(kInterpreterBytecodeOffsetRegister, |
1040 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); | 1044 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); |
1041 __ mov(kInterpreterDispatchTableRegister, | 1045 __ lwz(kInterpreterDispatchTableRegister, |
1042 Operand(ExternalReference::interpreter_dispatch_table_address( | 1046 MemOperand(fp, InterpreterFrameConstants::kDispatchTableFromFp)); |
1043 masm->isolate()))); | |
1044 | 1047 |
1045 // Dispatch to the first bytecode handler for the function. | 1048 // Dispatch to the first bytecode handler for the function. |
1046 __ lbzx(r4, MemOperand(kInterpreterBytecodeArrayRegister, | 1049 __ lbzx(r4, MemOperand(kInterpreterBytecodeArrayRegister, |
1047 kInterpreterBytecodeOffsetRegister)); | 1050 kInterpreterBytecodeOffsetRegister)); |
1048 __ ShiftLeftImm(ip, r4, Operand(kPointerSizeLog2)); | 1051 __ ShiftLeftImm(ip, r4, Operand(kPointerSizeLog2)); |
1049 __ LoadPX(ip, MemOperand(kInterpreterDispatchTableRegister, ip)); | 1052 __ LoadPX(ip, MemOperand(kInterpreterDispatchTableRegister, ip)); |
1050 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging | 1053 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging |
1051 // and header removal. | 1054 // and header removal. |
1052 __ addi(ip, ip, Operand(Code::kHeaderSize - kHeapObjectTag)); | 1055 __ addi(ip, ip, Operand(Code::kHeaderSize - kHeapObjectTag)); |
1053 __ Call(ip); | 1056 __ Call(ip); |
(...skipping 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2753 __ bkpt(0); | 2756 __ bkpt(0); |
2754 } | 2757 } |
2755 } | 2758 } |
2756 | 2759 |
2757 | 2760 |
2758 #undef __ | 2761 #undef __ |
2759 } // namespace internal | 2762 } // namespace internal |
2760 } // namespace v8 | 2763 } // namespace v8 |
2761 | 2764 |
2762 #endif // V8_TARGET_ARCH_PPC | 2765 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |