| OLD | NEW | 
|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. | 
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without | 
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are | 
| 4 // met: | 4 // met: | 
| 5 // | 5 // | 
| 6 //     * Redistributions of source code must retain the above copyright | 6 //     * Redistributions of source code must retain the above copyright | 
| 7 //       notice, this list of conditions and the following disclaimer. | 7 //       notice, this list of conditions and the following disclaimer. | 
| 8 //     * Redistributions in binary form must reproduce the above | 8 //     * Redistributions in binary form must reproduce the above | 
| 9 //       copyright notice, this list of conditions and the following | 9 //       copyright notice, this list of conditions and the following | 
| 10 //       disclaimer in the documentation and/or other materials provided | 10 //       disclaimer in the documentation and/or other materials provided | 
| (...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 758  public: | 758  public: | 
| 759   DECLARE_NODE_TYPE(DoWhileStatement) | 759   DECLARE_NODE_TYPE(DoWhileStatement) | 
| 760 | 760 | 
| 761   void Initialize(Expression* cond, Statement* body) { | 761   void Initialize(Expression* cond, Statement* body) { | 
| 762     IterationStatement::Initialize(body); | 762     IterationStatement::Initialize(body); | 
| 763     cond_ = cond; | 763     cond_ = cond; | 
| 764   } | 764   } | 
| 765 | 765 | 
| 766   Expression* cond() const { return cond_; } | 766   Expression* cond() const { return cond_; } | 
| 767 | 767 | 
| 768   // TODO(rossberg): get rid of this. |  | 
| 769   // Position where condition expression starts. We need it to make |  | 
| 770   // the loop's condition a breakable location. |  | 
| 771   int condition_position() { return condition_position_; } |  | 
| 772   void set_condition_position(int pos) { condition_position_ = pos; } |  | 
| 773 |  | 
| 774   virtual BailoutId ContinueId() const V8_OVERRIDE { return continue_id_; } | 768   virtual BailoutId ContinueId() const V8_OVERRIDE { return continue_id_; } | 
| 775   virtual BailoutId StackCheckId() const V8_OVERRIDE { return back_edge_id_; } | 769   virtual BailoutId StackCheckId() const V8_OVERRIDE { return back_edge_id_; } | 
| 776   BailoutId BackEdgeId() const { return back_edge_id_; } | 770   BailoutId BackEdgeId() const { return back_edge_id_; } | 
| 777 | 771 | 
| 778  protected: | 772  protected: | 
| 779   DoWhileStatement(Isolate* isolate, ZoneStringList* labels, int pos) | 773   DoWhileStatement(Isolate* isolate, ZoneStringList* labels, int pos) | 
| 780       : IterationStatement(isolate, labels, pos), | 774       : IterationStatement(isolate, labels, pos), | 
| 781         cond_(NULL), | 775         cond_(NULL), | 
| 782         condition_position_(-1), |  | 
| 783         continue_id_(GetNextId(isolate)), | 776         continue_id_(GetNextId(isolate)), | 
| 784         back_edge_id_(GetNextId(isolate)) { | 777         back_edge_id_(GetNextId(isolate)) { | 
| 785   } | 778   } | 
| 786 | 779 | 
| 787  private: | 780  private: | 
| 788   Expression* cond_; | 781   Expression* cond_; | 
| 789 | 782 | 
| 790   int condition_position_; |  | 
| 791 |  | 
| 792   const BailoutId continue_id_; | 783   const BailoutId continue_id_; | 
| 793   const BailoutId back_edge_id_; | 784   const BailoutId back_edge_id_; | 
| 794 }; | 785 }; | 
| 795 | 786 | 
| 796 | 787 | 
| 797 class WhileStatement V8_FINAL : public IterationStatement { | 788 class WhileStatement V8_FINAL : public IterationStatement { | 
| 798  public: | 789  public: | 
| 799   DECLARE_NODE_TYPE(WhileStatement) | 790   DECLARE_NODE_TYPE(WhileStatement) | 
| 800 | 791 | 
| 801   void Initialize(Expression* cond, Statement* body) { | 792   void Initialize(Expression* cond, Statement* body) { | 
| (...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2054 | 2045 | 
| 2055 | 2046 | 
| 2056 class Conditional V8_FINAL : public Expression { | 2047 class Conditional V8_FINAL : public Expression { | 
| 2057  public: | 2048  public: | 
| 2058   DECLARE_NODE_TYPE(Conditional) | 2049   DECLARE_NODE_TYPE(Conditional) | 
| 2059 | 2050 | 
| 2060   Expression* condition() const { return condition_; } | 2051   Expression* condition() const { return condition_; } | 
| 2061   Expression* then_expression() const { return then_expression_; } | 2052   Expression* then_expression() const { return then_expression_; } | 
| 2062   Expression* else_expression() const { return else_expression_; } | 2053   Expression* else_expression() const { return else_expression_; } | 
| 2063 | 2054 | 
| 2064   // TODO(rossberg): get rid of this. |  | 
| 2065   int then_expression_position() const { return then_expression_position_; } |  | 
| 2066   int else_expression_position() const { return else_expression_position_; } |  | 
| 2067 |  | 
| 2068   BailoutId ThenId() const { return then_id_; } | 2055   BailoutId ThenId() const { return then_id_; } | 
| 2069   BailoutId ElseId() const { return else_id_; } | 2056   BailoutId ElseId() const { return else_id_; } | 
| 2070 | 2057 | 
| 2071  protected: | 2058  protected: | 
| 2072   Conditional(Isolate* isolate, | 2059   Conditional(Isolate* isolate, | 
| 2073               Expression* condition, | 2060               Expression* condition, | 
| 2074               Expression* then_expression, | 2061               Expression* then_expression, | 
| 2075               Expression* else_expression, | 2062               Expression* else_expression, | 
| 2076               int then_expression_position, |  | 
| 2077               int else_expression_position, |  | 
| 2078               int position) | 2063               int position) | 
| 2079       : Expression(isolate, position), | 2064       : Expression(isolate, position), | 
| 2080         condition_(condition), | 2065         condition_(condition), | 
| 2081         then_expression_(then_expression), | 2066         then_expression_(then_expression), | 
| 2082         else_expression_(else_expression), | 2067         else_expression_(else_expression), | 
| 2083         then_expression_position_(then_expression_position), |  | 
| 2084         else_expression_position_(else_expression_position), |  | 
| 2085         then_id_(GetNextId(isolate)), | 2068         then_id_(GetNextId(isolate)), | 
| 2086         else_id_(GetNextId(isolate)) { } | 2069         else_id_(GetNextId(isolate)) { } | 
| 2087 | 2070 | 
| 2088  private: | 2071  private: | 
| 2089   Expression* condition_; | 2072   Expression* condition_; | 
| 2090   Expression* then_expression_; | 2073   Expression* then_expression_; | 
| 2091   Expression* else_expression_; | 2074   Expression* else_expression_; | 
| 2092   int then_expression_position_; |  | 
| 2093   int else_expression_position_; |  | 
| 2094   const BailoutId then_id_; | 2075   const BailoutId then_id_; | 
| 2095   const BailoutId else_id_; | 2076   const BailoutId else_id_; | 
| 2096 }; | 2077 }; | 
| 2097 | 2078 | 
| 2098 | 2079 | 
| 2099 class Assignment V8_FINAL : public Expression { | 2080 class Assignment V8_FINAL : public Expression { | 
| 2100  public: | 2081  public: | 
| 2101   DECLARE_NODE_TYPE(Assignment) | 2082   DECLARE_NODE_TYPE(Assignment) | 
| 2102 | 2083 | 
| 2103   Assignment* AsSimpleAssignment() { return !is_compound() ? this : NULL; } | 2084   Assignment* AsSimpleAssignment() { return !is_compound() ? this : NULL; } | 
| (...skipping 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 3191                                         Expression* right, | 3172                                         Expression* right, | 
| 3192                                         int pos) { | 3173                                         int pos) { | 
| 3193     CompareOperation* node = | 3174     CompareOperation* node = | 
| 3194         new(zone_) CompareOperation(isolate_, op, left, right, pos); | 3175         new(zone_) CompareOperation(isolate_, op, left, right, pos); | 
| 3195     VISIT_AND_RETURN(CompareOperation, node) | 3176     VISIT_AND_RETURN(CompareOperation, node) | 
| 3196   } | 3177   } | 
| 3197 | 3178 | 
| 3198   Conditional* NewConditional(Expression* condition, | 3179   Conditional* NewConditional(Expression* condition, | 
| 3199                               Expression* then_expression, | 3180                               Expression* then_expression, | 
| 3200                               Expression* else_expression, | 3181                               Expression* else_expression, | 
| 3201                               int then_expression_position, |  | 
| 3202                               int else_expression_position, |  | 
| 3203                               int position) { | 3182                               int position) { | 
| 3204     Conditional* cond = new(zone_) Conditional( | 3183     Conditional* cond = new(zone_) Conditional( | 
| 3205         isolate_, condition, then_expression, else_expression, | 3184         isolate_, condition, then_expression, else_expression, position); | 
| 3206         then_expression_position, else_expression_position, position); |  | 
| 3207     VISIT_AND_RETURN(Conditional, cond) | 3185     VISIT_AND_RETURN(Conditional, cond) | 
| 3208   } | 3186   } | 
| 3209 | 3187 | 
| 3210   Assignment* NewAssignment(Token::Value op, | 3188   Assignment* NewAssignment(Token::Value op, | 
| 3211                             Expression* target, | 3189                             Expression* target, | 
| 3212                             Expression* value, | 3190                             Expression* value, | 
| 3213                             int pos) { | 3191                             int pos) { | 
| 3214     Assignment* assign = | 3192     Assignment* assign = | 
| 3215         new(zone_) Assignment(isolate_, op, target, value, pos); | 3193         new(zone_) Assignment(isolate_, op, target, value, pos); | 
| 3216     assign->Init(isolate_, this); | 3194     assign->Init(isolate_, this); | 
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 3275  private: | 3253  private: | 
| 3276   Isolate* isolate_; | 3254   Isolate* isolate_; | 
| 3277   Zone* zone_; | 3255   Zone* zone_; | 
| 3278   Visitor visitor_; | 3256   Visitor visitor_; | 
| 3279 }; | 3257 }; | 
| 3280 | 3258 | 
| 3281 | 3259 | 
| 3282 } }  // namespace v8::internal | 3260 } }  // namespace v8::internal | 
| 3283 | 3261 | 
| 3284 #endif  // V8_AST_H_ | 3262 #endif  // V8_AST_H_ | 
| OLD | NEW | 
|---|