Commit 360c761d authored by zhengxing.li's avatar zhengxing.li Committed by Commit bot

X87: [interpreter, debugger] support debug breaks via bytecode array copy.

  port e032a98d (r34190)

  original commit message:

BUG=

Review URL: https://codereview.chromium.org/1717333003

Cr-Commit-Position: refs/heads/master@{#34205}
parent e1b9058f
......@@ -422,8 +422,14 @@ 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).
__ mov(eax, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
Label load_debug_bytecode_array, bytecode_array_loaded;
__ cmp(FieldOperand(eax, SharedFunctionInfo::kDebugInfoOffset),
Immediate(DebugInfo::uninitialized()));
__ j(not_equal, &load_debug_bytecode_array);
__ mov(kInterpreterBytecodeArrayRegister,
FieldOperand(eax, SharedFunctionInfo::kFunctionDataOffset));
__ bind(&bytecode_array_loaded);
if (FLAG_debug_code) {
// Check function data field is actually a BytecodeArray object.
......@@ -504,6 +510,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;
__ mov(debug_info, FieldOperand(eax, SharedFunctionInfo::kDebugInfoOffset));
__ mov(kInterpreterBytecodeArrayRegister,
FieldOperand(debug_info, DebugInfo::kAbstractCodeIndex));
__ jmp(&bytecode_array_loaded);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment