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 part of dart_backend; | 5 part of dart_backend; |
6 | 6 |
7 // TODO(ahe): This class is simply wrong. This backend should use | 7 // TODO(ahe): This class is simply wrong. This backend should use |
8 // elements when it can, not AST nodes. Perhaps a [Map<Element, | 8 // elements when it can, not AST nodes. Perhaps a [Map<Element, |
9 // TreeElements>] is what is needed. | 9 // TreeElements>] is what is needed. |
10 class ElementAst { | 10 class ElementAst { |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 classElement.ensureResolved(compiler); | 122 classElement.ensureResolved(compiler); |
123 } | 123 } |
124 // Enqueue the methods that the VM might invoke on user objects because | 124 // Enqueue the methods that the VM might invoke on user objects because |
125 // we don't trust the resolution to always get these included. | 125 // we don't trust the resolution to always get these included. |
126 world.registerInvocation(new Selector.call("toString", null, 0)); | 126 world.registerInvocation(new Selector.call("toString", null, 0)); |
127 world.registerInvokedGetter(new Selector.getter("hashCode", null)); | 127 world.registerInvokedGetter(new Selector.getter("hashCode", null)); |
128 world.registerInvocation(new Selector.binaryOperator("==")); | 128 world.registerInvocation(new Selector.binaryOperator("==")); |
129 world.registerInvocation(new Selector.call("compareTo", null, 1)); | 129 world.registerInvocation(new Selector.call("compareTo", null, 1)); |
130 } | 130 } |
131 | 131 |
132 void codegen(CodegenWorkItem work) { } | 132 WorldImpact codegen(CodegenWorkItem work) => const WorldImpact(); |
133 | 133 |
134 static bool checkTreeIntegrity(tree_ir.RootNode node) { | 134 static bool checkTreeIntegrity(tree_ir.RootNode node) { |
135 new CheckTreeIntegrity().check(node); | 135 new CheckTreeIntegrity().check(node); |
136 return true; // So this can be used from assert(). | 136 return true; // So this can be used from assert(). |
137 } | 137 } |
138 | 138 |
139 static bool checkCpsIntegrity(cps_ir.RootNode node) { | 139 static bool checkCpsIntegrity(cps_ir.RootNode node) { |
140 new CheckCpsIntegrity().check(node); | 140 new CheckCpsIntegrity().check(node); |
141 return true; // So this can be used from assert(). | 141 return true; // So this can be used from assert(). |
142 } | 142 } |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 } | 558 } |
559 | 559 |
560 void traceGraph(String title, var irObject) { | 560 void traceGraph(String title, var irObject) { |
561 compiler.tracer.traceGraph(title, irObject); | 561 compiler.tracer.traceGraph(title, irObject); |
562 } | 562 } |
563 | 563 |
564 DartTypes get dartTypes => compiler.types; | 564 DartTypes get dartTypes => compiler.types; |
565 | 565 |
566 InternalErrorFunction get internalError => compiler.internalError; | 566 InternalErrorFunction get internalError => compiler.internalError; |
567 } | 567 } |
OLD | NEW |