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

Side by Side Diff: src/isolate.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, 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/isolate.h" 5 #include "src/isolate.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include <fstream> // NOLINT(readability/streams) 9 #include <fstream> // NOLINT(readability/streams)
10 #include <sstream> 10 #include <sstream>
(...skipping 2541 matching lines...) Expand 10 before | Expand all | Expand 10 after
2552 2552
2553 return cell_reports_intact; 2553 return cell_reports_intact;
2554 } 2554 }
2555 2555
2556 bool Isolate::IsArraySpeciesLookupChainIntact() { 2556 bool Isolate::IsArraySpeciesLookupChainIntact() {
2557 if (!FLAG_harmony_species) return true; 2557 if (!FLAG_harmony_species) return true;
2558 // Note: It would be nice to have debug checks to make sure that the 2558 // Note: It would be nice to have debug checks to make sure that the
2559 // species protector is accurate, but this would be hard to do for most of 2559 // species protector is accurate, but this would be hard to do for most of
2560 // what the protector stands for: 2560 // what the protector stands for:
2561 // - You'd need to traverse the heap to check that no Array instance has 2561 // - You'd need to traverse the heap to check that no Array instance has
2562 // a constructor property or a modified __proto__ 2562 // a constructor property
2563 // - To check that Array[Symbol.species] == Array, JS code has to execute, 2563 // - To check that Array[Symbol.species] == Array, JS code has to execute,
2564 // but JS cannot be invoked in callstack overflow situations 2564 // but JS cannot be invoked in callstack overflow situations
2565 // All that could be checked reliably is that 2565 // All that could be checked reliably is that
2566 // Array.prototype.constructor == Array. Given that limitation, no check is 2566 // Array.prototype.constructor == Array. Given that limitation, no check is
2567 // done here. In place, there are mjsunit tests harmony/array-species* which 2567 // done here. In place, there are mjsunit tests harmony/array-species* which
2568 // ensure that behavior is correct in various invalid protector cases. 2568 // ensure that behavior is correct in various invalid protector cases.
2569 2569
2570 PropertyCell* species_cell = heap()->species_protector(); 2570 PropertyCell* species_cell = heap()->species_protector();
2571 return species_cell->value()->IsSmi() && 2571 return species_cell->value()->IsSmi() &&
2572 Smi::cast(species_cell->value())->value() == kArrayProtectorValid; 2572 Smi::cast(species_cell->value())->value() == kArrayProtectorValid;
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
2999 // Then check whether this scope intercepts. 2999 // Then check whether this scope intercepts.
3000 if ((flag & intercept_mask_)) { 3000 if ((flag & intercept_mask_)) {
3001 intercepted_flags_ |= flag; 3001 intercepted_flags_ |= flag;
3002 return true; 3002 return true;
3003 } 3003 }
3004 return false; 3004 return false;
3005 } 3005 }
3006 3006
3007 } // namespace internal 3007 } // namespace internal
3008 } // namespace v8 3008 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698