Skip to content

Commit

Permalink
[VM/Compiler/AOT] Bare instructions 8: Improve AOT code by using pc-r…
Browse files Browse the repository at this point in the history
…elative 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 dart-lang#33274

Change-Id: Ia1acd76ac6efa26642f99e1ce3e417100aa357f3
Reviewed-on: https://dart-review.googlesource.com/c/89620
Commit-Queue: Martin Kustermann <[email protected]>
Reviewed-by: Vyacheslav Egorov <[email protected]>
  • Loading branch information
mkustermann authored and [email protected] committed Jan 17, 2019
1 parent bf08276 commit 26636fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions assembler_arm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3406,9 +3406,9 @@ void Assembler::TryAllocateArray(intptr_t cid,
}
}

void Assembler::GenerateUnRelocatedPcRelativeCall() {
// Emit "blr <offset>".
EmitType5(AL, 0x686868, /*link=*/true);
void Assembler::GenerateUnRelocatedPcRelativeCall(Condition cond) {
// Emit "blr.cond <offset>".
EmitType5(cond, 0x686868, /*link=*/true);
}

void Assembler::Stop(const char* message) {
Expand Down
2 changes: 1 addition & 1 deletion assembler_arm.h
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,7 @@ class Assembler : public AssemblerBase {
// (Code::kPcRelativeCall & pc_offset, <target-code>, <target-function>)
//
// 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);
Expand Down

0 comments on commit 26636fa

Please sign in to comment.