Index: src/arm64/builtins-arm64.cc |
diff --git a/src/arm64/builtins-arm64.cc b/src/arm64/builtins-arm64.cc |
index dfac40469ee426340ed7060e1d688e4ec44be6d0..0962c88ee2de9dcb47c340a073bf6404ed0250e6 100644 |
--- a/src/arm64/builtins-arm64.cc |
+++ b/src/arm64/builtins-arm64.cc |
@@ -872,8 +872,15 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { |
// Get the bytecode array from the function object and load the pointer to the |
// first entry into kInterpreterBytecodeRegister. |
__ Ldr(x0, FieldMemOperand(x1, JSFunction::kSharedFunctionInfoOffset)); |
+ Register debug_info = kInterpreterBytecodeArrayRegister; |
+ Label load_debug_bytecode_array, bytecode_array_loaded; |
+ DCHECK(!debug_info.is(x0)); |
+ __ Ldr(debug_info, FieldMemOperand(x0, SharedFunctionInfo::kDebugInfoOffset)); |
+ __ Cmp(debug_info, Operand(DebugInfo::uninitialized())); |
+ __ B(ne, &load_debug_bytecode_array); |
__ Ldr(kInterpreterBytecodeArrayRegister, |
FieldMemOperand(x0, SharedFunctionInfo::kFunctionDataOffset)); |
+ __ Bind(&bytecode_array_loaded); |
if (FLAG_debug_code) { |
// Check function data field is actually a BytecodeArray object. |
@@ -943,6 +950,12 @@ 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); |
+ __ Ldr(kInterpreterBytecodeArrayRegister, |
+ FieldMemOperand(debug_info, DebugInfo::kAbstractCodeIndex)); |
+ __ B(&bytecode_array_loaded); |
} |