OSDN Git Service

Fix assert failure in interpreter after deoptimization.
authorMingyao Yang <mingyao@google.com>
Thu, 28 Apr 2016 23:23:01 +0000 (16:23 -0700)
committerMingyao Yang <mingyao@google.com>
Wed, 11 May 2016 17:55:11 +0000 (10:55 -0700)
commit0b80b746f295469f143b3088741642114c6e2a7d
tree4cc6fd79beddc5c937bcaea2b82bc79fa51576bf
parent63347bbb6d25b762eaa67c67d78a019d28e94321
Fix assert failure in interpreter after deoptimization.

There is code that does
  new String(chararr, 0, chararr_count);
which under debuggable turns into a call into pNewEmptyString() plus a
call into pNewStringFromChars_CII().
Even though we currently don't patch return pc in a runtime method,
calling into pNewEmptyString() is special since it's hacked such
that it's acting as if the caller calls into the java method
StringFactory.newEmptyString() directly. So deoptimization can now
happen at the NewEmptyString site and the assert is triggered since
it's a new instance instead of an invoke instruction.

The fix relaxes the assert to allow the special case.

Bug: 28555675

(cherry picked from commit 504a69081f63818ca332ddaf54e8198448554538)

Change-Id: Idbb159b5aa450df2344cd93ae74fef5f55bdc534
runtime/interpreter/interpreter.cc
test/597-deopt-new-string/deopt.cc [new file with mode: 0644]
test/597-deopt-new-string/expected.txt [new file with mode: 0644]
test/597-deopt-new-string/info.txt [new file with mode: 0644]
test/597-deopt-new-string/run [new file with mode: 0644]
test/597-deopt-new-string/src/Main.java [new file with mode: 0644]
test/Android.libarttest.mk