| 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 library dart2js.common.codegen; | 5 library dart2js.common.codegen; |
| 6 | 6 |
| 7 import '../compiler.dart' show | 7 import '../compiler.dart' show |
| 8 Compiler; | 8 Compiler; |
| 9 import '../constants/values.dart' show | 9 import '../constants/values.dart' show |
| 10 ConstantValue; | 10 ConstantValue; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 Element get currentElement => treeElements.analyzedElement; | 50 Element get currentElement => treeElements.analyzedElement; |
| 51 | 51 |
| 52 // TODO(johnniwinther): Remove this getter when [Registry] creates a | 52 // TODO(johnniwinther): Remove this getter when [Registry] creates a |
| 53 // dependency node. | 53 // dependency node. |
| 54 Setlet<Element> get otherDependencies => treeElements.otherDependencies; | 54 Setlet<Element> get otherDependencies => treeElements.otherDependencies; |
| 55 | 55 |
| 56 CodegenEnqueuer get world => compiler.enqueuer.codegen; | 56 CodegenEnqueuer get world => compiler.enqueuer.codegen; |
| 57 JavaScriptBackend get backend => compiler.backend; | 57 JavaScriptBackend get backend => compiler.backend; |
| 58 | 58 |
| 59 void registerAssert() { |
| 60 registerStaticInvocation(backend.assertConditionHelperMethod); |
| 61 registerStaticInvocation(backend.assertThrowMethod); |
| 62 } |
| 63 |
| 59 void registerDependency(Element element) { | 64 void registerDependency(Element element) { |
| 60 treeElements.registerDependency(element); | 65 treeElements.registerDependency(element); |
| 61 } | 66 } |
| 62 | 67 |
| 63 void registerInlining(Element inlinedElement, Element context) { | 68 void registerInlining(Element inlinedElement, Element context) { |
| 64 if (compiler.dumpInfo) { | 69 if (compiler.dumpInfo) { |
| 65 compiler.dumpInfoTask.registerInlined(inlinedElement, context); | 70 compiler.dumpInfoTask.registerInlined(inlinedElement, context); |
| 66 } | 71 } |
| 67 } | 72 } |
| 68 | 73 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 | 202 |
| 198 TreeElements get resolutionTree => element.resolvedAst.elements; | 203 TreeElements get resolutionTree => element.resolvedAst.elements; |
| 199 | 204 |
| 200 WorldImpact run(Compiler compiler, CodegenEnqueuer world) { | 205 WorldImpact run(Compiler compiler, CodegenEnqueuer world) { |
| 201 if (world.isProcessed(element)) return const WorldImpact(); | 206 if (world.isProcessed(element)) return const WorldImpact(); |
| 202 | 207 |
| 203 registry = new CodegenRegistry(compiler, resolutionTree); | 208 registry = new CodegenRegistry(compiler, resolutionTree); |
| 204 return compiler.codegen(this, world); | 209 return compiler.codegen(this, world); |
| 205 } | 210 } |
| 206 } | 211 } |
| OLD | NEW |