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 js_backend; | 5 part of js_backend; |
6 | 6 |
7 const VERBOSE_OPTIMIZER_HINTS = false; | 7 const VERBOSE_OPTIMIZER_HINTS = false; |
8 | 8 |
9 class JavaScriptItemCompilationContext extends ItemCompilationContext { | 9 class JavaScriptItemCompilationContext extends ItemCompilationContext { |
10 final Set<HInstruction> boundsChecked = new Set<HInstruction>(); | 10 final Set<HInstruction> boundsChecked = new Set<HInstruction>(); |
(...skipping 2086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2097 if (element == invokeOnMethod) { | 2097 if (element == invokeOnMethod) { |
2098 compiler.enabledInvokeOn = true; | 2098 compiler.enabledInvokeOn = true; |
2099 } | 2099 } |
2100 } | 2100 } |
2101 | 2101 |
2102 CodeBuffer codeOf(Element element) { | 2102 CodeBuffer codeOf(Element element) { |
2103 return generatedCode.containsKey(element) | 2103 return generatedCode.containsKey(element) |
2104 ? jsAst.prettyPrint(generatedCode[element], compiler) | 2104 ? jsAst.prettyPrint(generatedCode[element], compiler) |
2105 : null; | 2105 : null; |
2106 } | 2106 } |
| 2107 |
| 2108 FunctionElement helperForBadMain() => findHelper('badMain'); |
| 2109 |
| 2110 FunctionElement helperForMissingMain() => findHelper('missingMain'); |
| 2111 |
| 2112 FunctionElement helperForMainArity() { |
| 2113 return findHelper('mainHasTooManyParameters'); |
| 2114 } |
2107 } | 2115 } |
2108 | 2116 |
2109 class JavaScriptionResolutionCallbacks extends ResolutionCallbacks { | 2117 class JavaScriptionResolutionCallbacks extends ResolutionCallbacks { |
2110 final JavaScriptBackend backend; | 2118 final JavaScriptBackend backend; |
2111 | 2119 |
2112 JavaScriptionResolutionCallbacks(this.backend); | 2120 JavaScriptionResolutionCallbacks(this.backend); |
2113 | 2121 |
2114 void registerBackendStaticInvocation(Element element, Registry registry) { | 2122 void registerBackendStaticInvocation(Element element, Registry registry) { |
2115 registry.registerStaticInvocation(backend.registerBackendUse(element)); | 2123 registry.registerStaticInvocation(backend.registerBackendUse(element)); |
2116 } | 2124 } |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2302 } | 2310 } |
2303 | 2311 |
2304 /// Records that [constant] is used by the element behind [registry]. | 2312 /// Records that [constant] is used by the element behind [registry]. |
2305 class Dependency { | 2313 class Dependency { |
2306 final Constant constant; | 2314 final Constant constant; |
2307 // TODO(johnniwinther): Change to [Element] when dependency nodes are added. | 2315 // TODO(johnniwinther): Change to [Element] when dependency nodes are added. |
2308 final Registry registry; | 2316 final Registry registry; |
2309 | 2317 |
2310 const Dependency(this.constant, this.registry); | 2318 const Dependency(this.constant, this.registry); |
2311 } | 2319 } |
OLD | NEW |