diff options
author | Mingyao Yang <mingyao@google.com> | 2015-03-07 06:37:59 -0800 |
---|---|---|
committer | Mingyao Yang <mingyao@google.com> | 2015-03-23 16:39:37 -0700 |
commit | e295e6ec5beaea31be5d7d3c996cd8cfa2053129 (patch) | |
tree | 4d8a657d23d511743ce35bee596544d7f652efdb /compiler/optimizing/code_generator_arm.h | |
parent | d24ba2c44c76a2b2dd13aafe8f7981c15be31a98 (diff) | |
download | art-e295e6ec5beaea31be5d7d3c996cd8cfa2053129.tar.gz art-e295e6ec5beaea31be5d7d3c996cd8cfa2053129.tar.bz2 art-e295e6ec5beaea31be5d7d3c996cd8cfa2053129.zip |
Deoptimization-based bce.
A mechanism is introduced that a runtime method can be called
from code compiled with optimizing compiler to deoptimize into
interpreter. This can be used to establish invariants in the managed code
If the invariant does not hold at runtime, we will deoptimize and continue
execution in the interpreter. This allows to optimize the managed code as
if the invariant was proven during compile time. However, the exception
will be thrown according to the semantics demanded by the spec.
The invariant and optimization included in this patch are based on the
length of an array. Given a set of array accesses with constant indices
{c1, ..., cn}, we can optimize away all bounds checks iff all 0 <= min(ci) and
max(ci) < array-length. The first can be proven statically. The second can be
established with a deoptimization-based invariant. This replaces n bounds
checks with one invariant check (plus slow-path code).
Change-Id: I8c6e34b56c85d25b91074832d13dba1db0a81569
Diffstat (limited to 'compiler/optimizing/code_generator_arm.h')
-rw-r--r-- | compiler/optimizing/code_generator_arm.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/optimizing/code_generator_arm.h b/compiler/optimizing/code_generator_arm.h index 57e1d2f2f5..946a8a5c1b 100644 --- a/compiler/optimizing/code_generator_arm.h +++ b/compiler/optimizing/code_generator_arm.h @@ -169,6 +169,10 @@ class InstructionCodeGeneratorARM : public HGraphVisitor { void HandleFieldGet(HInstruction* instruction, const FieldInfo& field_info); void GenerateImplicitNullCheck(HNullCheck* instruction); void GenerateExplicitNullCheck(HNullCheck* instruction); + void GenerateTestAndBranch(HInstruction* instruction, + Label* true_target, + Label* false_target, + Label* always_true_target); ArmAssembler* const assembler_; CodeGeneratorARM* const codegen_; |