Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: src/objects.h

Issue 2407423002: [modules] Implement @@iterator on namespace objects. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 \ 412 \
412 V(JS_MESSAGE_OBJECT_TYPE) \ 413 V(JS_MESSAGE_OBJECT_TYPE) \
413 \ 414 \
414 V(JS_VALUE_TYPE) \ 415 V(JS_VALUE_TYPE) \
415 V(JS_DATE_TYPE) \ 416 V(JS_DATE_TYPE) \
416 V(JS_OBJECT_TYPE) \ 417 V(JS_OBJECT_TYPE) \
417 V(JS_ARGUMENTS_TYPE) \ 418 V(JS_ARGUMENTS_TYPE) \
418 V(JS_CONTEXT_EXTENSION_OBJECT_TYPE) \ 419 V(JS_CONTEXT_EXTENSION_OBJECT_TYPE) \
419 V(JS_GENERATOR_OBJECT_TYPE) \ 420 V(JS_GENERATOR_OBJECT_TYPE) \
420 V(JS_MODULE_NAMESPACE_TYPE) \ 421 V(JS_MODULE_NAMESPACE_TYPE) \
422 V(JS_FIXED_ARRAY_ITERATOR_TYPE) \
421 V(JS_GLOBAL_OBJECT_TYPE) \ 423 V(JS_GLOBAL_OBJECT_TYPE) \
422 V(JS_GLOBAL_PROXY_TYPE) \ 424 V(JS_GLOBAL_PROXY_TYPE) \
423 V(JS_API_OBJECT_TYPE) \ 425 V(JS_API_OBJECT_TYPE) \
424 V(JS_SPECIAL_API_OBJECT_TYPE) \ 426 V(JS_SPECIAL_API_OBJECT_TYPE) \
425 V(JS_ARRAY_TYPE) \ 427 V(JS_ARRAY_TYPE) \
426 V(JS_ARRAY_BUFFER_TYPE) \ 428 V(JS_ARRAY_BUFFER_TYPE) \
427 V(JS_TYPED_ARRAY_TYPE) \ 429 V(JS_TYPED_ARRAY_TYPE) \
428 V(JS_DATA_VIEW_TYPE) \ 430 V(JS_DATA_VIEW_TYPE) \
429 V(JS_PROXY_TYPE) \ 431 V(JS_PROXY_TYPE) \
430 V(JS_SET_TYPE) \ 432 V(JS_SET_TYPE) \
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 JS_VALUE_TYPE, // LAST_CUSTOM_ELEMENTS_RECEIVER 715 JS_VALUE_TYPE, // LAST_CUSTOM_ELEMENTS_RECEIVER
714 JS_MESSAGE_OBJECT_TYPE, 716 JS_MESSAGE_OBJECT_TYPE,
715 JS_DATE_TYPE, 717 JS_DATE_TYPE,
716 // Like JS_OBJECT_TYPE, but created from API function. 718 // Like JS_OBJECT_TYPE, but created from API function.
717 JS_API_OBJECT_TYPE, 719 JS_API_OBJECT_TYPE,
718 JS_OBJECT_TYPE, 720 JS_OBJECT_TYPE,
719 JS_ARGUMENTS_TYPE, 721 JS_ARGUMENTS_TYPE,
720 JS_CONTEXT_EXTENSION_OBJECT_TYPE, 722 JS_CONTEXT_EXTENSION_OBJECT_TYPE,
721 JS_GENERATOR_OBJECT_TYPE, 723 JS_GENERATOR_OBJECT_TYPE,
722 JS_MODULE_NAMESPACE_TYPE, 724 JS_MODULE_NAMESPACE_TYPE,
725 JS_FIXED_ARRAY_ITERATOR_TYPE,
723 JS_ARRAY_TYPE, 726 JS_ARRAY_TYPE,
724 JS_ARRAY_BUFFER_TYPE, 727 JS_ARRAY_BUFFER_TYPE,
725 JS_TYPED_ARRAY_TYPE, 728 JS_TYPED_ARRAY_TYPE,
726 JS_DATA_VIEW_TYPE, 729 JS_DATA_VIEW_TYPE,
727 JS_SET_TYPE, 730 JS_SET_TYPE,
728 JS_MAP_TYPE, 731 JS_MAP_TYPE,
729 JS_SET_ITERATOR_TYPE, 732 JS_SET_ITERATOR_TYPE,
730 JS_MAP_ITERATOR_TYPE, 733 JS_MAP_ITERATOR_TYPE,
731 JS_WEAK_MAP_TYPE, 734 JS_WEAK_MAP_TYPE,
732 JS_WEAK_SET_TYPE, 735 JS_WEAK_SET_TYPE,
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 V(FixedFloat64Array) \ 971 V(FixedFloat64Array) \
969 V(FixedUint8ClampedArray) \ 972 V(FixedUint8ClampedArray) \
970 V(ByteArray) \ 973 V(ByteArray) \
971 V(BytecodeArray) \ 974 V(BytecodeArray) \
972 V(FreeSpace) \ 975 V(FreeSpace) \
973 V(JSReceiver) \ 976 V(JSReceiver) \
974 V(JSObject) \ 977 V(JSObject) \
975 V(JSContextExtensionObject) \ 978 V(JSContextExtensionObject) \
976 V(JSGeneratorObject) \ 979 V(JSGeneratorObject) \
977 V(JSModuleNamespace) \ 980 V(JSModuleNamespace) \
981 V(JSFixedArrayIterator) \
978 V(Map) \ 982 V(Map) \
979 V(DescriptorArray) \ 983 V(DescriptorArray) \
980 V(FrameArray) \ 984 V(FrameArray) \
981 V(TransitionArray) \ 985 V(TransitionArray) \
982 V(LiteralsArray) \ 986 V(LiteralsArray) \
983 V(TypeFeedbackMetadata) \ 987 V(TypeFeedbackMetadata) \
984 V(TypeFeedbackVector) \ 988 V(TypeFeedbackVector) \
985 V(DeoptimizationInputData) \ 989 V(DeoptimizationInputData) \
986 V(DeoptimizationOutputData) \ 990 V(DeoptimizationOutputData) \
987 V(DependentCode) \ 991 V(DependentCode) \
(...skipping 9415 matching lines...) Expand 10 before | Expand all | Expand 10 after
10403 inline void set_index(int value); 10407 inline void set_index(int value);
10404 10408
10405 static const int kStringOffset = JSObject::kHeaderSize; 10409 static const int kStringOffset = JSObject::kHeaderSize;
10406 static const int kNextIndexOffset = kStringOffset + kPointerSize; 10410 static const int kNextIndexOffset = kStringOffset + kPointerSize;
10407 static const int kSize = kNextIndexOffset + kPointerSize; 10411 static const int kSize = kNextIndexOffset + kPointerSize;
10408 10412
10409 private: 10413 private:
10410 DISALLOW_IMPLICIT_CONSTRUCTORS(JSStringIterator); 10414 DISALLOW_IMPLICIT_CONSTRUCTORS(JSStringIterator);
10411 }; 10415 };
10412 10416
10417 // A JS iterator over the elements of a FixedArray.
10418 // This corresponds to ListIterator in ecma262/#sec-createlistiterator.
10419 class JSFixedArrayIterator : public JSObject {
10420 public:
10421 DECLARE_CAST(JSFixedArrayIterator)
10422 DECLARE_PRINTER(JSFixedArrayIterator)
10423 DECLARE_VERIFIER(JSFixedArrayIterator)
10424
10425 // The value of the object's "next" property.
10426 DECL_ACCESSORS(next, JSFunction)
10427
10428 // The array over which the iterator iterates.
10429 DECL_ACCESSORS(array, FixedArray)
10430
10431 // The index of the array element that will be returned next.
10432 DECL_INT_ACCESSORS(index)
10433
10434 static const int kNextOffset = JSObject::kHeaderSize;
10435 static const int kArrayOffset = kNextOffset + kPointerSize;
10436 static const int kIndexOffset = kArrayOffset + kPointerSize;
10437 static const int kSize = kIndexOffset + kPointerSize;
10438
10439 enum InObjectPropertyIndex { kNextIndex };
10440
10441 private:
10442 DISALLOW_IMPLICIT_CONSTRUCTORS(JSFixedArrayIterator);
10443 };
10444
10413 // OrderedHashTableIterator is an iterator that iterates over the keys and 10445 // OrderedHashTableIterator is an iterator that iterates over the keys and
10414 // values of an OrderedHashTable. 10446 // values of an OrderedHashTable.
10415 // 10447 //
10416 // The iterator has a reference to the underlying OrderedHashTable data, 10448 // The iterator has a reference to the underlying OrderedHashTable data,
10417 // [table], as well as the current [index] the iterator is at. 10449 // [table], as well as the current [index] the iterator is at.
10418 // 10450 //
10419 // When the OrderedHashTable is rehashed it adds a reference from the old table 10451 // When the OrderedHashTable is rehashed it adds a reference from the old table
10420 // to the new table as well as storing enough data about the changes so that the 10452 // to the new table as well as storing enough data about the changes so that the
10421 // iterator [index] can be adjusted accordingly. 10453 // iterator [index] can be adjusted accordingly.
10422 // 10454 //
(...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after
11451 } 11483 }
11452 return value; 11484 return value;
11453 } 11485 }
11454 }; 11486 };
11455 11487
11456 11488
11457 } // NOLINT, false-positive due to second-order macros. 11489 } // NOLINT, false-positive due to second-order macros.
11458 } // NOLINT, false-positive due to second-order macros. 11490 } // NOLINT, false-positive due to second-order macros.
11459 11491
11460 #endif // V8_OBJECTS_H_ 11492 #endif // V8_OBJECTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698