Index: src/builtins/x64/builtins-x64.cc |
diff --git a/src/builtins/x64/builtins-x64.cc b/src/builtins/x64/builtins-x64.cc |
index f4367871b7e81e8b4aa0f49c67d8e4c8f9877ec0..cde02647ac34ed43ad63a85593fda60ee20c7be9 100644 |
--- a/src/builtins/x64/builtins-x64.cc |
+++ b/src/builtins/x64/builtins-x64.cc |
@@ -956,7 +956,7 @@ void Builtins::Generate_InterpreterPushArgsAndConstructArray( |
} |
} |
-void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { |
+static void Generate_InterpreterEnterBytecode(MacroAssembler* masm) { |
// Set the return address to the correct point in the interpreter entry |
// trampoline. |
Smi* interpreter_entry_return_pc_offset( |
@@ -998,6 +998,31 @@ void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { |
__ jmp(rbx); |
} |
+void Builtins::Generate_InterpreterEnterBytecodeAdvance(MacroAssembler* masm) { |
+ // Advance the current bytecode offset stored within the given interpreter |
+ // stack frame. This simulates what all bytecode handlers do upon completion |
+ // of the underlying operation. |
+ __ movp(rbx, Operand(rbp, InterpreterFrameConstants::kBytecodeArrayFromFp)); |
+ __ movp(rdx, Operand(rbp, InterpreterFrameConstants::kBytecodeOffsetFromFp)); |
+ __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
+ { |
+ FrameScope scope(masm, StackFrame::INTERNAL); |
+ __ Push(kInterpreterAccumulatorRegister); |
+ __ Push(rbx); // First argument is the bytecode array. |
+ __ Push(rdx); // Second argument is the bytecode offset. |
+ __ CallRuntime(Runtime::kInterpreterAdvanceBytecodeOffset); |
+ __ Move(rdx, rax); // Result is the new bytecode offset. |
+ __ Pop(kInterpreterAccumulatorRegister); |
+ } |
+ __ movp(Operand(rbp, InterpreterFrameConstants::kBytecodeOffsetFromFp), rdx); |
+ |
+ Generate_InterpreterEnterBytecode(masm); |
+} |
+ |
+void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { |
+ Generate_InterpreterEnterBytecode(masm); |
+} |
+ |
void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
// ----------- S t a t e ------------- |
// -- rax : argument count (preserved for callee) |