OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
53 // - MaybeObject (an object or a failure) | 53 // - MaybeObject (an object or a failure) |
54 // - Failure (immediate for marking failed operation) | 54 // - Failure (immediate for marking failed operation) |
55 // - Object | 55 // - Object |
56 // - Smi (immediate small integer) | 56 // - Smi (immediate small integer) |
57 // - HeapObject (superclass for everything allocated in the heap) | 57 // - HeapObject (superclass for everything allocated in the heap) |
58 // - JSReceiver (suitable for property access) | 58 // - JSReceiver (suitable for property access) |
59 // - JSObject | 59 // - JSObject |
60 // - JSArray | 60 // - JSArray |
61 // - JSArrayBuffer | 61 // - JSArrayBuffer |
62 // - JSArrayBufferView | 62 // - JSArrayBufferView |
63 // - JSTypedArray | 63 // - JSTypedArray |
64 // - JSDataView | 64 // - JSDataView |
65 // - JSSet | 65 // - JSSet |
66 // - JSMap | 66 // - JSMap |
67 // - JSWeakMap | 67 // - WeakCollection |
rossberg
2013/07/19 09:55:49
Just one nit: this should be named JSWeakCollectio
| |
68 // - JSWeakMap | |
69 // - JSWeakSet | |
68 // - JSRegExp | 70 // - JSRegExp |
69 // - JSFunction | 71 // - JSFunction |
70 // - JSGeneratorObject | 72 // - JSGeneratorObject |
71 // - JSModule | 73 // - JSModule |
72 // - GlobalObject | 74 // - GlobalObject |
73 // - JSGlobalObject | 75 // - JSGlobalObject |
74 // - JSBuiltinsObject | 76 // - JSBuiltinsObject |
75 // - JSGlobalProxy | 77 // - JSGlobalProxy |
76 // - JSValue | 78 // - JSValue |
77 // - JSDate | 79 // - JSDate |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
408 V(JS_MODULE_TYPE) \ | 410 V(JS_MODULE_TYPE) \ |
409 V(JS_GLOBAL_OBJECT_TYPE) \ | 411 V(JS_GLOBAL_OBJECT_TYPE) \ |
410 V(JS_BUILTINS_OBJECT_TYPE) \ | 412 V(JS_BUILTINS_OBJECT_TYPE) \ |
411 V(JS_GLOBAL_PROXY_TYPE) \ | 413 V(JS_GLOBAL_PROXY_TYPE) \ |
412 V(JS_ARRAY_TYPE) \ | 414 V(JS_ARRAY_TYPE) \ |
413 V(JS_ARRAY_BUFFER_TYPE) \ | 415 V(JS_ARRAY_BUFFER_TYPE) \ |
414 V(JS_TYPED_ARRAY_TYPE) \ | 416 V(JS_TYPED_ARRAY_TYPE) \ |
415 V(JS_DATA_VIEW_TYPE) \ | 417 V(JS_DATA_VIEW_TYPE) \ |
416 V(JS_PROXY_TYPE) \ | 418 V(JS_PROXY_TYPE) \ |
417 V(JS_WEAK_MAP_TYPE) \ | 419 V(JS_WEAK_MAP_TYPE) \ |
420 V(JS_WEAK_SET_TYPE) \ | |
418 V(JS_REGEXP_TYPE) \ | 421 V(JS_REGEXP_TYPE) \ |
419 \ | 422 \ |
420 V(JS_FUNCTION_TYPE) \ | 423 V(JS_FUNCTION_TYPE) \ |
421 V(JS_FUNCTION_PROXY_TYPE) \ | 424 V(JS_FUNCTION_PROXY_TYPE) \ |
422 | 425 |
423 #ifdef ENABLE_DEBUGGER_SUPPORT | 426 #ifdef ENABLE_DEBUGGER_SUPPORT |
424 #define INSTANCE_TYPE_LIST_DEBUGGER(V) \ | 427 #define INSTANCE_TYPE_LIST_DEBUGGER(V) \ |
425 V(DEBUG_INFO_TYPE) \ | 428 V(DEBUG_INFO_TYPE) \ |
426 V(BREAK_POINT_INFO_TYPE) | 429 V(BREAK_POINT_INFO_TYPE) |
427 #else | 430 #else |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
747 JS_GLOBAL_OBJECT_TYPE, | 750 JS_GLOBAL_OBJECT_TYPE, |
748 JS_BUILTINS_OBJECT_TYPE, | 751 JS_BUILTINS_OBJECT_TYPE, |
749 JS_GLOBAL_PROXY_TYPE, | 752 JS_GLOBAL_PROXY_TYPE, |
750 JS_ARRAY_TYPE, | 753 JS_ARRAY_TYPE, |
751 JS_ARRAY_BUFFER_TYPE, | 754 JS_ARRAY_BUFFER_TYPE, |
752 JS_TYPED_ARRAY_TYPE, | 755 JS_TYPED_ARRAY_TYPE, |
753 JS_DATA_VIEW_TYPE, | 756 JS_DATA_VIEW_TYPE, |
754 JS_SET_TYPE, | 757 JS_SET_TYPE, |
755 JS_MAP_TYPE, | 758 JS_MAP_TYPE, |
756 JS_WEAK_MAP_TYPE, | 759 JS_WEAK_MAP_TYPE, |
760 JS_WEAK_SET_TYPE, | |
757 | 761 |
758 JS_REGEXP_TYPE, | 762 JS_REGEXP_TYPE, |
759 | 763 |
760 JS_FUNCTION_TYPE, // LAST_JS_OBJECT_TYPE, LAST_JS_RECEIVER_TYPE | 764 JS_FUNCTION_TYPE, // LAST_JS_OBJECT_TYPE, LAST_JS_RECEIVER_TYPE |
761 | 765 |
762 // Pseudo-types | 766 // Pseudo-types |
763 FIRST_TYPE = 0x0, | 767 FIRST_TYPE = 0x0, |
764 LAST_TYPE = JS_FUNCTION_TYPE, | 768 LAST_TYPE = JS_FUNCTION_TYPE, |
765 INVALID_TYPE = FIRST_TYPE - 1, | 769 INVALID_TYPE = FIRST_TYPE - 1, |
766 FIRST_NAME_TYPE = FIRST_TYPE, | 770 FIRST_NAME_TYPE = FIRST_TYPE, |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
996 V(Boolean) \ | 1000 V(Boolean) \ |
997 V(JSArray) \ | 1001 V(JSArray) \ |
998 V(JSArrayBuffer) \ | 1002 V(JSArrayBuffer) \ |
999 V(JSArrayBufferView) \ | 1003 V(JSArrayBufferView) \ |
1000 V(JSTypedArray) \ | 1004 V(JSTypedArray) \ |
1001 V(JSDataView) \ | 1005 V(JSDataView) \ |
1002 V(JSProxy) \ | 1006 V(JSProxy) \ |
1003 V(JSFunctionProxy) \ | 1007 V(JSFunctionProxy) \ |
1004 V(JSSet) \ | 1008 V(JSSet) \ |
1005 V(JSMap) \ | 1009 V(JSMap) \ |
1010 V(WeakCollection) \ | |
1006 V(JSWeakMap) \ | 1011 V(JSWeakMap) \ |
1012 V(JSWeakSet) \ | |
1007 V(JSRegExp) \ | 1013 V(JSRegExp) \ |
1008 V(HashTable) \ | 1014 V(HashTable) \ |
1009 V(Dictionary) \ | 1015 V(Dictionary) \ |
1010 V(StringTable) \ | 1016 V(StringTable) \ |
1011 V(JSFunctionResultCache) \ | 1017 V(JSFunctionResultCache) \ |
1012 V(NormalizedMapCache) \ | 1018 V(NormalizedMapCache) \ |
1013 V(CompilationCacheTable) \ | 1019 V(CompilationCacheTable) \ |
1014 V(CodeCacheHashTable) \ | 1020 V(CodeCacheHashTable) \ |
1015 V(PolymorphicCodeCacheHashTable) \ | 1021 V(PolymorphicCodeCacheHashTable) \ |
1016 V(MapCache) \ | 1022 V(MapCache) \ |
(...skipping 7849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8866 DECLARE_VERIFIER(JSMap) | 8872 DECLARE_VERIFIER(JSMap) |
8867 | 8873 |
8868 static const int kTableOffset = JSObject::kHeaderSize; | 8874 static const int kTableOffset = JSObject::kHeaderSize; |
8869 static const int kSize = kTableOffset + kPointerSize; | 8875 static const int kSize = kTableOffset + kPointerSize; |
8870 | 8876 |
8871 private: | 8877 private: |
8872 DISALLOW_IMPLICIT_CONSTRUCTORS(JSMap); | 8878 DISALLOW_IMPLICIT_CONSTRUCTORS(JSMap); |
8873 }; | 8879 }; |
8874 | 8880 |
8875 | 8881 |
8876 // The JSWeakMap describes EcmaScript Harmony weak maps | 8882 // Base class for both JSWeakMap and JSWeakSet |
8877 class JSWeakMap: public JSObject { | 8883 class WeakCollection: public JSObject { |
8878 public: | 8884 public: |
8879 // [table]: the backing hash table mapping keys to values. | 8885 // [table]: the backing hash table mapping keys to values. |
8880 DECL_ACCESSORS(table, Object) | 8886 DECL_ACCESSORS(table, Object) |
8881 | 8887 |
8882 // [next]: linked list of encountered weak maps during GC. | 8888 // [next]: linked list of encountered weak maps during GC. |
8883 DECL_ACCESSORS(next, Object) | 8889 DECL_ACCESSORS(next, Object) |
8884 | 8890 |
8891 static const int kTableOffset = JSObject::kHeaderSize; | |
8892 static const int kNextOffset = kTableOffset + kPointerSize; | |
8893 static const int kSize = kNextOffset + kPointerSize; | |
8894 | |
8895 private: | |
8896 DISALLOW_IMPLICIT_CONSTRUCTORS(WeakCollection); | |
8897 }; | |
8898 | |
8899 | |
8900 // The JSWeakMap describes EcmaScript Harmony weak maps | |
8901 class JSWeakMap: public WeakCollection { | |
8902 public: | |
8885 // Casting. | 8903 // Casting. |
8886 static inline JSWeakMap* cast(Object* obj); | 8904 static inline JSWeakMap* cast(Object* obj); |
8887 | 8905 |
8888 // Dispatched behavior. | 8906 // Dispatched behavior. |
8889 DECLARE_PRINTER(JSWeakMap) | 8907 DECLARE_PRINTER(JSWeakMap) |
8890 DECLARE_VERIFIER(JSWeakMap) | 8908 DECLARE_VERIFIER(JSWeakMap) |
8891 | 8909 |
8892 static const int kTableOffset = JSObject::kHeaderSize; | |
8893 static const int kNextOffset = kTableOffset + kPointerSize; | |
8894 static const int kSize = kNextOffset + kPointerSize; | |
8895 | |
8896 private: | 8910 private: |
8897 DISALLOW_IMPLICIT_CONSTRUCTORS(JSWeakMap); | 8911 DISALLOW_IMPLICIT_CONSTRUCTORS(JSWeakMap); |
8898 }; | 8912 }; |
8899 | 8913 |
8900 | 8914 |
8915 // The JSWeakSet describes EcmaScript Harmony weak sets | |
8916 class JSWeakSet: public WeakCollection { | |
8917 public: | |
8918 | |
8919 // Casting. | |
8920 static inline JSWeakSet* cast(Object* obj); | |
8921 | |
8922 // Dispatched behavior. | |
8923 DECLARE_PRINTER(JSWeakSet) | |
8924 DECLARE_VERIFIER(JSWeakSet) | |
8925 | |
8926 private: | |
8927 DISALLOW_IMPLICIT_CONSTRUCTORS(JSWeakSet); | |
8928 }; | |
8929 | |
8930 | |
8901 class JSArrayBuffer: public JSObject { | 8931 class JSArrayBuffer: public JSObject { |
8902 public: | 8932 public: |
8903 // [backing_store]: backing memory for this array | 8933 // [backing_store]: backing memory for this array |
8904 DECL_ACCESSORS(backing_store, void) | 8934 DECL_ACCESSORS(backing_store, void) |
8905 | 8935 |
8906 // [byte_length]: length in bytes | 8936 // [byte_length]: length in bytes |
8907 DECL_ACCESSORS(byte_length, Object) | 8937 DECL_ACCESSORS(byte_length, Object) |
8908 | 8938 |
8909 // [flags] | 8939 // [flags] |
8910 DECL_ACCESSORS(flag, Smi) | 8940 DECL_ACCESSORS(flag, Smi) |
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9831 } else { | 9861 } else { |
9832 value &= ~(1 << bit_position); | 9862 value &= ~(1 << bit_position); |
9833 } | 9863 } |
9834 return value; | 9864 return value; |
9835 } | 9865 } |
9836 }; | 9866 }; |
9837 | 9867 |
9838 } } // namespace v8::internal | 9868 } } // namespace v8::internal |
9839 | 9869 |
9840 #endif // V8_OBJECTS_H_ | 9870 #endif // V8_OBJECTS_H_ |
OLD | NEW |