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

Side by Side Diff: pkg/compiler/lib/src/dart_backend/backend_ast_emitter.dart

Issue 1134063002: dart2js cps: Introduce GetStatic/SetStatic. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix SExpression parsing/unparsing Created 5 years, 7 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 backend_ast_emitter; 5 library backend_ast_emitter;
6 6
7 import '../tree_ir/tree_ir_nodes.dart' as tree; 7 import '../tree_ir/tree_ir_nodes.dart' as tree;
8 import 'backend_ast_nodes.dart'; 8 import 'backend_ast_nodes.dart';
9 import '../constants/expressions.dart'; 9 import '../constants/expressions.dart';
10 import '../constants/values.dart'; 10 import '../constants/values.dart';
(...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after
962 Initializer visitSuperInitializer(tree.SuperInitializer node, 962 Initializer visitSuperInitializer(tree.SuperInitializer node,
963 BuilderContext<Statement> context) { 963 BuilderContext<Statement> context) {
964 List<Argument> arguments = node.arguments.map((tree.Statement argument) { 964 List<Argument> arguments = node.arguments.map((tree.Statement argument) {
965 return ensureExpression(buildInInitializerContext(argument, context)); 965 return ensureExpression(buildInInitializerContext(argument, context));
966 }).toList(); 966 }).toList();
967 return new SuperInitializer(node.target, 967 return new SuperInitializer(node.target,
968 emitArguments(arguments, node.selector)); 968 emitArguments(arguments, node.selector));
969 } 969 }
970 970
971 @override 971 @override
972 Expression visitGetStatic(tree.GetStatic node,
973 BuilderContext<Statement> context) {
974 return new Identifier(node.element.name)..element = node.element;
975 }
976
977 @override
978 Expression visitSetStatic(tree.SetStatic node,
979 BuilderContext<Statement> context) {
980 Expression target =
981 new Identifier(node.element.name)..element = node.element;
982 Expression value = visitExpression(node.value, context);
983 return makeAssignment(target, value);
984 }
985
986 @override
972 Expression visitTypeExpression(tree.TypeExpression node, arg) { 987 Expression visitTypeExpression(tree.TypeExpression node, arg) {
973 throw '$node not supported by dart backend'; 988 throw '$node not supported by dart backend';
974 } 989 }
975 990
976 @override 991 @override
977 visitGetField(tree.GetField node, arg) => errorUnsupportedNode(node); 992 visitGetField(tree.GetField node, arg) => errorUnsupportedNode(node);
978 993
979 @override 994 @override
980 visitSetField(tree.SetField node, arg) => errorUnsupportedNode(node); 995 visitSetField(tree.SetField node, arg) => errorUnsupportedNode(node);
981 996
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
1427 : super(name, ElementKind.VARIABLE, enclosingElement, variables, null); 1442 : super(name, ElementKind.VARIABLE, enclosingElement, variables, null);
1428 1443
1429 ExecutableElement get executableContext => enclosingElement; 1444 ExecutableElement get executableContext => enclosingElement;
1430 1445
1431 ExecutableElement get memberContext => executableContext.memberContext; 1446 ExecutableElement get memberContext => executableContext.memberContext;
1432 1447
1433 bool get isLocal => true; 1448 bool get isLocal => true;
1434 1449
1435 LibraryElement get implementationLibrary => enclosingElement.library; 1450 LibraryElement get implementationLibrary => enclosingElement.library;
1436 } 1451 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/type_propagation.dart ('k') | pkg/compiler/lib/src/js_backend/codegen/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698