summaryrefslogtreecommitdiff
path: root/deps/v8/src/objects/name.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/objects/name.h')
-rw-r--r--deps/v8/src/objects/name.h39
1 files changed, 18 insertions, 21 deletions
diff --git a/deps/v8/src/objects/name.h b/deps/v8/src/objects/name.h
index 06e08deb82..bcc1f2c27d 100644
--- a/deps/v8/src/objects/name.h
+++ b/deps/v8/src/objects/name.h
@@ -67,13 +67,8 @@ class Name : public HeapObject {
int NameShortPrint(Vector<char> str);
// Layout description.
- static const int kHashFieldSlot = HeapObject::kHeaderSize;
-#if V8_TARGET_LITTLE_ENDIAN || !V8_HOST_ARCH_64_BIT
- static const int kHashFieldOffset = kHashFieldSlot;
-#else
- static const int kHashFieldOffset = kHashFieldSlot + kInt32Size;
-#endif
- static const int kSize = kHashFieldSlot + kPointerSize;
+ static const int kHashFieldOffset = HeapObject::kHeaderSize;
+ static const int kHeaderSize = kHashFieldOffset + kInt32Size;
// Mask constant for checking if a name has a computed hash code
// and if it is a string that is an array index. The least significant bit
@@ -181,20 +176,22 @@ class Symbol : public Name {
DECL_VERIFIER(Symbol)
// Layout description.
- static const int kNameOffset = Name::kSize;
- static const int kFlagsOffset = kNameOffset + kPointerSize;
- static const int kSize = kFlagsOffset + kPointerSize;
-
- // Flags layout.
- static const int kPrivateBit = 0;
- static const int kWellKnownSymbolBit = 1;
- static const int kPublicBit = 2;
- static const int kInterestingSymbolBit = 3;
- static const int kPrivateFieldBit = 4;
-
- typedef FixedBodyDescriptor<kNameOffset, kFlagsOffset, kSize> BodyDescriptor;
- // No weak fields.
- typedef BodyDescriptor BodyDescriptorWeak;
+ static const int kFlagsOffset = Name::kHeaderSize;
+ static const int kNameOffset = kFlagsOffset + kInt32Size;
+ static const int kSize = kNameOffset + kPointerSize;
+
+// Flags layout.
+#define FLAGS_BIT_FIELDS(V, _) \
+ V(IsPrivateBit, bool, 1, _) \
+ V(IsWellKnownSymbolBit, bool, 1, _) \
+ V(IsPublicBit, bool, 1, _) \
+ V(IsInterestingSymbolBit, bool, 1, _) \
+ V(IsPrivateFieldBit, bool, 1, _)
+
+ DEFINE_BIT_FIELDS(FLAGS_BIT_FIELDS)
+#undef FLAGS_BIT_FIELDS
+
+ typedef FixedBodyDescriptor<kNameOffset, kSize, kSize> BodyDescriptor;
void SymbolShortPrint(std::ostream& os);