Chromium Code Reviews| 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 9434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 10429 inline void set_index(int value); | 10433 inline void set_index(int value); |
| 10430 | 10434 |
| 10431 static const int kStringOffset = JSObject::kHeaderSize; | 10435 static const int kStringOffset = JSObject::kHeaderSize; |
| 10432 static const int kNextIndexOffset = kStringOffset + kPointerSize; | 10436 static const int kNextIndexOffset = kStringOffset + kPointerSize; |
| 10433 static const int kSize = kNextIndexOffset + kPointerSize; | 10437 static const int kSize = kNextIndexOffset + kPointerSize; |
| 10434 | 10438 |
| 10435 private: | 10439 private: |
| 10436 DISALLOW_IMPLICIT_CONSTRUCTORS(JSStringIterator); | 10440 DISALLOW_IMPLICIT_CONSTRUCTORS(JSStringIterator); |
| 10437 }; | 10441 }; |
| 10438 | 10442 |
| 10443 // A JS iterator over the elements of a FixedArray. | |
| 10444 // This corresponds to ListIterator in ecma262/#sec-createlistiterator. | |
| 10445 class JSFixedArrayIterator : public JSObject { | |
| 10446 public: | |
| 10447 DECLARE_CAST(JSFixedArrayIterator) | |
| 10448 DECLARE_PRINTER(JSFixedArrayIterator) | |
| 10449 DECLARE_VERIFIER(JSFixedArrayIterator) | |
| 10450 | |
| 10451 // The array over which the iterator iterates. | |
| 10452 DECL_ACCESSORS(array, FixedArray) | |
| 10453 | |
| 10454 // The index of the array element that will be returned next. | |
| 10455 DECL_INT_ACCESSORS(index) | |
| 10456 | |
| 10457 // The initial value of the object's "next" property. | |
| 10458 DECL_ACCESSORS(next, JSFunction) | |
|
Igor Sheludko
2016/10/13 11:58:27
Maybe call it initial_next to avoid confusion with
| |
| 10459 | |
| 10460 static const int kArrayOffset = JSObject::kHeaderSize; | |
| 10461 static const int kIndexOffset = kArrayOffset + kPointerSize; | |
| 10462 static const int kNextOffset = kIndexOffset + kPointerSize; | |
| 10463 static const int kHeaderSize = kNextOffset + kPointerSize; | |
|
Igor Sheludko
2016/10/13 11:58:27
Please name it kSize to be consistent.
| |
| 10464 | |
| 10465 enum InObjectPropertyIndex { | |
| 10466 kNextIndex, | |
| 10467 kInObjectPropertyCount // Dummy. | |
| 10468 }; | |
| 10469 | |
| 10470 private: | |
| 10471 DISALLOW_IMPLICIT_CONSTRUCTORS(JSFixedArrayIterator); | |
| 10472 }; | |
| 10473 | |
| 10439 // OrderedHashTableIterator is an iterator that iterates over the keys and | 10474 // OrderedHashTableIterator is an iterator that iterates over the keys and |
| 10440 // values of an OrderedHashTable. | 10475 // values of an OrderedHashTable. |
| 10441 // | 10476 // |
| 10442 // The iterator has a reference to the underlying OrderedHashTable data, | 10477 // The iterator has a reference to the underlying OrderedHashTable data, |
| 10443 // [table], as well as the current [index] the iterator is at. | 10478 // [table], as well as the current [index] the iterator is at. |
| 10444 // | 10479 // |
| 10445 // When the OrderedHashTable is rehashed it adds a reference from the old table | 10480 // When the OrderedHashTable is rehashed it adds a reference from the old table |
| 10446 // to the new table as well as storing enough data about the changes so that the | 10481 // to the new table as well as storing enough data about the changes so that the |
| 10447 // iterator [index] can be adjusted accordingly. | 10482 // iterator [index] can be adjusted accordingly. |
| 10448 // | 10483 // |
| (...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 11475 } | 11510 } |
| 11476 return value; | 11511 return value; |
| 11477 } | 11512 } |
| 11478 }; | 11513 }; |
| 11479 | 11514 |
| 11480 | 11515 |
| 11481 } // NOLINT, false-positive due to second-order macros. | 11516 } // NOLINT, false-positive due to second-order macros. |
| 11482 } // NOLINT, false-positive due to second-order macros. | 11517 } // NOLINT, false-positive due to second-order macros. |
| 11483 | 11518 |
| 11484 #endif // V8_OBJECTS_H_ | 11519 #endif // V8_OBJECTS_H_ |
| OLD | NEW |