| 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 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 962 // o r6: the new target | 962 // o r6: the new target |
| 963 // o cp: our context | 963 // o cp: our context |
| 964 // o pp: the caller's constant pool pointer (if enabled) | 964 // o pp: the caller's constant pool pointer (if enabled) |
| 965 // o fp: the caller's frame pointer | 965 // o fp: the caller's frame pointer |
| 966 // o sp: stack pointer | 966 // o sp: stack pointer |
| 967 // o lr: return address | 967 // o lr: return address |
| 968 // | 968 // |
| 969 // The function builds an interpreter frame. See InterpreterFrameConstants in | 969 // The function builds an interpreter frame. See InterpreterFrameConstants in |
| 970 // frames.h for its layout. | 970 // frames.h for its layout. |
| 971 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { | 971 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { |
| 972 ProfileEntryHookStub::MaybeCallEntryHook(masm); |
| 973 |
| 972 // 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 |
| 973 // 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 |
| 974 // the frame (that is done below). | 976 // the frame (that is done below). |
| 975 FrameScope frame_scope(masm, StackFrame::MANUAL); | 977 FrameScope frame_scope(masm, StackFrame::MANUAL); |
| 976 __ PushStandardFrame(r4); | 978 __ PushStandardFrame(r4); |
| 977 | 979 |
| 978 // Get the bytecode array from the function object and load the pointer to the | 980 // Get the bytecode array from the function object and load the pointer to the |
| 979 // first entry into kInterpreterBytecodeRegister. | 981 // first entry into kInterpreterBytecodeRegister. |
| 980 __ LoadP(r3, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); | 982 __ LoadP(r3, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); |
| 981 Label array_done; | 983 Label array_done; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1026 __ LoadRoot(r6, Heap::kUndefinedValueRootIndex); | 1028 __ LoadRoot(r6, Heap::kUndefinedValueRootIndex); |
| 1027 __ ShiftRightImm(r5, r5, Operand(kPointerSizeLog2), SetRC); | 1029 __ ShiftRightImm(r5, r5, Operand(kPointerSizeLog2), SetRC); |
| 1028 __ beq(&no_args, cr0); | 1030 __ beq(&no_args, cr0); |
| 1029 __ mtctr(r5); | 1031 __ mtctr(r5); |
| 1030 __ bind(&loop); | 1032 __ bind(&loop); |
| 1031 __ push(r6); | 1033 __ push(r6); |
| 1032 __ bdnz(&loop); | 1034 __ bdnz(&loop); |
| 1033 __ bind(&no_args); | 1035 __ bind(&no_args); |
| 1034 } | 1036 } |
| 1035 | 1037 |
| 1036 // TODO(rmcilroy): List of things not currently dealt with here but done in | |
| 1037 // fullcodegen's prologue: | |
| 1038 // - Call ProfileEntryHookStub when isolate has a function_entry_hook. | |
| 1039 // - Code aging of the BytecodeArray object. | |
| 1040 | |
| 1041 // Load accumulator, register file, bytecode offset, dispatch table into | 1038 // Load accumulator, register file, bytecode offset, dispatch table into |
| 1042 // registers. | 1039 // registers. |
| 1043 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); | 1040 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); |
| 1044 __ addi(kInterpreterRegisterFileRegister, fp, | 1041 __ addi(kInterpreterRegisterFileRegister, fp, |
| 1045 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); | 1042 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); |
| 1046 __ mov(kInterpreterBytecodeOffsetRegister, | 1043 __ mov(kInterpreterBytecodeOffsetRegister, |
| 1047 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); | 1044 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); |
| 1048 __ mov(kInterpreterDispatchTableRegister, | 1045 __ mov(kInterpreterDispatchTableRegister, |
| 1049 Operand(ExternalReference::interpreter_dispatch_table_address( | 1046 Operand(ExternalReference::interpreter_dispatch_table_address( |
| 1050 masm->isolate()))); | 1047 masm->isolate()))); |
| (...skipping 1664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2715 __ bkpt(0); | 2712 __ bkpt(0); |
| 2716 } | 2713 } |
| 2717 } | 2714 } |
| 2718 | 2715 |
| 2719 | 2716 |
| 2720 #undef __ | 2717 #undef __ |
| 2721 } // namespace internal | 2718 } // namespace internal |
| 2722 } // namespace v8 | 2719 } // namespace v8 |
| 2723 | 2720 |
| 2724 #endif // V8_TARGET_ARCH_PPC | 2721 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |