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

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

Issue 831133004: Use closure conversion in new dart2js backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Removed redundant null-check Created 5 years, 11 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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 return giveup(node); 417 return giveup(node);
418 // TODO: implement FieldInitializer 418 // TODO: implement FieldInitializer
419 } 419 }
420 420
421 @override 421 @override
422 js.Expression visitSuperInitializer(tree_ir.SuperInitializer node) { 422 js.Expression visitSuperInitializer(tree_ir.SuperInitializer node) {
423 return giveup(node); 423 return giveup(node);
424 // TODO: implement SuperInitializer 424 // TODO: implement SuperInitializer
425 } 425 }
426 426
427 @override
428 js.Expression visitCreateBox(tree_ir.CreateBox node) {
429 return new js.ObjectInitializer([]);
430 }
431
432 @override
433 js.Expression visitCreateClosureClass(tree_ir.CreateClosureClass node) {
434 registry.registerInstantiatedClass(node.classElement);
435 return new js.New(glue.closureClassConstructorAccess(node.classElement),
436 node.arguments.map(visitExpression).toList());
437 }
438
439 @override
440 js.Expression visitGetField(tree_ir.GetField node) {
441 return new js.PropertyAccess.field(
442 visitExpression(node.object),
443 glue.instanceFieldPropertyName(node.field));
444 }
445
446 @override
447 void visitSetField(tree_ir.SetField node) {
448 js.PropertyAccess field =
449 new js.PropertyAccess.field(
450 visitExpression(node.object),
451 glue.instanceFieldPropertyName(node.field));
452 js.Assignment asn = new js.Assignment(field, visitExpression(node.value));
453 accumulator.add(new js.ExpressionStatement(asn));
454 visitStatement(node.next);
455 }
427 } 456 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/dart_backend/backend_ast_emitter.dart ('k') | pkg/compiler/lib/src/js_backend/codegen/glue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698