Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
| 6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 9638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 9649 | 9649 |
| 9650 // [is_private]: Whether this is a private symbol. Private symbols can only | 9650 // [is_private]: Whether this is a private symbol. Private symbols can only |
| 9651 // be used to designate own properties of objects. | 9651 // be used to designate own properties of objects. |
| 9652 DECL_BOOLEAN_ACCESSORS(is_private) | 9652 DECL_BOOLEAN_ACCESSORS(is_private) |
| 9653 | 9653 |
| 9654 // [is_well_known_symbol]: Whether this is a spec-defined well-known symbol, | 9654 // [is_well_known_symbol]: Whether this is a spec-defined well-known symbol, |
| 9655 // or not. Well-known symbols do not throw when an access check fails during | 9655 // or not. Well-known symbols do not throw when an access check fails during |
| 9656 // a load. | 9656 // a load. |
| 9657 DECL_BOOLEAN_ACCESSORS(is_well_known_symbol) | 9657 DECL_BOOLEAN_ACCESSORS(is_well_known_symbol) |
| 9658 | 9658 |
| 9659 // [is_public]: Whether this is a symbol created by Symbol.for. Calling | |
| 9660 // Symbol.keyFor on such a symbol simply needs to return the attached name. | |
| 9661 DECL_BOOLEAN_ACCESSORS(is_public) | |
| 9662 | |
| 9659 DECLARE_CAST(Symbol) | 9663 DECLARE_CAST(Symbol) |
| 9660 | 9664 |
| 9661 // Dispatched behavior. | 9665 // Dispatched behavior. |
| 9662 DECLARE_PRINTER(Symbol) | 9666 DECLARE_PRINTER(Symbol) |
| 9663 DECLARE_VERIFIER(Symbol) | 9667 DECLARE_VERIFIER(Symbol) |
| 9664 | 9668 |
| 9665 // Layout description. | 9669 // Layout description. |
| 9666 static const int kNameOffset = Name::kSize; | 9670 static const int kNameOffset = Name::kSize; |
| 9667 static const int kFlagsOffset = kNameOffset + kPointerSize; | 9671 static const int kFlagsOffset = kNameOffset + kPointerSize; |
| 9668 static const int kSize = kFlagsOffset + kPointerSize; | 9672 static const int kSize = kFlagsOffset + kPointerSize; |
| 9669 | 9673 |
| 9670 // Flags layout. | 9674 // Flags layout. |
| 9671 static const int kPrivateBit = 0; | 9675 static const int kPrivateBit = 0; |
| 9672 static const int kWellKnownSymbolBit = 1; | 9676 static const int kWellKnownSymbolBit = 1; |
| 9677 static const int kIsPublicBit = 2; | |
|
peria
2016/12/06 05:12:36
inconsistent with "kPrivateBit"
Yang
2016/12/06 12:53:07
Done.
| |
| 9673 | 9678 |
| 9674 typedef FixedBodyDescriptor<kNameOffset, kFlagsOffset, kSize> BodyDescriptor; | 9679 typedef FixedBodyDescriptor<kNameOffset, kFlagsOffset, kSize> BodyDescriptor; |
| 9675 | 9680 |
| 9676 void SymbolShortPrint(std::ostream& os); | 9681 void SymbolShortPrint(std::ostream& os); |
| 9677 | 9682 |
| 9678 private: | 9683 private: |
| 9679 const char* PrivateSymbolToName() const; | 9684 const char* PrivateSymbolToName() const; |
| 9680 | 9685 |
| 9681 #if TRACE_MAPS | 9686 #if TRACE_MAPS |
| 9682 friend class Name; // For PrivateSymbolToName. | 9687 friend class Name; // For PrivateSymbolToName. |
| (...skipping 2276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 11959 } | 11964 } |
| 11960 return value; | 11965 return value; |
| 11961 } | 11966 } |
| 11962 }; | 11967 }; |
| 11963 | 11968 |
| 11964 | 11969 |
| 11965 } // NOLINT, false-positive due to second-order macros. | 11970 } // NOLINT, false-positive due to second-order macros. |
| 11966 } // NOLINT, false-positive due to second-order macros. | 11971 } // NOLINT, false-positive due to second-order macros. |
| 11967 | 11972 |
| 11968 #endif // V8_OBJECTS_H_ | 11973 #endif // V8_OBJECTS_H_ |
| OLD | NEW |