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

Unified Diff: src/ic.cc

Issue 13910012: Record the initial Map in the Store IC if it is not the same as the transitioned Map (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic.cc
===================================================================
--- src/ic.cc (revision 14298)
+++ src/ic.cc (working copy)
@@ -1681,16 +1681,23 @@
State ic_state = target()->ic_state();
Handle<Map> receiver_map(receiver->map(), isolate());
+ MapHandleList target_receiver_maps;
if (ic_state == UNINITIALIZED || ic_state == PREMONOMORPHIC) {
// Optimistically assume that ICs that haven't reached the MONOMORPHIC state
// yet will do so and stay there.
Handle<Map> monomorphic_map = ComputeTransitionedMap(receiver, store_mode);
store_mode = GetNonTransitioningStoreMode(store_mode);
- return isolate()->stub_cache()->ComputeKeyedStoreElement(
- monomorphic_map, strict_mode, store_mode);
+ if (*monomorphic_map != *receiver_map) {
+ target_receiver_maps.Add(receiver_map);
+ target_receiver_maps.Add(monomorphic_map);
+ return isolate()->stub_cache()->ComputeStoreElementPolymorphic(
+ &target_receiver_maps, store_mode, strict_mode);
+ } else {
+ return isolate()->stub_cache()->ComputeKeyedStoreElement(
+ monomorphic_map, strict_mode, store_mode);
+ }
}
- MapHandleList target_receiver_maps;
target()->FindAllMaps(&target_receiver_maps);
if (target_receiver_maps.length() == 0) {
// In the case that there is a non-map-specific IC is installed (e.g. keyed
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698