aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jit
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@digia.com>2014-08-12 16:56:39 +0200
committerErik Verbruggen <erik.verbruggen@digia.com>2014-08-13 11:01:55 +0200
commita0986e6116e3a98f181cfd77fbcd3cf168dbc565 (patch)
treed1a36c7036bdb872afa37f33b570589ec06d53c9 /src/qml/jit
parent1fd06d1ecf588a1ac4bf6bc4f9eed5f95d4e7982 (diff)
V4 JIT: fix JS stack frame size calculation.
StackLayout::calculateJSStackFrameSize now returns the size in number of QV4::Value items, instead of bytes. The value is then multiplied in the assembler by sizeof(Value) to get the number of bytes. Previously, the return value was number of bytes, which also got multiplied. A direct effect is that the JS stack size will be ~87% smaller, with the nice effect that the GC will run faster (less roots on the stack). It also won't retain objects whose reference accidentally ended up on the stack below the used portion for the current function, so possibly freeing (more) objects (earlier) than before. Change-Id: Idd5a9c173e641c03e6b8a6fe743e403eda34dfe0 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jit')
-rw-r--r--src/qml/jit/qv4assembler_p.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/qml/jit/qv4assembler_p.h b/src/qml/jit/qv4assembler_p.h
index 6fde517e1f..41a1bc41d1 100644
--- a/src/qml/jit/qv4assembler_p.h
+++ b/src/qml/jit/qv4assembler_p.h
@@ -361,11 +361,10 @@ public:
return frameSize;
}
+ /// \return the stack frame size in number of Value items.
int calculateJSStackFrameSize() const
{
- const int locals = (localCount + sizeof(QV4::CallData)/sizeof(QV4::Value) - 1 + maxOutgoingArgumentCount) + 1;
- int frameSize = locals * sizeof(QV4::Value);
- return frameSize;
+ return (localCount + sizeof(QV4::CallData)/sizeof(QV4::Value) - 1 + maxOutgoingArgumentCount) + 1;
}
Address stackSlotPointer(int idx) const