Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2786)

Unified Diff: runtime/vm/assembler_arm64.cc

Issue 2226893002: Optimize AOT's switchable calls for the monomorphic case. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: sync Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/assembler_arm64.h ('k') | runtime/vm/assembler_mips.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_arm64.cc
diff --git a/runtime/vm/assembler_arm64.cc b/runtime/vm/assembler_arm64.cc
index 705d8c834e32ed147e50712b9c2e07152723de1f..72278e967a219aeda1961063fdf09d5000085159 100644
--- a/runtime/vm/assembler_arm64.cc
+++ b/runtime/vm/assembler_arm64.cc
@@ -27,6 +27,7 @@ Assembler::Assembler(bool use_far_branches)
use_far_branches_(use_far_branches),
comments_(),
constant_pool_allowed_(false) {
+ MonomorphicCheckedEntry();
}
@@ -1237,6 +1238,53 @@ void Assembler::LeaveStubFrame() {
}
+void Assembler::NoMonomorphicCheckedEntry() {
+ buffer_.Reset();
+ brk(0);
+ brk(0);
+ brk(0);
+ brk(0);
+ brk(0);
+ brk(0);
+ ASSERT(CodeSize() == Instructions::kCheckedEntryOffset);
+}
+
+
+// R0 receiver, R5 guarded cid as Smi
+void Assembler::MonomorphicCheckedEntry() {
+ bool saved_use_far_branches = use_far_branches();
+ set_use_far_branches(false);
+
+ Label immediate, have_cid, miss;
+ Bind(&miss);
+ ldr(CODE_REG, Address(THR, Thread::monomorphic_miss_stub_offset()));
+ ldr(IP0, FieldAddress(CODE_REG, Code::entry_point_offset()));
+ br(IP0);
+ brk(0);
+
+ Bind(&immediate);
+ movz(R4, Immediate(kSmiCid), 0);
+ b(&have_cid);
+
+ Comment("MonomorphicCheckedEntry");
+ ASSERT(CodeSize() == Instructions::kCheckedEntryOffset);
+ tsti(R0, Immediate(kSmiTagMask));
+ SmiUntag(R5);
+ b(&immediate, EQ);
+
+ LoadClassId(R4, R0);
+
+ Bind(&have_cid);
+ cmp(R4, Operand(R5));
+ b(&miss, NE);
+
+ // Fall through to unchecked entry.
+ ASSERT(CodeSize() == Instructions::kUncheckedEntryOffset);
+
+ set_use_far_branches(saved_use_far_branches);
+}
+
+
#ifndef PRODUCT
void Assembler::MaybeTraceAllocation(intptr_t cid,
Register temp_reg,
« no previous file with comments | « runtime/vm/assembler_arm64.h ('k') | runtime/vm/assembler_mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698