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

Side by Side Diff: src/mips/builtins-mips.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/ia32/builtins-ia32.cc ('k') | src/mips64/builtins-mips64.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_MIPS 5 #if V8_TARGET_ARCH_MIPS
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 846 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 // count expected by the function. 857 // count expected by the function.
858 // 858 //
859 // The live registers are: 859 // The live registers are:
860 // o a1: the JS function object being called. 860 // o a1: the JS function object being called.
861 // o a3: the new target 861 // o a3: the new target
862 // o cp: our context 862 // o cp: our context
863 // o fp: the caller's frame pointer 863 // o fp: the caller's frame pointer
864 // o sp: stack pointer 864 // o sp: stack pointer
865 // o ra: return address 865 // o ra: return address
866 // 866 //
867 // The function builds a JS frame. Please see JavaScriptFrameConstants in 867 // The function builds an interpreter frame. See InterpreterFrameConstants in
868 // frames-mips.h for its layout. 868 // frames.h for its layout.
869 // TODO(rmcilroy): We will need to include the current bytecode pointer in the
870 // frame.
871 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { 869 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
872 // Open a frame scope to indicate that there is a frame on the stack. The 870 // Open a frame scope to indicate that there is a frame on the stack. The
873 // MANUAL indicates that the scope shouldn't actually generate code to set up 871 // MANUAL indicates that the scope shouldn't actually generate code to set up
874 // the frame (that is done below). 872 // the frame (that is done below).
875 FrameScope frame_scope(masm, StackFrame::MANUAL); 873 FrameScope frame_scope(masm, StackFrame::MANUAL);
876 874
877 __ Push(ra, fp, cp, a1); 875 __ Push(ra, fp, cp, a1);
878 __ Addu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); 876 __ Addu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp));
879 __ Push(a3); 877 __ Push(a3);
880 878
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 // Dispatch to the first bytecode handler for the function. 955 // Dispatch to the first bytecode handler for the function.
958 __ Addu(a0, kInterpreterBytecodeArrayRegister, 956 __ Addu(a0, kInterpreterBytecodeArrayRegister,
959 kInterpreterBytecodeOffsetRegister); 957 kInterpreterBytecodeOffsetRegister);
960 __ lbu(a0, MemOperand(a0)); 958 __ lbu(a0, MemOperand(a0));
961 __ Lsa(at, kInterpreterDispatchTableRegister, a0, kPointerSizeLog2); 959 __ Lsa(at, kInterpreterDispatchTableRegister, a0, kPointerSizeLog2);
962 __ lw(at, MemOperand(at)); 960 __ lw(at, MemOperand(at));
963 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging 961 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging
964 // and header removal. 962 // and header removal.
965 __ Addu(at, at, Operand(Code::kHeaderSize - kHeapObjectTag)); 963 __ Addu(at, at, Operand(Code::kHeaderSize - kHeapObjectTag));
966 __ Call(at); 964 __ Call(at);
965
966 // Even though the first bytecode handler was called, we will never return.
967 __ Abort(kUnexpectedReturnFromBytecodeHandler);
967 } 968 }
968 969
969 970
970 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) { 971 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) {
971 // TODO(rmcilroy): List of things not currently dealt with here but done in 972 // TODO(rmcilroy): List of things not currently dealt with here but done in
972 // fullcodegen's EmitReturnSequence. 973 // fullcodegen's EmitReturnSequence.
973 // - Supporting FLAG_trace for Runtime::TraceExit. 974 // - Supporting FLAG_trace for Runtime::TraceExit.
974 // - Support profiler (specifically decrementing profiling_counter 975 // - Support profiler (specifically decrementing profiling_counter
975 // appropriately and calling out to HandleInterrupts if necessary). 976 // appropriately and calling out to HandleInterrupts if necessary).
976 977
(...skipping 1698 matching lines...) Expand 10 before | Expand all | Expand 10 after
2675 } 2676 }
2676 } 2677 }
2677 2678
2678 2679
2679 #undef __ 2680 #undef __
2680 2681
2681 } // namespace internal 2682 } // namespace internal
2682 } // namespace v8 2683 } // namespace v8
2683 2684
2684 #endif // V8_TARGET_ARCH_MIPS 2685 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/mips64/builtins-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698