diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-06-27 16:06:29 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-06-29 08:33:17 +0000 |
commit | dfe826d7f86db99bd6ecf681ec73c2e8c8b25a15 (patch) | |
tree | e3a98ece0c3e5599a44bbfd817abe2932d4b9355 /src/qml/compiler/qv4bytecodegenerator.cpp | |
parent | 987734ff5872c397651630a616a002947fec3810 (diff) |
Switch over to new JS call setup
Differences:
- push parameters on the stack, including space for CallData members
- call instructions calculate the argument start
- use temp space above the calldata to evaluate arguments
- fewer temporaries are needed when a call is done while generating the
arguments of another call
- when calling the function, the js stack space above the callData is
not used, allowing for optimizations in the future
- Array and ObjectLiteral use the same mechanism
Change-Id: Id100fa06f12cc9d941b0f90b0b81b8270a8e4f5d
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4bytecodegenerator.cpp')
-rw-r--r-- | src/qml/compiler/qv4bytecodegenerator.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4bytecodegenerator.cpp b/src/qml/compiler/qv4bytecodegenerator.cpp index 8f9b062af6..3a023c9989 100644 --- a/src/qml/compiler/qv4bytecodegenerator.cpp +++ b/src/qml/compiler/qv4bytecodegenerator.cpp @@ -63,6 +63,15 @@ unsigned BytecodeGenerator::newTemp() return t; } +unsigned BytecodeGenerator::newTempArray(int n) +{ + int t = function->currentTemp; + function->currentTemp += n; + if (function->tempCount < function->currentTemp) + function->tempCount = function->currentTemp; + return t; +} + QByteArray BytecodeGenerator::finalize() { QByteArray code; |