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

Unified Diff: runtime/vm/assembler_arm.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_arm.h ('k') | runtime/vm/assembler_arm64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_arm.cc
diff --git a/runtime/vm/assembler_arm.cc b/runtime/vm/assembler_arm.cc
index db7881d4c278a3abe36ef5e13d88bbff5fd56072..4d2dad63875faf08bb3b17a8061595794943aef8 100644
--- a/runtime/vm/assembler_arm.cc
+++ b/runtime/vm/assembler_arm.cc
@@ -3237,6 +3237,44 @@ void Assembler::LeaveStubFrame() {
}
+void Assembler::NoMonomorphicCheckedEntry() {
+ buffer_.Reset();
+ bkpt(0);
+ bkpt(0);
+ bkpt(0);
+ ASSERT(CodeSize() == Instructions::kCheckedEntryOffset);
+}
+
+
+// R0 receiver, R9 guarded cid as Smi
+void Assembler::MonomorphicCheckedEntry() {
+#if defined(TESTING) || defined(DEBUG)
+ bool saved_use_far_branches = use_far_branches();
+ set_use_far_branches(false);
+#endif
+
+ Label miss;
+ Bind(&miss);
+ ldr(CODE_REG, Address(THR, Thread::monomorphic_miss_stub_offset()));
+ ldr(IP, FieldAddress(CODE_REG, Code::entry_point_offset()));
+ bx(IP);
+
+ Comment("MonomorphicCheckedEntry");
+ ASSERT(CodeSize() == Instructions::kCheckedEntryOffset);
+ LoadClassIdMayBeSmi(R4, R0);
+ SmiUntag(R9);
+ cmp(R4, Operand(R9));
+ b(&miss, NE);
+
+ // Fall through to unchecked entry.
+ ASSERT(CodeSize() == Instructions::kUncheckedEntryOffset);
+
+#if defined(TESTING) || defined(DEBUG)
+ set_use_far_branches(saved_use_far_branches);
+#endif
+}
+
+
#ifndef PRODUCT
void Assembler::MaybeTraceAllocation(intptr_t cid,
Register temp_reg,
« no previous file with comments | « runtime/vm/assembler_arm.h ('k') | runtime/vm/assembler_arm64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698