From 99d8808bc5b85d54e8e735953a27a0c0c788f10e Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 14 Jun 2018 10:12:20 +0200 Subject: Add support for function calls with spread Function calls with thread are modelled by pushing an empty value in front of every argument that requires spreading. The runtime methods callWithSpread and constructWithSpread then take care of spreading out the arguments. Change-Id: Ie877c59d3d9d08fc5f20d7befb7153c7b716bf30 Reviewed-by: Simon Hausmann --- src/qml/compiler/qv4bytecodehandler.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/qml/compiler/qv4bytecodehandler.cpp') diff --git a/src/qml/compiler/qv4bytecodehandler.cpp b/src/qml/compiler/qv4bytecodehandler.cpp index 3e4844a1ac..8d1ac0bfd9 100644 --- a/src/qml/compiler/qv4bytecodehandler.cpp +++ b/src/qml/compiler/qv4bytecodehandler.cpp @@ -263,6 +263,15 @@ std::vector ByteCodeHandler::collectLabelsInBytecode(const char *code, uint COLLECTOR_BEGIN_INSTR(CallContextObjectProperty) COLLECTOR_END_INSTR(CallContextObjectProperty) + COLLECTOR_BEGIN_INSTR(CallWithSpread) + COLLECTOR_END_INSTR(CallWithSpread) + + COLLECTOR_BEGIN_INSTR(Construct) + COLLECTOR_END_INSTR(Construct) + + COLLECTOR_BEGIN_INSTR(ConstructWithSpread) + COLLECTOR_END_INSTR(ConstructWithSpread) + COLLECTOR_BEGIN_INSTR(SetUnwindHandler) addLabel(code - start + offset); COLLECTOR_END_INSTR(SetUnwindHandler) @@ -355,9 +364,6 @@ std::vector ByteCodeHandler::collectLabelsInBytecode(const char *code, uint COLLECTOR_BEGIN_INSTR(ToObject) COLLECTOR_END_INSTR(ToObject) - COLLECTOR_BEGIN_INSTR(Construct) - COLLECTOR_END_INSTR(Construct) - COLLECTOR_BEGIN_INSTR(Jump) addLabel(code - start + offset); COLLECTOR_END_INSTR(Jump) -- cgit v1.2.3