From 26636fadce4b8dfaf07fd240e803910fe516b803 Mon Sep 17 00:00:00 2001 From: Martin Kustermann Date: Thu, 17 Jan 2019 17:53:52 +0000 Subject: [PATCH] [VM/Compiler/AOT] Bare instructions 8: Improve AOT code by using pc-relative calls This CL improves AOT code for StackOverflowInstr/CheckNullInstr: * On ARM we can do a conditional pc-relative calls for the stack overflow checks, getting rid of the slow-paths entirely. * On ARM64 we can do pc-relative calls on the slow path, avoiding an extra load. Flutter gallery size impact (in bare instructions mode): * ARM: -3.7% RX * ARM64: -1.4% RX Issue https://github.com/dart-lang/sdk/issues/33274 Change-Id: Ia1acd76ac6efa26642f99e1ce3e417100aa357f3 Reviewed-on: https://dart-review.googlesource.com/c/89620 Commit-Queue: Martin Kustermann Reviewed-by: Vyacheslav Egorov --- assembler_arm.cc | 6 +++--- assembler_arm.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/assembler_arm.cc b/assembler_arm.cc index 53de88ba8d6f..199853154978 100644 --- a/assembler_arm.cc +++ b/assembler_arm.cc @@ -3406,9 +3406,9 @@ void Assembler::TryAllocateArray(intptr_t cid, } } -void Assembler::GenerateUnRelocatedPcRelativeCall() { - // Emit "blr ". - EmitType5(AL, 0x686868, /*link=*/true); +void Assembler::GenerateUnRelocatedPcRelativeCall(Condition cond) { + // Emit "blr.cond ". + EmitType5(cond, 0x686868, /*link=*/true); } void Assembler::Stop(const char* message) { diff --git a/assembler_arm.h b/assembler_arm.h index b4c35c9460bd..6ca0bb7f0c73 100644 --- a/assembler_arm.h +++ b/assembler_arm.h @@ -1106,7 +1106,7 @@ class Assembler : public AssemblerBase { // (Code::kPcRelativeCall & pc_offset, , ) // // will be used during relocation to fix the offset. - void GenerateUnRelocatedPcRelativeCall(); + void GenerateUnRelocatedPcRelativeCall(Condition cond = AL); // Emit data (e.g encoded instruction or immediate) in instruction stream. void Emit(int32_t value);