OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef V8_ISOLATE_INL_H_ | 5 #ifndef V8_ISOLATE_INL_H_ |
6 #define V8_ISOLATE_INL_H_ | 6 #define V8_ISOLATE_INL_H_ |
7 | 7 |
8 #include "src/isolate.h" | 8 #include "src/isolate.h" |
9 #include "src/objects-inl.h" | 9 #include "src/objects-inl.h" |
10 | 10 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // what the protector stands for: | 108 // what the protector stands for: |
109 // - You'd need to traverse the heap to check that no Array instance has | 109 // - You'd need to traverse the heap to check that no Array instance has |
110 // a constructor property | 110 // a constructor property |
111 // - To check that Array[Symbol.species] == Array, JS code has to execute, | 111 // - To check that Array[Symbol.species] == Array, JS code has to execute, |
112 // but JS cannot be invoked in callstack overflow situations | 112 // but JS cannot be invoked in callstack overflow situations |
113 // All that could be checked reliably is that | 113 // All that could be checked reliably is that |
114 // Array.prototype.constructor == Array. Given that limitation, no check is | 114 // Array.prototype.constructor == Array. Given that limitation, no check is |
115 // done here. In place, there are mjsunit tests harmony/array-species* which | 115 // done here. In place, there are mjsunit tests harmony/array-species* which |
116 // ensure that behavior is correct in various invalid protector cases. | 116 // ensure that behavior is correct in various invalid protector cases. |
117 | 117 |
118 PropertyCell* species_cell = heap()->species_protector(); | 118 Cell* species_cell = heap()->species_protector(); |
119 return species_cell->value()->IsSmi() && | 119 return species_cell->value()->IsSmi() && |
120 Smi::cast(species_cell->value())->value() == kArrayProtectorValid; | 120 Smi::cast(species_cell->value())->value() == kArrayProtectorValid; |
121 } | 121 } |
122 | 122 |
123 } // namespace internal | 123 } // namespace internal |
124 } // namespace v8 | 124 } // namespace v8 |
125 | 125 |
126 #endif // V8_ISOLATE_INL_H_ | 126 #endif // V8_ISOLATE_INL_H_ |
OLD | NEW |