Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_AST_H_ | 5 #ifndef V8_AST_H_ |
| 6 #define V8_AST_H_ | 6 #define V8_AST_H_ |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/assembler.h" | 10 #include "src/assembler.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 85 V(Yield) \ | 85 V(Yield) \ |
| 86 V(Throw) \ | 86 V(Throw) \ |
| 87 V(Property) \ | 87 V(Property) \ |
| 88 V(Call) \ | 88 V(Call) \ |
| 89 V(CallNew) \ | 89 V(CallNew) \ |
| 90 V(CallRuntime) \ | 90 V(CallRuntime) \ |
| 91 V(UnaryOperation) \ | 91 V(UnaryOperation) \ |
| 92 V(CountOperation) \ | 92 V(CountOperation) \ |
| 93 V(BinaryOperation) \ | 93 V(BinaryOperation) \ |
| 94 V(CompareOperation) \ | 94 V(CompareOperation) \ |
| 95 V(SpreadOperation) \ | |
|
arv (Not doing code reviews)
2015/03/10 13:44:02
Maybe just Spread?
| |
| 95 V(ThisFunction) \ | 96 V(ThisFunction) \ |
| 96 V(SuperReference) \ | 97 V(SuperReference) \ |
| 97 V(CaseClause) | 98 V(CaseClause) |
| 98 | 99 |
| 99 #define AST_NODE_LIST(V) \ | 100 #define AST_NODE_LIST(V) \ |
| 100 DECLARATION_NODE_LIST(V) \ | 101 DECLARATION_NODE_LIST(V) \ |
| 101 MODULE_NODE_LIST(V) \ | 102 MODULE_NODE_LIST(V) \ |
| 102 STATEMENT_NODE_LIST(V) \ | 103 STATEMENT_NODE_LIST(V) \ |
| 103 EXPRESSION_NODE_LIST(V) | 104 EXPRESSION_NODE_LIST(V) |
| 104 | 105 |
| (...skipping 2112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2217 int local_id(int n) const { return base_id() + parent_num_ids() + n; } | 2218 int local_id(int n) const { return base_id() + parent_num_ids() + n; } |
| 2218 | 2219 |
| 2219 Token::Value op_; | 2220 Token::Value op_; |
| 2220 Expression* left_; | 2221 Expression* left_; |
| 2221 Expression* right_; | 2222 Expression* right_; |
| 2222 | 2223 |
| 2223 Type* combined_type_; | 2224 Type* combined_type_; |
| 2224 }; | 2225 }; |
| 2225 | 2226 |
| 2226 | 2227 |
| 2228 class SpreadOperation FINAL : public Expression { | |
| 2229 public: | |
| 2230 DECLARE_NODE_TYPE(SpreadOperation) | |
| 2231 | |
| 2232 Expression* expression() const { return expression_; } | |
| 2233 static int num_ids() { return parent_num_ids() + 1; } | |
| 2234 | |
| 2235 protected: | |
| 2236 SpreadOperation(Zone* zone, Expression* expression, int pos) | |
| 2237 : Expression(zone, pos), expression_(expression) {} | |
| 2238 static int parent_num_ids() { return Expression::num_ids(); } | |
| 2239 | |
| 2240 private: | |
| 2241 int local_id(int n) const { return base_id() + parent_num_ids() + n; } | |
| 2242 Expression* expression_; | |
| 2243 }; | |
| 2244 | |
| 2245 | |
| 2227 class Conditional FINAL : public Expression { | 2246 class Conditional FINAL : public Expression { |
| 2228 public: | 2247 public: |
| 2229 DECLARE_NODE_TYPE(Conditional) | 2248 DECLARE_NODE_TYPE(Conditional) |
| 2230 | 2249 |
| 2231 Expression* condition() const { return condition_; } | 2250 Expression* condition() const { return condition_; } |
| 2232 Expression* then_expression() const { return then_expression_; } | 2251 Expression* then_expression() const { return then_expression_; } |
| 2233 Expression* else_expression() const { return else_expression_; } | 2252 Expression* else_expression() const { return else_expression_; } |
| 2234 | 2253 |
| 2235 static int num_ids() { return parent_num_ids() + 2; } | 2254 static int num_ids() { return parent_num_ids() + 2; } |
| 2236 BailoutId ThenId() const { return BailoutId(local_id(0)); } | 2255 BailoutId ThenId() const { return BailoutId(local_id(0)); } |
| (...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3425 return new (zone_) CountOperation(zone_, op, is_prefix, expr, pos); | 3444 return new (zone_) CountOperation(zone_, op, is_prefix, expr, pos); |
| 3426 } | 3445 } |
| 3427 | 3446 |
| 3428 CompareOperation* NewCompareOperation(Token::Value op, | 3447 CompareOperation* NewCompareOperation(Token::Value op, |
| 3429 Expression* left, | 3448 Expression* left, |
| 3430 Expression* right, | 3449 Expression* right, |
| 3431 int pos) { | 3450 int pos) { |
| 3432 return new (zone_) CompareOperation(zone_, op, left, right, pos); | 3451 return new (zone_) CompareOperation(zone_, op, left, right, pos); |
| 3433 } | 3452 } |
| 3434 | 3453 |
| 3454 SpreadOperation* NewSpreadOperation(Expression* expression, int pos) { | |
| 3455 return new (zone_) SpreadOperation(zone_, expression, pos); | |
| 3456 } | |
| 3457 | |
| 3435 Conditional* NewConditional(Expression* condition, | 3458 Conditional* NewConditional(Expression* condition, |
| 3436 Expression* then_expression, | 3459 Expression* then_expression, |
| 3437 Expression* else_expression, | 3460 Expression* else_expression, |
| 3438 int position) { | 3461 int position) { |
| 3439 return new (zone_) Conditional(zone_, condition, then_expression, | 3462 return new (zone_) Conditional(zone_, condition, then_expression, |
| 3440 else_expression, position); | 3463 else_expression, position); |
| 3441 } | 3464 } |
| 3442 | 3465 |
| 3443 Assignment* NewAssignment(Token::Value op, | 3466 Assignment* NewAssignment(Token::Value op, |
| 3444 Expression* target, | 3467 Expression* target, |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3509 | 3532 |
| 3510 private: | 3533 private: |
| 3511 Zone* zone_; | 3534 Zone* zone_; |
| 3512 AstValueFactory* ast_value_factory_; | 3535 AstValueFactory* ast_value_factory_; |
| 3513 }; | 3536 }; |
| 3514 | 3537 |
| 3515 | 3538 |
| 3516 } } // namespace v8::internal | 3539 } } // namespace v8::internal |
| 3517 | 3540 |
| 3518 #endif // V8_AST_H_ | 3541 #endif // V8_AST_H_ |
| OLD | NEW |