OSDN Git Service

Reuse promoted register temporarily
authorYevgeny Rouban <yevgeny.y.rouban@intel.com>
Tue, 18 Mar 2014 08:55:16 +0000 (15:55 +0700)
committerIan Rogers <irogers@google.com>
Wed, 26 Mar 2014 22:06:23 +0000 (15:06 -0700)
commitd3a2dfad0e1231b354e4bf77b67a4e179fa0e837
tree1f439e9a466aeb91c449fb81ba2417af2d46ff6f
parent223efbe5164f6fe83cf04e7f9121adb29b8dd231
Reuse promoted register temporarily

AtomicLong (x86) is implemented as an intrinsic, which uses
the cmpxchng8b instruction.
This instruction requires 4 physical registers plus 2 more used for
the memory operand. On x86 we have only 4 temporaries. The code tried
to solve this by using MarkTemp utility, but this was not meant to be
used with promoted registers. The problem is that MarkTemp does not
spill anything and as a result we can lose VR.

If the registers are promoted this patch just reuses the values pushed
on the stack.

Change-Id: Ifec9183e2483cf704d0d1166a1004a9aa07b4f1d
Signed-off-by: Serguei Katkov <serguei.i.katkov@intel.com>
Signed-off-by: Yevgeny Rouban <yevgeny.y.rouban@intel.com>
compiler/dex/quick/x86/int_x86.cc
test/083-compiler-regressions/expected.txt
test/083-compiler-regressions/src/Main.java