OSDN Git Service

Optimizing: LoadString may not have any side effects.
authorVladimir Marko <vmarko@google.com>
Tue, 5 Apr 2016 10:18:49 +0000 (11:18 +0100)
committerVladimir Marko <vmarko@google.com>
Tue, 10 May 2016 09:26:11 +0000 (10:26 +0100)
commitbf12e4d4209ac4e8fb98b4fd5193208adc7fe3ff
tree27ac87cda125c7182238e9ab80403b321690de1b
parentceeb3b73f84e8b11f362605007d382405d08d95c
Optimizing: LoadString may not have any side effects.

LoadString does not have any side effects if the string is
known to be in the dex cache or it's a boot image string
referenced directly, as specified by the string load kind.
We need to clear the side effects for these cases to avoid
a DCHECK() failure when such LoadString instruction ends up
between a ClinitCheck and an instruction to which we want to
merge that ClinitCheck. This may happen as a consequence of
inlining, LICM and DCE as shown by a regression test.

Bug: 27929914

(cherry picked from commit ace7a000a433ce4ecf94f30adea39c01a76fa936)

Change-Id: Iaf9c63b6e58aae1e246b43ca52eea0b47a6ad565
compiler/optimizing/nodes.cc
compiler/optimizing/nodes.h
test/594-load-string-regression/expected.txt [new file with mode: 0644]
test/594-load-string-regression/info.txt [new file with mode: 0644]
test/594-load-string-regression/src/Main.java [new file with mode: 0644]