Index: src/ia32/builtins-ia32.cc |
diff --git a/src/ia32/builtins-ia32.cc b/src/ia32/builtins-ia32.cc |
index 1715ac156291f14d4e3d03c57872e2b169d29faf..4f2a33d4a6c0913481ce764ceeec49efd92a0f9c 100644 |
--- a/src/ia32/builtins-ia32.cc |
+++ b/src/ia32/builtins-ia32.cc |
@@ -556,8 +556,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. |
@@ -633,6 +639,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); |
} |
@@ -755,8 +769,14 @@ static void Generate_EnterBytecodeDispatch(MacroAssembler* masm) { |
__ mov(ebx, Operand(kInterpreterRegisterFileRegister, |
InterpreterFrameConstants::kFunctionFromRegisterPointer)); |
__ mov(ebx, FieldOperand(ebx, JSFunction::kSharedFunctionInfoOffset)); |
+ |
+ Label load_debug_bytecode_array, bytecode_array_loaded; |
+ __ cmp(FieldOperand(ebx, SharedFunctionInfo::kDebugInfoOffset), |
+ Immediate(DebugInfo::uninitialized())); |
+ __ j(not_equal, &load_debug_bytecode_array); |
__ mov(kInterpreterBytecodeArrayRegister, |
FieldOperand(ebx, SharedFunctionInfo::kFunctionDataOffset)); |
+ __ bind(&bytecode_array_loaded); |
if (FLAG_debug_code) { |
// Check function data field is actually a BytecodeArray object. |
@@ -795,6 +815,14 @@ static void Generate_EnterBytecodeDispatch(MacroAssembler* masm) { |
// and header removal. |
__ add(ebx, Immediate(Code::kHeaderSize - kHeapObjectTag)); |
__ jmp(ebx); |
+ |
+ // Load debug copy of the bytecode array. |
+ __ bind(&load_debug_bytecode_array); |
+ Register debug_info = kInterpreterBytecodeArrayRegister; |
+ __ mov(debug_info, FieldOperand(ebx, SharedFunctionInfo::kDebugInfoOffset)); |
+ __ mov(kInterpreterBytecodeArrayRegister, |
+ FieldOperand(debug_info, DebugInfo::kAbstractCodeIndex)); |
+ __ jmp(&bytecode_array_loaded); |
} |