Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Side by Side Diff: runtime/vm/ast.h

Issue 2974233002: VM: Re-format to use at most one newline between functions (Closed)
Patch Set: Rebase and merge Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/assert_test.cc ('k') | runtime/vm/ast.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef RUNTIME_VM_AST_H_ 5 #ifndef RUNTIME_VM_AST_H_
6 #define RUNTIME_VM_AST_H_ 6 #define RUNTIME_VM_AST_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/allocation.h" 9 #include "vm/allocation.h"
10 #include "vm/growable_array.h" 10 #include "vm/growable_array.h"
11 #include "vm/native_entry.h"
12 #include "vm/object.h"
11 #include "vm/scopes.h" 13 #include "vm/scopes.h"
12 #include "vm/object.h"
13 #include "vm/native_entry.h"
14 #include "vm/token.h" 14 #include "vm/token.h"
15 #include "vm/token_position.h" 15 #include "vm/token_position.h"
16 16
17 namespace dart { 17 namespace dart {
18 18
19 #define FOR_EACH_NODE(V) \ 19 #define FOR_EACH_NODE(V) \
20 V(Await) \ 20 V(Await) \
21 V(AwaitMarker) \ 21 V(AwaitMarker) \
22 V(Return) \ 22 V(Return) \
23 V(Literal) \ 23 V(Literal) \
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 V(LoadIndexed) \ 59 V(LoadIndexed) \
60 V(StoreIndexed) \ 60 V(StoreIndexed) \
61 V(Sequence) \ 61 V(Sequence) \
62 V(Let) \ 62 V(Let) \
63 V(CatchClause) \ 63 V(CatchClause) \
64 V(TryCatch) \ 64 V(TryCatch) \
65 V(Throw) \ 65 V(Throw) \
66 V(InlinedFinally) \ 66 V(InlinedFinally) \
67 V(StringInterpolate) 67 V(StringInterpolate)
68 68
69
70 #define FORWARD_DECLARATION(BaseName) class BaseName##Node; 69 #define FORWARD_DECLARATION(BaseName) class BaseName##Node;
71 FOR_EACH_NODE(FORWARD_DECLARATION) 70 FOR_EACH_NODE(FORWARD_DECLARATION)
72 #undef FORWARD_DECLARATION 71 #undef FORWARD_DECLARATION
73 72
74
75 // Abstract class to implement an AST node visitor. An example is AstPrinter. 73 // Abstract class to implement an AST node visitor. An example is AstPrinter.
76 class AstNodeVisitor : public ValueObject { 74 class AstNodeVisitor : public ValueObject {
77 public: 75 public:
78 AstNodeVisitor() {} 76 AstNodeVisitor() {}
79 virtual ~AstNodeVisitor() {} 77 virtual ~AstNodeVisitor() {}
80 78
81 #define DEFINE_VISITOR_FUNCTION(BaseName) \ 79 #define DEFINE_VISITOR_FUNCTION(BaseName) \
82 virtual void Visit##BaseName##Node(BaseName##Node* node) {} 80 virtual void Visit##BaseName##Node(BaseName##Node* node) {}
83 81
84 FOR_EACH_NODE(DEFINE_VISITOR_FUNCTION) 82 FOR_EACH_NODE(DEFINE_VISITOR_FUNCTION)
85 #undef DEFINE_VISITOR_FUNCTION 83 #undef DEFINE_VISITOR_FUNCTION
86 84
87 private: 85 private:
88 DISALLOW_COPY_AND_ASSIGN(AstNodeVisitor); 86 DISALLOW_COPY_AND_ASSIGN(AstNodeVisitor);
89 }; 87 };
90 88
91
92 #define DECLARE_COMMON_NODE_FUNCTIONS(type) \ 89 #define DECLARE_COMMON_NODE_FUNCTIONS(type) \
93 virtual void Visit(AstNodeVisitor* visitor); \ 90 virtual void Visit(AstNodeVisitor* visitor); \
94 virtual const char* Name() const; \ 91 virtual const char* Name() const; \
95 virtual type* As##type() { return this; } 92 virtual type* As##type() { return this; }
96 93
97
98 class AstNode : public ZoneAllocated { 94 class AstNode : public ZoneAllocated {
99 public: 95 public:
100 explicit AstNode(TokenPosition token_pos) : token_pos_(token_pos) { 96 explicit AstNode(TokenPosition token_pos) : token_pos_(token_pos) {
101 ASSERT(!token_pos_.IsClassifying() || 97 ASSERT(!token_pos_.IsClassifying() ||
102 (token_pos_ == TokenPosition::kMethodExtractor)); 98 (token_pos_ == TokenPosition::kMethodExtractor));
103 } 99 }
104 virtual ~AstNode() {} 100 virtual ~AstNode() {}
105 101
106 TokenPosition token_pos() const { return token_pos_; } 102 TokenPosition token_pos() const { return token_pos_; }
107 103
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 static const Field* MayCloneField(const Field& value); 147 static const Field* MayCloneField(const Field& value);
152 148
153 protected: 149 protected:
154 friend class ParsedFunction; 150 friend class ParsedFunction;
155 151
156 private: 152 private:
157 const TokenPosition token_pos_; 153 const TokenPosition token_pos_;
158 DISALLOW_COPY_AND_ASSIGN(AstNode); 154 DISALLOW_COPY_AND_ASSIGN(AstNode);
159 }; 155 };
160 156
161
162 class AwaitNode : public AstNode { 157 class AwaitNode : public AstNode {
163 public: 158 public:
164 AwaitNode(TokenPosition token_pos, 159 AwaitNode(TokenPosition token_pos,
165 AstNode* expr, 160 AstNode* expr,
166 LocalVariable* saved_try_ctx, 161 LocalVariable* saved_try_ctx,
167 LocalVariable* async_saved_try_ctx, 162 LocalVariable* async_saved_try_ctx,
168 LocalVariable* outer_saved_try_ctx, 163 LocalVariable* outer_saved_try_ctx,
169 LocalVariable* outer_async_saved_try_ctx, 164 LocalVariable* outer_async_saved_try_ctx,
170 LocalScope* scope) 165 LocalScope* scope)
171 : AstNode(token_pos), 166 : AstNode(token_pos),
(...skipping 21 matching lines...) Expand all
193 AstNode* expr_; 188 AstNode* expr_;
194 LocalVariable* saved_try_ctx_; 189 LocalVariable* saved_try_ctx_;
195 LocalVariable* async_saved_try_ctx_; 190 LocalVariable* async_saved_try_ctx_;
196 LocalVariable* outer_saved_try_ctx_; 191 LocalVariable* outer_saved_try_ctx_;
197 LocalVariable* outer_async_saved_try_ctx_; 192 LocalVariable* outer_async_saved_try_ctx_;
198 LocalScope* scope_; 193 LocalScope* scope_;
199 194
200 DISALLOW_COPY_AND_ASSIGN(AwaitNode); 195 DISALLOW_COPY_AND_ASSIGN(AwaitNode);
201 }; 196 };
202 197
203
204 // AwaitMarker nodes are used to generate markers that the FlowGraphBuilder 198 // AwaitMarker nodes are used to generate markers that the FlowGraphBuilder
205 // relies on. A marker indicates that a new await state needs to be 199 // relies on. A marker indicates that a new await state needs to be
206 // added to a function preamble. This type also triggers storing of the 200 // added to a function preamble. This type also triggers storing of the
207 // current context. 201 // current context.
208 // 202 //
209 // It is expected (ASSERT) that an AwaitMarker is followed by 203 // It is expected (ASSERT) that an AwaitMarker is followed by
210 // a return node of kind kContinuationTarget. That is: 204 // a return node of kind kContinuationTarget. That is:
211 // <AwaitMarker> -> <other nodes> -> <kContinuationTarget> -> <other nodes> -> 205 // <AwaitMarker> -> <other nodes> -> <kContinuationTarget> -> <other nodes> ->
212 // <AwaitMarker> -> ... 206 // <AwaitMarker> -> ...
213 class AwaitMarkerNode : public AstNode { 207 class AwaitMarkerNode : public AstNode {
(...skipping 16 matching lines...) Expand all
230 224
231 DECLARE_COMMON_NODE_FUNCTIONS(AwaitMarkerNode); 225 DECLARE_COMMON_NODE_FUNCTIONS(AwaitMarkerNode);
232 226
233 private: 227 private:
234 LocalScope* async_scope_; 228 LocalScope* async_scope_;
235 LocalScope* await_scope_; 229 LocalScope* await_scope_;
236 230
237 DISALLOW_COPY_AND_ASSIGN(AwaitMarkerNode); 231 DISALLOW_COPY_AND_ASSIGN(AwaitMarkerNode);
238 }; 232 };
239 233
240
241 class SequenceNode : public AstNode { 234 class SequenceNode : public AstNode {
242 public: 235 public:
243 SequenceNode(TokenPosition token_pos, LocalScope* scope) 236 SequenceNode(TokenPosition token_pos, LocalScope* scope)
244 : AstNode(token_pos), scope_(scope), nodes_(4), label_(NULL) {} 237 : AstNode(token_pos), scope_(scope), nodes_(4), label_(NULL) {}
245 238
246 LocalScope* scope() const { return scope_; } 239 LocalScope* scope() const { return scope_; }
247 240
248 SourceLabel* label() const { return label_; } 241 SourceLabel* label() const { return label_; }
249 void set_label(SourceLabel* value) { label_ = value; } 242 void set_label(SourceLabel* value) { label_ = value; }
250 243
(...skipping 10 matching lines...) Expand all
261 void CollectAllNodes(GrowableArray<AstNode*>* nodes); 254 void CollectAllNodes(GrowableArray<AstNode*>* nodes);
262 255
263 private: 256 private:
264 LocalScope* scope_; 257 LocalScope* scope_;
265 GrowableArray<AstNode*> nodes_; 258 GrowableArray<AstNode*> nodes_;
266 SourceLabel* label_; 259 SourceLabel* label_;
267 260
268 DISALLOW_COPY_AND_ASSIGN(SequenceNode); 261 DISALLOW_COPY_AND_ASSIGN(SequenceNode);
269 }; 262 };
270 263
271
272 class CloneContextNode : public AstNode { 264 class CloneContextNode : public AstNode {
273 public: 265 public:
274 explicit CloneContextNode(TokenPosition token_pos) : AstNode(token_pos) {} 266 explicit CloneContextNode(TokenPosition token_pos) : AstNode(token_pos) {}
275 267
276 virtual void VisitChildren(AstNodeVisitor* visitor) const {} 268 virtual void VisitChildren(AstNodeVisitor* visitor) const {}
277 269
278 DECLARE_COMMON_NODE_FUNCTIONS(CloneContextNode); 270 DECLARE_COMMON_NODE_FUNCTIONS(CloneContextNode);
279 271
280 private: 272 private:
281 DISALLOW_COPY_AND_ASSIGN(CloneContextNode); 273 DISALLOW_COPY_AND_ASSIGN(CloneContextNode);
282 }; 274 };
283 275
284
285 class ArgumentListNode : public AstNode { 276 class ArgumentListNode : public AstNode {
286 public: 277 public:
287 explicit ArgumentListNode(TokenPosition token_pos) 278 explicit ArgumentListNode(TokenPosition token_pos)
288 : AstNode(token_pos), 279 : AstNode(token_pos),
289 type_args_var_(NULL), 280 type_args_var_(NULL),
290 type_arguments_(TypeArguments::ZoneHandle()), 281 type_arguments_(TypeArguments::ZoneHandle()),
291 type_args_len_(0), 282 type_args_len_(0),
292 nodes_(4), 283 nodes_(4),
293 names_(Array::ZoneHandle()) {} 284 names_(Array::ZoneHandle()) {}
294 285
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 // At most one of type_args_var_ and type_arguments_ can be set, not both. 328 // At most one of type_args_var_ and type_arguments_ can be set, not both.
338 LocalVariable* type_args_var_; 329 LocalVariable* type_args_var_;
339 const TypeArguments& type_arguments_; 330 const TypeArguments& type_arguments_;
340 intptr_t type_args_len_; 331 intptr_t type_args_len_;
341 GrowableArray<AstNode*> nodes_; 332 GrowableArray<AstNode*> nodes_;
342 Array& names_; 333 Array& names_;
343 334
344 DISALLOW_COPY_AND_ASSIGN(ArgumentListNode); 335 DISALLOW_COPY_AND_ASSIGN(ArgumentListNode);
345 }; 336 };
346 337
347
348 class LetNode : public AstNode { 338 class LetNode : public AstNode {
349 public: 339 public:
350 explicit LetNode(TokenPosition token_pos); 340 explicit LetNode(TokenPosition token_pos);
351 341
352 LocalVariable* TempAt(intptr_t i) const { return vars_[i]; } 342 LocalVariable* TempAt(intptr_t i) const { return vars_[i]; }
353 AstNode* InitializerAt(intptr_t i) const { return initializers_[i]; } 343 AstNode* InitializerAt(intptr_t i) const { return initializers_[i]; }
354 344
355 virtual bool IsPotentiallyConst() const; 345 virtual bool IsPotentiallyConst() const;
356 virtual const Instance* EvalConstExpr() const; 346 virtual const Instance* EvalConstExpr() const;
357 347
(...skipping 10 matching lines...) Expand all
368 DECLARE_COMMON_NODE_FUNCTIONS(LetNode); 358 DECLARE_COMMON_NODE_FUNCTIONS(LetNode);
369 359
370 private: 360 private:
371 GrowableArray<LocalVariable*> vars_; 361 GrowableArray<LocalVariable*> vars_;
372 GrowableArray<AstNode*> initializers_; 362 GrowableArray<AstNode*> initializers_;
373 GrowableArray<AstNode*> nodes_; 363 GrowableArray<AstNode*> nodes_;
374 364
375 DISALLOW_COPY_AND_ASSIGN(LetNode); 365 DISALLOW_COPY_AND_ASSIGN(LetNode);
376 }; 366 };
377 367
378
379 class ArrayNode : public AstNode { 368 class ArrayNode : public AstNode {
380 public: 369 public:
381 ArrayNode(TokenPosition token_pos, const AbstractType& type) 370 ArrayNode(TokenPosition token_pos, const AbstractType& type)
382 : AstNode(token_pos), type_(type), elements_() { 371 : AstNode(token_pos), type_(type), elements_() {
383 CheckFields(); 372 CheckFields();
384 } 373 }
385 ArrayNode(TokenPosition token_pos, 374 ArrayNode(TokenPosition token_pos,
386 const AbstractType& type, 375 const AbstractType& type,
387 const GrowableArray<AstNode*>& elements) 376 const GrowableArray<AstNode*>& elements)
388 : AstNode(token_pos), type_(type), elements_(elements.length()) { 377 : AstNode(token_pos), type_(type), elements_(elements.length()) {
(...skipping 26 matching lines...) Expand all
415 ASSERT(!type_.IsNull()); 404 ASSERT(!type_.IsNull());
416 ASSERT(type_.IsFinalized()); 405 ASSERT(type_.IsFinalized());
417 // Type may be uninstantiated when creating a generic list literal. 406 // Type may be uninstantiated when creating a generic list literal.
418 ASSERT((type_.arguments() == TypeArguments::null()) || 407 ASSERT((type_.arguments() == TypeArguments::null()) ||
419 ((TypeArguments::Handle(type_.arguments()).Length() == 1))); 408 ((TypeArguments::Handle(type_.arguments()).Length() == 1)));
420 } 409 }
421 410
422 DISALLOW_IMPLICIT_CONSTRUCTORS(ArrayNode); 411 DISALLOW_IMPLICIT_CONSTRUCTORS(ArrayNode);
423 }; 412 };
424 413
425
426 class StringInterpolateNode : public AstNode { 414 class StringInterpolateNode : public AstNode {
427 public: 415 public:
428 StringInterpolateNode(TokenPosition token_pos, ArrayNode* value) 416 StringInterpolateNode(TokenPosition token_pos, ArrayNode* value)
429 : AstNode(token_pos), value_(value) {} 417 : AstNode(token_pos), value_(value) {}
430 418
431 virtual void VisitChildren(AstNodeVisitor* visitor) const { 419 virtual void VisitChildren(AstNodeVisitor* visitor) const {
432 value_->Visit(visitor); 420 value_->Visit(visitor);
433 } 421 }
434 422
435 ArrayNode* value() const { return value_; } 423 ArrayNode* value() const { return value_; }
436 424
437 virtual bool IsPotentiallyConst() const; 425 virtual bool IsPotentiallyConst() const;
438 426
439 DECLARE_COMMON_NODE_FUNCTIONS(StringInterpolateNode); 427 DECLARE_COMMON_NODE_FUNCTIONS(StringInterpolateNode);
440 428
441 private: 429 private:
442 ArrayNode* value_; 430 ArrayNode* value_;
443 431
444 DISALLOW_IMPLICIT_CONSTRUCTORS(StringInterpolateNode); 432 DISALLOW_IMPLICIT_CONSTRUCTORS(StringInterpolateNode);
445 }; 433 };
446 434
447
448 class LiteralNode : public AstNode { 435 class LiteralNode : public AstNode {
449 public: 436 public:
450 LiteralNode(TokenPosition token_pos, const Instance& literal) 437 LiteralNode(TokenPosition token_pos, const Instance& literal)
451 : AstNode(token_pos), literal_(literal) { 438 : AstNode(token_pos), literal_(literal) {
452 ASSERT(literal_.IsNotTemporaryScopedHandle()); 439 ASSERT(literal_.IsNotTemporaryScopedHandle());
453 ASSERT(literal_.IsSmi() || literal_.IsOld()); 440 ASSERT(literal_.IsSmi() || literal_.IsOld());
454 #if defined(DEBUG) 441 #if defined(DEBUG)
455 if (literal_.IsString()) { 442 if (literal_.IsString()) {
456 ASSERT(String::Cast(literal_).IsSymbol()); 443 ASSERT(String::Cast(literal_).IsSymbol());
457 } 444 }
(...skipping 13 matching lines...) Expand all
471 virtual AstNode* ApplyUnaryOp(Token::Kind unary_op_kind); 458 virtual AstNode* ApplyUnaryOp(Token::Kind unary_op_kind);
472 459
473 DECLARE_COMMON_NODE_FUNCTIONS(LiteralNode); 460 DECLARE_COMMON_NODE_FUNCTIONS(LiteralNode);
474 461
475 private: 462 private:
476 const Instance& literal_; 463 const Instance& literal_;
477 464
478 DISALLOW_IMPLICIT_CONSTRUCTORS(LiteralNode); 465 DISALLOW_IMPLICIT_CONSTRUCTORS(LiteralNode);
479 }; 466 };
480 467
481
482 class TypeNode : public AstNode { 468 class TypeNode : public AstNode {
483 public: 469 public:
484 TypeNode(TokenPosition token_pos, 470 TypeNode(TokenPosition token_pos,
485 const AbstractType& type, 471 const AbstractType& type,
486 bool is_deferred_reference = false) 472 bool is_deferred_reference = false)
487 : AstNode(token_pos), 473 : AstNode(token_pos),
488 type_(type), 474 type_(type),
489 is_deferred_reference_(is_deferred_reference) { 475 is_deferred_reference_(is_deferred_reference) {
490 ASSERT(type_.IsZoneHandle()); 476 ASSERT(type_.IsZoneHandle());
491 ASSERT(!type_.IsNull()); 477 ASSERT(!type_.IsNull());
(...skipping 21 matching lines...) Expand all
513 499
514 DECLARE_COMMON_NODE_FUNCTIONS(TypeNode); 500 DECLARE_COMMON_NODE_FUNCTIONS(TypeNode);
515 501
516 private: 502 private:
517 const AbstractType& type_; 503 const AbstractType& type_;
518 bool is_deferred_reference_; 504 bool is_deferred_reference_;
519 505
520 DISALLOW_IMPLICIT_CONSTRUCTORS(TypeNode); 506 DISALLOW_IMPLICIT_CONSTRUCTORS(TypeNode);
521 }; 507 };
522 508
523
524 class AssignableNode : public AstNode { 509 class AssignableNode : public AstNode {
525 public: 510 public:
526 AssignableNode(TokenPosition token_pos, 511 AssignableNode(TokenPosition token_pos,
527 AstNode* expr, 512 AstNode* expr,
528 const AbstractType& type, 513 const AbstractType& type,
529 const String& dst_name) 514 const String& dst_name)
530 : AstNode(token_pos), expr_(expr), type_(type), dst_name_(dst_name) { 515 : AstNode(token_pos), expr_(expr), type_(type), dst_name_(dst_name) {
531 ASSERT(expr_ != NULL); 516 ASSERT(expr_ != NULL);
532 ASSERT(type_.IsZoneHandle()); 517 ASSERT(type_.IsZoneHandle());
533 ASSERT(!type_.IsNull()); 518 ASSERT(!type_.IsNull());
(...skipping 12 matching lines...) Expand all
546 DECLARE_COMMON_NODE_FUNCTIONS(AssignableNode); 531 DECLARE_COMMON_NODE_FUNCTIONS(AssignableNode);
547 532
548 private: 533 private:
549 AstNode* expr_; 534 AstNode* expr_;
550 const AbstractType& type_; 535 const AbstractType& type_;
551 const String& dst_name_; 536 const String& dst_name_;
552 537
553 DISALLOW_IMPLICIT_CONSTRUCTORS(AssignableNode); 538 DISALLOW_IMPLICIT_CONSTRUCTORS(AssignableNode);
554 }; 539 };
555 540
556
557 class ClosureNode : public AstNode { 541 class ClosureNode : public AstNode {
558 public: 542 public:
559 ClosureNode(TokenPosition token_pos, 543 ClosureNode(TokenPosition token_pos,
560 const Function& function, 544 const Function& function,
561 AstNode* receiver, // Non-null for implicit instance closures. 545 AstNode* receiver, // Non-null for implicit instance closures.
562 LocalScope* scope) // Null for implicit closures or functions 546 LocalScope* scope) // Null for implicit closures or functions
563 // that already have a ContextScope because 547 // that already have a ContextScope because
564 // they were compiled before. 548 // they were compiled before.
565 : AstNode(token_pos), 549 : AstNode(token_pos),
566 function_(function), 550 function_(function),
(...skipping 28 matching lines...) Expand all
595 579
596 private: 580 private:
597 const Function& function_; 581 const Function& function_;
598 AstNode* receiver_; 582 AstNode* receiver_;
599 LocalScope* scope_; 583 LocalScope* scope_;
600 bool is_deferred_reference_; 584 bool is_deferred_reference_;
601 585
602 DISALLOW_IMPLICIT_CONSTRUCTORS(ClosureNode); 586 DISALLOW_IMPLICIT_CONSTRUCTORS(ClosureNode);
603 }; 587 };
604 588
605
606 // Primary nodes hold identifiers or values (library, class or function) 589 // Primary nodes hold identifiers or values (library, class or function)
607 // resolved from an identifier. Primary nodes should not ever make it to the 590 // resolved from an identifier. Primary nodes should not ever make it to the
608 // code generation phase as they will be transformed into the correct call or 591 // code generation phase as they will be transformed into the correct call or
609 // field access nodes. 592 // field access nodes.
610 class PrimaryNode : public AstNode { 593 class PrimaryNode : public AstNode {
611 public: 594 public:
612 PrimaryNode(TokenPosition token_pos, const Object& primary) 595 PrimaryNode(TokenPosition token_pos, const Object& primary)
613 : AstNode(token_pos), primary_(primary), prefix_(NULL) { 596 : AstNode(token_pos), primary_(primary), prefix_(NULL) {
614 ASSERT(primary_.IsNotTemporaryScopedHandle()); 597 ASSERT(primary_.IsNotTemporaryScopedHandle());
615 } 598 }
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 678
696 private: 679 private:
697 AstNode* value_; 680 AstNode* value_;
698 GrowableArray<InlinedFinallyNode*> inlined_finally_list_; 681 GrowableArray<InlinedFinallyNode*> inlined_finally_list_;
699 LocalScope* scope_; 682 LocalScope* scope_;
700 ReturnType return_type_; 683 ReturnType return_type_;
701 684
702 DISALLOW_COPY_AND_ASSIGN(ReturnNode); 685 DISALLOW_COPY_AND_ASSIGN(ReturnNode);
703 }; 686 };
704 687
705
706 class ComparisonNode : public AstNode { 688 class ComparisonNode : public AstNode {
707 public: 689 public:
708 ComparisonNode(TokenPosition token_pos, 690 ComparisonNode(TokenPosition token_pos,
709 Token::Kind kind, 691 Token::Kind kind,
710 AstNode* left, 692 AstNode* left,
711 AstNode* right) 693 AstNode* right)
712 : AstNode(token_pos), kind_(kind), left_(left), right_(right) { 694 : AstNode(token_pos), kind_(kind), left_(left), right_(right) {
713 ASSERT(left_ != NULL); 695 ASSERT(left_ != NULL);
714 ASSERT(right_ != NULL); 696 ASSERT(right_ != NULL);
715 ASSERT(IsKindValid()); 697 ASSERT(IsKindValid());
(...skipping 17 matching lines...) Expand all
733 private: 715 private:
734 const Token::Kind kind_; 716 const Token::Kind kind_;
735 AstNode* left_; 717 AstNode* left_;
736 AstNode* right_; 718 AstNode* right_;
737 719
738 bool IsKindValid() const; 720 bool IsKindValid() const;
739 721
740 DISALLOW_IMPLICIT_CONSTRUCTORS(ComparisonNode); 722 DISALLOW_IMPLICIT_CONSTRUCTORS(ComparisonNode);
741 }; 723 };
742 724
743
744 class BinaryOpNode : public AstNode { 725 class BinaryOpNode : public AstNode {
745 public: 726 public:
746 BinaryOpNode(TokenPosition token_pos, 727 BinaryOpNode(TokenPosition token_pos,
747 Token::Kind kind, 728 Token::Kind kind,
748 AstNode* left, 729 AstNode* left,
749 AstNode* right) 730 AstNode* right)
750 : AstNode(token_pos), kind_(kind), left_(left), right_(right) { 731 : AstNode(token_pos), kind_(kind), left_(left), right_(right) {
751 ASSERT(left_ != NULL); 732 ASSERT(left_ != NULL);
752 ASSERT(right_ != NULL); 733 ASSERT(right_ != NULL);
753 ASSERT(IsKindValid()); 734 ASSERT(IsKindValid());
(...skipping 23 matching lines...) Expand all
777 private: 758 private:
778 const Token::Kind kind_; 759 const Token::Kind kind_;
779 AstNode* left_; 760 AstNode* left_;
780 AstNode* right_; 761 AstNode* right_;
781 762
782 bool IsKindValid() const; 763 bool IsKindValid() const;
783 764
784 DISALLOW_IMPLICIT_CONSTRUCTORS(BinaryOpNode); 765 DISALLOW_IMPLICIT_CONSTRUCTORS(BinaryOpNode);
785 }; 766 };
786 767
787
788 class UnaryOpNode : public AstNode { 768 class UnaryOpNode : public AstNode {
789 public: 769 public:
790 // Returns optimized version, e.g., for ('-' '1') ('-1') literal is returned. 770 // Returns optimized version, e.g., for ('-' '1') ('-1') literal is returned.
791 static AstNode* UnaryOpOrLiteral(TokenPosition token_pos, 771 static AstNode* UnaryOpOrLiteral(TokenPosition token_pos,
792 Token::Kind kind, 772 Token::Kind kind,
793 AstNode* operand); 773 AstNode* operand);
794 UnaryOpNode(TokenPosition token_pos, Token::Kind kind, AstNode* operand) 774 UnaryOpNode(TokenPosition token_pos, Token::Kind kind, AstNode* operand)
795 : AstNode(token_pos), kind_(kind), operand_(operand) { 775 : AstNode(token_pos), kind_(kind), operand_(operand) {
796 ASSERT(operand_ != NULL); 776 ASSERT(operand_ != NULL);
797 ASSERT(IsKindValid()); 777 ASSERT(IsKindValid());
(...skipping 14 matching lines...) Expand all
812 792
813 private: 793 private:
814 const Token::Kind kind_; 794 const Token::Kind kind_;
815 AstNode* operand_; 795 AstNode* operand_;
816 796
817 bool IsKindValid() const; 797 bool IsKindValid() const;
818 798
819 DISALLOW_IMPLICIT_CONSTRUCTORS(UnaryOpNode); 799 DISALLOW_IMPLICIT_CONSTRUCTORS(UnaryOpNode);
820 }; 800 };
821 801
822
823 class ConditionalExprNode : public AstNode { 802 class ConditionalExprNode : public AstNode {
824 public: 803 public:
825 ConditionalExprNode(TokenPosition token_pos, 804 ConditionalExprNode(TokenPosition token_pos,
826 AstNode* condition, 805 AstNode* condition,
827 AstNode* true_expr, 806 AstNode* true_expr,
828 AstNode* false_expr) 807 AstNode* false_expr)
829 : AstNode(token_pos), 808 : AstNode(token_pos),
830 condition_(condition), 809 condition_(condition),
831 true_expr_(true_expr), 810 true_expr_(true_expr),
832 false_expr_(false_expr) { 811 false_expr_(false_expr) {
(...skipping 27 matching lines...) Expand all
860 DECLARE_COMMON_NODE_FUNCTIONS(ConditionalExprNode); 839 DECLARE_COMMON_NODE_FUNCTIONS(ConditionalExprNode);
861 840
862 private: 841 private:
863 AstNode* condition_; 842 AstNode* condition_;
864 AstNode* true_expr_; 843 AstNode* true_expr_;
865 AstNode* false_expr_; 844 AstNode* false_expr_;
866 845
867 DISALLOW_IMPLICIT_CONSTRUCTORS(ConditionalExprNode); 846 DISALLOW_IMPLICIT_CONSTRUCTORS(ConditionalExprNode);
868 }; 847 };
869 848
870
871 class IfNode : public AstNode { 849 class IfNode : public AstNode {
872 public: 850 public:
873 IfNode(TokenPosition token_pos, 851 IfNode(TokenPosition token_pos,
874 AstNode* condition, 852 AstNode* condition,
875 SequenceNode* true_branch, 853 SequenceNode* true_branch,
876 SequenceNode* false_branch) 854 SequenceNode* false_branch)
877 : AstNode(token_pos), 855 : AstNode(token_pos),
878 condition_(condition), 856 condition_(condition),
879 true_branch_(true_branch), 857 true_branch_(true_branch),
880 false_branch_(false_branch) { 858 false_branch_(false_branch) {
(...skipping 15 matching lines...) Expand all
896 DECLARE_COMMON_NODE_FUNCTIONS(IfNode); 874 DECLARE_COMMON_NODE_FUNCTIONS(IfNode);
897 875
898 private: 876 private:
899 AstNode* condition_; 877 AstNode* condition_;
900 SequenceNode* true_branch_; 878 SequenceNode* true_branch_;
901 SequenceNode* false_branch_; 879 SequenceNode* false_branch_;
902 880
903 DISALLOW_IMPLICIT_CONSTRUCTORS(IfNode); 881 DISALLOW_IMPLICIT_CONSTRUCTORS(IfNode);
904 }; 882 };
905 883
906
907 class CaseNode : public AstNode { 884 class CaseNode : public AstNode {
908 public: 885 public:
909 CaseNode(TokenPosition token_pos, 886 CaseNode(TokenPosition token_pos,
910 SourceLabel* label, 887 SourceLabel* label,
911 SequenceNode* case_expressions, 888 SequenceNode* case_expressions,
912 bool contains_default, 889 bool contains_default,
913 LocalVariable* switch_expr_value, 890 LocalVariable* switch_expr_value,
914 SequenceNode* statements) 891 SequenceNode* statements)
915 : AstNode(token_pos), 892 : AstNode(token_pos),
916 label_(label), 893 label_(label),
(...skipping 23 matching lines...) Expand all
940 private: 917 private:
941 SourceLabel* label_; 918 SourceLabel* label_;
942 SequenceNode* case_expressions_; 919 SequenceNode* case_expressions_;
943 bool contains_default_; 920 bool contains_default_;
944 LocalVariable* switch_expr_value_; 921 LocalVariable* switch_expr_value_;
945 SequenceNode* statements_; 922 SequenceNode* statements_;
946 923
947 DISALLOW_IMPLICIT_CONSTRUCTORS(CaseNode); 924 DISALLOW_IMPLICIT_CONSTRUCTORS(CaseNode);
948 }; 925 };
949 926
950
951 class SwitchNode : public AstNode { 927 class SwitchNode : public AstNode {
952 public: 928 public:
953 SwitchNode(TokenPosition token_pos, SourceLabel* label, SequenceNode* body) 929 SwitchNode(TokenPosition token_pos, SourceLabel* label, SequenceNode* body)
954 : AstNode(token_pos), label_(label), body_(body) { 930 : AstNode(token_pos), label_(label), body_(body) {
955 ASSERT(label_ != NULL); 931 ASSERT(label_ != NULL);
956 ASSERT(body_ != NULL); 932 ASSERT(body_ != NULL);
957 } 933 }
958 934
959 SourceLabel* label() const { return label_; } 935 SourceLabel* label() const { return label_; }
960 SequenceNode* body() const { return body_; } 936 SequenceNode* body() const { return body_; }
961 937
962 virtual void VisitChildren(AstNodeVisitor* visitor) const { 938 virtual void VisitChildren(AstNodeVisitor* visitor) const {
963 body()->Visit(visitor); 939 body()->Visit(visitor);
964 } 940 }
965 941
966 DECLARE_COMMON_NODE_FUNCTIONS(SwitchNode); 942 DECLARE_COMMON_NODE_FUNCTIONS(SwitchNode);
967 943
968 private: 944 private:
969 SourceLabel* label_; 945 SourceLabel* label_;
970 SequenceNode* body_; 946 SequenceNode* body_;
971 947
972 DISALLOW_IMPLICIT_CONSTRUCTORS(SwitchNode); 948 DISALLOW_IMPLICIT_CONSTRUCTORS(SwitchNode);
973 }; 949 };
974 950
975
976 class WhileNode : public AstNode { 951 class WhileNode : public AstNode {
977 public: 952 public:
978 WhileNode(TokenPosition token_pos, 953 WhileNode(TokenPosition token_pos,
979 SourceLabel* label, 954 SourceLabel* label,
980 AstNode* condition, 955 AstNode* condition,
981 SequenceNode* condition_preamble, 956 SequenceNode* condition_preamble,
982 SequenceNode* body) 957 SequenceNode* body)
983 : AstNode(token_pos), 958 : AstNode(token_pos),
984 label_(label), 959 label_(label),
985 condition_(condition), 960 condition_(condition),
(...skipping 21 matching lines...) Expand all
1007 982
1008 private: 983 private:
1009 SourceLabel* label_; 984 SourceLabel* label_;
1010 AstNode* condition_; 985 AstNode* condition_;
1011 SequenceNode* condition_preamble_; 986 SequenceNode* condition_preamble_;
1012 SequenceNode* body_; 987 SequenceNode* body_;
1013 988
1014 DISALLOW_IMPLICIT_CONSTRUCTORS(WhileNode); 989 DISALLOW_IMPLICIT_CONSTRUCTORS(WhileNode);
1015 }; 990 };
1016 991
1017
1018 class DoWhileNode : public AstNode { 992 class DoWhileNode : public AstNode {
1019 public: 993 public:
1020 DoWhileNode(TokenPosition token_pos, 994 DoWhileNode(TokenPosition token_pos,
1021 SourceLabel* label, 995 SourceLabel* label,
1022 AstNode* condition, 996 AstNode* condition,
1023 SequenceNode* body) 997 SequenceNode* body)
1024 : AstNode(token_pos), label_(label), condition_(condition), body_(body) { 998 : AstNode(token_pos), label_(label), condition_(condition), body_(body) {
1025 ASSERT(label_ != NULL); 999 ASSERT(label_ != NULL);
1026 ASSERT(condition_ != NULL); 1000 ASSERT(condition_ != NULL);
1027 ASSERT(body_ != NULL); 1001 ASSERT(body_ != NULL);
(...skipping 11 matching lines...) Expand all
1039 DECLARE_COMMON_NODE_FUNCTIONS(DoWhileNode); 1013 DECLARE_COMMON_NODE_FUNCTIONS(DoWhileNode);
1040 1014
1041 private: 1015 private:
1042 SourceLabel* label_; 1016 SourceLabel* label_;
1043 AstNode* condition_; 1017 AstNode* condition_;
1044 SequenceNode* body_; 1018 SequenceNode* body_;
1045 1019
1046 DISALLOW_IMPLICIT_CONSTRUCTORS(DoWhileNode); 1020 DISALLOW_IMPLICIT_CONSTRUCTORS(DoWhileNode);
1047 }; 1021 };
1048 1022
1049
1050 // The condition can be NULL. 1023 // The condition can be NULL.
1051 class ForNode : public AstNode { 1024 class ForNode : public AstNode {
1052 public: 1025 public:
1053 ForNode(TokenPosition token_pos, 1026 ForNode(TokenPosition token_pos,
1054 SourceLabel* label, 1027 SourceLabel* label,
1055 SequenceNode* initializer, 1028 SequenceNode* initializer,
1056 AstNode* condition, 1029 AstNode* condition,
1057 SequenceNode* condition_preamble, 1030 SequenceNode* condition_preamble,
1058 SequenceNode* increment, 1031 SequenceNode* increment,
1059 SequenceNode* body) 1032 SequenceNode* body)
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1096 SourceLabel* label_; 1069 SourceLabel* label_;
1097 SequenceNode* initializer_; 1070 SequenceNode* initializer_;
1098 AstNode* condition_; 1071 AstNode* condition_;
1099 AstNode* condition_preamble_; 1072 AstNode* condition_preamble_;
1100 SequenceNode* increment_; 1073 SequenceNode* increment_;
1101 SequenceNode* body_; 1074 SequenceNode* body_;
1102 1075
1103 DISALLOW_IMPLICIT_CONSTRUCTORS(ForNode); 1076 DISALLOW_IMPLICIT_CONSTRUCTORS(ForNode);
1104 }; 1077 };
1105 1078
1106
1107 class JumpNode : public AstNode { 1079 class JumpNode : public AstNode {
1108 public: 1080 public:
1109 JumpNode(TokenPosition token_pos, Token::Kind kind, SourceLabel* label) 1081 JumpNode(TokenPosition token_pos, Token::Kind kind, SourceLabel* label)
1110 : AstNode(token_pos), 1082 : AstNode(token_pos),
1111 kind_(kind), 1083 kind_(kind),
1112 label_(label), 1084 label_(label),
1113 inlined_finally_list_() { 1085 inlined_finally_list_() {
1114 ASSERT(label_ != NULL); 1086 ASSERT(label_ != NULL);
1115 ASSERT(kind_ == Token::kBREAK || kind_ == Token::kCONTINUE); 1087 ASSERT(kind_ == Token::kBREAK || kind_ == Token::kCONTINUE);
1116 } 1088 }
(...skipping 18 matching lines...) Expand all
1135 DECLARE_COMMON_NODE_FUNCTIONS(JumpNode); 1107 DECLARE_COMMON_NODE_FUNCTIONS(JumpNode);
1136 1108
1137 private: 1109 private:
1138 Token::Kind kind_; 1110 Token::Kind kind_;
1139 SourceLabel* label_; 1111 SourceLabel* label_;
1140 GrowableArray<InlinedFinallyNode*> inlined_finally_list_; 1112 GrowableArray<InlinedFinallyNode*> inlined_finally_list_;
1141 1113
1142 DISALLOW_IMPLICIT_CONSTRUCTORS(JumpNode); 1114 DISALLOW_IMPLICIT_CONSTRUCTORS(JumpNode);
1143 }; 1115 };
1144 1116
1145
1146 class StopNode : public AstNode { 1117 class StopNode : public AstNode {
1147 public: 1118 public:
1148 StopNode(TokenPosition token_pos, const char* message) 1119 StopNode(TokenPosition token_pos, const char* message)
1149 : AstNode(token_pos), message_(message) { 1120 : AstNode(token_pos), message_(message) {
1150 ASSERT(message != NULL); 1121 ASSERT(message != NULL);
1151 } 1122 }
1152 1123
1153 const char* message() const { return message_; } 1124 const char* message() const { return message_; }
1154 1125
1155 virtual void VisitChildren(AstNodeVisitor* visitor) const {} 1126 virtual void VisitChildren(AstNodeVisitor* visitor) const {}
1156 1127
1157 DECLARE_COMMON_NODE_FUNCTIONS(StopNode); 1128 DECLARE_COMMON_NODE_FUNCTIONS(StopNode);
1158 1129
1159 private: 1130 private:
1160 const char* message_; 1131 const char* message_;
1161 1132
1162 DISALLOW_IMPLICIT_CONSTRUCTORS(StopNode); 1133 DISALLOW_IMPLICIT_CONSTRUCTORS(StopNode);
1163 }; 1134 };
1164 1135
1165
1166 class LoadLocalNode : public AstNode { 1136 class LoadLocalNode : public AstNode {
1167 public: 1137 public:
1168 LoadLocalNode(TokenPosition token_pos, const LocalVariable* local) 1138 LoadLocalNode(TokenPosition token_pos, const LocalVariable* local)
1169 : AstNode(token_pos), local_(*local) { 1139 : AstNode(token_pos), local_(*local) {
1170 ASSERT(local != NULL); 1140 ASSERT(local != NULL);
1171 } 1141 }
1172 1142
1173 const LocalVariable& local() const { return local_; } 1143 const LocalVariable& local() const { return local_; }
1174 1144
1175 virtual void VisitChildren(AstNodeVisitor* visitor) const {} 1145 virtual void VisitChildren(AstNodeVisitor* visitor) const {}
1176 1146
1177 virtual const Instance* EvalConstExpr() const; 1147 virtual const Instance* EvalConstExpr() const;
1178 virtual bool IsPotentiallyConst() const; 1148 virtual bool IsPotentiallyConst() const;
1179 virtual AstNode* MakeAssignmentNode(AstNode* rhs); 1149 virtual AstNode* MakeAssignmentNode(AstNode* rhs);
1180 1150
1181 DECLARE_COMMON_NODE_FUNCTIONS(LoadLocalNode); 1151 DECLARE_COMMON_NODE_FUNCTIONS(LoadLocalNode);
1182 1152
1183 private: 1153 private:
1184 const LocalVariable& local_; 1154 const LocalVariable& local_;
1185 1155
1186 DISALLOW_IMPLICIT_CONSTRUCTORS(LoadLocalNode); 1156 DISALLOW_IMPLICIT_CONSTRUCTORS(LoadLocalNode);
1187 }; 1157 };
1188 1158
1189
1190 class StoreLocalNode : public AstNode { 1159 class StoreLocalNode : public AstNode {
1191 public: 1160 public:
1192 StoreLocalNode(TokenPosition token_pos, 1161 StoreLocalNode(TokenPosition token_pos,
1193 const LocalVariable* local, 1162 const LocalVariable* local,
1194 AstNode* value) 1163 AstNode* value)
1195 : AstNode(token_pos), local_(*local), value_(value) { 1164 : AstNode(token_pos), local_(*local), value_(value) {
1196 ASSERT(local != NULL); 1165 ASSERT(local != NULL);
1197 ASSERT(value_ != NULL); 1166 ASSERT(value_ != NULL);
1198 } 1167 }
1199 1168
1200 const LocalVariable& local() const { return local_; } 1169 const LocalVariable& local() const { return local_; }
1201 AstNode* value() const { return value_; } 1170 AstNode* value() const { return value_; }
1202 1171
1203 virtual void VisitChildren(AstNodeVisitor* visitor) const { 1172 virtual void VisitChildren(AstNodeVisitor* visitor) const {
1204 value()->Visit(visitor); 1173 value()->Visit(visitor);
1205 } 1174 }
1206 1175
1207 DECLARE_COMMON_NODE_FUNCTIONS(StoreLocalNode); 1176 DECLARE_COMMON_NODE_FUNCTIONS(StoreLocalNode);
1208 1177
1209 private: 1178 private:
1210 const LocalVariable& local_; 1179 const LocalVariable& local_;
1211 AstNode* value_; 1180 AstNode* value_;
1212 1181
1213 DISALLOW_IMPLICIT_CONSTRUCTORS(StoreLocalNode); 1182 DISALLOW_IMPLICIT_CONSTRUCTORS(StoreLocalNode);
1214 }; 1183 };
1215 1184
1216
1217 class LoadInstanceFieldNode : public AstNode { 1185 class LoadInstanceFieldNode : public AstNode {
1218 public: 1186 public:
1219 LoadInstanceFieldNode(TokenPosition token_pos, 1187 LoadInstanceFieldNode(TokenPosition token_pos,
1220 AstNode* instance, 1188 AstNode* instance,
1221 const Field& field) 1189 const Field& field)
1222 : AstNode(token_pos), instance_(instance), field_(*MayCloneField(field)) { 1190 : AstNode(token_pos), instance_(instance), field_(*MayCloneField(field)) {
1223 ASSERT(instance_ != NULL); 1191 ASSERT(instance_ != NULL);
1224 ASSERT(field_.IsZoneHandle()); 1192 ASSERT(field_.IsZoneHandle());
1225 } 1193 }
1226 1194
1227 AstNode* instance() const { return instance_; } 1195 AstNode* instance() const { return instance_; }
1228 const Field& field() const { return field_; } 1196 const Field& field() const { return field_; }
1229 1197
1230 virtual void VisitChildren(AstNodeVisitor* visitor) const { 1198 virtual void VisitChildren(AstNodeVisitor* visitor) const {
1231 instance()->Visit(visitor); 1199 instance()->Visit(visitor);
1232 } 1200 }
1233 1201
1234 DECLARE_COMMON_NODE_FUNCTIONS(LoadInstanceFieldNode); 1202 DECLARE_COMMON_NODE_FUNCTIONS(LoadInstanceFieldNode);
1235 1203
1236 private: 1204 private:
1237 AstNode* instance_; 1205 AstNode* instance_;
1238 const Field& field_; 1206 const Field& field_;
1239 1207
1240 DISALLOW_IMPLICIT_CONSTRUCTORS(LoadInstanceFieldNode); 1208 DISALLOW_IMPLICIT_CONSTRUCTORS(LoadInstanceFieldNode);
1241 }; 1209 };
1242 1210
1243
1244 class StoreInstanceFieldNode : public AstNode { 1211 class StoreInstanceFieldNode : public AstNode {
1245 public: 1212 public:
1246 StoreInstanceFieldNode(TokenPosition token_pos, 1213 StoreInstanceFieldNode(TokenPosition token_pos,
1247 AstNode* instance, 1214 AstNode* instance,
1248 const Field& field, 1215 const Field& field,
1249 AstNode* value, 1216 AstNode* value,
1250 bool is_initializer) 1217 bool is_initializer)
1251 : AstNode(token_pos), 1218 : AstNode(token_pos),
1252 instance_(instance), 1219 instance_(instance),
1253 field_(*MayCloneField(field)), 1220 field_(*MayCloneField(field)),
(...skipping 18 matching lines...) Expand all
1272 1239
1273 private: 1240 private:
1274 AstNode* instance_; 1241 AstNode* instance_;
1275 const Field& field_; 1242 const Field& field_;
1276 AstNode* value_; 1243 AstNode* value_;
1277 const bool is_initializer_; 1244 const bool is_initializer_;
1278 1245
1279 DISALLOW_IMPLICIT_CONSTRUCTORS(StoreInstanceFieldNode); 1246 DISALLOW_IMPLICIT_CONSTRUCTORS(StoreInstanceFieldNode);
1280 }; 1247 };
1281 1248
1282
1283 class LoadStaticFieldNode : public AstNode { 1249 class LoadStaticFieldNode : public AstNode {
1284 public: 1250 public:
1285 LoadStaticFieldNode(TokenPosition token_pos, const Field& field) 1251 LoadStaticFieldNode(TokenPosition token_pos, const Field& field)
1286 : AstNode(token_pos), 1252 : AstNode(token_pos),
1287 field_(*MayCloneField(field)), 1253 field_(*MayCloneField(field)),
1288 is_deferred_reference_(false) { 1254 is_deferred_reference_(false) {
1289 ASSERT(field_.IsZoneHandle()); 1255 ASSERT(field_.IsZoneHandle());
1290 } 1256 }
1291 1257
1292 const Field& field() const { return field_; } 1258 const Field& field() const { return field_; }
(...skipping 15 matching lines...) Expand all
1308 1274
1309 DECLARE_COMMON_NODE_FUNCTIONS(LoadStaticFieldNode); 1275 DECLARE_COMMON_NODE_FUNCTIONS(LoadStaticFieldNode);
1310 1276
1311 private: 1277 private:
1312 const Field& field_; 1278 const Field& field_;
1313 bool is_deferred_reference_; 1279 bool is_deferred_reference_;
1314 1280
1315 DISALLOW_IMPLICIT_CONSTRUCTORS(LoadStaticFieldNode); 1281 DISALLOW_IMPLICIT_CONSTRUCTORS(LoadStaticFieldNode);
1316 }; 1282 };
1317 1283
1318
1319 class StoreStaticFieldNode : public AstNode { 1284 class StoreStaticFieldNode : public AstNode {
1320 public: 1285 public:
1321 StoreStaticFieldNode(TokenPosition token_pos, 1286 StoreStaticFieldNode(TokenPosition token_pos,
1322 const Field& field, 1287 const Field& field,
1323 AstNode* value) 1288 AstNode* value)
1324 : AstNode(token_pos), field_(*MayCloneField(field)), value_(value) { 1289 : AstNode(token_pos), field_(*MayCloneField(field)), value_(value) {
1325 ASSERT(field_.IsZoneHandle()); 1290 ASSERT(field_.IsZoneHandle());
1326 ASSERT(value_ != NULL); 1291 ASSERT(value_ != NULL);
1327 } 1292 }
1328 1293
1329 const Field& field() const { return field_; } 1294 const Field& field() const { return field_; }
1330 AstNode* value() const { return value_; } 1295 AstNode* value() const { return value_; }
1331 1296
1332 virtual void VisitChildren(AstNodeVisitor* visitor) const { 1297 virtual void VisitChildren(AstNodeVisitor* visitor) const {
1333 value()->Visit(visitor); 1298 value()->Visit(visitor);
1334 } 1299 }
1335 1300
1336 DECLARE_COMMON_NODE_FUNCTIONS(StoreStaticFieldNode); 1301 DECLARE_COMMON_NODE_FUNCTIONS(StoreStaticFieldNode);
1337 1302
1338 private: 1303 private:
1339 const Field& field_; 1304 const Field& field_;
1340 AstNode* value_; 1305 AstNode* value_;
1341 1306
1342 DISALLOW_IMPLICIT_CONSTRUCTORS(StoreStaticFieldNode); 1307 DISALLOW_IMPLICIT_CONSTRUCTORS(StoreStaticFieldNode);
1343 }; 1308 };
1344 1309
1345
1346 class LoadIndexedNode : public AstNode { 1310 class LoadIndexedNode : public AstNode {
1347 public: 1311 public:
1348 LoadIndexedNode(TokenPosition token_pos, 1312 LoadIndexedNode(TokenPosition token_pos,
1349 AstNode* array, 1313 AstNode* array,
1350 AstNode* index, 1314 AstNode* index,
1351 const Class& super_class) 1315 const Class& super_class)
1352 : AstNode(token_pos), 1316 : AstNode(token_pos),
1353 array_(array), 1317 array_(array),
1354 index_expr_(index), 1318 index_expr_(index),
1355 super_class_(super_class) { 1319 super_class_(super_class) {
(...skipping 16 matching lines...) Expand all
1372 1336
1373 DECLARE_COMMON_NODE_FUNCTIONS(LoadIndexedNode); 1337 DECLARE_COMMON_NODE_FUNCTIONS(LoadIndexedNode);
1374 1338
1375 private: 1339 private:
1376 AstNode* array_; 1340 AstNode* array_;
1377 AstNode* index_expr_; 1341 AstNode* index_expr_;
1378 const Class& super_class_; 1342 const Class& super_class_;
1379 DISALLOW_IMPLICIT_CONSTRUCTORS(LoadIndexedNode); 1343 DISALLOW_IMPLICIT_CONSTRUCTORS(LoadIndexedNode);
1380 }; 1344 };
1381 1345
1382
1383 class StoreIndexedNode : public AstNode { 1346 class StoreIndexedNode : public AstNode {
1384 public: 1347 public:
1385 StoreIndexedNode(TokenPosition token_pos, 1348 StoreIndexedNode(TokenPosition token_pos,
1386 AstNode* array, 1349 AstNode* array,
1387 AstNode* index, 1350 AstNode* index,
1388 AstNode* value, 1351 AstNode* value,
1389 const Class& super_class) 1352 const Class& super_class)
1390 : AstNode(token_pos), 1353 : AstNode(token_pos),
1391 array_(array), 1354 array_(array),
1392 index_expr_(index), 1355 index_expr_(index),
(...skipping 20 matching lines...) Expand all
1413 DECLARE_COMMON_NODE_FUNCTIONS(StoreIndexedNode); 1376 DECLARE_COMMON_NODE_FUNCTIONS(StoreIndexedNode);
1414 1377
1415 private: 1378 private:
1416 AstNode* array_; 1379 AstNode* array_;
1417 AstNode* index_expr_; 1380 AstNode* index_expr_;
1418 AstNode* value_; 1381 AstNode* value_;
1419 const Class& super_class_; 1382 const Class& super_class_;
1420 DISALLOW_IMPLICIT_CONSTRUCTORS(StoreIndexedNode); 1383 DISALLOW_IMPLICIT_CONSTRUCTORS(StoreIndexedNode);
1421 }; 1384 };
1422 1385
1423
1424 class InstanceCallNode : public AstNode { 1386 class InstanceCallNode : public AstNode {
1425 public: 1387 public:
1426 InstanceCallNode(TokenPosition token_pos, 1388 InstanceCallNode(TokenPosition token_pos,
1427 AstNode* receiver, 1389 AstNode* receiver,
1428 const String& function_name, 1390 const String& function_name,
1429 ArgumentListNode* arguments, 1391 ArgumentListNode* arguments,
1430 bool is_conditional = false) 1392 bool is_conditional = false)
1431 : AstNode(token_pos), 1393 : AstNode(token_pos),
1432 receiver_(receiver), 1394 receiver_(receiver),
1433 function_name_(function_name), 1395 function_name_(function_name),
(...skipping 19 matching lines...) Expand all
1453 1415
1454 private: 1416 private:
1455 AstNode* receiver_; 1417 AstNode* receiver_;
1456 const String& function_name_; 1418 const String& function_name_;
1457 ArgumentListNode* arguments_; 1419 ArgumentListNode* arguments_;
1458 const bool is_conditional_; 1420 const bool is_conditional_;
1459 1421
1460 DISALLOW_IMPLICIT_CONSTRUCTORS(InstanceCallNode); 1422 DISALLOW_IMPLICIT_CONSTRUCTORS(InstanceCallNode);
1461 }; 1423 };
1462 1424
1463
1464 class InstanceGetterNode : public AstNode { 1425 class InstanceGetterNode : public AstNode {
1465 public: 1426 public:
1466 InstanceGetterNode(TokenPosition token_pos, 1427 InstanceGetterNode(TokenPosition token_pos,
1467 AstNode* receiver, 1428 AstNode* receiver,
1468 const String& field_name, 1429 const String& field_name,
1469 bool is_conditional = false) 1430 bool is_conditional = false)
1470 : AstNode(token_pos), 1431 : AstNode(token_pos),
1471 receiver_(receiver), 1432 receiver_(receiver),
1472 field_name_(field_name), 1433 field_name_(field_name),
1473 is_conditional_(is_conditional) { 1434 is_conditional_(is_conditional) {
(...skipping 18 matching lines...) Expand all
1492 DECLARE_COMMON_NODE_FUNCTIONS(InstanceGetterNode); 1453 DECLARE_COMMON_NODE_FUNCTIONS(InstanceGetterNode);
1493 1454
1494 private: 1455 private:
1495 AstNode* receiver_; 1456 AstNode* receiver_;
1496 const String& field_name_; 1457 const String& field_name_;
1497 const bool is_conditional_; 1458 const bool is_conditional_;
1498 1459
1499 DISALLOW_IMPLICIT_CONSTRUCTORS(InstanceGetterNode); 1460 DISALLOW_IMPLICIT_CONSTRUCTORS(InstanceGetterNode);
1500 }; 1461 };
1501 1462
1502
1503 class InstanceSetterNode : public AstNode { 1463 class InstanceSetterNode : public AstNode {
1504 public: 1464 public:
1505 InstanceSetterNode(TokenPosition token_pos, 1465 InstanceSetterNode(TokenPosition token_pos,
1506 AstNode* receiver, 1466 AstNode* receiver,
1507 const String& field_name, 1467 const String& field_name,
1508 AstNode* value, 1468 AstNode* value,
1509 bool is_conditional = false) 1469 bool is_conditional = false)
1510 : AstNode(token_pos), 1470 : AstNode(token_pos),
1511 receiver_(receiver), 1471 receiver_(receiver),
1512 field_name_(field_name), 1472 field_name_(field_name),
(...skipping 19 matching lines...) Expand all
1532 1492
1533 private: 1493 private:
1534 AstNode* receiver_; 1494 AstNode* receiver_;
1535 const String& field_name_; 1495 const String& field_name_;
1536 AstNode* value_; 1496 AstNode* value_;
1537 const bool is_conditional_; 1497 const bool is_conditional_;
1538 1498
1539 DISALLOW_IMPLICIT_CONSTRUCTORS(InstanceSetterNode); 1499 DISALLOW_IMPLICIT_CONSTRUCTORS(InstanceSetterNode);
1540 }; 1500 };
1541 1501
1542
1543 class InitStaticFieldNode : public AstNode { 1502 class InitStaticFieldNode : public AstNode {
1544 public: 1503 public:
1545 InitStaticFieldNode(TokenPosition token_pos, const Field& field) 1504 InitStaticFieldNode(TokenPosition token_pos, const Field& field)
1546 : AstNode(token_pos), field_(*MayCloneField(field)) { 1505 : AstNode(token_pos), field_(*MayCloneField(field)) {
1547 ASSERT(field_.IsZoneHandle()); 1506 ASSERT(field_.IsZoneHandle());
1548 } 1507 }
1549 1508
1550 const Field& field() const { return field_; } 1509 const Field& field() const { return field_; }
1551 1510
1552 virtual void VisitChildren(AstNodeVisitor* visitor) const {} 1511 virtual void VisitChildren(AstNodeVisitor* visitor) const {}
1553 1512
1554 DECLARE_COMMON_NODE_FUNCTIONS(InitStaticFieldNode); 1513 DECLARE_COMMON_NODE_FUNCTIONS(InitStaticFieldNode);
1555 1514
1556 private: 1515 private:
1557 const Field& field_; 1516 const Field& field_;
1558 1517
1559 DISALLOW_COPY_AND_ASSIGN(InitStaticFieldNode); 1518 DISALLOW_COPY_AND_ASSIGN(InitStaticFieldNode);
1560 }; 1519 };
1561 1520
1562
1563 class StaticGetterNode : public AstNode { 1521 class StaticGetterNode : public AstNode {
1564 public: 1522 public:
1565 StaticGetterNode(TokenPosition token_pos, 1523 StaticGetterNode(TokenPosition token_pos,
1566 AstNode* receiver, 1524 AstNode* receiver,
1567 const Class& cls, 1525 const Class& cls,
1568 const String& field_name) 1526 const String& field_name)
1569 : AstNode(token_pos), 1527 : AstNode(token_pos),
1570 receiver_(receiver), 1528 receiver_(receiver),
1571 owner_(Object::ZoneHandle(cls.raw())), 1529 owner_(Object::ZoneHandle(cls.raw())),
1572 cls_(cls), 1530 cls_(cls),
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1608 private: 1566 private:
1609 AstNode* receiver_; 1567 AstNode* receiver_;
1610 Object& owner_; 1568 Object& owner_;
1611 const Class& cls_; 1569 const Class& cls_;
1612 const String& field_name_; 1570 const String& field_name_;
1613 bool is_deferred_reference_; 1571 bool is_deferred_reference_;
1614 1572
1615 DISALLOW_IMPLICIT_CONSTRUCTORS(StaticGetterNode); 1573 DISALLOW_IMPLICIT_CONSTRUCTORS(StaticGetterNode);
1616 }; 1574 };
1617 1575
1618
1619 class StaticSetterNode : public AstNode { 1576 class StaticSetterNode : public AstNode {
1620 public: 1577 public:
1621 // Static setter with resolved setter function. 1578 // Static setter with resolved setter function.
1622 StaticSetterNode(TokenPosition token_pos, 1579 StaticSetterNode(TokenPosition token_pos,
1623 AstNode* receiver, 1580 AstNode* receiver,
1624 const String& field_name, 1581 const String& field_name,
1625 const Function& function, 1582 const Function& function,
1626 AstNode* value) 1583 AstNode* value)
1627 : AstNode(token_pos), 1584 : AstNode(token_pos),
1628 receiver_(receiver), 1585 receiver_(receiver),
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1671 private: 1628 private:
1672 AstNode* receiver_; 1629 AstNode* receiver_;
1673 const Class& cls_; 1630 const Class& cls_;
1674 const String& field_name_; 1631 const String& field_name_;
1675 const Function& function_; 1632 const Function& function_;
1676 AstNode* value_; 1633 AstNode* value_;
1677 1634
1678 DISALLOW_IMPLICIT_CONSTRUCTORS(StaticSetterNode); 1635 DISALLOW_IMPLICIT_CONSTRUCTORS(StaticSetterNode);
1679 }; 1636 };
1680 1637
1681
1682 class StaticCallNode : public AstNode { 1638 class StaticCallNode : public AstNode {
1683 public: 1639 public:
1684 StaticCallNode(TokenPosition token_pos, 1640 StaticCallNode(TokenPosition token_pos,
1685 const Function& function, 1641 const Function& function,
1686 ArgumentListNode* arguments) 1642 ArgumentListNode* arguments)
1687 : AstNode(token_pos), function_(function), arguments_(arguments) { 1643 : AstNode(token_pos), function_(function), arguments_(arguments) {
1688 ASSERT(function_.IsZoneHandle()); 1644 ASSERT(function_.IsZoneHandle());
1689 ASSERT(arguments_ != NULL); 1645 ASSERT(arguments_ != NULL);
1690 } 1646 }
1691 1647
1692 const Function& function() const { return function_; } 1648 const Function& function() const { return function_; }
1693 ArgumentListNode* arguments() const { return arguments_; } 1649 ArgumentListNode* arguments() const { return arguments_; }
1694 1650
1695 virtual void VisitChildren(AstNodeVisitor* visitor) const { 1651 virtual void VisitChildren(AstNodeVisitor* visitor) const {
1696 arguments()->Visit(visitor); 1652 arguments()->Visit(visitor);
1697 } 1653 }
1698 1654
1699 virtual AstNode* MakeAssignmentNode(AstNode* rhs); 1655 virtual AstNode* MakeAssignmentNode(AstNode* rhs);
1700 1656
1701 DECLARE_COMMON_NODE_FUNCTIONS(StaticCallNode); 1657 DECLARE_COMMON_NODE_FUNCTIONS(StaticCallNode);
1702 1658
1703 private: 1659 private:
1704 const Function& function_; 1660 const Function& function_;
1705 ArgumentListNode* arguments_; 1661 ArgumentListNode* arguments_;
1706 1662
1707 DISALLOW_IMPLICIT_CONSTRUCTORS(StaticCallNode); 1663 DISALLOW_IMPLICIT_CONSTRUCTORS(StaticCallNode);
1708 }; 1664 };
1709 1665
1710
1711 class ClosureCallNode : public AstNode { 1666 class ClosureCallNode : public AstNode {
1712 public: 1667 public:
1713 ClosureCallNode(TokenPosition token_pos, 1668 ClosureCallNode(TokenPosition token_pos,
1714 AstNode* closure, 1669 AstNode* closure,
1715 ArgumentListNode* arguments) 1670 ArgumentListNode* arguments)
1716 : AstNode(token_pos), closure_(closure), arguments_(arguments) { 1671 : AstNode(token_pos), closure_(closure), arguments_(arguments) {
1717 ASSERT(closure_ != NULL); 1672 ASSERT(closure_ != NULL);
1718 ASSERT(arguments_ != NULL); 1673 ASSERT(arguments_ != NULL);
1719 } 1674 }
1720 1675
1721 AstNode* closure() const { return closure_; } 1676 AstNode* closure() const { return closure_; }
1722 ArgumentListNode* arguments() const { return arguments_; } 1677 ArgumentListNode* arguments() const { return arguments_; }
1723 1678
1724 virtual void VisitChildren(AstNodeVisitor* visitor) const { 1679 virtual void VisitChildren(AstNodeVisitor* visitor) const {
1725 closure()->Visit(visitor); 1680 closure()->Visit(visitor);
1726 arguments()->Visit(visitor); 1681 arguments()->Visit(visitor);
1727 } 1682 }
1728 1683
1729 DECLARE_COMMON_NODE_FUNCTIONS(ClosureCallNode); 1684 DECLARE_COMMON_NODE_FUNCTIONS(ClosureCallNode);
1730 1685
1731 private: 1686 private:
1732 AstNode* closure_; 1687 AstNode* closure_;
1733 ArgumentListNode* arguments_; 1688 ArgumentListNode* arguments_;
1734 1689
1735 DISALLOW_IMPLICIT_CONSTRUCTORS(ClosureCallNode); 1690 DISALLOW_IMPLICIT_CONSTRUCTORS(ClosureCallNode);
1736 }; 1691 };
1737 1692
1738
1739 // There are two kinds of constructor calls: factory calls and constructor 1693 // There are two kinds of constructor calls: factory calls and constructor
1740 // calls, distinguishable by constructor.IsFactory(). 1694 // calls, distinguishable by constructor.IsFactory().
1741 // 1695 //
1742 // Constructor calls implicitly allocate an object of class constructor.owner(), 1696 // Constructor calls implicitly allocate an object of class constructor.owner(),
1743 // possibly parameterized by type_arguments, which may still be uninstantiated. 1697 // possibly parameterized by type_arguments, which may still be uninstantiated.
1744 // For example, if the type argument T in 'new A<T>()' is not known at compile 1698 // For example, if the type argument T in 'new A<T>()' is not known at compile
1745 // time, it needs to be instantiated at run time. The instantiator and its 1699 // time, it needs to be instantiated at run time. The instantiator and its
1746 // instantiator_class are used to instantiate uninstantiated type arguments 1700 // instantiator_class are used to instantiate uninstantiated type arguments
1747 // at run time, as explained below. 1701 // at run time, as explained below.
1748 // 1702 //
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1788 DECLARE_COMMON_NODE_FUNCTIONS(ConstructorCallNode); 1742 DECLARE_COMMON_NODE_FUNCTIONS(ConstructorCallNode);
1789 1743
1790 private: 1744 private:
1791 const TypeArguments& type_arguments_; 1745 const TypeArguments& type_arguments_;
1792 const Function& constructor_; 1746 const Function& constructor_;
1793 ArgumentListNode* arguments_; 1747 ArgumentListNode* arguments_;
1794 1748
1795 DISALLOW_IMPLICIT_CONSTRUCTORS(ConstructorCallNode); 1749 DISALLOW_IMPLICIT_CONSTRUCTORS(ConstructorCallNode);
1796 }; 1750 };
1797 1751
1798
1799 // The body of a Dart function marked as 'native' consists of this node. 1752 // The body of a Dart function marked as 'native' consists of this node.
1800 class NativeBodyNode : public AstNode { 1753 class NativeBodyNode : public AstNode {
1801 public: 1754 public:
1802 NativeBodyNode(TokenPosition token_pos, 1755 NativeBodyNode(TokenPosition token_pos,
1803 const Function& function, 1756 const Function& function,
1804 const String& native_c_function_name, 1757 const String& native_c_function_name,
1805 LocalScope* scope, 1758 LocalScope* scope,
1806 bool link_lazily = false) 1759 bool link_lazily = false)
1807 : AstNode(token_pos), 1760 : AstNode(token_pos),
1808 function_(function), 1761 function_(function),
(...skipping 19 matching lines...) Expand all
1828 1781
1829 private: 1782 private:
1830 const Function& function_; // Native Dart function. 1783 const Function& function_; // Native Dart function.
1831 const String& native_c_function_name_; 1784 const String& native_c_function_name_;
1832 LocalScope* scope_; 1785 LocalScope* scope_;
1833 const bool link_lazily_; 1786 const bool link_lazily_;
1834 1787
1835 DISALLOW_IMPLICIT_CONSTRUCTORS(NativeBodyNode); 1788 DISALLOW_IMPLICIT_CONSTRUCTORS(NativeBodyNode);
1836 }; 1789 };
1837 1790
1838
1839 class CatchClauseNode : public AstNode { 1791 class CatchClauseNode : public AstNode {
1840 public: 1792 public:
1841 static const intptr_t kInvalidTryIndex = -1; 1793 static const intptr_t kInvalidTryIndex = -1;
1842 static const intptr_t kImplicitAsyncTryIndex = 0; 1794 static const intptr_t kImplicitAsyncTryIndex = 0;
1843 1795
1844 CatchClauseNode(TokenPosition token_pos, 1796 CatchClauseNode(TokenPosition token_pos,
1845 SequenceNode* catch_block, 1797 SequenceNode* catch_block,
1846 const Array& handler_types, 1798 const Array& handler_types,
1847 const LocalVariable* context_var, 1799 const LocalVariable* context_var,
1848 const LocalVariable* exception_var, 1800 const LocalVariable* exception_var,
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
1895 const LocalVariable& exception_var_; 1847 const LocalVariable& exception_var_;
1896 const LocalVariable& stacktrace_var_; 1848 const LocalVariable& stacktrace_var_;
1897 const LocalVariable& rethrow_exception_var_; 1849 const LocalVariable& rethrow_exception_var_;
1898 const LocalVariable& rethrow_stacktrace_var_; 1850 const LocalVariable& rethrow_stacktrace_var_;
1899 const intptr_t catch_handler_index_; 1851 const intptr_t catch_handler_index_;
1900 const bool needs_stacktrace_; 1852 const bool needs_stacktrace_;
1901 1853
1902 DISALLOW_COPY_AND_ASSIGN(CatchClauseNode); 1854 DISALLOW_COPY_AND_ASSIGN(CatchClauseNode);
1903 }; 1855 };
1904 1856
1905
1906 class TryCatchNode : public AstNode { 1857 class TryCatchNode : public AstNode {
1907 public: 1858 public:
1908 TryCatchNode(TokenPosition token_pos, 1859 TryCatchNode(TokenPosition token_pos,
1909 SequenceNode* try_block, 1860 SequenceNode* try_block,
1910 const LocalVariable* context_var, 1861 const LocalVariable* context_var,
1911 CatchClauseNode* catch_block, 1862 CatchClauseNode* catch_block,
1912 SequenceNode* finally_block, 1863 SequenceNode* finally_block,
1913 intptr_t try_index, 1864 intptr_t try_index,
1914 SequenceNode* rethrow_clause) 1865 SequenceNode* rethrow_clause)
1915 : AstNode(token_pos), 1866 : AstNode(token_pos),
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1948 SequenceNode* try_block_; 1899 SequenceNode* try_block_;
1949 const LocalVariable& context_var_; 1900 const LocalVariable& context_var_;
1950 CatchClauseNode* catch_block_; 1901 CatchClauseNode* catch_block_;
1951 SequenceNode* finally_block_; 1902 SequenceNode* finally_block_;
1952 const intptr_t try_index_; 1903 const intptr_t try_index_;
1953 SequenceNode* rethrow_clause_; 1904 SequenceNode* rethrow_clause_;
1954 1905
1955 DISALLOW_COPY_AND_ASSIGN(TryCatchNode); 1906 DISALLOW_COPY_AND_ASSIGN(TryCatchNode);
1956 }; 1907 };
1957 1908
1958
1959 class ThrowNode : public AstNode { 1909 class ThrowNode : public AstNode {
1960 public: 1910 public:
1961 ThrowNode(TokenPosition token_pos, AstNode* exception, AstNode* stacktrace) 1911 ThrowNode(TokenPosition token_pos, AstNode* exception, AstNode* stacktrace)
1962 : AstNode(token_pos), exception_(exception), stacktrace_(stacktrace) { 1912 : AstNode(token_pos), exception_(exception), stacktrace_(stacktrace) {
1963 ASSERT(exception_ != NULL); 1913 ASSERT(exception_ != NULL);
1964 } 1914 }
1965 1915
1966 AstNode* exception() const { return exception_; } 1916 AstNode* exception() const { return exception_; }
1967 AstNode* stacktrace() const { return stacktrace_; } 1917 AstNode* stacktrace() const { return stacktrace_; }
1968 1918
1969 virtual void VisitChildren(AstNodeVisitor* visitor) const { 1919 virtual void VisitChildren(AstNodeVisitor* visitor) const {
1970 exception()->Visit(visitor); 1920 exception()->Visit(visitor);
1971 if (stacktrace() != NULL) { 1921 if (stacktrace() != NULL) {
1972 stacktrace()->Visit(visitor); 1922 stacktrace()->Visit(visitor);
1973 } 1923 }
1974 } 1924 }
1975 1925
1976 DECLARE_COMMON_NODE_FUNCTIONS(ThrowNode); 1926 DECLARE_COMMON_NODE_FUNCTIONS(ThrowNode);
1977 1927
1978 private: 1928 private:
1979 AstNode* exception_; 1929 AstNode* exception_;
1980 AstNode* stacktrace_; 1930 AstNode* stacktrace_;
1981 1931
1982 DISALLOW_IMPLICIT_CONSTRUCTORS(ThrowNode); 1932 DISALLOW_IMPLICIT_CONSTRUCTORS(ThrowNode);
1983 }; 1933 };
1984 1934
1985
1986 class InlinedFinallyNode : public AstNode { 1935 class InlinedFinallyNode : public AstNode {
1987 public: 1936 public:
1988 InlinedFinallyNode(TokenPosition token_pos, 1937 InlinedFinallyNode(TokenPosition token_pos,
1989 SequenceNode* finally_block, 1938 SequenceNode* finally_block,
1990 const LocalVariable* context_var, 1939 const LocalVariable* context_var,
1991 intptr_t try_index) 1940 intptr_t try_index)
1992 : AstNode(token_pos), 1941 : AstNode(token_pos),
1993 finally_block_(finally_block), 1942 finally_block_(finally_block),
1994 context_var_(*context_var), 1943 context_var_(*context_var),
1995 try_index_(try_index) { 1944 try_index_(try_index) {
(...skipping 17 matching lines...) Expand all
2013 const intptr_t try_index_; 1962 const intptr_t try_index_;
2014 1963
2015 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); 1964 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode);
2016 }; 1965 };
2017 1966
2018 } // namespace dart 1967 } // namespace dart
2019 1968
2020 #undef DECLARE_COMMON_NODE_FUNCTIONS 1969 #undef DECLARE_COMMON_NODE_FUNCTIONS
2021 1970
2022 #endif // RUNTIME_VM_AST_H_ 1971 #endif // RUNTIME_VM_AST_H_
OLDNEW
« no previous file with comments | « runtime/vm/assert_test.cc ('k') | runtime/vm/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698