Index: src/x64/stub-cache-x64.cc |
diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc |
index b4222bc82f4ae9271ead55dc8c4d92b19ba4febe..3a1a1792d0a87409c554146e70ee95560929522b 100644 |
--- a/src/x64/stub-cache-x64.cc |
+++ b/src/x64/stub-cache-x64.cc |
@@ -3071,17 +3071,25 @@ Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC( |
GenerateNameCheck(name, this->name(), &miss); |
} |
- __ JumpIfSmi(receiver(), &miss); |
+ Label number_case; |
+ Label* smi_target = HasHeapNumberMap(receiver_maps) ? &number_case : &miss; |
+ __ JumpIfSmi(receiver(), smi_target); |
+ |
Register map_reg = scratch1(); |
__ movq(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset)); |
int receiver_count = receiver_maps->length(); |
int number_of_handled_maps = 0; |
+ Handle<Map> heap_number_map = isolate()->factory()->heap_number_map(); |
for (int current = 0; current < receiver_count; ++current) { |
Handle<Map> map = receiver_maps->at(current); |
if (!map->is_deprecated()) { |
number_of_handled_maps++; |
// Check map and tail call if there's a match |
__ Cmp(map_reg, receiver_maps->at(current)); |
+ if (map.is_identical_to(heap_number_map)) { |
+ ASSERT(!number_case.is_unused()); |
+ __ bind(&number_case); |
+ } |
__ j(equal, handlers->at(current), RelocInfo::CODE_TARGET); |
} |
} |