Index: src/x87/builtins-x87.cc |
diff --git a/src/x87/builtins-x87.cc b/src/x87/builtins-x87.cc |
index 1acaca683f6aad67dd8287ae005ab53efaf315ea..8a4272ada80ddef80f7680ce3ba6bf54abd665e1 100644 |
--- a/src/x87/builtins-x87.cc |
+++ b/src/x87/builtins-x87.cc |
@@ -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); |
} |