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); |
} |