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_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 V(JS_PROXY_TYPE) \ | 425 V(JS_PROXY_TYPE) \ |
426 V(JS_SET_TYPE) \ | 426 V(JS_SET_TYPE) \ |
427 V(JS_MAP_TYPE) \ | 427 V(JS_MAP_TYPE) \ |
428 V(JS_SET_ITERATOR_TYPE) \ | 428 V(JS_SET_ITERATOR_TYPE) \ |
429 V(JS_MAP_ITERATOR_TYPE) \ | 429 V(JS_MAP_ITERATOR_TYPE) \ |
430 V(JS_WEAK_MAP_TYPE) \ | 430 V(JS_WEAK_MAP_TYPE) \ |
431 V(JS_WEAK_SET_TYPE) \ | 431 V(JS_WEAK_SET_TYPE) \ |
432 V(JS_PROMISE_TYPE) \ | 432 V(JS_PROMISE_TYPE) \ |
433 V(JS_REGEXP_TYPE) \ | 433 V(JS_REGEXP_TYPE) \ |
434 V(JS_ERROR_TYPE) \ | 434 V(JS_ERROR_TYPE) \ |
| 435 V(JS_STRING_ITERATOR_TYPE) \ |
435 \ | 436 \ |
436 V(JS_BOUND_FUNCTION_TYPE) \ | 437 V(JS_BOUND_FUNCTION_TYPE) \ |
437 V(JS_FUNCTION_TYPE) \ | 438 V(JS_FUNCTION_TYPE) \ |
438 V(DEBUG_INFO_TYPE) \ | 439 V(DEBUG_INFO_TYPE) \ |
439 V(BREAK_POINT_INFO_TYPE) | 440 V(BREAK_POINT_INFO_TYPE) |
440 | 441 |
441 // Since string types are not consecutive, this macro is used to | 442 // Since string types are not consecutive, this macro is used to |
442 // iterate over them. | 443 // iterate over them. |
443 #define STRING_TYPE_LIST(V) \ | 444 #define STRING_TYPE_LIST(V) \ |
444 V(STRING_TYPE, kVariableSizeSentinel, string, String) \ | 445 V(STRING_TYPE, kVariableSizeSentinel, string, String) \ |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 JS_DATA_VIEW_TYPE, | 718 JS_DATA_VIEW_TYPE, |
718 JS_SET_TYPE, | 719 JS_SET_TYPE, |
719 JS_MAP_TYPE, | 720 JS_MAP_TYPE, |
720 JS_SET_ITERATOR_TYPE, | 721 JS_SET_ITERATOR_TYPE, |
721 JS_MAP_ITERATOR_TYPE, | 722 JS_MAP_ITERATOR_TYPE, |
722 JS_WEAK_MAP_TYPE, | 723 JS_WEAK_MAP_TYPE, |
723 JS_WEAK_SET_TYPE, | 724 JS_WEAK_SET_TYPE, |
724 JS_PROMISE_TYPE, | 725 JS_PROMISE_TYPE, |
725 JS_REGEXP_TYPE, | 726 JS_REGEXP_TYPE, |
726 JS_ERROR_TYPE, | 727 JS_ERROR_TYPE, |
| 728 JS_STRING_ITERATOR_TYPE, |
727 JS_BOUND_FUNCTION_TYPE, | 729 JS_BOUND_FUNCTION_TYPE, |
728 JS_FUNCTION_TYPE, // LAST_JS_OBJECT_TYPE, LAST_JS_RECEIVER_TYPE | 730 JS_FUNCTION_TYPE, // LAST_JS_OBJECT_TYPE, LAST_JS_RECEIVER_TYPE |
729 | 731 |
730 // Pseudo-types | 732 // Pseudo-types |
731 FIRST_TYPE = 0x0, | 733 FIRST_TYPE = 0x0, |
732 LAST_TYPE = JS_FUNCTION_TYPE, | 734 LAST_TYPE = JS_FUNCTION_TYPE, |
733 FIRST_NAME_TYPE = FIRST_TYPE, | 735 FIRST_NAME_TYPE = FIRST_TYPE, |
734 LAST_NAME_TYPE = SYMBOL_TYPE, | 736 LAST_NAME_TYPE = SYMBOL_TYPE, |
735 FIRST_UNIQUE_NAME_TYPE = INTERNALIZED_STRING_TYPE, | 737 FIRST_UNIQUE_NAME_TYPE = INTERNALIZED_STRING_TYPE, |
736 LAST_UNIQUE_NAME_TYPE = SYMBOL_TYPE, | 738 LAST_UNIQUE_NAME_TYPE = SYMBOL_TYPE, |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
999 V(Boolean) \ | 1001 V(Boolean) \ |
1000 V(JSArray) \ | 1002 V(JSArray) \ |
1001 V(JSArrayBuffer) \ | 1003 V(JSArrayBuffer) \ |
1002 V(JSArrayBufferView) \ | 1004 V(JSArrayBufferView) \ |
1003 V(JSCollection) \ | 1005 V(JSCollection) \ |
1004 V(JSTypedArray) \ | 1006 V(JSTypedArray) \ |
1005 V(JSDataView) \ | 1007 V(JSDataView) \ |
1006 V(JSProxy) \ | 1008 V(JSProxy) \ |
1007 V(JSError) \ | 1009 V(JSError) \ |
1008 V(JSPromise) \ | 1010 V(JSPromise) \ |
| 1011 V(JSStringIterator) \ |
1009 V(JSSet) \ | 1012 V(JSSet) \ |
1010 V(JSMap) \ | 1013 V(JSMap) \ |
1011 V(JSSetIterator) \ | 1014 V(JSSetIterator) \ |
1012 V(JSMapIterator) \ | 1015 V(JSMapIterator) \ |
1013 V(JSWeakCollection) \ | 1016 V(JSWeakCollection) \ |
1014 V(JSWeakMap) \ | 1017 V(JSWeakMap) \ |
1015 V(JSWeakSet) \ | 1018 V(JSWeakSet) \ |
1016 V(JSRegExp) \ | 1019 V(JSRegExp) \ |
1017 V(HashTable) \ | 1020 V(HashTable) \ |
1018 V(Dictionary) \ | 1021 V(Dictionary) \ |
(...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2605 private: | 2608 private: |
2606 DISALLOW_IMPLICIT_CONSTRUCTORS(JSDataPropertyDescriptor); | 2609 DISALLOW_IMPLICIT_CONSTRUCTORS(JSDataPropertyDescriptor); |
2607 }; | 2610 }; |
2608 | 2611 |
2609 | 2612 |
2610 // JSIteratorResult is just a JSObject with a specific initial map. | 2613 // JSIteratorResult is just a JSObject with a specific initial map. |
2611 // This initial map adds in-object properties for "done" and "value", | 2614 // This initial map adds in-object properties for "done" and "value", |
2612 // as specified by ES6 section 25.1.1.3 The IteratorResult Interface | 2615 // as specified by ES6 section 25.1.1.3 The IteratorResult Interface |
2613 class JSIteratorResult: public JSObject { | 2616 class JSIteratorResult: public JSObject { |
2614 public: | 2617 public: |
| 2618 DECL_ACCESSORS(value, Object) |
| 2619 |
| 2620 DECL_ACCESSORS(done, Object) |
| 2621 |
| 2622 static void Initialize(Handle<JSIteratorResult> object, Handle<Object> value, |
| 2623 Handle<Object> done); |
| 2624 |
2615 // Offsets of object fields. | 2625 // Offsets of object fields. |
2616 static const int kValueOffset = JSObject::kHeaderSize; | 2626 static const int kValueOffset = JSObject::kHeaderSize; |
2617 static const int kDoneOffset = kValueOffset + kPointerSize; | 2627 static const int kDoneOffset = kValueOffset + kPointerSize; |
2618 static const int kSize = kDoneOffset + kPointerSize; | 2628 static const int kSize = kDoneOffset + kPointerSize; |
2619 // Indices of in-object properties. | 2629 // Indices of in-object properties. |
2620 static const int kValueIndex = 0; | 2630 static const int kValueIndex = 0; |
2621 static const int kDoneIndex = 1; | 2631 static const int kDoneIndex = 1; |
2622 | 2632 |
2623 private: | 2633 private: |
2624 DISALLOW_IMPLICIT_CONSTRUCTORS(JSIteratorResult); | 2634 DISALLOW_IMPLICIT_CONSTRUCTORS(JSIteratorResult); |
(...skipping 7608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10233 static void Clear(Handle<JSMap> map); | 10243 static void Clear(Handle<JSMap> map); |
10234 | 10244 |
10235 // Dispatched behavior. | 10245 // Dispatched behavior. |
10236 DECLARE_PRINTER(JSMap) | 10246 DECLARE_PRINTER(JSMap) |
10237 DECLARE_VERIFIER(JSMap) | 10247 DECLARE_VERIFIER(JSMap) |
10238 | 10248 |
10239 private: | 10249 private: |
10240 DISALLOW_IMPLICIT_CONSTRUCTORS(JSMap); | 10250 DISALLOW_IMPLICIT_CONSTRUCTORS(JSMap); |
10241 }; | 10251 }; |
10242 | 10252 |
| 10253 class JSStringIterator : public JSObject { |
| 10254 public: |
| 10255 // Dispatched behavior. |
| 10256 DECLARE_PRINTER(JSStringIterator) |
| 10257 DECLARE_VERIFIER(JSStringIterator) |
| 10258 |
| 10259 DECLARE_CAST(JSStringIterator) |
| 10260 |
| 10261 // [string]: the [[IteratedString]] internal field. |
| 10262 DECL_ACCESSORS(string, String) |
| 10263 |
| 10264 // [index]: The [[StringIteratorNextIndex]] internal field. |
| 10265 DECL_ACCESSORS(index, Object) |
| 10266 |
| 10267 static const int kStringOffset = JSObject::kHeaderSize; |
| 10268 static const int kNextIndexOffset = kStringOffset + kPointerSize; |
| 10269 static const int kSize = kNextIndexOffset + kPointerSize; |
| 10270 |
| 10271 private: |
| 10272 DISALLOW_IMPLICIT_CONSTRUCTORS(JSStringIterator); |
| 10273 }; |
10243 | 10274 |
10244 // OrderedHashTableIterator is an iterator that iterates over the keys and | 10275 // OrderedHashTableIterator is an iterator that iterates over the keys and |
10245 // values of an OrderedHashTable. | 10276 // values of an OrderedHashTable. |
10246 // | 10277 // |
10247 // The iterator has a reference to the underlying OrderedHashTable data, | 10278 // The iterator has a reference to the underlying OrderedHashTable data, |
10248 // [table], as well as the current [index] the iterator is at. | 10279 // [table], as well as the current [index] the iterator is at. |
10249 // | 10280 // |
10250 // When the OrderedHashTable is rehashed it adds a reference from the old table | 10281 // When the OrderedHashTable is rehashed it adds a reference from the old table |
10251 // to the new table as well as storing enough data about the changes so that the | 10282 // to the new table as well as storing enough data about the changes so that the |
10252 // iterator [index] can be adjusted accordingly. | 10283 // iterator [index] can be adjusted accordingly. |
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11282 } | 11313 } |
11283 return value; | 11314 return value; |
11284 } | 11315 } |
11285 }; | 11316 }; |
11286 | 11317 |
11287 | 11318 |
11288 } // NOLINT, false-positive due to second-order macros. | 11319 } // NOLINT, false-positive due to second-order macros. |
11289 } // NOLINT, false-positive due to second-order macros. | 11320 } // NOLINT, false-positive due to second-order macros. |
11290 | 11321 |
11291 #endif // V8_OBJECTS_H_ | 11322 #endif // V8_OBJECTS_H_ |
OLD | NEW |