| OLD | NEW |
| 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 import 'colors.dart' as colors; | 12 import 'colors.dart' as colors; |
| 13 import 'compiler.dart' as compiler; | 13 import 'compiler.dart' as compiler; |
| 14 import 'constants/constant_system.dart' as constants; | 14 import 'constants/constant_system.dart' as constants; |
| 15 import 'constants/constructors.dart' as constants; | 15 import 'constants/constructors.dart' as constants; |
| 16 import 'constants/evaluation.dart' as constants; | 16 import 'constants/evaluation.dart' as constants; |
| 17 import 'constants/expressions.dart' as constants; | 17 import 'constants/expressions.dart' as constants; |
| 18 import 'constants/values.dart' as constants; | 18 import 'constants/values.dart' as constants; |
| 19 import 'cps_ir/cps_ir_builder.dart' as ir_builder; | |
| 20 import 'cps_ir/cps_ir_builder_task.dart' as ir_builder; | |
| 21 import 'dart2js.dart' as dart2js; | 19 import 'dart2js.dart' as dart2js; |
| 22 import 'dart_types.dart' as dart_types; | 20 import 'dart_types.dart' as dart_types; |
| 23 import 'deferred_load.dart' as deferred; | 21 import 'deferred_load.dart' as deferred; |
| 24 import 'diagnostics/source_span.dart' as diagnostics; | 22 import 'diagnostics/source_span.dart' as diagnostics; |
| 25 import 'elements/elements.dart' as elements; | 23 import 'elements/elements.dart' as elements; |
| 26 import 'elements/modelx.dart' as modelx; | 24 import 'elements/modelx.dart' as modelx; |
| 27 import 'elements/visitor.dart' as elements_visitor; | 25 import 'elements/visitor.dart' as elements_visitor; |
| 28 import 'filenames.dart' as filenames; | 26 import 'filenames.dart' as filenames; |
| 29 import 'inferrer/type_graph_inferrer.dart' as type_graph_inferrer; | 27 import 'inferrer/type_graph_inferrer.dart' as type_graph_inferrer; |
| 30 import 'io/line_column_provider.dart' as io; | 28 import 'io/line_column_provider.dart' as io; |
| 31 import 'io/source_map_builder.dart' as io; | 29 import 'io/source_map_builder.dart' as io; |
| 32 import 'js/js.dart' as js; | 30 import 'js/js.dart' as js; |
| 33 import 'js_backend/js_backend.dart' as js_backend; | 31 import 'js_backend/js_backend.dart' as js_backend; |
| 34 import 'js_emitter/full_emitter/emitter.dart' as full; | 32 import 'js_emitter/full_emitter/emitter.dart' as full; |
| 35 import 'js_emitter/js_emitter.dart' as js_emitter; | 33 import 'js_emitter/js_emitter.dart' as js_emitter; |
| 36 import 'js_emitter/program_builder/program_builder.dart' as program_builder; | 34 import 'js_emitter/program_builder/program_builder.dart' as program_builder; |
| 37 import 'parser/partial_elements.dart' | 35 import 'parser/partial_elements.dart' |
| 38 show PartialClassElement, PartialFunctionElement; | 36 show PartialClassElement, PartialFunctionElement; |
| 39 import 'resolution/operators.dart' as operators; | 37 import 'resolution/operators.dart' as operators; |
| 40 import 'resolution/semantic_visitor.dart' as semantic_visitor; | 38 import 'resolution/semantic_visitor.dart' as semantic_visitor; |
| 41 import 'script.dart'; | 39 import 'script.dart'; |
| 42 import 'source_file_provider.dart' as source_file_provider; | 40 import 'source_file_provider.dart' as source_file_provider; |
| 43 import 'ssa/nodes.dart' as ssa; | 41 import 'ssa/nodes.dart' as ssa; |
| 44 import 'tree/tree.dart' as tree; | 42 import 'tree/tree.dart' as tree; |
| 45 import 'tree_ir/tree_ir_nodes.dart' as tree_ir; | |
| 46 import 'util/util.dart' as util; | 43 import 'util/util.dart' as util; |
| 47 import 'world.dart'; | 44 import 'world.dart'; |
| 48 | 45 |
| 49 class ElementVisitor extends elements_visitor.BaseElementVisitor { | 46 class ElementVisitor extends elements_visitor.BaseElementVisitor { |
| 50 visitElement(e, a) {} | 47 visitElement(e, a) {} |
| 51 } | 48 } |
| 52 | 49 |
| 53 void main(List<String> arguments) { | 50 void main(List<String> arguments) { |
| 54 useApi(null); | 51 useApi(null); |
| 55 dart2js.main(arguments); | 52 dart2js.main(arguments); |
| 56 elements.Name.isPublicName(null); | 53 elements.Name.isPublicName(null); |
| 57 useConstant(); | 54 useConstant(); |
| 58 useNode(null); | 55 useNode(null); |
| 59 useUtil(null); | 56 useUtil(null); |
| 60 useSetlet(null); | 57 useSetlet(null); |
| 61 useImmutableEmptySet(null); | 58 useImmutableEmptySet(null); |
| 62 useElementVisitor(new ElementVisitor()); | 59 useElementVisitor(new ElementVisitor()); |
| 63 useJsNode(new js.Program(null)); | 60 useJsNode(new js.Program(null)); |
| 64 useJsNode(new js.NamedFunction(null, null)); | 61 useJsNode(new js.NamedFunction(null, null)); |
| 65 useJsNode(new js.ArrayHole()); | 62 useJsNode(new js.ArrayHole()); |
| 66 useJsOther(new js.SimpleJavaScriptPrintingContext()); | 63 useJsOther(new js.SimpleJavaScriptPrintingContext()); |
| 67 useJsBackend(null); | 64 useJsBackend(null); |
| 68 useColor(); | 65 useColor(); |
| 69 useFilenames(); | 66 useFilenames(); |
| 70 useSsa(null); | 67 useSsa(null); |
| 71 useIo(); | 68 useIo(); |
| 72 usedByTests(); | 69 usedByTests(); |
| 73 useElements(); | 70 useElements(); |
| 74 useIr(null); | |
| 75 useCompiler(null); | 71 useCompiler(null); |
| 76 useTypes(); | 72 useTypes(); |
| 77 useCodeEmitterTask(null); | 73 useCodeEmitterTask(null); |
| 78 useScript(null); | 74 useScript(null); |
| 79 useProgramBuilder(null); | 75 useProgramBuilder(null); |
| 80 useSemanticVisitor(); | 76 useSemanticVisitor(); |
| 81 useTreeVisitors(); | |
| 82 useDeferred(); | 77 useDeferred(); |
| 83 } | 78 } |
| 84 | 79 |
| 85 useApi([api.ReadStringFromUri uri, compiler.Compiler compiler]) { | 80 useApi([api.ReadStringFromUri uri, compiler.Compiler compiler]) { |
| 86 compiler.analyzeUri(null); | 81 compiler.analyzeUri(null); |
| 87 new diagnostics.SourceSpan.fromNode(null, null); | 82 new diagnostics.SourceSpan.fromNode(null, null); |
| 88 } | 83 } |
| 89 | 84 |
| 90 class NullConstantConstructorVisitor | 85 class NullConstantConstructorVisitor |
| 91 extends constants.ConstantConstructorVisitor { | 86 extends constants.ConstantConstructorVisitor { |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 elements.LibraryElement l]) { | 271 elements.LibraryElement l]) { |
| 277 e.lookupClassMember(null); | 272 e.lookupClassMember(null); |
| 278 e.lookupInterfaceMember(null); | 273 e.lookupInterfaceMember(null); |
| 279 n.isAccessibleFrom(null); | 274 n.isAccessibleFrom(null); |
| 280 f.reuseElement(); | 275 f.reuseElement(); |
| 281 pce.copyWithEnclosing(null); | 276 pce.copyWithEnclosing(null); |
| 282 pfe.copyWithEnclosing(null); | 277 pfe.copyWithEnclosing(null); |
| 283 l.forEachImport(null); | 278 l.forEachImport(null); |
| 284 } | 279 } |
| 285 | 280 |
| 286 useIr(ir_builder.IrBuilder builder) { | |
| 287 builder..buildStringConstant(null); | |
| 288 } | |
| 289 | |
| 290 useCompiler(compiler.Compiler c) { | 281 useCompiler(compiler.Compiler c) { |
| 291 c.libraryLoader | 282 c.libraryLoader |
| 292 ..reset() | 283 ..reset() |
| 293 ..resetAsync(null) | 284 ..resetAsync(null) |
| 294 ..lookupLibrary(null); | 285 ..lookupLibrary(null); |
| 295 c.forgetElement(null); | 286 c.forgetElement(null); |
| 296 c.backend.constantCompilerTask.copyConstantValues(null); | 287 c.backend.constantCompilerTask.copyConstantValues(null); |
| 297 c.currentlyInUserCode(); | 288 c.currentlyInUserCode(); |
| 298 } | 289 } |
| 299 | 290 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 315 } | 306 } |
| 316 | 307 |
| 317 useSemanticVisitor() { | 308 useSemanticVisitor() { |
| 318 operators.UnaryOperator.fromKind(null); | 309 operators.UnaryOperator.fromKind(null); |
| 319 operators.BinaryOperator.fromKind(null); | 310 operators.BinaryOperator.fromKind(null); |
| 320 new semantic_visitor.BulkSendVisitor()..apply(null, null); | 311 new semantic_visitor.BulkSendVisitor()..apply(null, null); |
| 321 new semantic_visitor.TraversalVisitor(null).apply(null, null); | 312 new semantic_visitor.TraversalVisitor(null).apply(null, null); |
| 322 new semantic_visitor.BulkDeclarationVisitor().apply(null, null); | 313 new semantic_visitor.BulkDeclarationVisitor().apply(null, null); |
| 323 } | 314 } |
| 324 | 315 |
| 325 class TreeVisitor1 extends tree_ir.ExpressionVisitor1 | |
| 326 with tree_ir.StatementVisitor1 { | |
| 327 noSuchMethod(inv) {} | |
| 328 } | |
| 329 | |
| 330 useTreeVisitors() { | |
| 331 new TreeVisitor1().visitExpression(null, null); | |
| 332 new TreeVisitor1().visitStatement(null, null); | |
| 333 } | |
| 334 | |
| 335 useDeferred([deferred.DeferredLoadTask task]) { | 316 useDeferred([deferred.DeferredLoadTask task]) { |
| 336 task.dump(); | 317 task.dump(); |
| 337 } | 318 } |
| OLD | NEW |