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

Side by Side Diff: pkg/compiler/lib/src/js_backend/codegen/codegen.dart

Issue 958603002: Added VariableUse expression to tree IR. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 library code_generator; 5 library code_generator;
6 6
7 import 'glue.dart'; 7 import 'glue.dart';
8 8
9 import '../../tree_ir/tree_ir_nodes.dart' as tree_ir; 9 import '../../tree_ir/tree_ir_nodes.dart' as tree_ir;
10 import '../../js/js.dart' as js; 10 import '../../js/js.dart' as js;
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 return new js.This(); 338 return new js.This();
339 } 339 }
340 340
341 @override 341 @override
342 js.Expression visitTypeOperator(tree_ir.TypeOperator node) { 342 js.Expression visitTypeOperator(tree_ir.TypeOperator node) {
343 return giveup(node); 343 return giveup(node);
344 // TODO: implement visitTypeOperator 344 // TODO: implement visitTypeOperator
345 } 345 }
346 346
347 @override 347 @override
348 js.Expression visitVariable(tree_ir.Variable node) { 348 js.Expression visitVariableUse(tree_ir.VariableUse node) {
349 return new js.VariableUse(getVariableName(node)); 349 return visitVariable(node.variable);
350 }
351
352 js.Expression visitVariable(tree_ir.Variable variable) {
Kevin Millikin (Google) 2015/02/26 12:43:18 Likewise, I'm not sure I'd call this visitVariable
asgerf 2015/02/27 12:05:19 Renamed to buildVariableAccess.
353 return new js.VariableUse(getVariableName(variable));
350 } 354 }
351 355
352 @override 356 @override
353 void visitContinue(tree_ir.Continue node) { 357 void visitContinue(tree_ir.Continue node) {
354 tree_ir.Statement fallthrough = this.fallthrough; 358 tree_ir.Statement fallthrough = this.fallthrough;
355 if (node.target.binding == fallthrough) { 359 if (node.target.binding == fallthrough) {
356 // Fall through to continue target 360 // Fall through to continue target
357 } else if (fallthrough is tree_ir.Continue && 361 } else if (fallthrough is tree_ir.Continue &&
358 fallthrough.target == node.target) { 362 fallthrough.target == node.target) {
359 // Fall through to equivalent continue 363 // Fall through to equivalent continue
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 527
524 @override 528 @override
525 visitSuperInitializer(tree_ir.SuperInitializer node) { 529 visitSuperInitializer(tree_ir.SuperInitializer node) {
526 return errorUnsupportedNode(node); 530 return errorUnsupportedNode(node);
527 } 531 }
528 532
529 dynamic errorUnsupportedNode(tree_ir.DartSpecificNode node) { 533 dynamic errorUnsupportedNode(tree_ir.DartSpecificNode node) {
530 throw "Unsupported node in JS backend: $node"; 534 throw "Unsupported node in JS backend: $node";
531 } 535 }
532 } 536 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698