@@ -168,7 +168,7 @@ class AstNode: public ZoneObject {
168168 void * operator new (size_t size);
169169
170170 int position_;
171- class NodeTypeField : public BitField <NodeType, 0 , 6 > {} ;
171+ using NodeTypeField = BitField<NodeType, 0 , 6 >;
172172
173173 protected:
174174 uint32_t bit_field_;
@@ -265,8 +265,7 @@ class Expression : public AstNode {
265265 }
266266
267267 private:
268- class IsParenthesizedField
269- : public BitField<bool , AstNode::kNextBitFieldIndex , 1 > {};
268+ using IsParenthesizedField = BitField<bool , AstNode::kNextBitFieldIndex , 1 >;
270269
271270 protected:
272271 Expression (int pos, NodeType type) : AstNode(pos, type) {
@@ -321,8 +320,8 @@ class BreakableStatement : public Statement {
321320 }
322321
323322 private:
324- class BreakableTypeField
325- : public BitField<BreakableType, Statement::kNextBitFieldIndex , 1 > {} ;
323+ using BreakableTypeField =
324+ BitField<BreakableType, Statement::kNextBitFieldIndex , 1 >;
326325
327326 protected:
328327 BreakableStatement (BreakableType breakable_type, int position, NodeType type)
@@ -357,10 +356,9 @@ class Block : public BreakableStatement {
357356 ZonePtrList<Statement> statements_;
358357 Scope* scope_;
359358
360- class IgnoreCompletionField
361- : public BitField<bool , BreakableStatement::kNextBitFieldIndex , 1 > {};
362- class IsLabeledField
363- : public BitField<bool , IgnoreCompletionField::kNext , 1 > {};
359+ using IgnoreCompletionField =
360+ BitField<bool , BreakableStatement::kNextBitFieldIndex , 1 >;
361+ using IsLabeledField = BitField<bool , IgnoreCompletionField::kNext , 1 >;
364362
365363 protected:
366364 Block (Zone* zone, ZonePtrList<const AstRawString>* labels, int capacity,
@@ -448,8 +446,7 @@ class VariableDeclaration : public Declaration {
448446 private:
449447 friend class AstNodeFactory ;
450448
451- class IsNestedField
452- : public BitField<bool , Declaration::kNextBitFieldIndex , 1 > {};
449+ using IsNestedField = BitField<bool , Declaration::kNextBitFieldIndex , 1 >;
453450
454451 protected:
455452 explicit VariableDeclaration (int pos, bool is_nested = false )
@@ -740,8 +737,7 @@ class ReturnStatement final : public JumpStatement {
740737 Expression* expression_;
741738 int end_position_;
742739
743- class TypeField
744- : public BitField<Type, JumpStatement::kNextBitFieldIndex , 1 > {};
740+ using TypeField = BitField<Type, JumpStatement::kNextBitFieldIndex , 1 >;
745741};
746742
747743
@@ -977,8 +973,7 @@ class SloppyBlockFunctionStatement final : public Statement {
977973 private:
978974 friend class AstNodeFactory ;
979975
980- class TokenField
981- : public BitField<Token::Value, Statement::kNextBitFieldIndex , 8 > {};
976+ using TokenField = BitField<Token::Value, Statement::kNextBitFieldIndex , 8 >;
982977
983978 SloppyBlockFunctionStatement (int pos, Variable* var, Token::Value init,
984979 Statement* statement)
@@ -1079,7 +1074,7 @@ class Literal final : public Expression {
10791074 private:
10801075 friend class AstNodeFactory ;
10811076
1082- class TypeField : public BitField <Type, Expression::kNextBitFieldIndex , 4 > {} ;
1077+ using TypeField = BitField<Type, Expression::kNextBitFieldIndex , 4 >;
10831078
10841079 Literal (int smi, int position) : Expression(position, kLiteral ), smi_(smi) {
10851080 bit_field_ = TypeField::update (bit_field_, kSmi );
@@ -1210,10 +1205,10 @@ class AggregateLiteral : public MaterializedLiteral {
12101205
12111206 private:
12121207 int depth_ : 31 ;
1213- class NeedsInitialAllocationSiteField
1214- : public BitField<bool , MaterializedLiteral::kNextBitFieldIndex , 1 > {} ;
1215- class IsSimpleField
1216- : public BitField<bool , NeedsInitialAllocationSiteField::kNext , 1 > {} ;
1208+ using NeedsInitialAllocationSiteField =
1209+ BitField<bool , MaterializedLiteral::kNextBitFieldIndex , 1 >;
1210+ using IsSimpleField =
1211+ BitField<bool , NeedsInitialAllocationSiteField::kNext , 1 >;
12171212
12181213 protected:
12191214 friend class AstNodeFactory ;
@@ -1413,14 +1408,11 @@ class ObjectLiteral final : public AggregateLiteral {
14131408 Handle<ObjectBoilerplateDescription> boilerplate_description_;
14141409 ZoneList<Property*> properties_;
14151410
1416- class HasElementsField
1417- : public BitField<bool , AggregateLiteral::kNextBitFieldIndex , 1 > {};
1418- class HasRestPropertyField
1419- : public BitField<bool , HasElementsField::kNext , 1 > {};
1420- class FastElementsField
1421- : public BitField<bool , HasRestPropertyField::kNext , 1 > {};
1422- class HasNullPrototypeField
1423- : public BitField<bool , FastElementsField::kNext , 1 > {};
1411+ using HasElementsField =
1412+ BitField<bool , AggregateLiteral::kNextBitFieldIndex , 1 >;
1413+ using HasRestPropertyField = BitField<bool , HasElementsField::kNext , 1 >;
1414+ using FastElementsField = BitField<bool , HasRestPropertyField::kNext , 1 >;
1415+ using HasNullPrototypeField = BitField<bool , FastElementsField::kNext , 1 >;
14241416};
14251417
14261418// An array literal has a literals object that is used
@@ -1586,15 +1578,14 @@ class VariableProxy final : public Expression {
15861578
15871579 explicit VariableProxy (const VariableProxy* copy_from);
15881580
1589- class IsAssignedField
1590- : public BitField<bool , Expression::kNextBitFieldIndex , 1 > {};
1591- class IsResolvedField : public BitField <bool , IsAssignedField::kNext , 1 > {};
1592- class IsRemovedFromUnresolvedField
1593- : public BitField<bool , IsResolvedField::kNext , 1 > {};
1594- class IsNewTargetField
1595- : public BitField<bool , IsRemovedFromUnresolvedField::kNext , 1 > {};
1596- class HoleCheckModeField
1597- : public BitField<HoleCheckMode, IsNewTargetField::kNext , 1 > {};
1581+ using IsAssignedField = BitField<bool , Expression::kNextBitFieldIndex , 1 >;
1582+ using IsResolvedField = BitField<bool , IsAssignedField::kNext , 1 >;
1583+ using IsRemovedFromUnresolvedField =
1584+ BitField<bool , IsResolvedField::kNext , 1 >;
1585+ using IsNewTargetField =
1586+ BitField<bool , IsRemovedFromUnresolvedField::kNext , 1 >;
1587+ using HoleCheckModeField =
1588+ BitField<HoleCheckMode, IsNewTargetField::kNext , 1 >;
15981589
15991590 union {
16001591 const AstRawString* raw_name_; // if !is_resolved_
@@ -1743,10 +1734,8 @@ class Call final : public Expression {
17431734 arguments.CopyTo (&arguments_, zone);
17441735 }
17451736
1746- class IsPossiblyEvalField
1747- : public BitField<bool , Expression::kNextBitFieldIndex , 1 > {};
1748- class IsTaggedTemplateField
1749- : public BitField<bool , IsPossiblyEvalField::kNext , 1 > {};
1737+ using IsPossiblyEvalField = BitField<bool , Expression::kNextBitFieldIndex , 1 >;
1738+ using IsTaggedTemplateField = BitField<bool , IsPossiblyEvalField::kNext , 1 >;
17501739
17511740 Expression* expression_;
17521741 ZonePtrList<Expression> arguments_;
@@ -1838,8 +1827,8 @@ class UnaryOperation final : public Expression {
18381827
18391828 Expression* expression_;
18401829
1841- class OperatorField
1842- : public BitField<Token::Value, Expression::kNextBitFieldIndex , 7 > {} ;
1830+ using OperatorField =
1831+ BitField<Token::Value, Expression::kNextBitFieldIndex , 7 >;
18431832};
18441833
18451834
@@ -1865,8 +1854,8 @@ class BinaryOperation final : public Expression {
18651854 Expression* left_;
18661855 Expression* right_;
18671856
1868- class OperatorField
1869- : public BitField<Token::Value, Expression::kNextBitFieldIndex , 7 > {} ;
1857+ using OperatorField =
1858+ BitField<Token::Value, Expression::kNextBitFieldIndex , 7 >;
18701859};
18711860
18721861class NaryOperation final : public Expression {
@@ -1925,8 +1914,8 @@ class NaryOperation final : public Expression {
19251914 };
19261915 ZoneVector<NaryOperationEntry> subsequent_;
19271916
1928- class OperatorField
1929- : public BitField<Token::Value, Expression::kNextBitFieldIndex , 7 > {} ;
1917+ using OperatorField =
1918+ BitField<Token::Value, Expression::kNextBitFieldIndex , 7 >;
19301919};
19311920
19321921class CountOperation final : public Expression {
@@ -1946,9 +1935,8 @@ class CountOperation final : public Expression {
19461935 bit_field_ |= IsPrefixField::encode (is_prefix) | TokenField::encode (op);
19471936 }
19481937
1949- class IsPrefixField
1950- : public BitField<bool , Expression::kNextBitFieldIndex , 1 > {};
1951- class TokenField : public BitField <Token::Value, IsPrefixField::kNext , 7 > {};
1938+ using IsPrefixField = BitField<bool , Expression::kNextBitFieldIndex , 1 >;
1939+ using TokenField = BitField<Token::Value, IsPrefixField::kNext , 7 >;
19521940
19531941 Expression* expression_;
19541942};
@@ -1978,8 +1966,8 @@ class CompareOperation final : public Expression {
19781966 Expression* left_;
19791967 Expression* right_;
19801968
1981- class OperatorField
1982- : public BitField<Token::Value, Expression::kNextBitFieldIndex , 7 > {} ;
1969+ using OperatorField =
1970+ BitField<Token::Value, Expression::kNextBitFieldIndex , 7 >;
19831971};
19841972
19851973
@@ -2071,10 +2059,8 @@ class Assignment : public Expression {
20712059 private:
20722060 friend class AstNodeFactory ;
20732061
2074- class TokenField
2075- : public BitField<Token::Value, Expression::kNextBitFieldIndex , 7 > {};
2076- class LookupHoistingModeField : public BitField <bool , TokenField::kNext , 1 > {
2077- };
2062+ using TokenField = BitField<Token::Value, Expression::kNextBitFieldIndex , 7 >;
2063+ using LookupHoistingModeField = BitField<bool , TokenField::kNext , 1 >;
20782064
20792065 Expression* target_;
20802066 Expression* value_;
@@ -2132,8 +2118,8 @@ class Suspend : public Expression {
21322118
21332119 Expression* expression_;
21342120
2135- class OnAbruptResumeField
2136- : public BitField<OnAbruptResume, Expression::kNextBitFieldIndex , 1 > {} ;
2121+ using OnAbruptResumeField =
2122+ BitField<OnAbruptResume, Expression::kNextBitFieldIndex , 1 >;
21372123};
21382124
21392125class Yield final : public Suspend {
@@ -2370,17 +2356,17 @@ class FunctionLiteral final : public Expression {
23702356 body.CopyTo (&body_, zone);
23712357 }
23722358
2373- class FunctionTypeBits
2374- : public BitField<FunctionType, Expression::kNextBitFieldIndex , 3 > {} ;
2375- class Pretenure : public BitField <bool , FunctionTypeBits::kNext , 1 > {} ;
2376- class HasDuplicateParameters : public BitField <bool , Pretenure::kNext , 1 > {} ;
2377- class DontOptimizeReasonField
2378- : public BitField<BailoutReason, HasDuplicateParameters::kNext , 8 > {} ;
2379- class RequiresInstanceMembersInitializer
2380- : public BitField<bool , DontOptimizeReasonField::kNext , 1 > {} ;
2381- class HasBracesField
2382- : public BitField<bool , RequiresInstanceMembersInitializer::kNext , 1 > {} ;
2383- class OneshotIIFEBit : public BitField <bool , HasBracesField::kNext , 1 > {} ;
2359+ using FunctionTypeBits =
2360+ BitField<FunctionType, Expression::kNextBitFieldIndex , 3 >;
2361+ using Pretenure = BitField<bool , FunctionTypeBits::kNext , 1 >;
2362+ using HasDuplicateParameters = BitField<bool , Pretenure::kNext , 1 >;
2363+ using DontOptimizeReasonField =
2364+ BitField<BailoutReason, HasDuplicateParameters::kNext , 8 >;
2365+ using RequiresInstanceMembersInitializer =
2366+ BitField<bool , DontOptimizeReasonField::kNext , 1 >;
2367+ using HasBracesField =
2368+ BitField<bool , RequiresInstanceMembersInitializer::kNext , 1 >;
2369+ using OneshotIIFEBit = BitField<bool , HasBracesField::kNext , 1 >;
23842370
23852371 // expected_property_count_ is the sum of instance fields and properties.
23862372 // It can vary depending on whether a function is lazily or eagerly parsed.
@@ -2525,12 +2511,12 @@ class ClassLiteral final : public Expression {
25252511 ZonePtrList<Property>* properties_;
25262512 FunctionLiteral* static_fields_initializer_;
25272513 FunctionLiteral* instance_members_initializer_function_;
2528- class HasNameStaticProperty
2529- : public BitField<bool , Expression::kNextBitFieldIndex , 1 > {} ;
2530- class HasStaticComputedNames
2531- : public BitField<bool , HasNameStaticProperty::kNext , 1 > {} ;
2532- class IsAnonymousExpression
2533- : public BitField<bool , HasStaticComputedNames::kNext , 1 > {} ;
2514+ using HasNameStaticProperty =
2515+ BitField<bool , Expression::kNextBitFieldIndex , 1 >;
2516+ using HasStaticComputedNames =
2517+ BitField<bool , HasNameStaticProperty::kNext , 1 >;
2518+ using IsAnonymousExpression =
2519+ BitField<bool , HasStaticComputedNames::kNext , 1 >;
25342520};
25352521
25362522
0 commit comments