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 | 9 |
10 #include "src/assert-scope.h" | 10 #include "src/assert-scope.h" |
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 | 770 |
771 STATIC_ASSERT(JS_OBJECT_TYPE == Internals::kJSObjectType); | 771 STATIC_ASSERT(JS_OBJECT_TYPE == Internals::kJSObjectType); |
772 STATIC_ASSERT(JS_API_OBJECT_TYPE == Internals::kJSApiObjectType); | 772 STATIC_ASSERT(JS_API_OBJECT_TYPE == Internals::kJSApiObjectType); |
773 STATIC_ASSERT(FIRST_NONSTRING_TYPE == Internals::kFirstNonstringType); | 773 STATIC_ASSERT(FIRST_NONSTRING_TYPE == Internals::kFirstNonstringType); |
774 STATIC_ASSERT(ODDBALL_TYPE == Internals::kOddballType); | 774 STATIC_ASSERT(ODDBALL_TYPE == Internals::kOddballType); |
775 STATIC_ASSERT(FOREIGN_TYPE == Internals::kForeignType); | 775 STATIC_ASSERT(FOREIGN_TYPE == Internals::kForeignType); |
776 | 776 |
777 | 777 |
778 std::ostream& operator<<(std::ostream& os, InstanceType instance_type); | 778 std::ostream& operator<<(std::ostream& os, InstanceType instance_type); |
779 | 779 |
780 | |
781 #define FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(V) \ | 780 #define FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(V) \ |
782 V(FAST_ELEMENTS_SUB_TYPE) \ | 781 V(FAST_ELEMENTS_SUB_TYPE) \ |
783 V(DICTIONARY_ELEMENTS_SUB_TYPE) \ | 782 V(DICTIONARY_ELEMENTS_SUB_TYPE) \ |
784 V(FAST_PROPERTIES_SUB_TYPE) \ | 783 V(FAST_PROPERTIES_SUB_TYPE) \ |
785 V(DICTIONARY_PROPERTIES_SUB_TYPE) \ | 784 V(DICTIONARY_PROPERTIES_SUB_TYPE) \ |
786 V(MAP_CODE_CACHE_SUB_TYPE) \ | 785 V(MAP_CODE_CACHE_SUB_TYPE) \ |
787 V(SCOPE_INFO_SUB_TYPE) \ | 786 V(SCOPE_INFO_SUB_TYPE) \ |
788 V(STRING_TABLE_SUB_TYPE) \ | 787 V(STRING_TABLE_SUB_TYPE) \ |
789 V(DESCRIPTOR_ARRAY_SUB_TYPE) | 788 V(DESCRIPTOR_ARRAY_SUB_TYPE) \ |
| 789 V(ENUM_CACHE_SUB_TYPE) \ |
| 790 V(ENUM_INDICES_CACHE_SUB_TYPE) \ |
| 791 V(TYPE_FEEDBACK_METADATA_TYPE) \ |
| 792 V(DEOPTIMIZATION_DATA_TYPE) \ |
| 793 V(WEAK_COLLECTION_SUB_TYPE) \ |
| 794 V(RELOC_INFO_SUB_TYPE) \ |
| 795 V(SOURCE_POS_SUB_TYPE) |
790 | 796 |
791 enum FixedArraySubInstanceType { | 797 enum FixedArraySubInstanceType { |
792 #define DEFINE_FIXED_ARRAY_SUB_INSTANCE_TYPE(name) name, | 798 #define DEFINE_FIXED_ARRAY_SUB_INSTANCE_TYPE(name) name, |
793 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(DEFINE_FIXED_ARRAY_SUB_INSTANCE_TYPE) | 799 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(DEFINE_FIXED_ARRAY_SUB_INSTANCE_TYPE) |
794 #undef DEFINE_FIXED_ARRAY_SUB_INSTANCE_TYPE | 800 #undef DEFINE_FIXED_ARRAY_SUB_INSTANCE_TYPE |
795 LAST_FIXED_ARRAY_SUB_TYPE = DESCRIPTOR_ARRAY_SUB_TYPE | 801 LAST_FIXED_ARRAY_SUB_TYPE = SOURCE_POS_SUB_TYPE |
796 }; | 802 }; |
797 | 803 |
798 | 804 |
799 // TODO(bmeurer): Remove this in favor of the ComparisonResult below. | 805 // TODO(bmeurer): Remove this in favor of the ComparisonResult below. |
800 enum CompareResult { | 806 enum CompareResult { |
801 LESS = -1, | 807 LESS = -1, |
802 EQUAL = 0, | 808 EQUAL = 0, |
803 GREATER = 1, | 809 GREATER = 1, |
804 | 810 |
805 NOT_EQUAL = GREATER | 811 NOT_EQUAL = GREATER |
(...skipping 9234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10040 // |HasMore| returns true. | 10046 // |HasMore| returns true. |
10041 inline Object* CurrentValue(); | 10047 inline Object* CurrentValue(); |
10042 | 10048 |
10043 DISALLOW_IMPLICIT_CONSTRUCTORS(JSMapIterator); | 10049 DISALLOW_IMPLICIT_CONSTRUCTORS(JSMapIterator); |
10044 }; | 10050 }; |
10045 | 10051 |
10046 | 10052 |
10047 // Base class for both JSWeakMap and JSWeakSet | 10053 // Base class for both JSWeakMap and JSWeakSet |
10048 class JSWeakCollection: public JSObject { | 10054 class JSWeakCollection: public JSObject { |
10049 public: | 10055 public: |
| 10056 DECLARE_CAST(JSWeakCollection) |
| 10057 |
10050 // [table]: the backing hash table mapping keys to values. | 10058 // [table]: the backing hash table mapping keys to values. |
10051 DECL_ACCESSORS(table, Object) | 10059 DECL_ACCESSORS(table, Object) |
10052 | 10060 |
10053 // [next]: linked list of encountered weak maps during GC. | 10061 // [next]: linked list of encountered weak maps during GC. |
10054 DECL_ACCESSORS(next, Object) | 10062 DECL_ACCESSORS(next, Object) |
10055 | 10063 |
10056 static void Initialize(Handle<JSWeakCollection> collection, Isolate* isolate); | 10064 static void Initialize(Handle<JSWeakCollection> collection, Isolate* isolate); |
10057 static void Set(Handle<JSWeakCollection> collection, Handle<Object> key, | 10065 static void Set(Handle<JSWeakCollection> collection, Handle<Object> key, |
10058 Handle<Object> value, int32_t hash); | 10066 Handle<Object> value, int32_t hash); |
10059 static bool Delete(Handle<JSWeakCollection> collection, Handle<Object> key, | 10067 static bool Delete(Handle<JSWeakCollection> collection, Handle<Object> key, |
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10970 } | 10978 } |
10971 return value; | 10979 return value; |
10972 } | 10980 } |
10973 }; | 10981 }; |
10974 | 10982 |
10975 | 10983 |
10976 } // NOLINT, false-positive due to second-order macros. | 10984 } // NOLINT, false-positive due to second-order macros. |
10977 } // NOLINT, false-positive due to second-order macros. | 10985 } // NOLINT, false-positive due to second-order macros. |
10978 | 10986 |
10979 #endif // V8_OBJECTS_H_ | 10987 #endif // V8_OBJECTS_H_ |
OLD | NEW |