| 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 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1018 __ beq(&bytecode_array_not_present); | 1018 __ beq(&bytecode_array_not_present); |
| 1019 | 1019 |
| 1020 if (FLAG_debug_code) { | 1020 if (FLAG_debug_code) { |
| 1021 __ TestIfSmi(kInterpreterBytecodeArrayRegister, r0); | 1021 __ TestIfSmi(kInterpreterBytecodeArrayRegister, r0); |
| 1022 __ Assert(ne, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry); | 1022 __ Assert(ne, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry); |
| 1023 __ CompareObjectType(kInterpreterBytecodeArrayRegister, r3, no_reg, | 1023 __ CompareObjectType(kInterpreterBytecodeArrayRegister, r3, no_reg, |
| 1024 BYTECODE_ARRAY_TYPE); | 1024 BYTECODE_ARRAY_TYPE); |
| 1025 __ Assert(eq, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry); | 1025 __ Assert(eq, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry); |
| 1026 } | 1026 } |
| 1027 | 1027 |
| 1028 // Push new.target, bytecode array and zero for bytecode array offset. | 1028 // Load initial bytecode offset. |
| 1029 __ li(r3, Operand::Zero()); | 1029 __ mov(kInterpreterBytecodeOffsetRegister, |
| 1030 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); |
| 1031 |
| 1032 // Push new.target, bytecode array and Smi tagged bytecode array offset. |
| 1033 __ SmiTag(r3, kInterpreterBytecodeOffsetRegister); |
| 1030 __ Push(r6, kInterpreterBytecodeArrayRegister, r3); | 1034 __ Push(r6, kInterpreterBytecodeArrayRegister, r3); |
| 1031 | 1035 |
| 1032 // Allocate the local and temporary register file on the stack. | 1036 // Allocate the local and temporary register file on the stack. |
| 1033 { | 1037 { |
| 1034 // Load frame size (word) from the BytecodeArray object. | 1038 // Load frame size (word) from the BytecodeArray object. |
| 1035 __ lwz(r5, FieldMemOperand(kInterpreterBytecodeArrayRegister, | 1039 __ lwz(r5, FieldMemOperand(kInterpreterBytecodeArrayRegister, |
| 1036 BytecodeArray::kFrameSizeOffset)); | 1040 BytecodeArray::kFrameSizeOffset)); |
| 1037 | 1041 |
| 1038 // Do a stack check to ensure we don't go over the limit. | 1042 // Do a stack check to ensure we don't go over the limit. |
| 1039 Label ok; | 1043 Label ok; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1050 __ LoadRoot(r6, Heap::kUndefinedValueRootIndex); | 1054 __ LoadRoot(r6, Heap::kUndefinedValueRootIndex); |
| 1051 __ ShiftRightImm(r5, r5, Operand(kPointerSizeLog2), SetRC); | 1055 __ ShiftRightImm(r5, r5, Operand(kPointerSizeLog2), SetRC); |
| 1052 __ beq(&no_args, cr0); | 1056 __ beq(&no_args, cr0); |
| 1053 __ mtctr(r5); | 1057 __ mtctr(r5); |
| 1054 __ bind(&loop); | 1058 __ bind(&loop); |
| 1055 __ push(r6); | 1059 __ push(r6); |
| 1056 __ bdnz(&loop); | 1060 __ bdnz(&loop); |
| 1057 __ bind(&no_args); | 1061 __ bind(&no_args); |
| 1058 } | 1062 } |
| 1059 | 1063 |
| 1060 // Load accumulator, register file, bytecode offset, dispatch table into | 1064 // Load accumulator and dispatch table into registers. |
| 1061 // registers. | |
| 1062 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); | 1065 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); |
| 1063 __ addi(r7, fp, Operand(InterpreterFrameConstants::kRegisterFileFromFp)); | |
| 1064 __ mov(kInterpreterBytecodeOffsetRegister, | |
| 1065 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); | |
| 1066 __ mov(kInterpreterDispatchTableRegister, | 1066 __ mov(kInterpreterDispatchTableRegister, |
| 1067 Operand(ExternalReference::interpreter_dispatch_table_address( | 1067 Operand(ExternalReference::interpreter_dispatch_table_address( |
| 1068 masm->isolate()))); | 1068 masm->isolate()))); |
| 1069 | 1069 |
| 1070 // Dispatch to the first bytecode handler for the function. | 1070 // Dispatch to the first bytecode handler for the function. |
| 1071 __ lbzx(r4, MemOperand(kInterpreterBytecodeArrayRegister, | 1071 __ lbzx(r4, MemOperand(kInterpreterBytecodeArrayRegister, |
| 1072 kInterpreterBytecodeOffsetRegister)); | 1072 kInterpreterBytecodeOffsetRegister)); |
| 1073 __ ShiftLeftImm(ip, r4, Operand(kPointerSizeLog2)); | 1073 __ ShiftLeftImm(ip, r4, Operand(kPointerSizeLog2)); |
| 1074 __ LoadPX(ip, MemOperand(kInterpreterDispatchTableRegister, ip)); | 1074 __ LoadPX(ip, MemOperand(kInterpreterDispatchTableRegister, ip)); |
| 1075 __ Call(ip); | 1075 __ Call(ip); |
| (...skipping 1825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2901 __ bkpt(0); | 2901 __ bkpt(0); |
| 2902 } | 2902 } |
| 2903 } | 2903 } |
| 2904 | 2904 |
| 2905 | 2905 |
| 2906 #undef __ | 2906 #undef __ |
| 2907 } // namespace internal | 2907 } // namespace internal |
| 2908 } // namespace v8 | 2908 } // namespace v8 |
| 2909 | 2909 |
| 2910 #endif // V8_TARGET_ARCH_PPC | 2910 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |