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

Unified Diff: src/objects.cc

Issue 1936393002: Make array __proto__ manipulations not disturb the species protector (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix review issues Created 4 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
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 13123f19005cdd39de8615e95cf6e11b2366343b..563c976e890ca1d3342736c314c1a4a010ac786e 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -1564,7 +1564,7 @@ MaybeHandle<Object> Object::ArraySpeciesConstructor(
return default_species;
}
if (original_array->IsJSArray() &&
- Handle<JSReceiver>::cast(original_array)->map()->new_target_is_base() &&
+ Handle<JSArray>::cast(original_array)->HasArrayPrototype(isolate) &&
isolate->IsArraySpeciesLookupChainIntact()) {
return default_species;
}
@@ -14926,16 +14926,6 @@ Maybe<bool> JSObject::SetPrototype(Handle<JSObject> object,
ShouldThrow should_throw) {
Isolate* isolate = object->GetIsolate();
- // Setting the prototype of an Array instance invalidates the species
- // protector
- // because it could change the constructor property of the instance, which
- // could change the @@species constructor.
- if (object->IsJSArray() && isolate->IsArraySpeciesLookupChainIntact()) {
- isolate->CountUsage(
- v8::Isolate::UseCounterFeature::kArrayInstanceProtoModified);
- isolate->InvalidateArraySpeciesProtector();
- }
-
#ifdef DEBUG
int size = object->Size();
#endif

Powered by Google App Engine
This is Rietveld 408576698