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

Side by Side Diff: src/mips64/builtins-mips64.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/mips/builtins-mips.cc ('k') | src/ppc/builtins-ppc.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
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 837 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 // count expected by the function. 848 // count expected by the function.
849 // 849 //
850 // The live registers are: 850 // The live registers are:
851 // o a1: the JS function object being called. 851 // o a1: the JS function object being called.
852 // o a3: the new target 852 // o a3: the new target
853 // o cp: our context 853 // o cp: our context
854 // o fp: the caller's frame pointer 854 // o fp: the caller's frame pointer
855 // o sp: stack pointer 855 // o sp: stack pointer
856 // o ra: return address 856 // o ra: return address
857 // 857 //
858 // The function builds a JS frame. Please see JavaScriptFrameConstants in 858 // The function builds an interpreter frame. See InterpreterFrameConstants in
859 // frames-mips.h for its layout. 859 // frames.h for its layout.
860 // TODO(rmcilroy): We will need to include the current bytecode pointer in the
861 // frame.
862 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { 860 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
863 // Open a frame scope to indicate that there is a frame on the stack. The 861 // Open a frame scope to indicate that there is a frame on the stack. The
864 // MANUAL indicates that the scope shouldn't actually generate code to set up 862 // MANUAL indicates that the scope shouldn't actually generate code to set up
865 // the frame (that is done below). 863 // the frame (that is done below).
866 FrameScope frame_scope(masm, StackFrame::MANUAL); 864 FrameScope frame_scope(masm, StackFrame::MANUAL);
867 865
868 __ Push(ra, fp, cp, a1); 866 __ Push(ra, fp, cp, a1);
869 __ Daddu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); 867 __ Daddu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp));
870 __ Push(a3); 868 __ Push(a3);
871 869
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 // Dispatch to the first bytecode handler for the function. 946 // Dispatch to the first bytecode handler for the function.
949 __ Daddu(a0, kInterpreterBytecodeArrayRegister, 947 __ Daddu(a0, kInterpreterBytecodeArrayRegister,
950 kInterpreterBytecodeOffsetRegister); 948 kInterpreterBytecodeOffsetRegister);
951 __ lbu(a0, MemOperand(a0)); 949 __ lbu(a0, MemOperand(a0));
952 __ Dlsa(at, kInterpreterDispatchTableRegister, a0, kPointerSizeLog2); 950 __ Dlsa(at, kInterpreterDispatchTableRegister, a0, kPointerSizeLog2);
953 __ ld(at, MemOperand(at)); 951 __ ld(at, MemOperand(at));
954 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging 952 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging
955 // and header removal. 953 // and header removal.
956 __ Daddu(at, at, Operand(Code::kHeaderSize - kHeapObjectTag)); 954 __ Daddu(at, at, Operand(Code::kHeaderSize - kHeapObjectTag));
957 __ Call(at); 955 __ Call(at);
956
957 // Even though the first bytecode handler was called, we will never return.
958 __ Abort(kUnexpectedReturnFromBytecodeHandler);
958 } 959 }
959 960
960 961
961 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) { 962 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) {
962 // TODO(rmcilroy): List of things not currently dealt with here but done in 963 // TODO(rmcilroy): List of things not currently dealt with here but done in
963 // fullcodegen's EmitReturnSequence. 964 // fullcodegen's EmitReturnSequence.
964 // - Supporting FLAG_trace for Runtime::TraceExit. 965 // - Supporting FLAG_trace for Runtime::TraceExit.
965 // - Support profiler (specifically decrementing profiling_counter 966 // - Support profiler (specifically decrementing profiling_counter
966 // appropriately and calling out to HandleInterrupts if necessary). 967 // appropriately and calling out to HandleInterrupts if necessary).
967 968
(...skipping 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after
2667 } 2668 }
2668 } 2669 }
2669 2670
2670 2671
2671 #undef __ 2672 #undef __
2672 2673
2673 } // namespace internal 2674 } // namespace internal
2674 } // namespace v8 2675 } // namespace v8
2675 2676
2676 #endif // V8_TARGET_ARCH_MIPS64 2677 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips/builtins-mips.cc ('k') | src/ppc/builtins-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698