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

Unified Diff: runtime/vm/code_generator.cc

Issue 1429303005: Add fast Smi op version of switchable instance calls. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | runtime/vm/flow_graph_compiler_arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_generator.cc
diff --git a/runtime/vm/code_generator.cc b/runtime/vm/code_generator.cc
index 9b3eb295c83059e52210650f7fca07def7f3d33b..54613cdff366a07a4ba6eaf6ce838260fed31f05 100644
--- a/runtime/vm/code_generator.cc
+++ b/runtime/vm/code_generator.cc
@@ -1049,7 +1049,17 @@ DEFINE_RUNTIME_ENTRY(MegamorphicCacheMissHandler, 3) {
if (ic_data_or_cache.IsICData()) {
const ICData& ic_data = ICData::Cast(ic_data_or_cache);
- ic_data.AddReceiverCheck(receiver.GetClassId(), target_function);
+
+ if (ic_data.NumArgsTested() == 1) {
+ ic_data.AddReceiverCheck(receiver.GetClassId(), target_function);
+ } else {
+ ASSERT(ic_data.NumArgsTested() == 2);
+ GrowableArray<intptr_t> class_ids(2);
+ class_ids.Add(receiver.GetClassId());
+ class_ids.Add(kDynamicCid); // No one will read this.
+ ic_data.AddCheck(class_ids, target_function);
+ }
+
if (ic_data.NumberOfChecks() > FLAG_max_polymorphic_checks) {
// Switch to megamorphic call.
const MegamorphicCache& cache = MegamorphicCache::Handle(zone,
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698