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

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

Issue 1703453002: [interpreter, debugger] support debug breaks via bytecode array copy (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase 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/interpreter/interpreter-assembler.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 836 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 // MANUAL indicates that the scope shouldn't actually generate code to set up 847 // MANUAL indicates that the scope shouldn't actually generate code to set up
848 // the frame (that is done below). 848 // the frame (that is done below).
849 FrameScope frame_scope(masm, StackFrame::MANUAL); 849 FrameScope frame_scope(masm, StackFrame::MANUAL);
850 850
851 __ Push(ra, fp, cp, a1); 851 __ Push(ra, fp, cp, a1);
852 __ Addu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); 852 __ Addu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp));
853 853
854 // Get the bytecode array from the function object and load the pointer to the 854 // Get the bytecode array from the function object and load the pointer to the
855 // first entry into kInterpreterBytecodeRegister. 855 // first entry into kInterpreterBytecodeRegister.
856 __ lw(a0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); 856 __ lw(a0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
857 Label load_debug_bytecode_array, bytecode_array_loaded;
858 Register debug_info = kInterpreterBytecodeArrayRegister;
859 DCHECK(!debug_info.is(a0));
860 __ lw(debug_info, FieldMemOperand(a0, SharedFunctionInfo::kDebugInfoOffset));
861 __ Branch(&load_debug_bytecode_array, ne, debug_info,
862 Operand(DebugInfo::uninitialized()));
857 __ lw(kInterpreterBytecodeArrayRegister, 863 __ lw(kInterpreterBytecodeArrayRegister,
858 FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset)); 864 FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset));
865 __ bind(&bytecode_array_loaded);
859 866
860 if (FLAG_debug_code) { 867 if (FLAG_debug_code) {
861 // Check function data field is actually a BytecodeArray object. 868 // Check function data field is actually a BytecodeArray object.
862 __ SmiTst(kInterpreterBytecodeArrayRegister, t0); 869 __ SmiTst(kInterpreterBytecodeArrayRegister, t0);
863 __ Assert(ne, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, t0, 870 __ Assert(ne, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, t0,
864 Operand(zero_reg)); 871 Operand(zero_reg));
865 __ GetObjectType(kInterpreterBytecodeArrayRegister, t0, t0); 872 __ GetObjectType(kInterpreterBytecodeArrayRegister, t0, t0);
866 __ Assert(eq, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, t0, 873 __ Assert(eq, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, t0,
867 Operand(BYTECODE_ARRAY_TYPE)); 874 Operand(BYTECODE_ARRAY_TYPE));
868 } 875 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 __ lbu(a0, MemOperand(a0)); 926 __ lbu(a0, MemOperand(a0));
920 __ Lsa(at, kInterpreterDispatchTableRegister, a0, kPointerSizeLog2); 927 __ Lsa(at, kInterpreterDispatchTableRegister, a0, kPointerSizeLog2);
921 __ lw(at, MemOperand(at)); 928 __ lw(at, MemOperand(at));
922 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging 929 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging
923 // and header removal. 930 // and header removal.
924 __ Addu(at, at, Operand(Code::kHeaderSize - kHeapObjectTag)); 931 __ Addu(at, at, Operand(Code::kHeaderSize - kHeapObjectTag));
925 __ Call(at); 932 __ Call(at);
926 933
927 // Even though the first bytecode handler was called, we will never return. 934 // Even though the first bytecode handler was called, we will never return.
928 __ Abort(kUnexpectedReturnFromBytecodeHandler); 935 __ Abort(kUnexpectedReturnFromBytecodeHandler);
936
937 // Load debug copy of the bytecode array.
938 __ bind(&load_debug_bytecode_array);
939 __ lw(kInterpreterBytecodeArrayRegister,
940 FieldMemOperand(debug_info, DebugInfo::kAbstractCodeIndex));
941 __ Branch(&bytecode_array_loaded);
929 } 942 }
930 943
931 944
932 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) { 945 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) {
933 // TODO(rmcilroy): List of things not currently dealt with here but done in 946 // TODO(rmcilroy): List of things not currently dealt with here but done in
934 // fullcodegen's EmitReturnSequence. 947 // fullcodegen's EmitReturnSequence.
935 // - Supporting FLAG_trace for Runtime::TraceExit. 948 // - Supporting FLAG_trace for Runtime::TraceExit.
936 // - Support profiler (specifically decrementing profiling_counter 949 // - Support profiler (specifically decrementing profiling_counter
937 // appropriately and calling out to HandleInterrupts if necessary). 950 // appropriately and calling out to HandleInterrupts if necessary).
938 951
(...skipping 1701 matching lines...) Expand 10 before | Expand all | Expand 10 after
2640 } 2653 }
2641 } 2654 }
2642 2655
2643 2656
2644 #undef __ 2657 #undef __
2645 2658
2646 } // namespace internal 2659 } // namespace internal
2647 } // namespace v8 2660 } // namespace v8
2648 2661
2649 #endif // V8_TARGET_ARCH_MIPS 2662 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/interpreter/interpreter-assembler.cc ('k') | src/mips64/builtins-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698