Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index d9d36e0f4be1147ad8d5e3eee2c9625f6b024c1e..e8723a593a010344919603d5777af6bab9c079cf 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -189,6 +189,11 @@ TYPE_CHECKER(HeapNumber, HEAP_NUMBER_TYPE) |
TYPE_CHECKER(Symbol, SYMBOL_TYPE) |
+bool Object::IsPrivate() { |
+ return IsSymbol() && Symbol::cast(this)->name()->IsBox(); |
+} |
+ |
+ |
bool Object::IsString() { |
return Object::IsHeapObject() |
&& HeapObject::cast(this)->map()->instance_type() < FIRST_NONSTRING_TYPE; |
@@ -2602,6 +2607,7 @@ CAST_ACCESSOR(ExternalString) |
CAST_ACCESSOR(ExternalAsciiString) |
CAST_ACCESSOR(ExternalTwoByteString) |
CAST_ACCESSOR(Symbol) |
+CAST_ACCESSOR(Private) |
CAST_ACCESSOR(Name) |
CAST_ACCESSOR(JSReceiver) |
CAST_ACCESSOR(JSObject) |
@@ -2692,6 +2698,18 @@ bool Name::Equals(Name* other) { |
ACCESSORS(Symbol, name, Object, kNameOffset) |
+Object* Private::name() { |
+ ASSERT(IsPrivate()); |
+ return Box::cast(Symbol::name())->value(); |
Yang
2013/10/29 12:47:26
could we assert in those accessors that the value
rossberg
2013/10/29 15:08:19
Yeah, that is nasty. I decided to remove the whole
|
+} |
+ |
+ |
+void Private::set_name(Object* value, WriteBarrierMode mode) { |
+ ASSERT(IsPrivate()); |
+ return Box::cast(Symbol::name())->set_value(value, mode); |
+} |
+ |
+ |
bool String::Equals(String* other) { |
if (other == this) return true; |
if (this->IsInternalizedString() && other->IsInternalizedString()) { |