diff options
author | Erik Verbruggen <[email protected]> | 2014-01-28 13:25:55 +0100 |
---|---|---|
committer | The Qt Project <[email protected]> | 2014-02-07 10:44:53 +0100 |
commit | 0b806c3adda7172673ee76a9d6f4320cf986bbf8 (patch) | |
tree | 76b9cc67ba2fd4a37efcee0a5f1fc166125f0dda /src/qml/compiler/qv4ssa.cpp | |
parent | 412f22f15ac13d678d018763aafad134ee02e872 (diff) |
V4: stack slot allocator for the interpreter.
Use the life-time intervals to track which temps go out of scope, in
order to re-use the stack-slots they occupied. This reduces the memory
consumption on the JavaScript stack and allows for deeper call stacks.
For the ECMA tests, this reduces the number of slots needed for the
main/entry function from more than 650 to about 10 (depending on the
test).
Change-Id: Iff4044f5ff7f25e1f88ff1a04f4e80dd99a67590
Reviewed-by: Lars Knoll <[email protected]>
Diffstat (limited to 'src/qml/compiler/qv4ssa.cpp')
-rw-r--r-- | src/qml/compiler/qv4ssa.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/qml/compiler/qv4ssa.cpp b/src/qml/compiler/qv4ssa.cpp index d9cc51fc82..3ffaca5134 100644 --- a/src/qml/compiler/qv4ssa.cpp +++ b/src/qml/compiler/qv4ssa.cpp @@ -3994,15 +3994,21 @@ void MoveMapping::order() qSwap(_moves, output); } -void MoveMapping::insertMoves(BasicBlock *bb, Function *function, bool atEnd) const +QList<V4IR::Move *> MoveMapping::insertMoves(BasicBlock *bb, Function *function, bool atEnd) const { + QList<V4IR::Move *> newMoves; + newMoves.reserve(_moves.size()); + int insertionPoint = atEnd ? bb->statements.size() - 1 : 0; foreach (const Move &m, _moves) { V4IR::Move *move = function->New<V4IR::Move>(); - move->init(m.to, m.from); + move->init(clone(m.to, function), clone(m.from, function)); move->swap = m.needsSwap; bb->statements.insert(insertionPoint++, move); + newMoves.append(move); } + + return newMoves; } void MoveMapping::dump() const |