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

Side by Side Diff: pkg/compiler/lib/src/js_backend/backend.dart

Issue 1851433002: Better record compile-time errors on elements (Closed) Base URL: https://github.com/dart-lang/sdk.git@_temporary_fletch_patches
Patch Set: Address comment Created 4 years, 8 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
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1549 matching lines...) Expand 10 before | Expand all | Expand 10 after
1560 } 1560 }
1561 for (BackendImpact otherImpact in impact.otherImpacts) { 1561 for (BackendImpact otherImpact in impact.otherImpacts) {
1562 enqueueImpact(enqueuer, otherImpact, registry); 1562 enqueueImpact(enqueuer, otherImpact, registry);
1563 } 1563 }
1564 } 1564 }
1565 1565
1566 WorldImpact codegen(CodegenWorkItem work) { 1566 WorldImpact codegen(CodegenWorkItem work) {
1567 Element element = work.element; 1567 Element element = work.element;
1568 if (compiler.elementHasCompileTimeError(element)) { 1568 if (compiler.elementHasCompileTimeError(element)) {
1569 DiagnosticMessage message = 1569 DiagnosticMessage message =
1570 compiler.elementsWithCompileTimeErrors[element]; 1570 compiler.elementsWithCompileTimeErrors[element].last;
1571 String messageText = message.message.computeMessage(); 1571 String messageText = message.message.computeMessage();
1572 jsAst.LiteralString messageLiteral = 1572 jsAst.LiteralString messageLiteral =
1573 js.escapedString("Compile time error in $element: $messageText"); 1573 js.escapedString("Compile time error in $element: $messageText");
1574 generatedCode[element] = js( 1574 generatedCode[element] = js(
1575 "function () { throw new Error(#); }", [messageLiteral]); 1575 "function () { throw new Error(#); }", [messageLiteral]);
1576 return const CodegenImpact(); 1576 return const CodegenImpact();
1577 } 1577 }
1578 var kind = element.kind; 1578 var kind = element.kind;
1579 if (kind == ElementKind.TYPEDEF) { 1579 if (kind == ElementKind.TYPEDEF) {
1580 return const WorldImpact(); 1580 return const WorldImpact();
(...skipping 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after
3079 } 3079 }
3080 } 3080 }
3081 3081
3082 /// Records that [constant] is used by the element behind [registry]. 3082 /// Records that [constant] is used by the element behind [registry].
3083 class Dependency { 3083 class Dependency {
3084 final ConstantValue constant; 3084 final ConstantValue constant;
3085 final Element annotatedElement; 3085 final Element annotatedElement;
3086 3086
3087 const Dependency(this.constant, this.annotatedElement); 3087 const Dependency(this.constant, this.annotatedElement);
3088 } 3088 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698