Remove dead AST code in For and While statements
R=marja@chromium.org Review URL: https://codereview.chromium.org/717923003 Cr-Commit-Position: refs/heads/master@{#25310}
This commit is contained in:
parent
c93c8969d1
commit
d7f8ea2c68
32
src/ast.h
32
src/ast.h
@ -829,12 +829,6 @@ class WhileStatement FINAL : public IterationStatement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Expression* cond() const { return cond_; }
|
Expression* cond() const { return cond_; }
|
||||||
bool may_have_function_literal() const {
|
|
||||||
return may_have_function_literal_;
|
|
||||||
}
|
|
||||||
void set_may_have_function_literal(bool value) {
|
|
||||||
may_have_function_literal_ = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int num_ids() { return parent_num_ids() + 1; }
|
static int num_ids() { return parent_num_ids() + 1; }
|
||||||
virtual BailoutId ContinueId() const OVERRIDE { return EntryId(); }
|
virtual BailoutId ContinueId() const OVERRIDE { return EntryId(); }
|
||||||
@ -843,18 +837,13 @@ class WhileStatement FINAL : public IterationStatement {
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
WhileStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos)
|
WhileStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos)
|
||||||
: IterationStatement(zone, labels, pos),
|
: IterationStatement(zone, labels, pos), cond_(NULL) {}
|
||||||
cond_(NULL),
|
|
||||||
may_have_function_literal_(true) {}
|
|
||||||
static int parent_num_ids() { return IterationStatement::num_ids(); }
|
static int parent_num_ids() { return IterationStatement::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* cond_;
|
Expression* cond_;
|
||||||
|
|
||||||
// True if there is a function literal subexpression in the condition.
|
|
||||||
bool may_have_function_literal_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -876,13 +865,6 @@ class ForStatement FINAL : public IterationStatement {
|
|||||||
Expression* cond() const { return cond_; }
|
Expression* cond() const { return cond_; }
|
||||||
Statement* next() const { return next_; }
|
Statement* next() const { return next_; }
|
||||||
|
|
||||||
bool may_have_function_literal() const {
|
|
||||||
return may_have_function_literal_;
|
|
||||||
}
|
|
||||||
void set_may_have_function_literal(bool value) {
|
|
||||||
may_have_function_literal_ = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int num_ids() { return parent_num_ids() + 2; }
|
static int num_ids() { return parent_num_ids() + 2; }
|
||||||
virtual BailoutId ContinueId() const OVERRIDE {
|
virtual BailoutId ContinueId() const OVERRIDE {
|
||||||
return BailoutId(local_id(0));
|
return BailoutId(local_id(0));
|
||||||
@ -890,18 +872,12 @@ class ForStatement FINAL : public IterationStatement {
|
|||||||
virtual BailoutId StackCheckId() const OVERRIDE { return BodyId(); }
|
virtual BailoutId StackCheckId() const OVERRIDE { return BodyId(); }
|
||||||
BailoutId BodyId() const { return BailoutId(local_id(1)); }
|
BailoutId BodyId() const { return BailoutId(local_id(1)); }
|
||||||
|
|
||||||
bool is_fast_smi_loop() { return loop_variable_ != NULL; }
|
|
||||||
Variable* loop_variable() { return loop_variable_; }
|
|
||||||
void set_loop_variable(Variable* var) { loop_variable_ = var; }
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ForStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos)
|
ForStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos)
|
||||||
: IterationStatement(zone, labels, pos),
|
: IterationStatement(zone, labels, pos),
|
||||||
init_(NULL),
|
init_(NULL),
|
||||||
cond_(NULL),
|
cond_(NULL),
|
||||||
next_(NULL),
|
next_(NULL) {}
|
||||||
may_have_function_literal_(true),
|
|
||||||
loop_variable_(NULL) {}
|
|
||||||
static int parent_num_ids() { return IterationStatement::num_ids(); }
|
static int parent_num_ids() { return IterationStatement::num_ids(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -910,10 +886,6 @@ class ForStatement FINAL : public IterationStatement {
|
|||||||
Statement* init_;
|
Statement* init_;
|
||||||
Expression* cond_;
|
Expression* cond_;
|
||||||
Statement* next_;
|
Statement* next_;
|
||||||
|
|
||||||
// True if there is a function literal subexpression in the condition.
|
|
||||||
bool may_have_function_literal_;
|
|
||||||
Variable* loop_variable_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user