| Index: src/ast.h
|
| ===================================================================
|
| --- src/ast.h (revision 6904)
|
| +++ src/ast.h (working copy)
|
| @@ -438,7 +438,6 @@
|
| virtual IterationStatement* AsIterationStatement() { return this; }
|
|
|
| Statement* body() const { return body_; }
|
| - void set_body(Statement* stmt) { body_ = stmt; }
|
|
|
| // Bailout support.
|
| int OsrEntryId() const { return osr_entry_id_; }
|
| @@ -480,12 +479,14 @@
|
| void set_condition_position(int pos) { condition_position_ = pos; }
|
|
|
| // Bailout support.
|
| - virtual int ContinueId() const { return next_id_; }
|
| + virtual int ContinueId() const { return continue_id_; }
|
| + int BackEdgeId() const { return back_edge_id_; }
|
|
|
| private:
|
| Expression* cond_;
|
| int condition_position_;
|
| - int next_id_;
|
| + int continue_id_;
|
| + int back_edge_id_;
|
| };
|
|
|
|
|
| @@ -510,11 +511,13 @@
|
|
|
| // Bailout support.
|
| virtual int ContinueId() const { return EntryId(); }
|
| + int BodyId() const { return body_id_; }
|
|
|
| private:
|
| Expression* cond_;
|
| // True if there is a function literal subexpression in the condition.
|
| bool may_have_function_literal_;
|
| + int body_id_;
|
| };
|
|
|
|
|
| @@ -535,11 +538,8 @@
|
| }
|
|
|
| Statement* init() const { return init_; }
|
| - void set_init(Statement* stmt) { init_ = stmt; }
|
| Expression* cond() const { return cond_; }
|
| - void set_cond(Expression* expr) { cond_ = expr; }
|
| Statement* next() const { return next_; }
|
| - void set_next(Statement* stmt) { next_ = stmt; }
|
|
|
| bool may_have_function_literal() const {
|
| return may_have_function_literal_;
|
| @@ -549,7 +549,8 @@
|
| }
|
|
|
| // Bailout support.
|
| - virtual int ContinueId() const { return next_id_; }
|
| + virtual int ContinueId() const { return continue_id_; }
|
| + int BodyId() const { return body_id_; }
|
|
|
| bool is_fast_smi_loop() { return loop_variable_ != NULL; }
|
| Variable* loop_variable() { return loop_variable_; }
|
| @@ -562,7 +563,8 @@
|
| // True if there is a function literal subexpression in the condition.
|
| bool may_have_function_literal_;
|
| Variable* loop_variable_;
|
| - int next_id_;
|
| + int continue_id_;
|
| + int body_id_;
|
| };
|
|
|
|
|
| @@ -582,11 +584,13 @@
|
| Expression* enumerable() const { return enumerable_; }
|
|
|
| // Bailout support.
|
| + int AssignmentId() const { return assignment_id_; }
|
| virtual int ContinueId() const { return EntryId(); }
|
|
|
| private:
|
| Expression* each_;
|
| Expression* enumerable_;
|
| + int assignment_id_;
|
| };
|
|
|
|
|
| @@ -740,7 +744,10 @@
|
| Statement* else_statement)
|
| : condition_(condition),
|
| then_statement_(then_statement),
|
| - else_statement_(else_statement) { }
|
| + else_statement_(else_statement),
|
| + then_id_(GetNextId()),
|
| + else_id_(GetNextId()) {
|
| + }
|
|
|
| DECLARE_NODE_TYPE(IfStatement)
|
|
|
| @@ -751,14 +758,17 @@
|
|
|
| Expression* condition() const { return condition_; }
|
| Statement* then_statement() const { return then_statement_; }
|
| - void set_then_statement(Statement* stmt) { then_statement_ = stmt; }
|
| Statement* else_statement() const { return else_statement_; }
|
| - void set_else_statement(Statement* stmt) { else_statement_ = stmt; }
|
|
|
| + int ThenId() const { return then_id_; }
|
| + int ElseId() const { return else_id_; }
|
| +
|
| private:
|
| Expression* condition_;
|
| Statement* then_statement_;
|
| Statement* else_statement_;
|
| + int then_id_;
|
| + int else_id_;
|
| };
|
|
|
|
|
| @@ -1405,6 +1415,9 @@
|
| int pos)
|
| : op_(op), left_(left), right_(right), pos_(pos), is_smi_only_(false) {
|
| ASSERT(Token::IsBinaryOp(op));
|
| + right_id_ = (op == Token::AND || op == Token::OR)
|
| + ? GetNextId()
|
| + : AstNode::kNoNumber;
|
| }
|
|
|
| // Create the binary operation corresponding to a compound assignment.
|
| @@ -1425,12 +1438,18 @@
|
| void RecordTypeFeedback(TypeFeedbackOracle* oracle);
|
| bool IsSmiOnly() const { return is_smi_only_; }
|
|
|
| + // Bailout support.
|
| + int RightId() const { return right_id_; }
|
| +
|
| private:
|
| Token::Value op_;
|
| Expression* left_;
|
| Expression* right_;
|
| int pos_;
|
| bool is_smi_only_;
|
| + // The short-circuit logical operations have an AST ID for their
|
| + // right-hand subexpression.
|
| + int right_id_;
|
| };
|
|
|
|
|
| @@ -1457,7 +1476,9 @@
|
| class CountOperation: public Expression {
|
| public:
|
| CountOperation(bool is_prefix, IncrementOperation* increment, int pos)
|
| - : is_prefix_(is_prefix), increment_(increment), pos_(pos) { }
|
| + : is_prefix_(is_prefix), increment_(increment), pos_(pos),
|
| + assignment_id_(GetNextId()) {
|
| + }
|
|
|
| DECLARE_NODE_TYPE(CountOperation)
|
|
|
| @@ -1477,10 +1498,14 @@
|
|
|
| virtual bool IsInlineable() const;
|
|
|
| + // Bailout support.
|
| + int AssignmentId() const { return assignment_id_; }
|
| +
|
| private:
|
| bool is_prefix_;
|
| IncrementOperation* increment_;
|
| int pos_;
|
| + int assignment_id_;
|
| };
|
|
|
|
|
| @@ -1549,7 +1574,10 @@
|
| then_expression_(then_expression),
|
| else_expression_(else_expression),
|
| then_expression_position_(then_expression_position),
|
| - else_expression_position_(else_expression_position) { }
|
| + else_expression_position_(else_expression_position),
|
| + then_id_(GetNextId()),
|
| + else_id_(GetNextId()) {
|
| + }
|
|
|
| DECLARE_NODE_TYPE(Conditional)
|
|
|
| @@ -1559,15 +1587,20 @@
|
| Expression* then_expression() const { return then_expression_; }
|
| Expression* else_expression() const { return else_expression_; }
|
|
|
| - int then_expression_position() { return then_expression_position_; }
|
| - int else_expression_position() { return else_expression_position_; }
|
| + int then_expression_position() const { return then_expression_position_; }
|
| + int else_expression_position() const { return else_expression_position_; }
|
|
|
| + int ThenId() const { return then_id_; }
|
| + int ElseId() const { return else_id_; }
|
| +
|
| private:
|
| Expression* condition_;
|
| Expression* then_expression_;
|
| Expression* else_expression_;
|
| int then_expression_position_;
|
| int else_expression_position_;
|
| + int then_id_;
|
| + int else_id_;
|
| };
|
|
|
|
|
| @@ -1610,7 +1643,8 @@
|
| }
|
|
|
| // Bailout support.
|
| - int compound_bailout_id() const { return compound_bailout_id_; }
|
| + int CompoundLoadId() const { return compound_load_id_; }
|
| + int AssignmentId() const { return assignment_id_; }
|
|
|
| private:
|
| Token::Value op_;
|
| @@ -1618,7 +1652,8 @@
|
| Expression* value_;
|
| int pos_;
|
| BinaryOperation* binary_operation_;
|
| - int compound_bailout_id_;
|
| + int compound_load_id_;
|
| + int assignment_id_;
|
|
|
| bool block_start_;
|
| bool block_end_;
|
|
|