diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-06-13 12:29:02 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-09-03 13:21:10 +0200 |
commit | db3dd029d7cd911712102efd5ea71868494f9f6f (patch) | |
tree | 143e600d5393496b2b77ed7da74b94fc864efcf8 /tests | |
parent | eeb00570679c447f4701a92cd2e836f098724979 (diff) |
Fix various accumulator-saving problems
We need to keep the accumulator alive across function calls. This
requires:
1, Saving the accumulator on the stack if the function might allocate, to
protect it from the garbage collector. However, we don't need to do
that if the result of the function is to be saved in the accumulator
and the function itself doesn't use the accumulator as argument. In
this case the previous value becomes unaccessible and we might as
well GC it.
2, In the JIT, restoring the accumulator from the stack after the
function call if we want to ignore the return value.
3, Therefore, also saving the accumulator on the stack before calling in
case of 2.
We assume that we don't need to keep the accumulator alive across the
jump to the exception handler. Saving the accumulator more often than
necessary is detrimental for performance. To make sure the assumption
holds, explicitly load the accumulator with undefined _before_ jumping
to any exception handler.
Change-Id: I78cbc42847b8885a0659b23f3b81655b7f1a0bc4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions