Index: src/ia32/stub-cache-ia32.cc |
diff --git a/src/ia32/stub-cache-ia32.cc b/src/ia32/stub-cache-ia32.cc |
index b3753f72a30f76f6a0021f52557bf196a32fde38..5bb85ed38a353cae61a251895c102112ec3f0e0e 100644 |
--- a/src/ia32/stub-cache-ia32.cc |
+++ b/src/ia32/stub-cache-ia32.cc |
@@ -3163,7 +3163,20 @@ Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC( |
GenerateNameCheck(name, this->name(), &miss); |
} |
- __ JumpIfSmi(receiver(), &miss); |
+ Label number_case; |
+ Label* smi_target = &miss; |
ulan
2013/11/14 14:52:11
I think it would be more readable if you would def
|
+ for (int i = 0; i < receiver_maps->length(); ++i) { |
+ Handle<Map> map = receiver_maps->at(i); |
+ if (map.is_identical_to(isolate()->factory()->heap_number_map())) { |
ulan
2013/11/14 14:52:11
Micro-optimization: keep isolate()->factory()->hea
|
+ // Indirectly jump to the number handler to ensure map / handler pairs are |
+ // still in sync, rather than off-by-one because of an extra handler in |
+ // the beginning of the stub. |
+ smi_target = &number_case; |
+ break; |
+ } |
+ } |
+ __ JumpIfSmi(receiver(), smi_target); |
+ |
Register map_reg = scratch1(); |
__ mov(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset)); |
int receiver_count = receiver_maps->length(); |
@@ -3173,6 +3186,10 @@ Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC( |
if (!map->is_deprecated()) { |
number_of_handled_maps++; |
__ cmp(map_reg, map); |
+ if (map.is_identical_to(isolate()->factory()->heap_number_map())) { |
+ ASSERT(!number_case.is_unused()); |
+ __ bind(&number_case); |
+ } |
__ j(equal, handlers->at(current)); |
} |
} |