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

Side by Side Diff: src/objects.h

Issue 19678023: ES6: Implement WeakSet (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Reitveld is acting up Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
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
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 // - JSWeakCollection
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
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
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
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(JSWeakCollection) \
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
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 JSWeakCollection: 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(JSWeakCollection);
8897 };
8898
8899
8900 // The JSWeakMap describes EcmaScript Harmony weak maps
8901 class JSWeakMap: public JSWeakCollection {
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 JSWeakCollection {
8917 public:
8918 // Casting.
8919 static inline JSWeakSet* cast(Object* obj);
8920
8921 // Dispatched behavior.
8922 DECLARE_PRINTER(JSWeakSet)
8923 DECLARE_VERIFIER(JSWeakSet)
8924
8925 private:
8926 DISALLOW_IMPLICIT_CONSTRUCTORS(JSWeakSet);
8927 };
8928
8929
8901 class JSArrayBuffer: public JSObject { 8930 class JSArrayBuffer: public JSObject {
8902 public: 8931 public:
8903 // [backing_store]: backing memory for this array 8932 // [backing_store]: backing memory for this array
8904 DECL_ACCESSORS(backing_store, void) 8933 DECL_ACCESSORS(backing_store, void)
8905 8934
8906 // [byte_length]: length in bytes 8935 // [byte_length]: length in bytes
8907 DECL_ACCESSORS(byte_length, Object) 8936 DECL_ACCESSORS(byte_length, Object)
8908 8937
8909 // [flags] 8938 // [flags]
8910 DECL_ACCESSORS(flag, Smi) 8939 DECL_ACCESSORS(flag, Smi)
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after
9831 } else { 9860 } else {
9832 value &= ~(1 << bit_position); 9861 value &= ~(1 << bit_position);
9833 } 9862 }
9834 return value; 9863 return value;
9835 } 9864 }
9836 }; 9865 };
9837 9866
9838 } } // namespace v8::internal 9867 } } // namespace v8::internal
9839 9868
9840 #endif // V8_OBJECTS_H_ 9869 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/object-observe.js ('k') | src/objects.cc » ('j') | src/objects-printer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698