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

Unified Diff: runtime/vm/flow_graph_compiler_mips.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_ia32.cc ('k') | runtime/vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler_mips.cc
diff --git a/runtime/vm/flow_graph_compiler_mips.cc b/runtime/vm/flow_graph_compiler_mips.cc
index ff0ec98ff619300cb72648234ff6a59fdb5a5d00..3ec27561dfec76e128bb6b7db4ae10d6db2b3c24 100644
--- a/runtime/vm/flow_graph_compiler_mips.cc
+++ b/runtime/vm/flow_graph_compiler_mips.cc
@@ -1620,7 +1620,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");
const Array& arguments_descriptor =
@@ -1637,8 +1638,8 @@ void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data,
ASSERT(!ic_data.IsNull() && (kNumChecks > 0));
Label after_smi_test;
- __ andi(CMPRES1, T0, Immediate(kSmiTagMask));
if (kFirstCheckIsSmi) {
+ __ andi(CMPRES1, T0, Immediate(kSmiTagMask));
// Jump if receiver is not Smi.
if (kNumChecks == 1) {
__ bne(CMPRES1, ZR, failed);
@@ -1662,7 +1663,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).
- __ beq(CMPRES1, ZR, failed);
+ if (!complete) {
+ __ andi(CMPRES1, T0, Immediate(kSmiTagMask));
+ __ beq(CMPRES1, ZR, failed);
+ }
}
__ Bind(&after_smi_test);
@@ -1681,10 +1685,16 @@ void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data,
const bool kIsLastCheck = (i == (kSortedLen - 1));
ASSERT(sorted[i].cid != kSmiCid);
Label next_test;
- if (kIsLastCheck) {
- __ BranchNotEqual(T2, Immediate(sorted[i].cid), failed);
+ if (!complete) {
+ if (kIsLastCheck) {
+ __ BranchNotEqual(T2, Immediate(sorted[i].cid), failed);
+ } else {
+ __ BranchNotEqual(T2, Immediate(sorted[i].cid), &next_test);
+ }
} else {
- __ BranchNotEqual(T2, Immediate(sorted[i].cid), &next_test);
+ if (!kIsLastCheck) {
+ __ BranchNotEqual(T2, Immediate(sorted[i].cid), &next_test);
+ }
}
// 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_ia32.cc ('k') | runtime/vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698