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

Unified Diff: src/x64/builtins-x64.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime/runtime-debug.cc ('k') | test/mjsunit/ignition/debug-break.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/builtins-x64.cc
diff --git a/src/x64/builtins-x64.cc b/src/x64/builtins-x64.cc
index d7382144d28b2bc53ee80360a77eabe666834f5b..c0a0421a5eb08f2fc773c0da84be2782ffb5c47a 100644
--- a/src/x64/builtins-x64.cc
+++ b/src/x64/builtins-x64.cc
@@ -494,8 +494,15 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
// Get the bytecode array from the function object and load the pointer to the
// first entry into edi (InterpreterBytecodeRegister).
__ movp(rax, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset));
+
+ Label load_debug_bytecode_array, bytecode_array_loaded;
+ DCHECK_EQ(Smi::FromInt(0), DebugInfo::uninitialized());
+ __ cmpp(FieldOperand(rax, SharedFunctionInfo::kDebugInfoOffset),
+ Immediate(0));
+ __ j(not_equal, &load_debug_bytecode_array);
__ movp(kInterpreterBytecodeArrayRegister,
FieldOperand(rax, SharedFunctionInfo::kFunctionDataOffset));
+ __ bind(&bytecode_array_loaded);
if (FLAG_debug_code) {
// Check function data field is actually a BytecodeArray object.
@@ -568,6 +575,14 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
// Even though the first bytecode handler was called, we will never return.
__ Abort(kUnexpectedReturnFromBytecodeHandler);
+
+ // Load debug copy of the bytecode array.
+ __ bind(&load_debug_bytecode_array);
+ Register debug_info = kInterpreterBytecodeArrayRegister;
+ __ movp(debug_info, FieldOperand(rax, SharedFunctionInfo::kDebugInfoOffset));
+ __ movp(kInterpreterBytecodeArrayRegister,
+ FieldOperand(debug_info, DebugInfo::kAbstractCodeIndex));
+ __ jmp(&bytecode_array_loaded);
}
« no previous file with comments | « src/runtime/runtime-debug.cc ('k') | test/mjsunit/ignition/debug-break.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698