Squeeze the layout of expression nodes a bit.

Again 112MB less peak memory usage in the bug mentioned below. :-)
Routed all writes to to_boolean_types_ through its setter on the way.

BUG=417697
LOG=y
R=mvstanton@chromium.org

Review URL: https://codereview.chromium.org/615423006

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24393 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 8d283edd
......@@ -560,7 +560,7 @@ bool FunctionDeclaration::IsInlineable() const {
// once we use the common type field in the AST consistently.
void Expression::RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle) {
to_boolean_types_ = oracle->ToBooleanTypes(test_id());
set_to_boolean_types(oracle->ToBooleanTypes(test_id()));
}
......
......@@ -363,9 +363,12 @@ class Expression : public AstNode {
void set_bounds(Bounds bounds) { bounds_ = bounds; }
// Whether the expression is parenthesized
unsigned parenthesization_level() const { return parenthesization_level_; }
bool is_parenthesized() const { return parenthesization_level_ > 0; }
void increase_parenthesization_level() { ++parenthesization_level_; }
bool is_parenthesized() const { return is_parenthesized_; }
bool is_multi_parenthesized() const { return is_multi_parenthesized_; }
void increase_parenthesization_level() {
is_multi_parenthesized_ = is_parenthesized_;
is_parenthesized_ = true;
}
// Type feedback information for assignments and properties.
virtual bool IsMonomorphic() {
......@@ -391,16 +394,18 @@ class Expression : public AstNode {
protected:
Expression(Zone* zone, int pos, IdGen* id_gen)
: AstNode(pos),
is_parenthesized_(false),
is_multi_parenthesized_(false),
bounds_(Bounds::Unbounded(zone)),
parenthesization_level_(0),
id_(id_gen->GetNextId()),
test_id_(id_gen->GetNextId()) {}
void set_to_boolean_types(byte types) { to_boolean_types_ = types; }
private:
Bounds bounds_;
byte to_boolean_types_;
unsigned parenthesization_level_;
bool is_parenthesized_ : 1;
bool is_multi_parenthesized_ : 1;
Bounds bounds_;
const BailoutId id_;
const TypeFeedbackId test_id_;
......
......@@ -3381,7 +3381,7 @@ bool CheckAndDeclareArrowParameter(ParserTraits* traits, Expression* expression,
// Too many parentheses around expression:
// (( ... )) => ...
if (expression->parenthesization_level() > 1) return false;
if (expression->is_multi_parenthesized()) return false;
// Case for a single parameter:
// (foo) => ...
......
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