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

Unified Diff: src/builtins.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: Tests, cleanup 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
« no previous file with comments | « no previous file | src/isolate.cc » ('j') | src/objects.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins.cc
diff --git a/src/builtins.cc b/src/builtins.cc
index 4bdfe5e1a6de3db64c5d9de5519e0899f6544e8b..8d375bb388602a31d0dd6e0504a833883a5a8246 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -698,7 +698,7 @@ BUILTIN(ArraySlice) {
!IsJSArrayFastElementMovingAllowed(isolate, array) ||
!isolate->IsArraySpeciesLookupChainIntact() ||
// If this is a subclass of Array, then call out to JS
- !array->map()->new_target_is_base()) {
+ !array->HasArrayPrototype(isolate)) {
adamk 2016/05/03 00:45:31 Given your claim in the CL description about the s
Dan Ehrenberg 2016/05/04 00:18:50 I improved the comment above HasArrayPrototype
AllowHeapAllocation allow_allocation;
return CallJsIntrinsic(isolate, isolate->array_slice(), args);
}
@@ -759,7 +759,8 @@ BUILTIN(ArraySplice) {
Handle<Object> receiver = args.receiver();
if (!EnsureJSArrayWithWritableFastElements(isolate, receiver, &args, 3) ||
// If this is a subclass of Array, then call out to JS.
- !JSArray::cast(*receiver)->map()->new_target_is_base() ||
+ !receiver->IsJSArray() ||
adamk 2016/05/03 00:45:31 The old code just casted directly here, I think be
Dan Ehrenberg 2016/05/04 00:18:50 Oops, done
+ !Handle<JSArray>::cast(receiver)->HasArrayPrototype(isolate) ||
// If anything with @@species has been messed with, call out to JS.
!isolate->IsArraySpeciesLookupChainIntact()) {
return CallJsIntrinsic(isolate, isolate->array_splice(), args);
« no previous file with comments | « no previous file | src/isolate.cc » ('j') | src/objects.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698