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>
Thu, 5 May 2016 18:44:27 +0000 (11:44 -0700)
commit504a69081f63818ca332ddaf54e8198448554538
tree337b397a2167c91ada31f33f9613b9ec6479c4a3
parentb652da7aae5515c58c776a6975305d895f81ac19
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
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