| 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 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1032 // - Allow simulator stop operations if FLAG_stop_at is set. | 1032 // - Allow simulator stop operations if FLAG_stop_at is set. |
| 1033 // - Code aging of the BytecodeArray object. | 1033 // - Code aging of the BytecodeArray object. |
| 1034 | 1034 |
| 1035 // Load accumulator, register file, bytecode offset, dispatch table into | 1035 // Load accumulator, register file, bytecode offset, dispatch table into |
| 1036 // registers. | 1036 // registers. |
| 1037 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); | 1037 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); |
| 1038 __ addi(kInterpreterRegisterFileRegister, fp, | 1038 __ addi(kInterpreterRegisterFileRegister, fp, |
| 1039 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); | 1039 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); |
| 1040 __ mov(kInterpreterBytecodeOffsetRegister, | 1040 __ mov(kInterpreterBytecodeOffsetRegister, |
| 1041 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); | 1041 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); |
| 1042 __ LoadRoot(kInterpreterDispatchTableRegister, | 1042 __ mov(kInterpreterDispatchTableRegister, |
| 1043 Heap::kInterpreterTableRootIndex); | 1043 Operand(ExternalReference::interpreter_dispatch_table_address( |
| 1044 __ addi(kInterpreterDispatchTableRegister, kInterpreterDispatchTableRegister, | 1044 masm->isolate()))); |
| 1045 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); | |
| 1046 | 1045 |
| 1047 // Dispatch to the first bytecode handler for the function. | 1046 // Dispatch to the first bytecode handler for the function. |
| 1048 __ lbzx(r4, MemOperand(kInterpreterBytecodeArrayRegister, | 1047 __ lbzx(r4, MemOperand(kInterpreterBytecodeArrayRegister, |
| 1049 kInterpreterBytecodeOffsetRegister)); | 1048 kInterpreterBytecodeOffsetRegister)); |
| 1050 __ ShiftLeftImm(ip, r4, Operand(kPointerSizeLog2)); | 1049 __ ShiftLeftImm(ip, r4, Operand(kPointerSizeLog2)); |
| 1051 __ LoadPX(ip, MemOperand(kInterpreterDispatchTableRegister, ip)); | 1050 __ LoadPX(ip, MemOperand(kInterpreterDispatchTableRegister, ip)); |
| 1052 // 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 |
| 1053 // and header removal. | 1052 // and header removal. |
| 1054 __ addi(ip, ip, Operand(Code::kHeaderSize - kHeapObjectTag)); | 1053 __ addi(ip, ip, Operand(Code::kHeaderSize - kHeapObjectTag)); |
| 1055 __ Call(ip); | 1054 __ Call(ip); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1134 | 1133 |
| 1135 // Call the constructor with r3, r4, and r6 unmodified. | 1134 // Call the constructor with r3, r4, and r6 unmodified. |
| 1136 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); | 1135 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); |
| 1137 } | 1136 } |
| 1138 | 1137 |
| 1139 | 1138 |
| 1140 static void Generate_EnterBytecodeDispatch(MacroAssembler* masm) { | 1139 static void Generate_EnterBytecodeDispatch(MacroAssembler* masm) { |
| 1141 // Initialize register file register and dispatch table register. | 1140 // Initialize register file register and dispatch table register. |
| 1142 __ addi(kInterpreterRegisterFileRegister, fp, | 1141 __ addi(kInterpreterRegisterFileRegister, fp, |
| 1143 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); | 1142 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); |
| 1144 __ LoadRoot(kInterpreterDispatchTableRegister, | 1143 __ mov(kInterpreterDispatchTableRegister, |
| 1145 Heap::kInterpreterTableRootIndex); | 1144 Operand(ExternalReference::interpreter_dispatch_table_address( |
| 1146 __ addi(kInterpreterDispatchTableRegister, kInterpreterDispatchTableRegister, | 1145 masm->isolate()))); |
| 1147 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); | |
| 1148 | 1146 |
| 1149 // Get the context from the frame. | 1147 // Get the context from the frame. |
| 1150 __ LoadP(kContextRegister, | 1148 __ LoadP(kContextRegister, |
| 1151 MemOperand(kInterpreterRegisterFileRegister, | 1149 MemOperand(kInterpreterRegisterFileRegister, |
| 1152 InterpreterFrameConstants::kContextFromRegisterPointer)); | 1150 InterpreterFrameConstants::kContextFromRegisterPointer)); |
| 1153 | 1151 |
| 1154 // Get the bytecode array pointer from the frame. | 1152 // Get the bytecode array pointer from the frame. |
| 1155 __ LoadP(r4, | 1153 __ LoadP(r4, |
| 1156 MemOperand(kInterpreterRegisterFileRegister, | 1154 MemOperand(kInterpreterRegisterFileRegister, |
| 1157 InterpreterFrameConstants::kFunctionFromRegisterPointer)); | 1155 InterpreterFrameConstants::kFunctionFromRegisterPointer)); |
| (...skipping 1599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2757 __ bkpt(0); | 2755 __ bkpt(0); |
| 2758 } | 2756 } |
| 2759 } | 2757 } |
| 2760 | 2758 |
| 2761 | 2759 |
| 2762 #undef __ | 2760 #undef __ |
| 2763 } // namespace internal | 2761 } // namespace internal |
| 2764 } // namespace v8 | 2762 } // namespace v8 |
| 2765 | 2763 |
| 2766 #endif // V8_TARGET_ARCH_PPC | 2764 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |