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) \ |
| 781 V(CONTEXT_SUB_TYPE) \ |
| 782 V(COPY_ON_WRITE_SUB_TYPE) \ |
| 783 V(DEOPTIMIZATION_DATA_SUB_TYPE) \ |
| 784 V(DESCRIPTOR_ARRAY_SUB_TYPE) \ |
| 785 V(ENUM_CACHE_SUB_TYPE) \ |
| 786 V(ENUM_INDICES_CACHE_SUB_TYPE) \ |
| 787 V(DICTIONARY_ELEMENTS_SUB_TYPE) \ |
| 788 V(DICTIONARY_PROPERTIES_SUB_TYPE) \ |
782 V(FAST_ELEMENTS_SUB_TYPE) \ | 789 V(FAST_ELEMENTS_SUB_TYPE) \ |
783 V(DICTIONARY_ELEMENTS_SUB_TYPE) \ | |
784 V(FAST_PROPERTIES_SUB_TYPE) \ | 790 V(FAST_PROPERTIES_SUB_TYPE) \ |
785 V(DICTIONARY_PROPERTIES_SUB_TYPE) \ | 791 V(LITERALS_ARRAY_SUB_TYPE) \ |
786 V(MAP_CODE_CACHE_SUB_TYPE) \ | 792 V(MAP_CODE_CACHE_SUB_TYPE) \ |
| 793 V(OBJECT_TO_CODE_SUB_TYPE) \ |
| 794 V(RELOC_INFO_SUB_TYPE) \ |
787 V(SCOPE_INFO_SUB_TYPE) \ | 795 V(SCOPE_INFO_SUB_TYPE) \ |
| 796 V(SOURCE_POS_SUB_TYPE) \ |
788 V(STRING_TABLE_SUB_TYPE) \ | 797 V(STRING_TABLE_SUB_TYPE) \ |
789 V(DESCRIPTOR_ARRAY_SUB_TYPE) | 798 V(TYPE_FEEDBACK_VECTOR_SUB_TYPE) \ |
| 799 V(TYPE_FEEDBACK_METADATA_SUB_TYPE) \ |
| 800 V(WEAK_COLLECTION_SUB_TYPE) |
790 | 801 |
791 enum FixedArraySubInstanceType { | 802 enum FixedArraySubInstanceType { |
792 #define DEFINE_FIXED_ARRAY_SUB_INSTANCE_TYPE(name) name, | 803 #define DEFINE_FIXED_ARRAY_SUB_INSTANCE_TYPE(name) name, |
793 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(DEFINE_FIXED_ARRAY_SUB_INSTANCE_TYPE) | 804 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(DEFINE_FIXED_ARRAY_SUB_INSTANCE_TYPE) |
794 #undef DEFINE_FIXED_ARRAY_SUB_INSTANCE_TYPE | 805 #undef DEFINE_FIXED_ARRAY_SUB_INSTANCE_TYPE |
795 LAST_FIXED_ARRAY_SUB_TYPE = DESCRIPTOR_ARRAY_SUB_TYPE | 806 LAST_FIXED_ARRAY_SUB_TYPE = WEAK_COLLECTION_SUB_TYPE |
796 }; | 807 }; |
797 | 808 |
798 | 809 |
799 // TODO(bmeurer): Remove this in favor of the ComparisonResult below. | 810 // TODO(bmeurer): Remove this in favor of the ComparisonResult below. |
800 enum CompareResult { | 811 enum CompareResult { |
801 LESS = -1, | 812 LESS = -1, |
802 EQUAL = 0, | 813 EQUAL = 0, |
803 GREATER = 1, | 814 GREATER = 1, |
804 | 815 |
805 NOT_EQUAL = GREATER | 816 NOT_EQUAL = GREATER |
(...skipping 9243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10049 // |HasMore| returns true. | 10060 // |HasMore| returns true. |
10050 inline Object* CurrentValue(); | 10061 inline Object* CurrentValue(); |
10051 | 10062 |
10052 DISALLOW_IMPLICIT_CONSTRUCTORS(JSMapIterator); | 10063 DISALLOW_IMPLICIT_CONSTRUCTORS(JSMapIterator); |
10053 }; | 10064 }; |
10054 | 10065 |
10055 | 10066 |
10056 // Base class for both JSWeakMap and JSWeakSet | 10067 // Base class for both JSWeakMap and JSWeakSet |
10057 class JSWeakCollection: public JSObject { | 10068 class JSWeakCollection: public JSObject { |
10058 public: | 10069 public: |
| 10070 DECLARE_CAST(JSWeakCollection) |
| 10071 |
10059 // [table]: the backing hash table mapping keys to values. | 10072 // [table]: the backing hash table mapping keys to values. |
10060 DECL_ACCESSORS(table, Object) | 10073 DECL_ACCESSORS(table, Object) |
10061 | 10074 |
10062 // [next]: linked list of encountered weak maps during GC. | 10075 // [next]: linked list of encountered weak maps during GC. |
10063 DECL_ACCESSORS(next, Object) | 10076 DECL_ACCESSORS(next, Object) |
10064 | 10077 |
10065 static void Initialize(Handle<JSWeakCollection> collection, Isolate* isolate); | 10078 static void Initialize(Handle<JSWeakCollection> collection, Isolate* isolate); |
10066 static void Set(Handle<JSWeakCollection> collection, Handle<Object> key, | 10079 static void Set(Handle<JSWeakCollection> collection, Handle<Object> key, |
10067 Handle<Object> value, int32_t hash); | 10080 Handle<Object> value, int32_t hash); |
10068 static bool Delete(Handle<JSWeakCollection> collection, Handle<Object> key, | 10081 static bool Delete(Handle<JSWeakCollection> collection, Handle<Object> key, |
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10979 } | 10992 } |
10980 return value; | 10993 return value; |
10981 } | 10994 } |
10982 }; | 10995 }; |
10983 | 10996 |
10984 | 10997 |
10985 } // NOLINT, false-positive due to second-order macros. | 10998 } // NOLINT, false-positive due to second-order macros. |
10986 } // NOLINT, false-positive due to second-order macros. | 10999 } // NOLINT, false-positive due to second-order macros. |
10987 | 11000 |
10988 #endif // V8_OBJECTS_H_ | 11001 #endif // V8_OBJECTS_H_ |
OLD | NEW |