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

Unified Diff: src/objects.h

Issue 640303006: Weak Cells (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Skip cleared weak cells Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/objects-visiting-inl.h ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 6fe52c35c9f94f7ba5869d4a2c68d7a18b9e62e3..a0741cc91cc4ade16202bcb56454b85c97211c9b 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -143,6 +143,7 @@
// - DebugInfo
// - BreakPointInfo
// - CodeCache
+// - WeakCell
//
// Formats of Object*:
// Smi: [31 bit signed int] 0
@@ -425,6 +426,7 @@ const int kStubMinorKeyBits = kSmiValueSize - kStubMajorKeyBits - 1;
V(FIXED_DOUBLE_ARRAY_TYPE) \
V(CONSTANT_POOL_ARRAY_TYPE) \
V(SHARED_FUNCTION_INFO_TYPE) \
+ V(WEAK_CELL_TYPE) \
\
V(JS_MESSAGE_OBJECT_TYPE) \
\
@@ -721,6 +723,7 @@ enum InstanceType {
FIXED_ARRAY_TYPE,
CONSTANT_POOL_ARRAY_TYPE,
SHARED_FUNCTION_INFO_TYPE,
+ WEAK_CELL_TYPE,
// All the following types are subtypes of JSReceiver, which corresponds to
// objects in the JS sense. The first and the last type in this range are
@@ -984,6 +987,7 @@ template <class C> inline bool Is(Object* obj);
V(AccessCheckNeeded) \
V(Cell) \
V(PropertyCell) \
+ V(WeakCell) \
V(ObjectHashTable) \
V(WeakHashTable) \
V(OrderedHashTable)
@@ -9567,6 +9571,35 @@ class PropertyCell: public Cell {
};
+class WeakCell : public HeapObject {
+ public:
+ inline HeapObject* value() const;
+
+ // This should not be called by anyone except GC.
+ inline void clear(HeapObject* undefined);
+
+ // This should not be called by anyone except allocator.
+ inline void initialize(HeapObject* value);
+
+ DECL_ACCESSORS(next, Object)
+
+ DECLARE_CAST(WeakCell)
+
+ DECLARE_PRINTER(WeakCell)
+ DECLARE_VERIFIER(WeakCell)
+
+ // Layout description.
+ static const int kValueOffset = HeapObject::kHeaderSize;
+ static const int kNextOffset = kValueOffset + kPointerSize;
+ static const int kSize = kNextOffset + kPointerSize;
+
+ typedef FixedBodyDescriptor<kValueOffset, kSize, kSize> BodyDescriptor;
+
+ private:
+ DISALLOW_IMPLICIT_CONSTRUCTORS(WeakCell);
+};
+
+
// The JSProxy describes EcmaScript Harmony proxies
class JSProxy: public JSReceiver {
public:
« no previous file with comments | « src/heap/objects-visiting-inl.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698