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

Unified Diff: src/ic.cc

Issue 9111036: Promote double arrays to FAST_ELEMENT that use generic KeyedLoadIC (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 8 years, 10 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 | src/runtime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic.cc
diff --git a/src/ic.cc b/src/ic.cc
index b084109a713aa572bb79acdfb7f1155d8a9ba9f8..715c805ce068284fc9b382905fb1b0bb39e48b8b 100644
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -1120,6 +1120,17 @@ MaybeObject* KeyedLoadIC::Load(State state,
} else if (key->IsSmi() && (target() != *non_strict_arguments_stub())) {
stub = ComputeStub(receiver, LOAD, kNonStrictMode, stub);
}
+ // If the IC is being replaced by the generic stub, loads from
+ // FAST_DOUBLE_ELEMENTS arrays will cause unboxing in Crankshafted
+ // code. To prevent these expensive allocations, proactively promote
+ // arrays to FAST_ELEMENTS ElementKinds.
+ if (*stub == *generic_stub()) {
+ if (receiver->HasFastDoubleElements()) {
+ MaybeObject* maybe_object =
+ receiver->TransitionElementsKind(FAST_ELEMENTS);
+ if (maybe_object->IsFailure()) return maybe_object;
+ }
+ }
}
} else {
TRACE_GENERIC_IC("KeyedLoadIC", "force generic");
« no previous file with comments | « no previous file | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698