Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 4e6a17f1eec1474dddd385bf47e12ea744c1b963..6385c587c5837b635ce1fc2fbd5f062bb5011d41 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -786,6 +786,7 @@ TYPE_CHECKER(Code, CODE_TYPE) |
TYPE_CHECKER(Oddball, ODDBALL_TYPE) |
TYPE_CHECKER(Cell, CELL_TYPE) |
TYPE_CHECKER(PropertyCell, PROPERTY_CELL_TYPE) |
+TYPE_CHECKER(WeakCell, WEAK_CELL_TYPE) |
TYPE_CHECKER(SharedFunctionInfo, SHARED_FUNCTION_INFO_TYPE) |
TYPE_CHECKER(JSGeneratorObject, JS_GENERATOR_OBJECT_TYPE) |
TYPE_CHECKER(JSModule, JS_MODULE_TYPE) |
@@ -1929,6 +1930,33 @@ void PropertyCell::set_type_raw(Object* val, WriteBarrierMode ignored) { |
} |
+HeapObject* WeakCell::value() const { |
+ return HeapObject::cast(READ_FIELD(this, kValueOffset)); |
+} |
+ |
+ |
+void WeakCell::clear(HeapObject* undefined) { |
+ WRITE_FIELD(this, kValueOffset, undefined); |
+} |
+ |
+ |
+void WeakCell::initialize(HeapObject* val) { |
+ WRITE_FIELD(this, kValueOffset, val); |
+ WRITE_BARRIER(GetHeap(), this, kValueOffset, val); |
+} |
+ |
+ |
+Object* WeakCell::next() const { return READ_FIELD(this, kNextOffset); } |
+ |
+ |
+void WeakCell::set_next(Object* val, WriteBarrierMode mode) { |
+ WRITE_FIELD(this, kNextOffset, val); |
+ if (mode == UPDATE_WRITE_BARRIER) { |
+ WRITE_BARRIER(GetHeap(), this, kNextOffset, val); |
+ } |
+} |
+ |
+ |
int JSObject::GetHeaderSize() { |
InstanceType type = map()->instance_type(); |
// Check for the most common kind of JavaScript object before |
@@ -3253,6 +3281,7 @@ CAST_ACCESSOR(StringTable) |
CAST_ACCESSOR(Struct) |
CAST_ACCESSOR(Symbol) |
CAST_ACCESSOR(UnseededNumberDictionary) |
+CAST_ACCESSOR(WeakCell) |
CAST_ACCESSOR(WeakHashTable) |