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

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

Issue 15935005: Remove pseudo-node from LoadLocalNode and replace it with a proper AST node. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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.h" 5 #include "vm/ast.h"
6 #include "vm/compiler.h" 6 #include "vm/compiler.h"
7 #include "vm/dart_entry.h" 7 #include "vm/dart_entry.h"
8 #include "vm/isolate.h" 8 #include "vm/isolate.h"
9 #include "vm/object_store.h" 9 #include "vm/object_store.h"
10 #include "vm/resolver.h" 10 #include "vm/resolver.h"
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 return local().ConstValue(); 322 return local().ConstValue();
323 } 323 }
324 return NULL; 324 return NULL;
325 } 325 }
326 326
327 327
328 AstNode* LoadLocalNode::MakeAssignmentNode(AstNode* rhs) { 328 AstNode* LoadLocalNode::MakeAssignmentNode(AstNode* rhs) {
329 if (local().is_final()) { 329 if (local().is_final()) {
330 return NULL; 330 return NULL;
331 } 331 }
332 if (HasPseudo()) {
333 return NULL;
334 }
335 return new StoreLocalNode(token_pos(), &local(), rhs); 332 return new StoreLocalNode(token_pos(), &local(), rhs);
336 } 333 }
337 334
338 335
339 AstNode* LoadStaticFieldNode::MakeAssignmentNode(AstNode* rhs) { 336 AstNode* LoadStaticFieldNode::MakeAssignmentNode(AstNode* rhs) {
340 if (field().is_final()) { 337 if (field().is_final()) {
341 return NULL; 338 return NULL;
342 } 339 }
343 return new StoreStaticFieldNode(token_pos(), field(), rhs); 340 return new StoreStaticFieldNode(token_pos(), field(), rhs);
344 } 341 }
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 if (result.IsError() || result.IsNull()) { 430 if (result.IsError() || result.IsNull()) {
434 // TODO(turnidge): We could get better error messages by returning 431 // TODO(turnidge): We could get better error messages by returning
435 // the Error object directly to the parser. This will involve 432 // the Error object directly to the parser. This will involve
436 // replumbing all of the EvalConstExpr methods. 433 // replumbing all of the EvalConstExpr methods.
437 return NULL; 434 return NULL;
438 } 435 }
439 return &Instance::ZoneHandle(Instance::Cast(result).raw()); 436 return &Instance::ZoneHandle(Instance::Cast(result).raw());
440 } 437 }
441 438
442 } // namespace dart 439 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698