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

Unified Diff: runtime/vm/flow_graph_compiler_ia32.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_ia32.cc
diff --git a/runtime/vm/flow_graph_compiler_ia32.cc b/runtime/vm/flow_graph_compiler_ia32.cc
index 8a7c349c5e7738afcff4fb83e9798d6a8106a10a..30cff6b26e89a0fcb551d66aad7cb6123f71214a 100644
--- a/runtime/vm/flow_graph_compiler_ia32.cc
+++ b/runtime/vm/flow_graph_compiler_ia32.cc
@@ -1303,15 +1303,13 @@ void FlowGraphCompiler::EmitMegamorphicInstanceCall(
// Load receiver into EBX.
__ movl(EBX, Address(ESP, (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");
+ __ movl(EAX, EBX); // Move Smi hashcode to EAX.
zra 2016/04/27 16:28:17 Smi hash code looks really easy to calculate =) Ha
srdjan 2016/04/27 18:10:22 In order to get the cid we must check for Smi anyw
__ testl(EBX, Immediate(kSmiTagMask));
- __ j(NOT_ZERO, &try_onebytestring, Assembler::kNearJump); // Non-smi value.
- __ movl(EAX, EBX);
- __ jmp(&done, Assembler::kNearJump);
+ __ j(ZERO, &done, Assembler::kNearJump); // It is Smi, we are done.
- __ Bind(&try_onebytestring);
__ CompareClassId(EBX, kOneByteStringCid, EAX);
__ j(NOT_EQUAL, &megamorphic_call, Assembler::kNearJump);
__ movl(EAX, FieldAddress(EBX, String::hash_offset()));

Powered by Google App Engine
This is Rietveld 408576698