Chromium Code Reviews| Index: src/objects.h |
| diff --git a/src/objects.h b/src/objects.h |
| index c0835e21eb9cb5d3df0d1f5ad1e464b6d4022323..2b8e3b20236e24208b8d8ffe5d52f443617710ad 100644 |
| --- a/src/objects.h |
| +++ b/src/objects.h |
| @@ -123,6 +123,7 @@ |
| // - ExternalAsciiInternalizedString |
| // - ExternalTwoByteInternalizedString |
| // - Symbol |
| +// - Private |
| // - HeapNumber |
| // - Cell |
| // - PropertyCell |
| @@ -359,6 +360,7 @@ const int kStubMinorKeyBits = kBitsPerInt - kSmiTagSize - kStubMajorKeyBits; |
| V(SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE) \ |
| \ |
| V(SYMBOL_TYPE) \ |
| + \ |
|
Yang
2013/10/29 12:47:26
stray edit?
rossberg
2013/10/29 15:08:19
On purpose. :)
|
| V(MAP_TYPE) \ |
| V(CODE_TYPE) \ |
| V(ODDBALL_TYPE) \ |
| @@ -691,7 +693,7 @@ enum InstanceType { |
| | kNotInternalizedTag, |
| // Non-string names |
| - SYMBOL_TYPE = kNotStringTag, // LAST_NAME_TYPE, FIRST_NONSTRING_TYPE |
| + SYMBOL_TYPE = kNotStringTag, // FIRST_NONSTRING_TYPE, LAST_NAME_TYPE |
| // Objects allocated in their own spaces (never in new space). |
| MAP_TYPE, |
| @@ -1384,6 +1386,7 @@ class Object : public MaybeObject { |
| INLINE(bool IsUninitialized()); |
| INLINE(bool IsTrue()); |
| INLINE(bool IsFalse()); |
| + INLINE(bool IsPrivate()); |
| inline bool IsArgumentsMarker(); |
| inline bool NonFailureIsHeapObject(); |
| @@ -8330,10 +8333,11 @@ class Name: public HeapObject { |
| }; |
| -// ES6 symbols. |
| +// ES6 unique symbols. |
| class Symbol: public Name { |
| public: |
| - // [name]: the print name of a symbol, or undefined if none. |
| + // [name]: the print name of a symbol, or undefined if none, |
| + // or for private symbols, a Box containing one of those. |
| DECL_ACCESSORS(name, Object) |
| // Casting. |
| @@ -8355,6 +8359,20 @@ class Symbol: public Name { |
| }; |
| +// Private symbols. |
| +class Private: public Symbol { |
| + public: |
| + // The print name of a private symbol, or undefined if none. |
| + DECL_ACCESSORS(name, Object) |
| + |
| + // Casting. |
| + static inline Private* cast(Object* obj); |
| + |
| + private: |
| + DISALLOW_IMPLICIT_CONSTRUCTORS(Private); |
| +}; |
| + |
| + |
| class ConsString; |
| // The String abstract class captures JavaScript string values: |