From: Erik Verbruggen Date: Tue, 12 Aug 2014 14:56:39 +0000 (+0200) Subject: V4 JIT: fix JS stack frame size calculation. X-Git-Tag: v5.3.99+beta1~80^2^2~25 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a0986e6116e3a98f181cfd77fbcd3cf168dbc565;p=platform%2Fupstream%2Fqtdeclarative.git 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 --- diff --git a/src/qml/jit/qv4assembler_p.h b/src/qml/jit/qv4assembler_p.h index 6fde517..41a1bc4 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