summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/code_generator_arm64.h
diff options
context:
space:
mode:
authorMingyao Yang <mingyao@google.com>2015-03-07 06:37:59 -0800
committerMingyao Yang <mingyao@google.com>2015-03-23 16:39:37 -0700
commite295e6ec5beaea31be5d7d3c996cd8cfa2053129 (patch)
tree4d8a657d23d511743ce35bee596544d7f652efdb /compiler/optimizing/code_generator_arm64.h
parentd24ba2c44c76a2b2dd13aafe8f7981c15be31a98 (diff)
downloadandroid_art-e295e6ec5beaea31be5d7d3c996cd8cfa2053129.tar.gz
android_art-e295e6ec5beaea31be5d7d3c996cd8cfa2053129.tar.bz2
android_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_arm64.h')
-rw-r--r--compiler/optimizing/code_generator_arm64.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/optimizing/code_generator_arm64.h b/compiler/optimizing/code_generator_arm64.h
index cbb2e5c749..860b25005b 100644
--- a/compiler/optimizing/code_generator_arm64.h
+++ b/compiler/optimizing/code_generator_arm64.h
@@ -140,6 +140,10 @@ class InstructionCodeGeneratorARM64 : public HGraphVisitor {
void HandleShift(HBinaryOperation* instr);
void GenerateImplicitNullCheck(HNullCheck* instruction);
void GenerateExplicitNullCheck(HNullCheck* instruction);
+ void GenerateTestAndBranch(HInstruction* instruction,
+ vixl::Label* true_target,
+ vixl::Label* false_target,
+ vixl::Label* always_true_target);
Arm64Assembler* const assembler_;
CodeGeneratorARM64* const codegen_;