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

Unified Diff: runtime/vm/flow_graph_compiler_mips.cc

Issue 1920103004: Added flag --inline_smi_string_hashcode and --inline_smi_string_hashcode_ratio to decide when/if sh… (Closed) Base URL: https://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
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 9fa5d9f31afd4d1d932ee5ba1c059f930732ef44..266c5660409db7e1247b0741a67364221d911187 100644
--- a/runtime/vm/flow_graph_compiler_mips.cc
+++ b/runtime/vm/flow_graph_compiler_mips.cc
@@ -1330,15 +1330,13 @@ void FlowGraphCompiler::EmitMegamorphicInstanceCall(
// Load receiver into T0,
__ lw(T0, Address(SP, (argument_count - 1) * kWordSize));
Label done;
- if (name.raw() == Symbols::hashCode().raw()) {
- Label try_onebytestring, megamorphic_call;
+ if (ShouldInlineSmiStringHashCode(ic_data)) {
+ Label megamorphic_call;
__ Comment("Inlined get:hashCode for Smi and OneByteString");
+ __ mov(V0, T0); // Move Smi hashcode to V0.
__ andi(CMPRES1, T0, Immediate(kSmiTagMask));
- __ bne(CMPRES1, ZR, &try_onebytestring); // Not Smi.
- __ mov(V0, T0);
- __ b(&done);
+ __ beq(CMPRES1, ZR, &done); // Is Smi.
zra 2016/04/27 16:28:17 The mov can go in the branch delay slot: __ beq(C
srdjan 2016/04/27 18:10:22 Done.
- __ Bind(&try_onebytestring);
__ LoadClassId(CMPRES1, T0); // Class ID check.
__ BranchNotEqual(
CMPRES1, Immediate(kOneByteStringCid), &megamorphic_call);

Powered by Google App Engine
This is Rietveld 408576698