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