OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
6 | 6 |
7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
10 #include "src/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
959 // - x1: the JS function object being called. | 959 // - x1: the JS function object being called. |
960 // - x3: the new target | 960 // - x3: the new target |
961 // - cp: our context. | 961 // - cp: our context. |
962 // - fp: our caller's frame pointer. | 962 // - fp: our caller's frame pointer. |
963 // - jssp: stack pointer. | 963 // - jssp: stack pointer. |
964 // - lr: return address. | 964 // - lr: return address. |
965 // | 965 // |
966 // The function builds an interpreter frame. See InterpreterFrameConstants in | 966 // The function builds an interpreter frame. See InterpreterFrameConstants in |
967 // frames.h for its layout. | 967 // frames.h for its layout. |
968 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { | 968 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { |
| 969 ProfileEntryHookStub::MaybeCallEntryHook(masm); |
| 970 |
969 // Open a frame scope to indicate that there is a frame on the stack. The | 971 // Open a frame scope to indicate that there is a frame on the stack. The |
970 // MANUAL indicates that the scope shouldn't actually generate code to set up | 972 // MANUAL indicates that the scope shouldn't actually generate code to set up |
971 // the frame (that is done below). | 973 // the frame (that is done below). |
972 FrameScope frame_scope(masm, StackFrame::MANUAL); | 974 FrameScope frame_scope(masm, StackFrame::MANUAL); |
973 __ Push(lr, fp, cp, x1); | 975 __ Push(lr, fp, cp, x1); |
974 __ Add(fp, jssp, StandardFrameConstants::kFixedFrameSizeFromFp); | 976 __ Add(fp, jssp, StandardFrameConstants::kFixedFrameSizeFromFp); |
975 | 977 |
976 // Get the bytecode array from the function object and load the pointer to the | 978 // Get the bytecode array from the function object and load the pointer to the |
977 // first entry into kInterpreterBytecodeRegister. | 979 // first entry into kInterpreterBytecodeRegister. |
978 __ Ldr(x0, FieldMemOperand(x1, JSFunction::kSharedFunctionInfoOffset)); | 980 __ Ldr(x0, FieldMemOperand(x1, JSFunction::kSharedFunctionInfoOffset)); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1019 // register in the register file. | 1021 // register in the register file. |
1020 Label loop_header; | 1022 Label loop_header; |
1021 __ LoadRoot(x10, Heap::kUndefinedValueRootIndex); | 1023 __ LoadRoot(x10, Heap::kUndefinedValueRootIndex); |
1022 // TODO(rmcilroy): Ensure we always have an even number of registers to | 1024 // TODO(rmcilroy): Ensure we always have an even number of registers to |
1023 // allow stack to be 16 bit aligned (and remove need for jssp). | 1025 // allow stack to be 16 bit aligned (and remove need for jssp). |
1024 __ Lsr(x11, x11, kPointerSizeLog2); | 1026 __ Lsr(x11, x11, kPointerSizeLog2); |
1025 __ PushMultipleTimes(x10, x11); | 1027 __ PushMultipleTimes(x10, x11); |
1026 __ Bind(&loop_header); | 1028 __ Bind(&loop_header); |
1027 } | 1029 } |
1028 | 1030 |
1029 // TODO(rmcilroy): List of things not currently dealt with here but done in | |
1030 // fullcodegen's prologue: | |
1031 // - Call ProfileEntryHookStub when isolate has a function_entry_hook. | |
1032 // - Code aging of the BytecodeArray object. | |
1033 | |
1034 // Load accumulator, register file, bytecode offset, dispatch table into | 1031 // Load accumulator, register file, bytecode offset, dispatch table into |
1035 // registers. | 1032 // registers. |
1036 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); | 1033 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); |
1037 __ Add(kInterpreterRegisterFileRegister, fp, | 1034 __ Add(kInterpreterRegisterFileRegister, fp, |
1038 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); | 1035 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); |
1039 __ Mov(kInterpreterBytecodeOffsetRegister, | 1036 __ Mov(kInterpreterBytecodeOffsetRegister, |
1040 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); | 1037 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); |
1041 __ Mov(kInterpreterDispatchTableRegister, | 1038 __ Mov(kInterpreterDispatchTableRegister, |
1042 Operand(ExternalReference::interpreter_dispatch_table_address( | 1039 Operand(ExternalReference::interpreter_dispatch_table_address( |
1043 masm->isolate()))); | 1040 masm->isolate()))); |
(...skipping 1846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2890 } | 2887 } |
2891 } | 2888 } |
2892 | 2889 |
2893 | 2890 |
2894 #undef __ | 2891 #undef __ |
2895 | 2892 |
2896 } // namespace internal | 2893 } // namespace internal |
2897 } // namespace v8 | 2894 } // namespace v8 |
2898 | 2895 |
2899 #endif // V8_TARGET_ARCH_ARM | 2896 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |