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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // - JSObject | 50 // - JSObject |
51 // - JSArray | 51 // - JSArray |
52 // - JSArrayBuffer | 52 // - JSArrayBuffer |
53 // - JSArrayBufferView | 53 // - JSArrayBufferView |
54 // - JSTypedArray | 54 // - JSTypedArray |
55 // - JSDataView | 55 // - JSDataView |
56 // - JSBoundFunction | 56 // - JSBoundFunction |
57 // - JSCollection | 57 // - JSCollection |
58 // - JSSet | 58 // - JSSet |
59 // - JSMap | 59 // - JSMap |
| 60 // - JSStringIterator |
60 // - JSSetIterator | 61 // - JSSetIterator |
61 // - JSMapIterator | 62 // - JSMapIterator |
62 // - JSWeakCollection | 63 // - JSWeakCollection |
63 // - JSWeakMap | 64 // - JSWeakMap |
64 // - JSWeakSet | 65 // - JSWeakSet |
65 // - JSRegExp | 66 // - JSRegExp |
66 // - JSFunction | 67 // - JSFunction |
67 // - JSGeneratorObject | 68 // - JSGeneratorObject |
68 // - JSGlobalObject | 69 // - JSGlobalObject |
69 // - JSGlobalProxy | 70 // - JSGlobalProxy |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 V(JS_PROXY_TYPE) \ | 427 V(JS_PROXY_TYPE) \ |
427 V(JS_SET_TYPE) \ | 428 V(JS_SET_TYPE) \ |
428 V(JS_MAP_TYPE) \ | 429 V(JS_MAP_TYPE) \ |
429 V(JS_SET_ITERATOR_TYPE) \ | 430 V(JS_SET_ITERATOR_TYPE) \ |
430 V(JS_MAP_ITERATOR_TYPE) \ | 431 V(JS_MAP_ITERATOR_TYPE) \ |
431 V(JS_WEAK_MAP_TYPE) \ | 432 V(JS_WEAK_MAP_TYPE) \ |
432 V(JS_WEAK_SET_TYPE) \ | 433 V(JS_WEAK_SET_TYPE) \ |
433 V(JS_PROMISE_TYPE) \ | 434 V(JS_PROMISE_TYPE) \ |
434 V(JS_REGEXP_TYPE) \ | 435 V(JS_REGEXP_TYPE) \ |
435 V(JS_ERROR_TYPE) \ | 436 V(JS_ERROR_TYPE) \ |
| 437 V(JS_STRING_ITERATOR_TYPE) \ |
436 \ | 438 \ |
437 V(JS_BOUND_FUNCTION_TYPE) \ | 439 V(JS_BOUND_FUNCTION_TYPE) \ |
438 V(JS_FUNCTION_TYPE) \ | 440 V(JS_FUNCTION_TYPE) \ |
439 V(DEBUG_INFO_TYPE) \ | 441 V(DEBUG_INFO_TYPE) \ |
440 V(BREAK_POINT_INFO_TYPE) | 442 V(BREAK_POINT_INFO_TYPE) |
441 | 443 |
442 // Since string types are not consecutive, this macro is used to | 444 // Since string types are not consecutive, this macro is used to |
443 // iterate over them. | 445 // iterate over them. |
444 #define STRING_TYPE_LIST(V) \ | 446 #define STRING_TYPE_LIST(V) \ |
445 V(STRING_TYPE, kVariableSizeSentinel, string, String) \ | 447 V(STRING_TYPE, kVariableSizeSentinel, string, String) \ |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 JS_DATA_VIEW_TYPE, | 723 JS_DATA_VIEW_TYPE, |
722 JS_SET_TYPE, | 724 JS_SET_TYPE, |
723 JS_MAP_TYPE, | 725 JS_MAP_TYPE, |
724 JS_SET_ITERATOR_TYPE, | 726 JS_SET_ITERATOR_TYPE, |
725 JS_MAP_ITERATOR_TYPE, | 727 JS_MAP_ITERATOR_TYPE, |
726 JS_WEAK_MAP_TYPE, | 728 JS_WEAK_MAP_TYPE, |
727 JS_WEAK_SET_TYPE, | 729 JS_WEAK_SET_TYPE, |
728 JS_PROMISE_TYPE, | 730 JS_PROMISE_TYPE, |
729 JS_REGEXP_TYPE, | 731 JS_REGEXP_TYPE, |
730 JS_ERROR_TYPE, | 732 JS_ERROR_TYPE, |
| 733 JS_STRING_ITERATOR_TYPE, |
731 JS_BOUND_FUNCTION_TYPE, | 734 JS_BOUND_FUNCTION_TYPE, |
732 JS_FUNCTION_TYPE, // LAST_JS_OBJECT_TYPE, LAST_JS_RECEIVER_TYPE | 735 JS_FUNCTION_TYPE, // LAST_JS_OBJECT_TYPE, LAST_JS_RECEIVER_TYPE |
733 | 736 |
734 // Pseudo-types | 737 // Pseudo-types |
735 FIRST_TYPE = 0x0, | 738 FIRST_TYPE = 0x0, |
736 LAST_TYPE = JS_FUNCTION_TYPE, | 739 LAST_TYPE = JS_FUNCTION_TYPE, |
737 FIRST_NAME_TYPE = FIRST_TYPE, | 740 FIRST_NAME_TYPE = FIRST_TYPE, |
738 LAST_NAME_TYPE = SYMBOL_TYPE, | 741 LAST_NAME_TYPE = SYMBOL_TYPE, |
739 FIRST_UNIQUE_NAME_TYPE = INTERNALIZED_STRING_TYPE, | 742 FIRST_UNIQUE_NAME_TYPE = INTERNALIZED_STRING_TYPE, |
740 LAST_UNIQUE_NAME_TYPE = SYMBOL_TYPE, | 743 LAST_UNIQUE_NAME_TYPE = SYMBOL_TYPE, |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 V(Boolean) \ | 1005 V(Boolean) \ |
1003 V(JSArray) \ | 1006 V(JSArray) \ |
1004 V(JSArrayBuffer) \ | 1007 V(JSArrayBuffer) \ |
1005 V(JSArrayBufferView) \ | 1008 V(JSArrayBufferView) \ |
1006 V(JSCollection) \ | 1009 V(JSCollection) \ |
1007 V(JSTypedArray) \ | 1010 V(JSTypedArray) \ |
1008 V(JSDataView) \ | 1011 V(JSDataView) \ |
1009 V(JSProxy) \ | 1012 V(JSProxy) \ |
1010 V(JSError) \ | 1013 V(JSError) \ |
1011 V(JSPromise) \ | 1014 V(JSPromise) \ |
| 1015 V(JSStringIterator) \ |
1012 V(JSSet) \ | 1016 V(JSSet) \ |
1013 V(JSMap) \ | 1017 V(JSMap) \ |
1014 V(JSSetIterator) \ | 1018 V(JSSetIterator) \ |
1015 V(JSMapIterator) \ | 1019 V(JSMapIterator) \ |
1016 V(JSWeakCollection) \ | 1020 V(JSWeakCollection) \ |
1017 V(JSWeakMap) \ | 1021 V(JSWeakMap) \ |
1018 V(JSWeakSet) \ | 1022 V(JSWeakSet) \ |
1019 V(JSRegExp) \ | 1023 V(JSRegExp) \ |
1020 V(HashTable) \ | 1024 V(HashTable) \ |
1021 V(Dictionary) \ | 1025 V(Dictionary) \ |
(...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2608 private: | 2612 private: |
2609 DISALLOW_IMPLICIT_CONSTRUCTORS(JSDataPropertyDescriptor); | 2613 DISALLOW_IMPLICIT_CONSTRUCTORS(JSDataPropertyDescriptor); |
2610 }; | 2614 }; |
2611 | 2615 |
2612 | 2616 |
2613 // JSIteratorResult is just a JSObject with a specific initial map. | 2617 // JSIteratorResult is just a JSObject with a specific initial map. |
2614 // This initial map adds in-object properties for "done" and "value", | 2618 // This initial map adds in-object properties for "done" and "value", |
2615 // as specified by ES6 section 25.1.1.3 The IteratorResult Interface | 2619 // as specified by ES6 section 25.1.1.3 The IteratorResult Interface |
2616 class JSIteratorResult: public JSObject { | 2620 class JSIteratorResult: public JSObject { |
2617 public: | 2621 public: |
| 2622 DECL_ACCESSORS(value, Object) |
| 2623 |
| 2624 DECL_ACCESSORS(done, Object) |
| 2625 |
2618 // Offsets of object fields. | 2626 // Offsets of object fields. |
2619 static const int kValueOffset = JSObject::kHeaderSize; | 2627 static const int kValueOffset = JSObject::kHeaderSize; |
2620 static const int kDoneOffset = kValueOffset + kPointerSize; | 2628 static const int kDoneOffset = kValueOffset + kPointerSize; |
2621 static const int kSize = kDoneOffset + kPointerSize; | 2629 static const int kSize = kDoneOffset + kPointerSize; |
2622 // Indices of in-object properties. | 2630 // Indices of in-object properties. |
2623 static const int kValueIndex = 0; | 2631 static const int kValueIndex = 0; |
2624 static const int kDoneIndex = 1; | 2632 static const int kDoneIndex = 1; |
2625 | 2633 |
2626 private: | 2634 private: |
2627 DISALLOW_IMPLICIT_CONSTRUCTORS(JSIteratorResult); | 2635 DISALLOW_IMPLICIT_CONSTRUCTORS(JSIteratorResult); |
(...skipping 7690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10318 static void Clear(Handle<JSMap> map); | 10326 static void Clear(Handle<JSMap> map); |
10319 | 10327 |
10320 // Dispatched behavior. | 10328 // Dispatched behavior. |
10321 DECLARE_PRINTER(JSMap) | 10329 DECLARE_PRINTER(JSMap) |
10322 DECLARE_VERIFIER(JSMap) | 10330 DECLARE_VERIFIER(JSMap) |
10323 | 10331 |
10324 private: | 10332 private: |
10325 DISALLOW_IMPLICIT_CONSTRUCTORS(JSMap); | 10333 DISALLOW_IMPLICIT_CONSTRUCTORS(JSMap); |
10326 }; | 10334 }; |
10327 | 10335 |
| 10336 class JSStringIterator : public JSObject { |
| 10337 public: |
| 10338 // Dispatched behavior. |
| 10339 DECLARE_PRINTER(JSStringIterator) |
| 10340 DECLARE_VERIFIER(JSStringIterator) |
| 10341 |
| 10342 DECLARE_CAST(JSStringIterator) |
| 10343 |
| 10344 // [string]: the [[IteratedString]] internal field. |
| 10345 DECL_ACCESSORS(string, String) |
| 10346 |
| 10347 // [index]: The [[StringIteratorNextIndex]] internal field. |
| 10348 inline int index() const; |
| 10349 inline void set_index(int value); |
| 10350 |
| 10351 static const int kStringOffset = JSObject::kHeaderSize; |
| 10352 static const int kNextIndexOffset = kStringOffset + kPointerSize; |
| 10353 static const int kSize = kNextIndexOffset + kPointerSize; |
| 10354 |
| 10355 private: |
| 10356 DISALLOW_IMPLICIT_CONSTRUCTORS(JSStringIterator); |
| 10357 }; |
10328 | 10358 |
10329 // OrderedHashTableIterator is an iterator that iterates over the keys and | 10359 // OrderedHashTableIterator is an iterator that iterates over the keys and |
10330 // values of an OrderedHashTable. | 10360 // values of an OrderedHashTable. |
10331 // | 10361 // |
10332 // The iterator has a reference to the underlying OrderedHashTable data, | 10362 // The iterator has a reference to the underlying OrderedHashTable data, |
10333 // [table], as well as the current [index] the iterator is at. | 10363 // [table], as well as the current [index] the iterator is at. |
10334 // | 10364 // |
10335 // When the OrderedHashTable is rehashed it adds a reference from the old table | 10365 // When the OrderedHashTable is rehashed it adds a reference from the old table |
10336 // to the new table as well as storing enough data about the changes so that the | 10366 // to the new table as well as storing enough data about the changes so that the |
10337 // iterator [index] can be adjusted accordingly. | 10367 // iterator [index] can be adjusted accordingly. |
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11367 } | 11397 } |
11368 return value; | 11398 return value; |
11369 } | 11399 } |
11370 }; | 11400 }; |
11371 | 11401 |
11372 | 11402 |
11373 } // NOLINT, false-positive due to second-order macros. | 11403 } // NOLINT, false-positive due to second-order macros. |
11374 } // NOLINT, false-positive due to second-order macros. | 11404 } // NOLINT, false-positive due to second-order macros. |
11375 | 11405 |
11376 #endif // V8_OBJECTS_H_ | 11406 #endif // V8_OBJECTS_H_ |
OLD | NEW |