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

Side by Side Diff: pkg/compiler/lib/src/use_unused_api.dart

Issue 1115183002: Add ConstantConstructor to ConstantExpression system. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 /// This file use methods that aren't used by dart2js.dart, but that we wish to 5 /// This file use methods that aren't used by dart2js.dart, but that we wish to
6 /// keep anyway. This might be general API that isn't currently in use, 6 /// keep anyway. This might be general API that isn't currently in use,
7 /// debugging aids, or API only used for testing (see TODO below). 7 /// debugging aids, or API only used for testing (see TODO below).
8 8
9 library dart2js.use_unused_api; 9 library dart2js.use_unused_api;
10 10
11 import '../compiler.dart' as api; 11 import '../compiler.dart' as api;
12 12
13 import 'colors.dart' as colors; 13 import 'colors.dart' as colors;
14 import 'constants/constant_system.dart' as constants; 14 import 'constants/constant_system.dart' as constants;
15 import 'constants/expressions.dart' as constants;
15 import 'constants/values.dart' as constants; 16 import 'constants/values.dart' as constants;
16 import 'cps_ir/cps_ir_builder.dart' as ir_builder; 17 import 'cps_ir/cps_ir_builder.dart' as ir_builder;
17 import 'cps_ir/cps_ir_builder_task.dart' as ir_builder; 18 import 'cps_ir/cps_ir_builder_task.dart' as ir_builder;
18 import 'cps_ir/cps_ir_nodes_sexpr.dart' as cps_ir_nodes_sexpr; 19 import 'cps_ir/cps_ir_nodes_sexpr.dart' as cps_ir_nodes_sexpr;
19 import 'tree_ir/tree_ir_nodes.dart' as tree_ir; 20 import 'tree_ir/tree_ir_nodes.dart' as tree_ir;
20 import 'dart_types.dart' as dart_types; 21 import 'dart_types.dart' as dart_types;
21 import 'dart2js.dart' as dart2js; 22 import 'dart2js.dart' as dart2js;
22 import 'dart2jslib.dart' as dart2jslib; 23 import 'dart2jslib.dart' as dart2jslib;
23 import 'elements/elements.dart' as elements; 24 import 'elements/elements.dart' as elements;
24 import 'elements/modelx.dart' as modelx; 25 import 'elements/modelx.dart' as modelx;
(...skipping 19 matching lines...) Expand all
44 PartialFunctionElement; 45 PartialFunctionElement;
45 46
46 class ElementVisitor extends elements_visitor.BaseElementVisitor { 47 class ElementVisitor extends elements_visitor.BaseElementVisitor {
47 visitElement(e, a) {} 48 visitElement(e, a) {}
48 } 49 }
49 50
50 void main(List<String> arguments) { 51 void main(List<String> arguments) {
51 useApi(); 52 useApi();
52 dart2js.main(arguments); 53 dart2js.main(arguments);
53 dart2jslib.isPublicName(null); 54 dart2jslib.isPublicName(null);
54 useConstant(null, null); 55 useConstant(null, null, null);
55 useNode(null); 56 useNode(null);
56 useUtil(null); 57 useUtil(null);
57 useSetlet(null); 58 useSetlet(null);
58 useImmutableEmptySet(null); 59 useImmutableEmptySet(null);
59 useElementVisitor(new ElementVisitor()); 60 useElementVisitor(new ElementVisitor());
60 useJsNode(new js.Program(null)); 61 useJsNode(new js.Program(null));
61 useJsNode(new js.NamedFunction(null, null)); 62 useJsNode(new js.NamedFunction(null, null));
62 useJsNode(new js.ArrayHole()); 63 useJsNode(new js.ArrayHole());
63 useJsOther(new js.SimpleJavaScriptPrintingContext()); 64 useJsOther(new js.SimpleJavaScriptPrintingContext());
64 useJsBackend(null); 65 useJsBackend(null);
(...skipping 12 matching lines...) Expand all
77 useProgramBuilder(null); 78 useProgramBuilder(null);
78 useSemanticVisitor(); 79 useSemanticVisitor();
79 useTreeVisitors(); 80 useTreeVisitors();
80 } 81 }
81 82
82 useApi() { 83 useApi() {
83 api.ReadStringFromUri uri; 84 api.ReadStringFromUri uri;
84 } 85 }
85 86
86 void useConstant(constants.ConstantValue constant, 87 void useConstant(constants.ConstantValue constant,
88 constants.ConstructedConstantExpression constructedConstant,
87 constants.ConstantSystem cs) { 89 constants.ConstantSystem cs) {
88 constant.isObject; 90 constant.isObject;
89 cs.isBool(constant); 91 cs.isBool(constant);
92 constructedConstant.computeInstanceType();
93 constructedConstant.computeInstanceFields();
90 } 94 }
91 95
92 void useNode(tree.Node node) { 96 void useNode(tree.Node node) {
93 node 97 node
94 ..asAsyncModifier() 98 ..asAsyncModifier()
95 ..asAsyncForIn() 99 ..asAsyncForIn()
96 ..asAwait() 100 ..asAwait()
97 ..asBreakStatement() 101 ..asBreakStatement()
98 ..asCascade() 102 ..asCascade()
99 ..asCatchBlock() 103 ..asCatchBlock()
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 visitFieldDefinition(tree_ir.FieldDefinition node) {} 306 visitFieldDefinition(tree_ir.FieldDefinition node) {}
303 307
304 visitFieldInitializer(tree_ir.FieldInitializer node) {} 308 visitFieldInitializer(tree_ir.FieldInitializer node) {}
305 visitSuperInitializer(tree_ir.SuperInitializer node) {} 309 visitSuperInitializer(tree_ir.SuperInitializer node) {}
306 } 310 }
307 311
308 useTreeVisitors() { 312 useTreeVisitors() {
309 new DummyTreeVisitor().visitRootNode(null); 313 new DummyTreeVisitor().visitRootNode(null);
310 new DummyTreeVisitor().visitInitializer(null); 314 new DummyTreeVisitor().visitInitializer(null);
311 } 315 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/send_resolver.dart ('k') | pkg/docgen/lib/src/models/model_helpers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698