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

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

Issue 737363002: Remove unused code (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | 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) 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 211
212 @override 212 @override
213 js.Expression visitTypeOperator(tree_ir.TypeOperator node) { 213 js.Expression visitTypeOperator(tree_ir.TypeOperator node) {
214 return giveup(node); 214 return giveup(node);
215 // TODO: implement visitTypeOperator 215 // TODO: implement visitTypeOperator
216 } 216 }
217 217
218 @override 218 @override
219 js.Expression visitVariable(tree_ir.Variable node) { 219 js.Expression visitVariable(tree_ir.Variable node) {
220 return new js.VariableUse(getVariableName(node)); 220 return new js.VariableUse(getVariableName(node));
221 // TODO: implement visitVariable
222 } 221 }
223 222
224 @override 223 @override
225 void visitContinue(tree_ir.Continue node) { 224 void visitContinue(tree_ir.Continue node) {
226 return giveup(node); 225 return giveup(node);
227 // TODO: implement visitContinue 226 // TODO: implement visitContinue
228 } 227 }
229 228
230 @override 229 @override
231 void visitExpressionStatement(tree_ir.ExpressionStatement node) { 230 void visitExpressionStatement(tree_ir.ExpressionStatement node) {
(...skipping 15 matching lines...) Expand all
247 } 246 }
248 247
249 @override 248 @override
250 void visitLabeledStatement(tree_ir.LabeledStatement node) { 249 void visitLabeledStatement(tree_ir.LabeledStatement node) {
251 giveup(node); 250 giveup(node);
252 // TODO: implement visitLabeledStatement 251 // TODO: implement visitLabeledStatement
253 } 252 }
254 253
255 @override 254 @override
256 void visitAssign(tree_ir.Assign node) { 255 void visitAssign(tree_ir.Assign node) {
257
258 bool isFirstOccurrence = (variableNames[node.variable] == null);
259 bool isDeclaredHere = node.variable.host.element == currentFunction;
260 String name = getVariableName(node.variable);
261 tree_ir.Expression value = node.definition; 256 tree_ir.Expression value = node.definition;
262 js.Expression definition = visitExpression(value); 257 js.Expression definition = visitExpression(value);
263 258
264 accumulator.add(new js.ExpressionStatement(new js.Assignment( 259 accumulator.add(new js.ExpressionStatement(new js.Assignment(
265 visitVariable(node.variable), 260 visitVariable(node.variable),
266 definition))); 261 definition)));
267 visitStatement(node.next); 262 visitStatement(node.next);
268 } 263 }
269 264
270 @override 265 @override
(...skipping 15 matching lines...) Expand all
286 } 281 }
287 282
288 @override 283 @override
289 void visitReturn(tree_ir.Return node) { 284 void visitReturn(tree_ir.Return node) {
290 accumulator.add(new js.Return(visitExpression(node.value))); 285 accumulator.add(new js.Return(visitExpression(node.value)));
291 } 286 }
292 287
293 bool isNullLiteral(js.Expression exp) => exp is js.LiteralNull; 288 bool isNullLiteral(js.Expression exp) => exp is js.LiteralNull;
294 289
295 } 290 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698