Scope* scope,
ZoneList<Statement*>* body,
int materialized_literal_count,
- bool contains_array_literal,
int expected_property_count,
bool has_only_this_property_assignments,
bool has_only_simple_this_property_assignments,
scope_(scope),
body_(body),
materialized_literal_count_(materialized_literal_count),
- contains_array_literal_(contains_array_literal),
expected_property_count_(expected_property_count),
has_only_this_property_assignments_(has_only_this_property_assignments),
has_only_simple_this_property_assignments_(
bool is_expression() const { return is_expression_; }
int materialized_literal_count() { return materialized_literal_count_; }
- bool contains_array_literal() { return contains_array_literal_; }
int expected_property_count() { return expected_property_count_; }
bool has_only_this_property_assignments() {
return has_only_this_property_assignments_;
Scope* scope_;
ZoneList<Statement*>* body_;
int materialized_literal_count_;
- bool contains_array_literal_;
int expected_property_count_;
bool has_only_this_property_assignments_;
bool has_only_simple_this_property_assignments_;
}
int materialized_literal_count() { return materialized_literal_count_; }
- void set_contains_array_literal() { contains_array_literal_ = true; }
- bool contains_array_literal() { return contains_array_literal_; }
-
void SetThisPropertyAssignmentInfo(
bool only_this_property_assignments,
bool only_simple_this_property_assignments,
void AddProperty() { expected_property_count_++; }
int expected_property_count() { return expected_property_count_; }
private:
- // Captures the number of nodes that need materialization in the
- // function. regexp literals, and boilerplate for object literals.
+ // Captures the number of literals that need materialization in the
+ // function. Includes regexp literals, and boilerplate for object
+ // and array literals.
int materialized_literal_count_;
- // Captures whether or not the function contains array literals. If
- // the function contains array literals, we have to allocate space
- // for the array constructor in the literals array of the function.
- // This array constructor is used when creating the actual array
- // literals.
- bool contains_array_literal_;
-
// Properties count estimation.
int expected_property_count_;
TemporaryScope::TemporaryScope(Parser* parser)
: materialized_literal_count_(0),
- contains_array_literal_(false),
expected_property_count_(0),
only_this_property_assignments_(false),
only_simple_this_property_assignments_(false),
top_scope_,
body.elements(),
temp_scope.materialized_literal_count(),
- temp_scope.contains_array_literal(),
temp_scope.expected_property_count(),
temp_scope.only_this_property_assignments(),
temp_scope.only_simple_this_property_assignments(),
const int literals = fun->NumberOfLiterals();
Handle<Code> code = Handle<Code>(fun->shared()->code());
Handle<JSFunction> boilerplate =
- Factory::NewFunctionBoilerplate(name, literals, false, code);
+ Factory::NewFunctionBoilerplate(name, literals, code);
// Copy the function data to the boilerplate. Used by
// builtins.cc:HandleApiCall to perform argument type checks and to
Expect(Token::RBRACK, CHECK_OK);
// Update the scope information before the pre-parsing bailout.
- temp_scope_->set_contains_array_literal();
int literal_index = temp_scope_->NextMaterializedLiteralIndex();
if (is_pre_parsing_) return NULL;
int materialized_literal_count;
int expected_property_count;
- bool contains_array_literal;
bool only_this_property_assignments;
bool only_simple_this_property_assignments;
Handle<FixedArray> this_property_assignments;
only_this_property_assignments = false;
only_simple_this_property_assignments = false;
this_property_assignments = Factory::empty_fixed_array();
- contains_array_literal = entry.contains_array_literal();
} else {
ParseSourceElements(&body, Token::RBRACE, CHECK_OK);
materialized_literal_count = temp_scope.materialized_literal_count();
expected_property_count = temp_scope.expected_property_count();
- contains_array_literal = temp_scope.contains_array_literal();
only_this_property_assignments =
temp_scope.only_this_property_assignments();
only_simple_this_property_assignments =
entry.set_end_pos(end_pos);
entry.set_literal_count(materialized_literal_count);
entry.set_property_count(expected_property_count);
- entry.set_contains_array_literal(contains_array_literal);
}
FunctionLiteral* function_literal =
top_scope_,
body.elements(),
materialized_literal_count,
- contains_array_literal,
expected_property_count,
only_this_property_assignments,
only_simple_this_property_assignments,