Index: src/builtins/ia32/builtins-ia32.cc |
diff --git a/src/builtins/ia32/builtins-ia32.cc b/src/builtins/ia32/builtins-ia32.cc |
index bcffedfef2ba51010fbfff161b626e0b1a82a4a9..22d88388869b08fa29e10ad162d63974f7942587 100644 |
--- a/src/builtins/ia32/builtins-ia32.cc |
+++ b/src/builtins/ia32/builtins-ia32.cc |
@@ -710,12 +710,12 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { |
// Get the bytecode array from the function object (or from the DebugInfo if |
// it is present) and load it into kInterpreterBytecodeArrayRegister. |
+ Label maybe_load_debug_bytecode_array, bytecode_array_loaded; |
__ mov(eax, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); |
- Label load_debug_bytecode_array, bytecode_array_loaded; |
- __ JumpIfNotSmi(FieldOperand(eax, SharedFunctionInfo::kDebugInfoOffset), |
- &load_debug_bytecode_array); |
__ mov(kInterpreterBytecodeArrayRegister, |
FieldOperand(eax, SharedFunctionInfo::kFunctionDataOffset)); |
+ __ JumpIfNotSmi(FieldOperand(eax, SharedFunctionInfo::kDebugInfoOffset), |
+ &maybe_load_debug_bytecode_array); |
__ bind(&bytecode_array_loaded); |
// Check whether we should continue to use the interpreter. |
@@ -802,12 +802,17 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { |
LeaveInterpreterFrame(masm, ebx, ecx); |
__ ret(0); |
- // Load debug copy of the bytecode array. |
- __ bind(&load_debug_bytecode_array); |
- Register debug_info = kInterpreterBytecodeArrayRegister; |
- __ mov(debug_info, FieldOperand(eax, SharedFunctionInfo::kDebugInfoOffset)); |
+ // Load debug copy of the bytecode array if it exists. |
+ // kInterpreterBytecodeArrayRegister is already loaded with |
+ // SharedFunctionInfo::kFunctionDataOffset. |
+ __ bind(&maybe_load_debug_bytecode_array); |
+ __ mov(ecx, FieldOperand(eax, SharedFunctionInfo::kDebugInfoOffset)); |
+ __ mov(ebx, FieldOperand(ecx, DebugInfo::kFlagsOffset)); |
+ __ SmiUntag(ebx); |
+ __ test(ebx, Immediate(DebugInfo::kHasBreakInfo)); |
+ __ j(zero, &bytecode_array_loaded); |
__ mov(kInterpreterBytecodeArrayRegister, |
- FieldOperand(debug_info, DebugInfo::kDebugBytecodeArrayIndex)); |
+ FieldOperand(ecx, DebugInfo::kDebugBytecodeArrayOffset)); |
__ jmp(&bytecode_array_loaded); |
// If the shared code is no longer this entry trampoline, then the underlying |