From aedc9bc5ebdacadc9efe4465173e1b7ca7edc226 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Thu, 4 Jul 2019 15:31:42 +0100 Subject: Ensure we can always enter OSR code When the the loop header is not the target of a back-edge, we used to never enter the OSR code even if it's been compiled. Test: testrunner.py --host --jit -t 570-checker-osr-locals (it used to get stuck, you can kill the dalvikvm to check that the weirdLoop was OSR-compiled) Bug: 136743846 Change-Id: Iae55463eff92adccf9adec842e04f8ff6d9d8568 --- compiler/optimizing/block_builder.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'compiler/optimizing/block_builder.h') diff --git a/compiler/optimizing/block_builder.h b/compiler/optimizing/block_builder.h index 2c1f034d80..42a3f327e7 100644 --- a/compiler/optimizing/block_builder.h +++ b/compiler/optimizing/block_builder.h @@ -59,6 +59,11 @@ class HBasicBlockBuilder : public ValueObject { void ConnectBasicBlocks(); void InsertTryBoundaryBlocks(); + // To ensure branches with negative offsets can always OSR jump to compiled + // code, we insert synthesized loops before each block that is the target of a + // negative branch. + void InsertSynthesizedLoopsForOsr(); + // Helper method which decides whether `catch_block` may have live normal // predecessors and thus whether a synthetic catch block needs to be created // to avoid mixing normal and exceptional predecessors. -- cgit v1.2.3-59-g8ed1b