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

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: Created 8 years, 12 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') | src/runtime.cc » ('J')
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 9024605da54a6f111f54d180732906a083166807..b68fd38dced16b27eb7702e07df31ce5956c8915 100644
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -1,4 +1,4 @@
-// Copyright 2011 the V8 project authors. All rights reserved.
+// Copyright 2012 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
@@ -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') | src/runtime.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698