| Index: src/ast/ast.h
|
| diff --git a/src/ast/ast.h b/src/ast/ast.h
|
| index 8a503301484ee0f91e6901cbaf6d469306faa94f..ec4b70192844c4a5d6d07ae0814e56f2744251f3 100644
|
| --- a/src/ast/ast.h
|
| +++ b/src/ast/ast.h
|
| @@ -392,6 +392,9 @@ class Expression : public AstNode {
|
| int base_id_;
|
| Bounds bounds_;
|
| class ToBooleanTypesField : public BitField16<uint16_t, 0, 9> {};
|
| +
|
| + protected:
|
| + static const int kExpressionBitFieldNext = ToBooleanTypesField::kNext;
|
| uint16_t bit_field_;
|
| // Ends with 16-bit field; deriving classes in turn begin with
|
| // 16-bit fields for optimum packing efficiency.
|
| @@ -2589,7 +2592,9 @@ class FunctionLiteral final : public Expression {
|
| int start_position() const;
|
| int end_position() const;
|
| int SourceSize() const { return end_position() - start_position(); }
|
| - bool is_declaration() const { return IsDeclaration::decode(bitfield_); }
|
| + bool is_declaration() const {
|
| + return IsDeclaration::decode(Expression::bit_field_);
|
| + }
|
| bool is_named_expression() const {
|
| return IsNamedExpression::decode(bitfield_);
|
| }
|
| @@ -2716,7 +2721,6 @@ class FunctionLiteral final : public Expression {
|
| function_token_position_(RelocInfo::kNoPosition),
|
| yield_count_(0) {
|
| bitfield_ =
|
| - IsDeclaration::encode(function_type == kDeclaration) |
|
| IsNamedExpression::encode(function_type == kNamedExpression) |
|
| IsAnonymousExpression::encode(function_type == kAnonymousExpression) |
|
| Pretenure::encode(false) |
|
| @@ -2729,15 +2733,17 @@ class FunctionLiteral final : public Expression {
|
| }
|
|
|
| private:
|
| - class IsDeclaration : public BitField16<bool, 0, 1> {};
|
| - class IsNamedExpression : public BitField16<bool, 1, 1> {};
|
| - class IsAnonymousExpression : public BitField16<bool, 2, 1> {};
|
| - class Pretenure : public BitField16<bool, 3, 1> {};
|
| - class HasDuplicateParameters : public BitField16<bool, 4, 1> {};
|
| - class IsFunction : public BitField16<bool, 5, 1> {};
|
| - class ShouldEagerCompile : public BitField16<bool, 6, 1> {};
|
| - class ShouldBeUsedOnceHint : public BitField16<bool, 7, 1> {};
|
| - class FunctionKindBits : public BitField16<FunctionKind, 8, 8> {};
|
| + STATIC_ASSERT((Expression::kExpressionBitFieldNext + 1) < 16);
|
| + class IsDeclaration
|
| + : public BitField16<bool, Expression::kExpressionBitFieldNext, 1> {};
|
| + class IsNamedExpression : public BitField16<bool, 0, 1> {};
|
| + class IsAnonymousExpression : public BitField16<bool, 1, 1> {};
|
| + class Pretenure : public BitField16<bool, 2, 1> {};
|
| + class HasDuplicateParameters : public BitField16<bool, 3, 1> {};
|
| + class IsFunction : public BitField16<bool, 4, 1> {};
|
| + class ShouldEagerCompile : public BitField16<bool, 5, 1> {};
|
| + class ShouldBeUsedOnceHint : public BitField16<bool, 6, 1> {};
|
| + class FunctionKindBits : public BitField16<FunctionKind, 7, 9> {};
|
|
|
| // Start with 16-bit field, which should get packed together
|
| // with Expression's trailing 16-bit field.
|
|
|