From 1c61e70a0c0f1718c538c04dcc80dd3039ccd384 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Fri, 24 Aug 2018 15:41:53 +0200 Subject: ES7: Detect Tail Position Calls and pass that to the runtime Doing the tail call in the runtime will come in a follow-up patch Change-Id: I8224aac0edbdc765ee9b97703948edd52fd33f3e Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4vme_moth.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/qml/jsruntime/qv4vme_moth.cpp') diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp index f81c8438ce..7fd7be8e38 100644 --- a/src/qml/jsruntime/qv4vme_moth.cpp +++ b/src/qml/jsruntime/qv4vme_moth.cpp @@ -776,6 +776,12 @@ QV4::ReturnedValue VME::interpret(CppStackFrame *frame, ExecutionEngine *engine, CHECK_EXCEPTION; MOTH_END_INSTR(CallWithSpread) + MOTH_BEGIN_INSTR(TailCall) + STORE_IP(); + acc = Runtime::method_tailCall(engine, STACK_VALUE(func), STACK_VALUE(thisObject), stack + argv, argc); + CHECK_EXCEPTION; + MOTH_END_INSTR(TailCall) + MOTH_BEGIN_INSTR(Construct) STORE_IP(); acc = Runtime::method_construct(engine, STACK_VALUE(func), ACC, stack + argv, argc); -- cgit v1.2.3