From a663d9d5b32a525794a2b98fa43da54dd7c79e3b Mon Sep 17 00:00:00 2001 From: Alexey Frunze Date: Mon, 31 Jul 2017 18:43:18 -0700 Subject: MIPS32: Allow some patched instructions in delay slots Test: test-art-host-gtest Test: booted MIPS64 (with 2nd arch MIPS32R6) in QEMU Test: test-art-target-gtest32 Test: testrunner.py --target --optimizing --32 Test: same tests as above on CI20 Test: booted MIPS32R2 in QEMU Change-Id: I7e1ba59993008014d0115ae20c56e0a71fef0fb0 --- compiler/utils/mips/assembler_mips.h | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) (limited to 'compiler/utils/mips/assembler_mips.h') diff --git a/compiler/utils/mips/assembler_mips.h b/compiler/utils/mips/assembler_mips.h index 7f9d5763f1..0f163ac83f 100644 --- a/compiler/utils/mips/assembler_mips.h +++ b/compiler/utils/mips/assembler_mips.h @@ -80,6 +80,12 @@ class MipsLabel : public Label { MipsLabel(MipsLabel&& src) : Label(std::move(src)), prev_branch_id_plus_one_(src.prev_branch_id_plus_one_) {} + void AdjustBoundPosition(int delta) { + CHECK(IsBound()); + // Bound label's position is negative, hence decrementing it. + position_ -= delta; + } + private: uint32_t prev_branch_id_plus_one_; // To get distance from preceding branch, if any. @@ -215,6 +221,7 @@ class MipsAssembler FINAL : public Assembler, public JNIMacroAssembler