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

Unified Diff: src/hydrogen.cc

Issue 1100083002: Don't MISS if you read the hole from certain FastHoley arrays. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE and fix arm64 compilation. Created 5 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 | « src/heap/heap.cc ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index eb7a73ee6334110231cc0e3b7c2be069588ecbf0..c17c5f1d9c9e9edf37bb433f3c868fd9736e621e 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -6977,16 +6977,23 @@ HInstruction* HOptimizedGraphBuilder::BuildKeyedGeneric(
LoadKeyedHoleMode HOptimizedGraphBuilder::BuildKeyedHoleMode(Handle<Map> map) {
// Loads from a "stock" fast holey double arrays can elide the hole check.
+ // Loads from a "stock" fast holey array can convert the hole to undefined
+ // with impunity.
LoadKeyedHoleMode load_mode = NEVER_RETURN_HOLE;
- if (*map == isolate()->get_initial_js_array_map(FAST_HOLEY_DOUBLE_ELEMENTS) &&
+ bool holey_double_elements =
+ *map == isolate()->get_initial_js_array_map(FAST_HOLEY_DOUBLE_ELEMENTS);
+ bool holey_elements =
+ *map == isolate()->get_initial_js_array_map(FAST_HOLEY_ELEMENTS);
+ if ((holey_double_elements || holey_elements) &&
isolate()->IsFastArrayConstructorPrototypeChainIntact()) {
+ load_mode =
+ holey_double_elements ? ALLOW_RETURN_HOLE : CONVERT_HOLE_TO_UNDEFINED;
+
Handle<JSObject> prototype(JSObject::cast(map->prototype()), isolate());
Handle<JSObject> object_prototype = isolate()->initial_object_prototype();
BuildCheckPrototypeMaps(prototype, object_prototype);
- load_mode = ALLOW_RETURN_HOLE;
graph()->MarkDependsOnEmptyArrayProtoElements();
}
-
return load_mode;
}
« no previous file with comments | « src/heap/heap.cc ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698