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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 #define NATIVE_CONTEXT_FIELD_ACCESSOR(index, type, name) \ | 94 #define NATIVE_CONTEXT_FIELD_ACCESSOR(index, type, name) \ |
95 Handle<type> Isolate::name() { \ | 95 Handle<type> Isolate::name() { \ |
96 return Handle<type>(native_context()->name(), this); \ | 96 return Handle<type>(native_context()->name(), this); \ |
97 } \ | 97 } \ |
98 bool Isolate::is_##name(type* value) { \ | 98 bool Isolate::is_##name(type* value) { \ |
99 return native_context()->is_##name(value); \ | 99 return native_context()->is_##name(value); \ |
100 } | 100 } |
101 NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELD_ACCESSOR) | 101 NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELD_ACCESSOR) |
102 #undef NATIVE_CONTEXT_FIELD_ACCESSOR | 102 #undef NATIVE_CONTEXT_FIELD_ACCESSOR |
103 | 103 |
| 104 bool Isolate::IsArraySpeciesLookupChainIntact() { |
| 105 if (!FLAG_harmony_species) return true; |
| 106 // Note: It would be nice to have debug checks to make sure that the |
| 107 // species protector is accurate, but this would be hard to do for most of |
| 108 // what the protector stands for: |
| 109 // - You'd need to traverse the heap to check that no Array instance has |
| 110 // a constructor property |
| 111 // - To check that Array[Symbol.species] == Array, JS code has to execute, |
| 112 // but JS cannot be invoked in callstack overflow situations |
| 113 // All that could be checked reliably is that |
| 114 // Array.prototype.constructor == Array. Given that limitation, no check is |
| 115 // done here. In place, there are mjsunit tests harmony/array-species* which |
| 116 // ensure that behavior is correct in various invalid protector cases. |
| 117 |
| 118 PropertyCell* species_cell = heap()->species_protector(); |
| 119 return species_cell->value()->IsSmi() && |
| 120 Smi::cast(species_cell->value())->value() == kArrayProtectorValid; |
| 121 } |
104 | 122 |
105 } // namespace internal | 123 } // namespace internal |
106 } // namespace v8 | 124 } // namespace v8 |
107 | 125 |
108 #endif // V8_ISOLATE_INL_H_ | 126 #endif // V8_ISOLATE_INL_H_ |
OLD | NEW |