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

Unified Diff: runtime/vm/flow_graph_compiler_x64.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: Review addressed 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_mips.cc ('k') | runtime/vm/il_printer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler_x64.cc
diff --git a/runtime/vm/flow_graph_compiler_x64.cc b/runtime/vm/flow_graph_compiler_x64.cc
index def75aa46cf2ef1f6386380f0c21994b414ff86d..c8ce4f5d248d4d8ce1df9a2dd9862c1356434177 100644
--- a/runtime/vm/flow_graph_compiler_x64.cc
+++ b/runtime/vm/flow_graph_compiler_x64.cc
@@ -1332,15 +1332,13 @@ void FlowGraphCompiler::EmitMegamorphicInstanceCall(
// Load receiver into RDI.
__ movq(RDI, Address(RSP, (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");
+ __ movq(RAX, RDI); // Move Smi hashcode to RAX.
__ testq(RDI, Immediate(kSmiTagMask));
- __ j(NOT_ZERO, &try_onebytestring, Assembler::kNearJump); // Non-smi value.
- __ movq(RAX, RDI);
- __ jmp(&done, Assembler::kNearJump);
+ __ j(ZERO, &done, Assembler::kNearJump); // It is Smi, we are done.
- __ Bind(&try_onebytestring);
__ CompareClassId(RDI, kOneByteStringCid);
__ j(NOT_EQUAL, &megamorphic_call, Assembler::kNearJump);
__ movq(RAX, FieldAddress(RDI, String::hash_offset()));
« no previous file with comments | « runtime/vm/flow_graph_compiler_mips.cc ('k') | runtime/vm/il_printer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698