Commit 3cd82879 authored by verwaest's avatar verwaest Committed by Commit bot

Reorder fields of AstNode subclasses for better packing

BUG=

Review-Url: https://codereview.chromium.org/2149663003
Cr-Commit-Position: refs/heads/master@{#37834}
parent a51f4297
...@@ -177,8 +177,8 @@ VariableProxy::VariableProxy(Zone* zone, Variable* var, int start_position, ...@@ -177,8 +177,8 @@ VariableProxy::VariableProxy(Zone* zone, Variable* var, int start_position,
bit_field_(IsThisField::encode(var->is_this()) | bit_field_(IsThisField::encode(var->is_this()) |
IsAssignedField::encode(false) | IsAssignedField::encode(false) |
IsResolvedField::encode(false)), IsResolvedField::encode(false)),
raw_name_(var->raw_name()), end_position_(end_position),
end_position_(end_position) { raw_name_(var->raw_name()) {
BindTo(var); BindTo(var);
} }
...@@ -189,8 +189,8 @@ VariableProxy::VariableProxy(Zone* zone, const AstRawString* name, ...@@ -189,8 +189,8 @@ VariableProxy::VariableProxy(Zone* zone, const AstRawString* name,
bit_field_(IsThisField::encode(variable_kind == Variable::THIS) | bit_field_(IsThisField::encode(variable_kind == Variable::THIS) |
IsAssignedField::encode(false) | IsAssignedField::encode(false) |
IsResolvedField::encode(false)), IsResolvedField::encode(false)),
raw_name_(name), end_position_(end_position),
end_position_(end_position) {} raw_name_(name) {}
void VariableProxy::BindTo(Variable* var) { void VariableProxy::BindTo(Variable* var) {
DCHECK((is_this() && var->is_this()) || raw_name() == var->raw_name()); DCHECK((is_this() && var->is_this()) || raw_name() == var->raw_name());
......
...@@ -229,6 +229,8 @@ class AstNode: public ZoneObject { ...@@ -229,6 +229,8 @@ class AstNode: public ZoneObject {
int position_; int position_;
NodeType node_type_; NodeType node_type_;
// Ends with NodeType which is uint8_t sized. Deriving classes in turn begin
// sub-int32_t-sized fields for optimum packing efficiency.
}; };
...@@ -358,8 +360,8 @@ class Expression : public AstNode { ...@@ -358,8 +360,8 @@ class Expression : public AstNode {
protected: protected:
Expression(Zone* zone, int pos, NodeType type) Expression(Zone* zone, int pos, NodeType type)
: AstNode(pos, type), : AstNode(pos, type),
base_id_(BailoutId::None().ToInt()), bit_field_(0),
bit_field_(0) {} base_id_(BailoutId::None().ToInt()) {}
static int parent_num_ids() { return 0; } static int parent_num_ids() { return 0; }
void set_to_boolean_types(uint16_t types) { void set_to_boolean_types(uint16_t types) {
bit_field_ = ToBooleanTypesField::update(bit_field_, types); bit_field_ = ToBooleanTypesField::update(bit_field_, types);
...@@ -373,11 +375,9 @@ class Expression : public AstNode { ...@@ -373,11 +375,9 @@ class Expression : public AstNode {
private: private:
int local_id(int n) const { return base_id() + parent_num_ids() + n; } int local_id(int n) const { return base_id() + parent_num_ids() + n; }
uint16_t bit_field_;
int base_id_; int base_id_;
class ToBooleanTypesField : public BitField16<uint16_t, 0, 9> {}; class ToBooleanTypesField : public BitField16<uint16_t, 0, 9> {};
uint16_t bit_field_;
// Ends with 16-bit field; deriving classes in turn begin with
// 16-bit fields for optimum packing efficiency.
}; };
...@@ -409,9 +409,9 @@ class BreakableStatement : public Statement { ...@@ -409,9 +409,9 @@ class BreakableStatement : public Statement {
BreakableStatement(Zone* zone, ZoneList<const AstRawString*>* labels, BreakableStatement(Zone* zone, ZoneList<const AstRawString*>* labels,
BreakableType breakable_type, int position, NodeType type) BreakableType breakable_type, int position, NodeType type)
: Statement(zone, position, type), : Statement(zone, position, type),
labels_(labels),
breakable_type_(breakable_type), breakable_type_(breakable_type),
base_id_(BailoutId::None().ToInt()) { base_id_(BailoutId::None().ToInt()),
labels_(labels) {
DCHECK(labels == NULL || labels->length() > 0); DCHECK(labels == NULL || labels->length() > 0);
} }
static int parent_num_ids() { return 0; } static int parent_num_ids() { return 0; }
...@@ -424,10 +424,10 @@ class BreakableStatement : public Statement { ...@@ -424,10 +424,10 @@ class BreakableStatement : public Statement {
private: private:
int local_id(int n) const { return base_id() + parent_num_ids() + n; } int local_id(int n) const { return base_id() + parent_num_ids() + n; }
ZoneList<const AstRawString*>* labels_;
BreakableType breakable_type_; BreakableType breakable_type_;
Label break_target_;
int base_id_; int base_id_;
Label break_target_;
ZoneList<const AstRawString*>* labels_;
}; };
...@@ -938,10 +938,10 @@ class WithStatement final : public Statement { ...@@ -938,10 +938,10 @@ class WithStatement final : public Statement {
WithStatement(Zone* zone, Scope* scope, Expression* expression, WithStatement(Zone* zone, Scope* scope, Expression* expression,
Statement* statement, int pos) Statement* statement, int pos)
: Statement(zone, pos, kWithStatement), : Statement(zone, pos, kWithStatement),
base_id_(BailoutId::None().ToInt()),
scope_(scope), scope_(scope),
expression_(expression), expression_(expression),
statement_(statement), statement_(statement) {}
base_id_(BailoutId::None().ToInt()) {}
static int parent_num_ids() { return 0; } static int parent_num_ids() { return 0; }
int base_id() const { int base_id() const {
...@@ -952,10 +952,10 @@ class WithStatement final : public Statement { ...@@ -952,10 +952,10 @@ class WithStatement final : public Statement {
private: private:
int local_id(int n) const { return base_id() + parent_num_ids() + n; } int local_id(int n) const { return base_id() + parent_num_ids() + n; }
int base_id_;
Scope* scope_; Scope* scope_;
Expression* expression_; Expression* expression_;
Statement* statement_; Statement* statement_;
int base_id_;
}; };
...@@ -1056,10 +1056,10 @@ class IfStatement final : public Statement { ...@@ -1056,10 +1056,10 @@ class IfStatement final : public Statement {
IfStatement(Zone* zone, Expression* condition, Statement* then_statement, IfStatement(Zone* zone, Expression* condition, Statement* then_statement,
Statement* else_statement, int pos) Statement* else_statement, int pos)
: Statement(zone, pos, kIfStatement), : Statement(zone, pos, kIfStatement),
base_id_(BailoutId::None().ToInt()),
condition_(condition), condition_(condition),
then_statement_(then_statement), then_statement_(then_statement),
else_statement_(else_statement), else_statement_(else_statement) {}
base_id_(BailoutId::None().ToInt()) {}
static int parent_num_ids() { return 0; } static int parent_num_ids() { return 0; }
int base_id() const { int base_id() const {
...@@ -1070,10 +1070,10 @@ class IfStatement final : public Statement { ...@@ -1070,10 +1070,10 @@ class IfStatement final : public Statement {
private: private:
int local_id(int n) const { return base_id() + parent_num_ids() + n; } int local_id(int n) const { return base_id() + parent_num_ids() + n; }
int base_id_;
Expression* condition_; Expression* condition_;
Statement* then_statement_; Statement* then_statement_;
Statement* else_statement_; Statement* else_statement_;
int base_id_;
}; };
...@@ -1098,12 +1098,12 @@ class TryStatement : public Statement { ...@@ -1098,12 +1098,12 @@ class TryStatement : public Statement {
protected: protected:
TryStatement(Zone* zone, Block* try_block, int pos, NodeType type) TryStatement(Zone* zone, Block* try_block, int pos, NodeType type)
: Statement(zone, pos, type), : Statement(zone, pos, type),
try_block_(try_block), catch_predicted_(false),
catch_predicted_(false) {} try_block_(try_block) {}
private: private:
Block* try_block_;
bool catch_predicted_; bool catch_predicted_;
Block* try_block_;
}; };
...@@ -1133,16 +1133,16 @@ class TryCatchStatement final : public TryStatement { ...@@ -1133,16 +1133,16 @@ class TryCatchStatement final : public TryStatement {
Variable* variable, Block* catch_block, Variable* variable, Block* catch_block,
bool clear_pending_message, int pos) bool clear_pending_message, int pos)
: TryStatement(zone, try_block, pos, kTryCatchStatement), : TryStatement(zone, try_block, pos, kTryCatchStatement),
clear_pending_message_(clear_pending_message),
scope_(scope), scope_(scope),
variable_(variable), variable_(variable),
catch_block_(catch_block), catch_block_(catch_block) {}
clear_pending_message_(clear_pending_message) {}
private: private:
bool clear_pending_message_;
Scope* scope_; Scope* scope_;
Variable* variable_; Variable* variable_;
Block* catch_block_; Block* catch_block_;
bool clear_pending_message_;
}; };
...@@ -1282,9 +1282,9 @@ class MaterializedLiteral : public Expression { ...@@ -1282,9 +1282,9 @@ class MaterializedLiteral : public Expression {
protected: protected:
MaterializedLiteral(Zone* zone, int literal_index, int pos, NodeType type) MaterializedLiteral(Zone* zone, int literal_index, int pos, NodeType type)
: Expression(zone, pos, type), : Expression(zone, pos, type),
literal_index_(literal_index),
is_simple_(false), is_simple_(false),
depth_(0) {} depth_(0),
literal_index_(literal_index) {}
// A materialized literal is simple if the values consist of only // A materialized literal is simple if the values consist of only
// constants and simple object and array literals. // constants and simple object and array literals.
...@@ -1293,7 +1293,7 @@ class MaterializedLiteral : public Expression { ...@@ -1293,7 +1293,7 @@ class MaterializedLiteral : public Expression {
friend class CompileTimeValue; friend class CompileTimeValue;
void set_depth(int depth) { void set_depth(int depth) {
DCHECK(depth >= 1); DCHECK_LE(1, depth);
depth_ = depth; depth_ = depth;
} }
...@@ -1310,9 +1310,9 @@ class MaterializedLiteral : public Expression { ...@@ -1310,9 +1310,9 @@ class MaterializedLiteral : public Expression {
Handle<Object> GetBoilerplateValue(Expression* expression, Isolate* isolate); Handle<Object> GetBoilerplateValue(Expression* expression, Isolate* isolate);
private: private:
bool is_simple_ : 1;
int depth_ : 31;
int literal_index_; int literal_index_;
bool is_simple_;
int depth_;
friend class AstLiteralReindexer; friend class AstLiteralReindexer;
}; };
...@@ -1323,12 +1323,13 @@ class MaterializedLiteral : public Expression { ...@@ -1323,12 +1323,13 @@ class MaterializedLiteral : public Expression {
// to the code generator. // to the code generator.
class ObjectLiteralProperty final : public ZoneObject { class ObjectLiteralProperty final : public ZoneObject {
public: public:
enum Kind { enum Kind : uint8_t {
CONSTANT, // Property with constant value (compile time). CONSTANT, // Property with constant value (compile time).
COMPUTED, // Property with computed value (execution time). COMPUTED, // Property with computed value (execution time).
MATERIALIZED_LITERAL, // Property value is a materialized literal. MATERIALIZED_LITERAL, // Property value is a materialized literal.
GETTER, SETTER, // Property is an accessor function. GETTER,
PROTOTYPE // Property is __proto__. SETTER, // Property is an accessor function.
PROTOTYPE // Property is __proto__.
}; };
Expression* key() { return key_; } Expression* key() { return key_; }
...@@ -1463,24 +1464,24 @@ class ObjectLiteral final : public MaterializedLiteral { ...@@ -1463,24 +1464,24 @@ class ObjectLiteral final : public MaterializedLiteral {
protected: protected:
ObjectLiteral(Zone* zone, ZoneList<Property*>* properties, int literal_index, ObjectLiteral(Zone* zone, ZoneList<Property*>* properties, int literal_index,
int boilerplate_properties, int pos) uint32_t boilerplate_properties, int pos)
: MaterializedLiteral(zone, literal_index, pos, kObjectLiteral), : MaterializedLiteral(zone, literal_index, pos, kObjectLiteral),
properties_(properties),
boilerplate_properties_(boilerplate_properties), boilerplate_properties_(boilerplate_properties),
fast_elements_(false), fast_elements_(false),
has_elements_(false), has_elements_(false),
may_store_doubles_(false) {} may_store_doubles_(false),
properties_(properties) {}
static int parent_num_ids() { return MaterializedLiteral::num_ids(); } static int parent_num_ids() { return MaterializedLiteral::num_ids(); }
private: private:
int local_id(int n) const { return base_id() + parent_num_ids() + n; } int local_id(int n) const { return base_id() + parent_num_ids() + n; }
uint32_t boilerplate_properties_ : 29;
bool fast_elements_ : 1;
bool has_elements_ : 1;
bool may_store_doubles_ : 1;
FeedbackVectorSlot slot_;
Handle<FixedArray> constant_properties_; Handle<FixedArray> constant_properties_;
ZoneList<Property*>* properties_; ZoneList<Property*>* properties_;
int boilerplate_properties_;
bool fast_elements_;
bool has_elements_;
bool may_store_doubles_;
FeedbackVectorSlot slot_;
}; };
...@@ -1518,14 +1519,14 @@ class RegExpLiteral final : public MaterializedLiteral { ...@@ -1518,14 +1519,14 @@ class RegExpLiteral final : public MaterializedLiteral {
RegExpLiteral(Zone* zone, const AstRawString* pattern, int flags, RegExpLiteral(Zone* zone, const AstRawString* pattern, int flags,
int literal_index, int pos) int literal_index, int pos)
: MaterializedLiteral(zone, literal_index, pos, kRegExpLiteral), : MaterializedLiteral(zone, literal_index, pos, kRegExpLiteral),
pattern_(pattern), flags_(flags),
flags_(flags) { pattern_(pattern) {
set_depth(1); set_depth(1);
} }
private: private:
const AstRawString* const pattern_;
int const flags_; int const flags_;
const AstRawString* const pattern_;
}; };
...@@ -1592,17 +1593,17 @@ class ArrayLiteral final : public MaterializedLiteral { ...@@ -1592,17 +1593,17 @@ class ArrayLiteral final : public MaterializedLiteral {
ArrayLiteral(Zone* zone, ZoneList<Expression*>* values, ArrayLiteral(Zone* zone, ZoneList<Expression*>* values,
int first_spread_index, int literal_index, int pos) int first_spread_index, int literal_index, int pos)
: MaterializedLiteral(zone, literal_index, pos, kArrayLiteral), : MaterializedLiteral(zone, literal_index, pos, kArrayLiteral),
values_(values), first_spread_index_(first_spread_index),
first_spread_index_(first_spread_index) {} values_(values) {}
static int parent_num_ids() { return MaterializedLiteral::num_ids(); } static int parent_num_ids() { return MaterializedLiteral::num_ids(); }
private: private:
int local_id(int n) const { return base_id() + parent_num_ids() + n; } int local_id(int n) const { return base_id() + parent_num_ids() + n; }
Handle<FixedArray> constant_elements_;
ZoneList<Expression*>* values_;
int first_spread_index_; int first_spread_index_;
FeedbackVectorSlot literal_slot_; FeedbackVectorSlot literal_slot_;
Handle<FixedArray> constant_elements_;
ZoneList<Expression*>* values_;
}; };
...@@ -1683,15 +1684,15 @@ class VariableProxy final : public Expression { ...@@ -1683,15 +1684,15 @@ class VariableProxy final : public Expression {
// Start with 16-bit (or smaller) field, which should get packed together // Start with 16-bit (or smaller) field, which should get packed together
// with Expression's trailing 16-bit field. // with Expression's trailing 16-bit field.
uint8_t bit_field_; uint8_t bit_field_;
// Position is stored in the AstNode superclass, but VariableProxy needs to
// know its end position too (for error messages). It cannot be inferred from
// the variable name length because it can contain escapes.
int end_position_;
FeedbackVectorSlot variable_feedback_slot_; FeedbackVectorSlot variable_feedback_slot_;
union { union {
const AstRawString* raw_name_; // if !is_resolved_ const AstRawString* raw_name_; // if !is_resolved_
Variable* var_; // if is_resolved_ Variable* var_; // if is_resolved_
}; };
// Position is stored in the AstNode superclass, but VariableProxy needs to
// know its end position too (for error messages). It cannot be inferred from
// the variable name length because it can contain escapes.
int end_position_;
}; };
...@@ -1898,9 +1899,9 @@ class Call final : public Expression { ...@@ -1898,9 +1899,9 @@ class Call final : public Expression {
Call(Zone* zone, Expression* expression, ZoneList<Expression*>* arguments, Call(Zone* zone, Expression* expression, ZoneList<Expression*>* arguments,
int pos) int pos)
: Expression(zone, pos, kCall), : Expression(zone, pos, kCall),
bit_field_(IsUninitializedField::encode(false)),
expression_(expression), expression_(expression),
arguments_(arguments), arguments_(arguments) {
bit_field_(IsUninitializedField::encode(false)) {
if (expression->IsProperty()) { if (expression->IsProperty()) {
expression->AsProperty()->mark_for_call(); expression->AsProperty()->mark_for_call();
} }
...@@ -1910,15 +1911,15 @@ class Call final : public Expression { ...@@ -1910,15 +1911,15 @@ class Call final : public Expression {
private: private:
int local_id(int n) const { return base_id() + parent_num_ids() + n; } int local_id(int n) const { return base_id() + parent_num_ids() + n; }
class IsUninitializedField : public BitField8<bool, 0, 1> {};
class IsTailField : public BitField8<bool, 1, 1> {};
uint8_t bit_field_;
FeedbackVectorSlot ic_slot_; FeedbackVectorSlot ic_slot_;
FeedbackVectorSlot stub_slot_; FeedbackVectorSlot stub_slot_;
Expression* expression_; Expression* expression_;
ZoneList<Expression*>* arguments_; ZoneList<Expression*>* arguments_;
Handle<JSFunction> target_; Handle<JSFunction> target_;
Handle<AllocationSite> allocation_site_; Handle<AllocationSite> allocation_site_;
class IsUninitializedField : public BitField8<bool, 0, 1> {};
class IsTailField : public BitField8<bool, 1, 1> {};
uint8_t bit_field_;
}; };
...@@ -1969,21 +1970,21 @@ class CallNew final : public Expression { ...@@ -1969,21 +1970,21 @@ class CallNew final : public Expression {
CallNew(Zone* zone, Expression* expression, ZoneList<Expression*>* arguments, CallNew(Zone* zone, Expression* expression, ZoneList<Expression*>* arguments,
int pos) int pos)
: Expression(zone, pos, kCallNew), : Expression(zone, pos, kCallNew),
is_monomorphic_(false),
expression_(expression), expression_(expression),
arguments_(arguments), arguments_(arguments) {}
is_monomorphic_(false) {}
static int parent_num_ids() { return Expression::num_ids(); } static int parent_num_ids() { return Expression::num_ids(); }
private: private:
int local_id(int n) const { return base_id() + parent_num_ids() + n; } int local_id(int n) const { return base_id() + parent_num_ids() + n; }
bool is_monomorphic_;
FeedbackVectorSlot callnew_feedback_slot_;
Expression* expression_; Expression* expression_;
ZoneList<Expression*>* arguments_; ZoneList<Expression*>* arguments_;
bool is_monomorphic_;
Handle<JSFunction> target_; Handle<JSFunction> target_;
Handle<AllocationSite> allocation_site_; Handle<AllocationSite> allocation_site_;
FeedbackVectorSlot callnew_feedback_slot_;
}; };
...@@ -2024,8 +2025,8 @@ class CallRuntime final : public Expression { ...@@ -2024,8 +2025,8 @@ class CallRuntime final : public Expression {
CallRuntime(Zone* zone, int context_index, ZoneList<Expression*>* arguments, CallRuntime(Zone* zone, int context_index, ZoneList<Expression*>* arguments,
int pos) int pos)
: Expression(zone, pos, kCallRuntime), : Expression(zone, pos, kCallRuntime),
function_(NULL),
context_index_(context_index), context_index_(context_index),
function_(NULL),
arguments_(arguments) {} arguments_(arguments) {}
static int parent_num_ids() { return Expression::num_ids(); } static int parent_num_ids() { return Expression::num_ids(); }
...@@ -2033,8 +2034,8 @@ class CallRuntime final : public Expression { ...@@ -2033,8 +2034,8 @@ class CallRuntime final : public Expression {
private: private:
int local_id(int n) const { return base_id() + parent_num_ids() + n; } int local_id(int n) const { return base_id() + parent_num_ids() + n; }
const Runtime::Function* function_;
int context_index_; int context_index_;
const Runtime::Function* function_;
ZoneList<Expression*>* arguments_; ZoneList<Expression*>* arguments_;
}; };
...@@ -2208,10 +2209,10 @@ class CountOperation final : public Expression { ...@@ -2208,10 +2209,10 @@ class CountOperation final : public Expression {
// Starts with 16-bit field, which should get packed together with // Starts with 16-bit field, which should get packed together with
// Expression's trailing 16-bit field. // Expression's trailing 16-bit field.
uint16_t bit_field_; uint16_t bit_field_;
FeedbackVectorSlot slot_;
Type* type_; Type* type_;
Expression* expression_; Expression* expression_;
SmallMapList receiver_types_; SmallMapList receiver_types_;
FeedbackVectorSlot slot_;
}; };
...@@ -2276,15 +2277,15 @@ class Spread final : public Expression { ...@@ -2276,15 +2277,15 @@ class Spread final : public Expression {
protected: protected:
Spread(Zone* zone, Expression* expression, int pos, int expr_pos) Spread(Zone* zone, Expression* expression, int pos, int expr_pos)
: Expression(zone, pos, kSpread), : Expression(zone, pos, kSpread),
expression_(expression), expr_pos_(expr_pos),
expr_pos_(expr_pos) {} expression_(expression) {}
static int parent_num_ids() { return Expression::num_ids(); } static int parent_num_ids() { return Expression::num_ids(); }
private: private:
int local_id(int n) const { return base_id() + parent_num_ids() + n; } int local_id(int n) const { return base_id() + parent_num_ids() + n; }
Expression* expression_;
int expr_pos_; int expr_pos_;
Expression* expression_;
}; };
...@@ -2397,11 +2398,11 @@ class Assignment final : public Expression { ...@@ -2397,11 +2398,11 @@ class Assignment final : public Expression {
// Starts with 16-bit field, which should get packed together with // Starts with 16-bit field, which should get packed together with
// Expression's trailing 16-bit field. // Expression's trailing 16-bit field.
uint16_t bit_field_; uint16_t bit_field_;
FeedbackVectorSlot slot_;
Expression* target_; Expression* target_;
Expression* value_; Expression* value_;
BinaryOperation* binary_operation_; BinaryOperation* binary_operation_;
SmallMapList receiver_types_; SmallMapList receiver_types_;
FeedbackVectorSlot slot_;
}; };
...@@ -2476,16 +2477,16 @@ class Yield final : public Expression { ...@@ -2476,16 +2477,16 @@ class Yield final : public Expression {
Yield(Zone* zone, Expression* generator_object, Expression* expression, Yield(Zone* zone, Expression* generator_object, Expression* expression,
int pos, OnException on_exception) int pos, OnException on_exception)
: Expression(zone, pos, kYield), : Expression(zone, pos, kYield),
generator_object_(generator_object),
expression_(expression),
on_exception_(on_exception), on_exception_(on_exception),
yield_id_(-1) {} yield_id_(-1),
generator_object_(generator_object),
expression_(expression) {}
private: private:
Expression* generator_object_;
Expression* expression_;
OnException on_exception_; OnException on_exception_;
int yield_id_; int yield_id_;
Expression* generator_object_;
Expression* expression_;
}; };
...@@ -2648,17 +2649,17 @@ class FunctionLiteral final : public Expression { ...@@ -2648,17 +2649,17 @@ class FunctionLiteral final : public Expression {
EagerCompileHint eager_compile_hint, FunctionKind kind, EagerCompileHint eager_compile_hint, FunctionKind kind,
int position, bool is_function) int position, bool is_function)
: Expression(zone, position, kFunctionLiteral), : Expression(zone, position, kFunctionLiteral),
raw_name_(name),
scope_(scope),
body_(body),
raw_inferred_name_(ast_value_factory->empty_string()),
ast_properties_(zone),
dont_optimize_reason_(kNoReason), dont_optimize_reason_(kNoReason),
materialized_literal_count_(materialized_literal_count), materialized_literal_count_(materialized_literal_count),
expected_property_count_(expected_property_count), expected_property_count_(expected_property_count),
parameter_count_(parameter_count), parameter_count_(parameter_count),
function_token_position_(kNoSourcePosition), function_token_position_(kNoSourcePosition),
yield_count_(0) { yield_count_(0),
raw_name_(name),
scope_(scope),
body_(body),
raw_inferred_name_(ast_value_factory->empty_string()),
ast_properties_(zone) {
bitfield_ = bitfield_ =
FunctionTypeBits::encode(function_type) | Pretenure::encode(false) | FunctionTypeBits::encode(function_type) | Pretenure::encode(false) |
HasDuplicateParameters::encode(has_duplicate_parameters == HasDuplicateParameters::encode(has_duplicate_parameters ==
...@@ -2682,12 +2683,6 @@ class FunctionLiteral final : public Expression { ...@@ -2682,12 +2683,6 @@ class FunctionLiteral final : public Expression {
// with Expression's trailing 16-bit field. // with Expression's trailing 16-bit field.
uint16_t bitfield_; uint16_t bitfield_;
const AstString* raw_name_;
Scope* scope_;
ZoneList<Statement*>* body_;
const AstString* raw_inferred_name_;
Handle<String> inferred_name_;
AstProperties ast_properties_;
BailoutReason dont_optimize_reason_; BailoutReason dont_optimize_reason_;
int materialized_literal_count_; int materialized_literal_count_;
...@@ -2695,6 +2690,13 @@ class FunctionLiteral final : public Expression { ...@@ -2695,6 +2690,13 @@ class FunctionLiteral final : public Expression {
int parameter_count_; int parameter_count_;
int function_token_position_; int function_token_position_;
int yield_count_; int yield_count_;
const AstString* raw_name_;
Scope* scope_;
ZoneList<Statement*>* body_;
const AstString* raw_inferred_name_;
Handle<String> inferred_name_;
AstProperties ast_properties_;
}; };
...@@ -2750,26 +2752,26 @@ class ClassLiteral final : public Expression { ...@@ -2750,26 +2752,26 @@ class ClassLiteral final : public Expression {
ZoneList<Property*>* properties, int start_position, ZoneList<Property*>* properties, int start_position,
int end_position) int end_position)
: Expression(zone, start_position, kClassLiteral), : Expression(zone, start_position, kClassLiteral),
end_position_(end_position),
scope_(scope), scope_(scope),
class_variable_proxy_(class_variable_proxy), class_variable_proxy_(class_variable_proxy),
extends_(extends), extends_(extends),
constructor_(constructor), constructor_(constructor),
properties_(properties), properties_(properties) {}
end_position_(end_position) {}
static int parent_num_ids() { return Expression::num_ids(); } static int parent_num_ids() { return Expression::num_ids(); }
private: private:
int local_id(int n) const { return base_id() + parent_num_ids() + n; } int local_id(int n) const { return base_id() + parent_num_ids() + n; }
int end_position_;
FeedbackVectorSlot prototype_slot_;
FeedbackVectorSlot proxy_slot_;
Scope* scope_; Scope* scope_;
VariableProxy* class_variable_proxy_; VariableProxy* class_variable_proxy_;
Expression* extends_; Expression* extends_;
FunctionLiteral* constructor_; FunctionLiteral* constructor_;
ZoneList<Property*>* properties_; ZoneList<Property*>* properties_;
int end_position_;
FeedbackVectorSlot prototype_slot_;
FeedbackVectorSlot proxy_slot_;
}; };
...@@ -3232,10 +3234,8 @@ class AstNodeFactory final BASE_EMBEDDED { ...@@ -3232,10 +3234,8 @@ class AstNodeFactory final BASE_EMBEDDED {
} }
ObjectLiteral* NewObjectLiteral( ObjectLiteral* NewObjectLiteral(
ZoneList<ObjectLiteral::Property*>* properties, ZoneList<ObjectLiteral::Property*>* properties, int literal_index,
int literal_index, uint32_t boilerplate_properties, int pos) {
int boilerplate_properties,
int pos) {
return new (local_zone_) ObjectLiteral( return new (local_zone_) ObjectLiteral(
local_zone_, properties, literal_index, boilerplate_properties, pos); local_zone_, properties, literal_index, boilerplate_properties, pos);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment