From f1e18135fa4a19d808421af1a0d123f95649e523 Mon Sep 17 00:00:00 2001 From: "mvstanton@chromium.org" Date: Thu, 13 Mar 2014 12:17:43 +0000 Subject: [PATCH] Perf regression: changes in KeyedStoreIC introduced polymorphism. When fixing bug 350884, I introduced an error that meant we went polymorphic in KeyedStoreIC where we stayed monomorphic before. This CL addresses the error, while preserving the bug fix for 350884. R=verwaest@chromium.org Review URL: https://codereview.chromium.org/198793002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19893 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/ic.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/ic.cc b/src/ic.cc index 6ce2299796..7f4d1cd270 100644 --- a/src/ic.cc +++ b/src/ic.cc @@ -1459,22 +1459,22 @@ Handle KeyedStoreIC::StoreElementStub(Handle receiver, KeyedStoreIC::GetKeyedAccessStoreMode(target()->extra_ic_state()); Handle previous_receiver_map = target_receiver_maps.at(0); if (state() == MONOMORPHIC) { + Handle transitioned_receiver_map = receiver_map; if (IsTransitionStoreMode(store_mode)) { + transitioned_receiver_map = ComputeTransitionedMap(receiver, store_mode); + } + if (receiver_map.is_identical_to(previous_receiver_map) || + IsTransitionOfMonomorphicTarget( + MapToType(transitioned_receiver_map, isolate()))) { // If the "old" and "new" maps are in the same elements map family, or // if they at least come from the same origin for a transitioning store, // stay MONOMORPHIC and use the map for the most generic ElementsKind. - Handle transitioned_receiver_map = - ComputeTransitionedMap(receiver, store_mode); - if (*previous_receiver_map == receiver->map() || - IsTransitionOfMonomorphicTarget( - MapToType(transitioned_receiver_map, isolate()))) { - store_mode = GetNonTransitioningStoreMode(store_mode); - return isolate()->stub_cache()->ComputeKeyedStoreElement( - transitioned_receiver_map, strict_mode(), store_mode); - } + store_mode = GetNonTransitioningStoreMode(store_mode); + return isolate()->stub_cache()->ComputeKeyedStoreElement( + transitioned_receiver_map, strict_mode(), store_mode); } else if (*previous_receiver_map == receiver->map() && old_store_mode == STANDARD_STORE && - (IsGrowStoreMode(store_mode) || + (store_mode == STORE_AND_GROW_NO_TRANSITION || store_mode == STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS || store_mode == STORE_NO_TRANSITION_HANDLE_COW)) { // A "normal" IC that handles stores can switch to a version that can