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

Unified Diff: src/ia32/stub-cache-ia32.cc

Issue 68523009: Also support smi in load-ICs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month 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 | « src/arm/stub-cache-arm.cc ('k') | src/ic.h » ('j') | src/ic-inl.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
}
}
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/ic.h » ('j') | src/ic-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698