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

Side by Side Diff: src/mips64/builtins-mips64.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/mips/builtins-mips.cc ('k') | src/objects.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 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 952 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 // MANUAL indicates that the scope shouldn't actually generate code to set up 963 // MANUAL indicates that the scope shouldn't actually generate code to set up
964 // the frame (that is done below). 964 // the frame (that is done below).
965 FrameScope frame_scope(masm, StackFrame::MANUAL); 965 FrameScope frame_scope(masm, StackFrame::MANUAL);
966 966
967 __ Push(ra, fp, cp, a1); 967 __ Push(ra, fp, cp, a1);
968 __ Daddu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); 968 __ Daddu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp));
969 969
970 // Get the bytecode array from the function object and load the pointer to the 970 // Get the bytecode array from the function object and load the pointer to the
971 // first entry into kInterpreterBytecodeRegister. 971 // first entry into kInterpreterBytecodeRegister.
972 __ ld(a0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); 972 __ ld(a0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
973 Label load_debug_bytecode_array, bytecode_array_loaded;
974 Register debug_info = kInterpreterBytecodeArrayRegister;
975 DCHECK(!debug_info.is(a0));
976 __ ld(debug_info, FieldMemOperand(a0, SharedFunctionInfo::kDebugInfoOffset));
977 __ Branch(&load_debug_bytecode_array, ne, debug_info,
978 Operand(DebugInfo::uninitialized()));
973 __ ld(kInterpreterBytecodeArrayRegister, 979 __ ld(kInterpreterBytecodeArrayRegister,
974 FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset)); 980 FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset));
981 __ bind(&bytecode_array_loaded);
975 982
976 if (FLAG_debug_code) { 983 if (FLAG_debug_code) {
977 // Check function data field is actually a BytecodeArray object. 984 // Check function data field is actually a BytecodeArray object.
978 __ SmiTst(kInterpreterBytecodeArrayRegister, a4); 985 __ SmiTst(kInterpreterBytecodeArrayRegister, a4);
979 __ Assert(ne, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, a4, 986 __ Assert(ne, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, a4,
980 Operand(zero_reg)); 987 Operand(zero_reg));
981 __ GetObjectType(kInterpreterBytecodeArrayRegister, a4, a4); 988 __ GetObjectType(kInterpreterBytecodeArrayRegister, a4, a4);
982 __ Assert(eq, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, a4, 989 __ Assert(eq, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, a4,
983 Operand(BYTECODE_ARRAY_TYPE)); 990 Operand(BYTECODE_ARRAY_TYPE));
984 } 991 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 __ lbu(a0, MemOperand(a0)); 1042 __ lbu(a0, MemOperand(a0));
1036 __ Dlsa(at, kInterpreterDispatchTableRegister, a0, kPointerSizeLog2); 1043 __ Dlsa(at, kInterpreterDispatchTableRegister, a0, kPointerSizeLog2);
1037 __ ld(at, MemOperand(at)); 1044 __ ld(at, MemOperand(at));
1038 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging 1045 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging
1039 // and header removal. 1046 // and header removal.
1040 __ Daddu(at, at, Operand(Code::kHeaderSize - kHeapObjectTag)); 1047 __ Daddu(at, at, Operand(Code::kHeaderSize - kHeapObjectTag));
1041 __ Call(at); 1048 __ Call(at);
1042 1049
1043 // Even though the first bytecode handler was called, we will never return. 1050 // Even though the first bytecode handler was called, we will never return.
1044 __ Abort(kUnexpectedReturnFromBytecodeHandler); 1051 __ Abort(kUnexpectedReturnFromBytecodeHandler);
1052
1053 // Load debug copy of the bytecode array.
1054 __ bind(&load_debug_bytecode_array);
1055 __ ld(kInterpreterBytecodeArrayRegister,
1056 FieldMemOperand(debug_info, DebugInfo::kAbstractCodeIndex));
1057 __ Branch(&bytecode_array_loaded);
1045 } 1058 }
1046 1059
1047 1060
1048 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) { 1061 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) {
1049 // TODO(rmcilroy): List of things not currently dealt with here but done in 1062 // TODO(rmcilroy): List of things not currently dealt with here but done in
1050 // fullcodegen's EmitReturnSequence. 1063 // fullcodegen's EmitReturnSequence.
1051 // - Supporting FLAG_trace for Runtime::TraceExit. 1064 // - Supporting FLAG_trace for Runtime::TraceExit.
1052 // - Support profiler (specifically decrementing profiling_counter 1065 // - Support profiler (specifically decrementing profiling_counter
1053 // appropriately and calling out to HandleInterrupts if necessary). 1066 // appropriately and calling out to HandleInterrupts if necessary).
1054 1067
(...skipping 1703 matching lines...) Expand 10 before | Expand all | Expand 10 after
2758 } 2771 }
2759 } 2772 }
2760 2773
2761 2774
2762 #undef __ 2775 #undef __
2763 2776
2764 } // namespace internal 2777 } // namespace internal
2765 } // namespace v8 2778 } // namespace v8
2766 2779
2767 #endif // V8_TARGET_ARCH_MIPS64 2780 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips/builtins-mips.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698