OSDN Git Service

Fix premature deoptimization if the loop body isn't entered.
authorMingyao Yang <mingyao@google.com>
Tue, 19 May 2015 23:01:59 +0000 (16:01 -0700)
committerMingyao Yang <mingyao@google.com>
Wed, 10 Jun 2015 23:51:57 +0000 (16:51 -0700)
commit3584bce5b1f45e5741d3a6ca24884a36320ecb6b
treed9ccce473db996594e84135cb6d50d260063aabf
parentcbc1e2ed4a7d3d43d59c20713888058097c8188f
Fix premature deoptimization if the loop body isn't entered.

Add a test between initial_ and end_ to see if the loop body is entered.
If the loop body isn't entered at all, we jump to the loop header. Loop header is
still executed and is going to test the condition again and loop body won't be
entered. This makes sure no deoptimization is triggered if the loop body isn't
even entered.

Bug: 21034044
Change-Id: I2b6de1f22fbc4568ca419f76382ebd87806d9694
compiler/optimizing/bounds_check_elimination.cc
compiler/optimizing/bounds_check_elimination_test.cc
compiler/optimizing/nodes.cc
compiler/optimizing/nodes.h
test/449-checker-bce/src/Main.java