Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(455)

Side by Side Diff: src/arm64/builtins-arm64.cc

Issue 1642063002: [interpreter] Add a safety-net for interpreter entry. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comment. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/arm/builtins-arm.cc ('k') | src/bailout-reason.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 // count expected by the function. 890 // count expected by the function.
891 // 891 //
892 // The live registers are: 892 // The live registers are:
893 // - x1: the JS function object being called. 893 // - x1: the JS function object being called.
894 // - x3: the new target 894 // - x3: the new target
895 // - cp: our context. 895 // - cp: our context.
896 // - fp: our caller's frame pointer. 896 // - fp: our caller's frame pointer.
897 // - jssp: stack pointer. 897 // - jssp: stack pointer.
898 // - lr: return address. 898 // - lr: return address.
899 // 899 //
900 // The function builds a JS frame. Please see JavaScriptFrameConstants in 900 // The function builds an interpreter frame. See InterpreterFrameConstants in
901 // frames-arm64.h for its layout. 901 // frames.h for its layout.
902 // TODO(rmcilroy): We will need to include the current bytecode pointer in the
903 // frame.
904 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { 902 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
905 // Open a frame scope to indicate that there is a frame on the stack. The 903 // Open a frame scope to indicate that there is a frame on the stack. The
906 // MANUAL indicates that the scope shouldn't actually generate code to set up 904 // MANUAL indicates that the scope shouldn't actually generate code to set up
907 // the frame (that is done below). 905 // the frame (that is done below).
908 FrameScope frame_scope(masm, StackFrame::MANUAL); 906 FrameScope frame_scope(masm, StackFrame::MANUAL);
909 __ Push(lr, fp, cp, x1); 907 __ Push(lr, fp, cp, x1);
910 __ Add(fp, jssp, StandardFrameConstants::kFixedFrameSizeFromFp); 908 __ Add(fp, jssp, StandardFrameConstants::kFixedFrameSizeFromFp);
911 __ Push(x3); 909 __ Push(x3);
912 910
913 // Push zero for bytecode array offset. 911 // Push zero for bytecode array offset.
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
988 986
989 // Dispatch to the first bytecode handler for the function. 987 // Dispatch to the first bytecode handler for the function.
990 __ Ldrb(x1, MemOperand(kInterpreterBytecodeArrayRegister, 988 __ Ldrb(x1, MemOperand(kInterpreterBytecodeArrayRegister,
991 kInterpreterBytecodeOffsetRegister)); 989 kInterpreterBytecodeOffsetRegister));
992 __ Mov(x1, Operand(x1, LSL, kPointerSizeLog2)); 990 __ Mov(x1, Operand(x1, LSL, kPointerSizeLog2));
993 __ Ldr(ip0, MemOperand(kInterpreterDispatchTableRegister, x1)); 991 __ Ldr(ip0, MemOperand(kInterpreterDispatchTableRegister, x1));
994 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging 992 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging
995 // and header removal. 993 // and header removal.
996 __ Add(ip0, ip0, Operand(Code::kHeaderSize - kHeapObjectTag)); 994 __ Add(ip0, ip0, Operand(Code::kHeaderSize - kHeapObjectTag));
997 __ Call(ip0); 995 __ Call(ip0);
996
997 // Even though the first bytecode handler was called, we will never return.
998 __ Abort(kUnexpectedReturnFromBytecodeHandler);
998 } 999 }
999 1000
1000 1001
1001 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) { 1002 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) {
1002 // TODO(rmcilroy): List of things not currently dealt with here but done in 1003 // TODO(rmcilroy): List of things not currently dealt with here but done in
1003 // fullcodegen's EmitReturnSequence. 1004 // fullcodegen's EmitReturnSequence.
1004 // - Supporting FLAG_trace for Runtime::TraceExit. 1005 // - Supporting FLAG_trace for Runtime::TraceExit.
1005 // - Support profiler (specifically decrementing profiling_counter 1006 // - Support profiler (specifically decrementing profiling_counter
1006 // appropriately and calling out to HandleInterrupts if necessary). 1007 // appropriately and calling out to HandleInterrupts if necessary).
1007 1008
(...skipping 1736 matching lines...) Expand 10 before | Expand all | Expand 10 after
2744 } 2745 }
2745 } 2746 }
2746 2747
2747 2748
2748 #undef __ 2749 #undef __
2749 2750
2750 } // namespace internal 2751 } // namespace internal
2751 } // namespace v8 2752 } // namespace v8
2752 2753
2753 #endif // V8_TARGET_ARCH_ARM 2754 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/builtins-arm.cc ('k') | src/bailout-reason.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698