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

Unified Diff: runtime/vm/flow_graph_compiler_arm64.cc

Issue 1867913004: Specialize instance calls when the call receiver is the method receiver and the method class has a … (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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/flow_graph_compiler_arm.cc ('k') | runtime/vm/flow_graph_compiler_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler_arm64.cc
diff --git a/runtime/vm/flow_graph_compiler_arm64.cc b/runtime/vm/flow_graph_compiler_arm64.cc
index 034eec67b54087694e93c30fe8fa559009cdfb1d..f872532517d6f5008399e6409875dcd208ef3776 100644
--- a/runtime/vm/flow_graph_compiler_arm64.cc
+++ b/runtime/vm/flow_graph_compiler_arm64.cc
@@ -1551,7 +1551,8 @@ void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data,
Label* match_found,
intptr_t deopt_id,
TokenPosition token_index,
- LocationSummary* locs) {
+ LocationSummary* locs,
+ bool complete) {
ASSERT(is_optimizing());
__ Comment("EmitTestAndCall");
@@ -1569,8 +1570,8 @@ void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data,
ASSERT(!ic_data.IsNull() && (kNumChecks > 0));
Label after_smi_test;
- __ tsti(R0, Immediate(kSmiTagMask));
if (kFirstCheckIsSmi) {
+ __ tsti(R0, Immediate(kSmiTagMask));
// Jump if receiver is not Smi.
if (kNumChecks == 1) {
__ b(failed, NE);
@@ -1594,7 +1595,10 @@ void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data,
} else {
// Receiver is Smi, but Smi is not a valid class therefore fail.
// (Smi class must be first in the list).
- __ b(failed, EQ);
+ if (!complete) {
+ __ tsti(R0, Immediate(kSmiTagMask));
+ __ b(failed, EQ);
+ }
}
__ Bind(&after_smi_test);
@@ -1613,11 +1617,18 @@ void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data,
const bool kIsLastCheck = (i == (kSortedLen - 1));
ASSERT(sorted[i].cid != kSmiCid);
Label next_test;
- __ CompareImmediate(R2, sorted[i].cid);
- if (kIsLastCheck) {
- __ b(failed, NE);
+ if (!complete) {
+ __ CompareImmediate(R2, sorted[i].cid);
+ if (kIsLastCheck) {
+ __ b(failed, NE);
+ } else {
+ __ b(&next_test, NE);
+ }
} else {
- __ b(&next_test, NE);
+ if (!kIsLastCheck) {
+ __ CompareImmediate(R2, sorted[i].cid);
+ __ b(&next_test, NE);
+ }
}
// Do not use the code from the function, but let the code be patched so
// that we can record the outgoing edges to other code.
« no previous file with comments | « runtime/vm/flow_graph_compiler_arm.cc ('k') | runtime/vm/flow_graph_compiler_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698