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

Side by Side Diff: runtime/vm/ast_transformer.cc

Issue 1090373006: Properly resolve top-level setters (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 #include "vm/ast_transformer.h" 5 #include "vm/ast_transformer.h"
6 6
7 #include "vm/object_store.h" 7 #include "vm/object_store.h"
8 #include "vm/parser.h" 8 #include "vm/parser.h"
9 #include "vm/thread.h" 9 #include "vm/thread.h"
10 10
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 void AwaitTransformer::VisitStaticGetterNode(StaticGetterNode* node) { 492 void AwaitTransformer::VisitStaticGetterNode(StaticGetterNode* node) {
493 AstNode* new_receiver = node->receiver(); 493 AstNode* new_receiver = node->receiver();
494 if (new_receiver != NULL) { 494 if (new_receiver != NULL) {
495 new_receiver = Transform(new_receiver); 495 new_receiver = Transform(new_receiver);
496 } 496 }
497 StaticGetterNode* new_getter = 497 StaticGetterNode* new_getter =
498 new(Z) StaticGetterNode(node->token_pos(), 498 new(Z) StaticGetterNode(node->token_pos(),
499 new_receiver, 499 new_receiver,
500 node->cls(), 500 node->cls(),
501 node->field_name()); 501 node->field_name());
502 new_getter->set_owner(node->owner());
502 LocalVariable* result = AddToPreambleNewTempVar(new_getter); 503 LocalVariable* result = AddToPreambleNewTempVar(new_getter);
503 result_ = new(Z) LoadLocalNode(Scanner::kNoSourcePos, result); 504 result_ = new(Z) LoadLocalNode(Scanner::kNoSourcePos, result);
504 } 505 }
505 506
506 507
507 void AwaitTransformer::VisitStaticSetterNode(StaticSetterNode* node) { 508 void AwaitTransformer::VisitStaticSetterNode(StaticSetterNode* node) {
508 AstNode* new_receiver = node->receiver(); 509 AstNode* new_receiver = node->receiver();
509 if (new_receiver != NULL) { 510 if (new_receiver != NULL) {
510 new_receiver = Transform(new_receiver); 511 new_receiver = Transform(new_receiver);
511 } 512 }
512 AstNode* new_value = Transform(node->value()); 513 AstNode* new_value = Transform(node->value());
513 LocalVariable* result = AddToPreambleNewTempVar( 514 StaticSetterNode* new_setter =
514 new(Z) StaticSetterNode(node->token_pos(), 515 node->function().IsNull()
515 new_receiver, 516 ? new(Z) StaticSetterNode(node->token_pos(),
516 node->cls(), 517 new_receiver,
517 node->field_name(), 518 node->cls(),
518 new_value)); 519 node->field_name(),
520 new_value)
regis 2015/04/21 17:30:30 Indent lines above.
hausner 2015/04/21 17:40:11 Done.
521 : new(Z) StaticSetterNode(node->token_pos(),
522 new_receiver,
523 node->field_name(),
524 node->function(),
525 new_value);
526
527 LocalVariable* result = AddToPreambleNewTempVar(new_setter);
519 result_ = new(Z) LoadLocalNode(Scanner::kNoSourcePos, result); 528 result_ = new(Z) LoadLocalNode(Scanner::kNoSourcePos, result);
520 } 529 }
521 530
522 531
523 void AwaitTransformer::VisitLoadLocalNode(LoadLocalNode* node) { 532 void AwaitTransformer::VisitLoadLocalNode(LoadLocalNode* node) {
524 result_ = node; 533 result_ = node;
525 } 534 }
526 535
527 536
528 void AwaitTransformer::VisitStoreLocalNode(StoreLocalNode* node) { 537 void AwaitTransformer::VisitStoreLocalNode(StoreLocalNode* node) {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 613
605 614
606 void AwaitTransformer::VisitThrowNode(ThrowNode* node) { 615 void AwaitTransformer::VisitThrowNode(ThrowNode* node) {
607 AstNode* new_exception = Transform(node->exception()); 616 AstNode* new_exception = Transform(node->exception());
608 result_ = new(Z) ThrowNode(node->token_pos(), 617 result_ = new(Z) ThrowNode(node->token_pos(),
609 new_exception, 618 new_exception,
610 node->stacktrace()); 619 node->stacktrace());
611 } 620 }
612 621
613 } // namespace dart 622 } // namespace dart
OLDNEW
« runtime/vm/ast.cc ('K') | « runtime/vm/ast.cc ('k') | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698