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

Unified Diff: src/hydrogen.cc

Issue 1330233004: Fix for v8:4380 introduced a regression in Octane crypto. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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 | no next file » | 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 337c35b87b76e897e131848e58a0a191e2ec739f..06948a15f6448457d4cee1c5eb5c3ec59e4cadeb 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -7452,37 +7452,36 @@ HInstruction* HOptimizedGraphBuilder::TryBuildConsolidatedElementLoad(
: most_general_consolidated_map->elements_kind();
LoadKeyedHoleMode load_mode = NEVER_RETURN_HOLE;
if (has_seen_holey_elements) {
- if (!isolate()->IsFastArrayConstructorPrototypeChainIntact()) {
- return NULL;
- }
-
// Make sure that all of the maps we are handling have the initial array
// prototype.
+ bool saw_non_array_prototype = false;
for (int i = 0; i < maps->length(); ++i) {
Handle<Map> map = maps->at(i);
if (map->prototype() != *isolate()->initial_array_prototype()) {
// We can't guarantee that loading the hole is safe. The prototype may
// have an element at this position.
- return NULL;
+ saw_non_array_prototype = true;
+ break;
}
}
- Handle<Map> holey_map =
- handle(isolate()->get_initial_js_array_map(consolidated_elements_kind));
- load_mode = BuildKeyedHoleMode(holey_map);
- if (load_mode == NEVER_RETURN_HOLE) {
- return NULL;
- }
-
- for (int i = 0; i < maps->length(); ++i) {
- Handle<Map> map = maps->at(i);
- // The prototype check was already done for the holey map in
- // BuildKeyedHoleMode.
- if (!map.is_identical_to(holey_map)) {
- Handle<JSObject> prototype(JSObject::cast(map->prototype()), isolate());
- Handle<JSObject> object_prototype =
- isolate()->initial_object_prototype();
- BuildCheckPrototypeMaps(prototype, object_prototype);
+ if (!saw_non_array_prototype) {
+ Handle<Map> holey_map = handle(
+ isolate()->get_initial_js_array_map(consolidated_elements_kind));
+ load_mode = BuildKeyedHoleMode(holey_map);
+ if (load_mode != NEVER_RETURN_HOLE) {
+ for (int i = 0; i < maps->length(); ++i) {
+ Handle<Map> map = maps->at(i);
+ // The prototype check was already done for the holey map in
+ // BuildKeyedHoleMode.
+ if (!map.is_identical_to(holey_map)) {
+ Handle<JSObject> prototype(JSObject::cast(map->prototype()),
+ isolate());
+ Handle<JSObject> object_prototype =
+ isolate()->initial_object_prototype();
+ BuildCheckPrototypeMaps(prototype, object_prototype);
+ }
+ }
}
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698