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

Side by Side Diff: dart/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart

Issue 285903006: Fix main handling in dart2js and add tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r38186. Created 6 years, 5 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 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 2087 matching lines...) Expand 10 before | Expand all | Expand 10 after
2098 if (element == invokeOnMethod) { 2098 if (element == invokeOnMethod) {
2099 compiler.enabledInvokeOn = true; 2099 compiler.enabledInvokeOn = true;
2100 } 2100 }
2101 } 2101 }
2102 2102
2103 CodeBuffer codeOf(Element element) { 2103 CodeBuffer codeOf(Element element) {
2104 return generatedCode.containsKey(element) 2104 return generatedCode.containsKey(element)
2105 ? jsAst.prettyPrint(generatedCode[element], compiler) 2105 ? jsAst.prettyPrint(generatedCode[element], compiler)
2106 : null; 2106 : null;
2107 } 2107 }
2108
2109 FunctionElement helperForBadMain() => findHelper('badMain');
2110
2111 FunctionElement helperForMissingMain() => findHelper('missingMain');
2112
2113 FunctionElement helperForMainArity() {
2114 return findHelper('mainHasTooManyParameters');
2115 }
2108 } 2116 }
2109 2117
2110 class JavaScriptionResolutionCallbacks extends ResolutionCallbacks { 2118 class JavaScriptionResolutionCallbacks extends ResolutionCallbacks {
2111 final JavaScriptBackend backend; 2119 final JavaScriptBackend backend;
2112 2120
2113 JavaScriptionResolutionCallbacks(this.backend); 2121 JavaScriptionResolutionCallbacks(this.backend);
2114 2122
2115 void registerBackendStaticInvocation(Element element, Registry registry) { 2123 void registerBackendStaticInvocation(Element element, Registry registry) {
2116 registry.registerStaticInvocation(backend.registerBackendUse(element)); 2124 registry.registerStaticInvocation(backend.registerBackendUse(element));
2117 } 2125 }
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
2303 } 2311 }
2304 2312
2305 /// Records that [constant] is used by the element behind [registry]. 2313 /// Records that [constant] is used by the element behind [registry].
2306 class Dependency { 2314 class Dependency {
2307 final Constant constant; 2315 final Constant constant;
2308 // TODO(johnniwinther): Change to [Element] when dependency nodes are added. 2316 // TODO(johnniwinther): Change to [Element] when dependency nodes are added.
2309 final Registry registry; 2317 final Registry registry;
2310 2318
2311 const Dependency(this.constant, this.registry); 2319 const Dependency(this.constant, this.registry);
2312 } 2320 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698