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

Unified Diff: src/objects.cc

Issue 15014020: Elide hole checks on KeyedLoads of holey double arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Implement missing platforms and add tests Created 7 years, 7 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
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index d127d1bb8a095bd8d9c9ac6adbcf2572e30989fe..21cba63c4e2df0e6670f12b752ca80d13f370715 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -3006,6 +3006,19 @@ Map* Map::LookupElementsTransitionMap(ElementsKind to_kind) {
}
+bool Map::IsMapInArrayPrototypeChain() {
+ Isolate* isolate = GetIsolate();
+ if (isolate->initial_array_prototype()->map() == this) {
+ return true;
+ }
+
+ if (isolate->initial_object_prototype()->map() == this) {
+ return true;
+ }
+
+ return false;
+}
+
static MaybeObject* AddMissingElementsTransitions(Map* map,
ElementsKind to_kind) {
ASSERT(IsFastElementsKind(map->elements_kind()));
@@ -11151,6 +11164,18 @@ MaybeObject* JSObject::SetFastElement(uint32_t index,
ASSERT(HasFastSmiOrObjectElements() ||
HasFastArgumentsElements());
+ // Array optimizations rely on the prototype lookups of Array objects always
+ // returning undefined. If there is a store to the initial prototype object,
+ // make sure all of these optimizations are invalidated.
+ Isolate* isolate(GetIsolate());
+ if (isolate->is_initial_object_prototype(this) ||
+ isolate->is_initial_array_prototype(this)) {
+ HandleScope scope(GetIsolate());
+ map()->dependent_code()->DeoptimizeDependentCodeGroup(
+ GetIsolate(),
+ DependentCode::kElementsCantBeAddedGroup);
+ }
+
FixedArray* backing_store = FixedArray::cast(elements());
if (backing_store->map() == GetHeap()->non_strict_arguments_elements_map()) {
backing_store = FixedArray::cast(backing_store->get(1));
« src/isolate.cc ('K') | « src/objects.h ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698