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

Side by Side Diff: pkg/compiler/lib/src/common/codegen.dart

Issue 1325843003: Add optional message to assert in Dart2js. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Reintroduce assertHelper for asserts without messages. Created 5 years, 3 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
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 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
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(bool hasMessage) {
60 if (hasMessage) {
61 registerStaticInvocation(backend.assertTestMethod);
62 registerStaticInvocation(backend.assertThrowMethod);
63 } else {
64 registerStaticInvocation(backend.assertHelperMethod);
65 }
66 }
67
59 void registerDependency(Element element) { 68 void registerDependency(Element element) {
60 treeElements.registerDependency(element); 69 treeElements.registerDependency(element);
61 } 70 }
62 71
63 void registerInlining(Element inlinedElement, Element context) { 72 void registerInlining(Element inlinedElement, Element context) {
64 if (compiler.dumpInfo) { 73 if (compiler.dumpInfo) {
65 compiler.dumpInfoTask.registerInlined(inlinedElement, context); 74 compiler.dumpInfoTask.registerInlined(inlinedElement, context);
66 } 75 }
67 } 76 }
68 77
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 206
198 TreeElements get resolutionTree => element.resolvedAst.elements; 207 TreeElements get resolutionTree => element.resolvedAst.elements;
199 208
200 WorldImpact run(Compiler compiler, CodegenEnqueuer world) { 209 WorldImpact run(Compiler compiler, CodegenEnqueuer world) {
201 if (world.isProcessed(element)) return const WorldImpact(); 210 if (world.isProcessed(element)) return const WorldImpact();
202 211
203 registry = new CodegenRegistry(compiler, resolutionTree); 212 registry = new CodegenRegistry(compiler, resolutionTree);
204 return compiler.codegen(this, world); 213 return compiler.codegen(this, world);
205 } 214 }
206 } 215 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698