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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // - JSWeakSet | 65 // - JSWeakSet |
66 // - JSRegExp | 66 // - JSRegExp |
67 // - JSFunction | 67 // - JSFunction |
68 // - JSGeneratorObject | 68 // - JSGeneratorObject |
69 // - JSGlobalObject | 69 // - JSGlobalObject |
70 // - JSGlobalProxy | 70 // - JSGlobalProxy |
71 // - JSValue | 71 // - JSValue |
72 // - JSDate | 72 // - JSDate |
73 // - JSMessageObject | 73 // - JSMessageObject |
74 // - JSModuleNamespace | 74 // - JSModuleNamespace |
| 75 // - JSFixedArrayIterator |
75 // - JSProxy | 76 // - JSProxy |
76 // - FixedArrayBase | 77 // - FixedArrayBase |
77 // - ByteArray | 78 // - ByteArray |
78 // - BytecodeArray | 79 // - BytecodeArray |
79 // - FixedArray | 80 // - FixedArray |
80 // - DescriptorArray | 81 // - DescriptorArray |
81 // - FrameArray | 82 // - FrameArray |
82 // - LiteralsArray | 83 // - LiteralsArray |
83 // - HashTable | 84 // - HashTable |
84 // - Dictionary | 85 // - Dictionary |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 \ | 415 \ |
415 V(JS_MESSAGE_OBJECT_TYPE) \ | 416 V(JS_MESSAGE_OBJECT_TYPE) \ |
416 \ | 417 \ |
417 V(JS_VALUE_TYPE) \ | 418 V(JS_VALUE_TYPE) \ |
418 V(JS_DATE_TYPE) \ | 419 V(JS_DATE_TYPE) \ |
419 V(JS_OBJECT_TYPE) \ | 420 V(JS_OBJECT_TYPE) \ |
420 V(JS_ARGUMENTS_TYPE) \ | 421 V(JS_ARGUMENTS_TYPE) \ |
421 V(JS_CONTEXT_EXTENSION_OBJECT_TYPE) \ | 422 V(JS_CONTEXT_EXTENSION_OBJECT_TYPE) \ |
422 V(JS_GENERATOR_OBJECT_TYPE) \ | 423 V(JS_GENERATOR_OBJECT_TYPE) \ |
423 V(JS_MODULE_NAMESPACE_TYPE) \ | 424 V(JS_MODULE_NAMESPACE_TYPE) \ |
| 425 V(JS_FIXED_ARRAY_ITERATOR_TYPE) \ |
424 V(JS_GLOBAL_OBJECT_TYPE) \ | 426 V(JS_GLOBAL_OBJECT_TYPE) \ |
425 V(JS_GLOBAL_PROXY_TYPE) \ | 427 V(JS_GLOBAL_PROXY_TYPE) \ |
426 V(JS_API_OBJECT_TYPE) \ | 428 V(JS_API_OBJECT_TYPE) \ |
427 V(JS_SPECIAL_API_OBJECT_TYPE) \ | 429 V(JS_SPECIAL_API_OBJECT_TYPE) \ |
428 V(JS_ARRAY_TYPE) \ | 430 V(JS_ARRAY_TYPE) \ |
429 V(JS_ARRAY_BUFFER_TYPE) \ | 431 V(JS_ARRAY_BUFFER_TYPE) \ |
430 V(JS_TYPED_ARRAY_TYPE) \ | 432 V(JS_TYPED_ARRAY_TYPE) \ |
431 V(JS_DATA_VIEW_TYPE) \ | 433 V(JS_DATA_VIEW_TYPE) \ |
432 V(JS_PROXY_TYPE) \ | 434 V(JS_PROXY_TYPE) \ |
433 V(JS_SET_TYPE) \ | 435 V(JS_SET_TYPE) \ |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 JS_VALUE_TYPE, // LAST_CUSTOM_ELEMENTS_RECEIVER | 722 JS_VALUE_TYPE, // LAST_CUSTOM_ELEMENTS_RECEIVER |
721 JS_MESSAGE_OBJECT_TYPE, | 723 JS_MESSAGE_OBJECT_TYPE, |
722 JS_DATE_TYPE, | 724 JS_DATE_TYPE, |
723 // Like JS_OBJECT_TYPE, but created from API function. | 725 // Like JS_OBJECT_TYPE, but created from API function. |
724 JS_API_OBJECT_TYPE, | 726 JS_API_OBJECT_TYPE, |
725 JS_OBJECT_TYPE, | 727 JS_OBJECT_TYPE, |
726 JS_ARGUMENTS_TYPE, | 728 JS_ARGUMENTS_TYPE, |
727 JS_CONTEXT_EXTENSION_OBJECT_TYPE, | 729 JS_CONTEXT_EXTENSION_OBJECT_TYPE, |
728 JS_GENERATOR_OBJECT_TYPE, | 730 JS_GENERATOR_OBJECT_TYPE, |
729 JS_MODULE_NAMESPACE_TYPE, | 731 JS_MODULE_NAMESPACE_TYPE, |
| 732 JS_FIXED_ARRAY_ITERATOR_TYPE, |
730 JS_ARRAY_TYPE, | 733 JS_ARRAY_TYPE, |
731 JS_ARRAY_BUFFER_TYPE, | 734 JS_ARRAY_BUFFER_TYPE, |
732 JS_TYPED_ARRAY_TYPE, | 735 JS_TYPED_ARRAY_TYPE, |
733 JS_DATA_VIEW_TYPE, | 736 JS_DATA_VIEW_TYPE, |
734 JS_SET_TYPE, | 737 JS_SET_TYPE, |
735 JS_MAP_TYPE, | 738 JS_MAP_TYPE, |
736 JS_SET_ITERATOR_TYPE, | 739 JS_SET_ITERATOR_TYPE, |
737 JS_MAP_ITERATOR_TYPE, | 740 JS_MAP_ITERATOR_TYPE, |
738 JS_WEAK_MAP_TYPE, | 741 JS_WEAK_MAP_TYPE, |
739 JS_WEAK_SET_TYPE, | 742 JS_WEAK_SET_TYPE, |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
975 V(FixedFloat64Array) \ | 978 V(FixedFloat64Array) \ |
976 V(FixedUint8ClampedArray) \ | 979 V(FixedUint8ClampedArray) \ |
977 V(ByteArray) \ | 980 V(ByteArray) \ |
978 V(BytecodeArray) \ | 981 V(BytecodeArray) \ |
979 V(FreeSpace) \ | 982 V(FreeSpace) \ |
980 V(JSReceiver) \ | 983 V(JSReceiver) \ |
981 V(JSObject) \ | 984 V(JSObject) \ |
982 V(JSContextExtensionObject) \ | 985 V(JSContextExtensionObject) \ |
983 V(JSGeneratorObject) \ | 986 V(JSGeneratorObject) \ |
984 V(JSModuleNamespace) \ | 987 V(JSModuleNamespace) \ |
| 988 V(JSFixedArrayIterator) \ |
985 V(Map) \ | 989 V(Map) \ |
986 V(DescriptorArray) \ | 990 V(DescriptorArray) \ |
987 V(FrameArray) \ | 991 V(FrameArray) \ |
988 V(TransitionArray) \ | 992 V(TransitionArray) \ |
989 V(LiteralsArray) \ | 993 V(LiteralsArray) \ |
990 V(TypeFeedbackMetadata) \ | 994 V(TypeFeedbackMetadata) \ |
991 V(TypeFeedbackVector) \ | 995 V(TypeFeedbackVector) \ |
992 V(DeoptimizationInputData) \ | 996 V(DeoptimizationInputData) \ |
993 V(DeoptimizationOutputData) \ | 997 V(DeoptimizationOutputData) \ |
994 V(DependentCode) \ | 998 V(DependentCode) \ |
(...skipping 9453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10448 inline void set_index(int value); | 10452 inline void set_index(int value); |
10449 | 10453 |
10450 static const int kStringOffset = JSObject::kHeaderSize; | 10454 static const int kStringOffset = JSObject::kHeaderSize; |
10451 static const int kNextIndexOffset = kStringOffset + kPointerSize; | 10455 static const int kNextIndexOffset = kStringOffset + kPointerSize; |
10452 static const int kSize = kNextIndexOffset + kPointerSize; | 10456 static const int kSize = kNextIndexOffset + kPointerSize; |
10453 | 10457 |
10454 private: | 10458 private: |
10455 DISALLOW_IMPLICIT_CONSTRUCTORS(JSStringIterator); | 10459 DISALLOW_IMPLICIT_CONSTRUCTORS(JSStringIterator); |
10456 }; | 10460 }; |
10457 | 10461 |
| 10462 // A JS iterator over the elements of a FixedArray. |
| 10463 // This corresponds to ListIterator in ecma262/#sec-createlistiterator. |
| 10464 class JSFixedArrayIterator : public JSObject { |
| 10465 public: |
| 10466 DECLARE_CAST(JSFixedArrayIterator) |
| 10467 DECLARE_PRINTER(JSFixedArrayIterator) |
| 10468 DECLARE_VERIFIER(JSFixedArrayIterator) |
| 10469 |
| 10470 // The array over which the iterator iterates. |
| 10471 DECL_ACCESSORS(array, FixedArray) |
| 10472 |
| 10473 // The index of the array element that will be returned next. |
| 10474 DECL_INT_ACCESSORS(index) |
| 10475 |
| 10476 // The initial value of the object's "next" property. |
| 10477 DECL_ACCESSORS(initial_next, JSFunction) |
| 10478 |
| 10479 static const int kArrayOffset = JSObject::kHeaderSize; |
| 10480 static const int kIndexOffset = kArrayOffset + kPointerSize; |
| 10481 static const int kNextOffset = kIndexOffset + kPointerSize; |
| 10482 static const int kHeaderSize = kNextOffset + kPointerSize; |
| 10483 |
| 10484 enum InObjectPropertyIndex { |
| 10485 kNextIndex, |
| 10486 kInObjectPropertyCount // Dummy. |
| 10487 }; |
| 10488 |
| 10489 private: |
| 10490 DISALLOW_IMPLICIT_CONSTRUCTORS(JSFixedArrayIterator); |
| 10491 }; |
| 10492 |
10458 // OrderedHashTableIterator is an iterator that iterates over the keys and | 10493 // OrderedHashTableIterator is an iterator that iterates over the keys and |
10459 // values of an OrderedHashTable. | 10494 // values of an OrderedHashTable. |
10460 // | 10495 // |
10461 // The iterator has a reference to the underlying OrderedHashTable data, | 10496 // The iterator has a reference to the underlying OrderedHashTable data, |
10462 // [table], as well as the current [index] the iterator is at. | 10497 // [table], as well as the current [index] the iterator is at. |
10463 // | 10498 // |
10464 // When the OrderedHashTable is rehashed it adds a reference from the old table | 10499 // When the OrderedHashTable is rehashed it adds a reference from the old table |
10465 // to the new table as well as storing enough data about the changes so that the | 10500 // to the new table as well as storing enough data about the changes so that the |
10466 // iterator [index] can be adjusted accordingly. | 10501 // iterator [index] can be adjusted accordingly. |
10467 // | 10502 // |
(...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11494 } | 11529 } |
11495 return value; | 11530 return value; |
11496 } | 11531 } |
11497 }; | 11532 }; |
11498 | 11533 |
11499 | 11534 |
11500 } // NOLINT, false-positive due to second-order macros. | 11535 } // NOLINT, false-positive due to second-order macros. |
11501 } // NOLINT, false-positive due to second-order macros. | 11536 } // NOLINT, false-positive due to second-order macros. |
11502 | 11537 |
11503 #endif // V8_OBJECTS_H_ | 11538 #endif // V8_OBJECTS_H_ |
OLD | NEW |