Chromium Code Reviews| 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())); |