| 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 1439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1450 Element element = work.element; | 1450 Element element = work.element; |
| 1451 if (compiler.elementHasCompileTimeError(element)) { | 1451 if (compiler.elementHasCompileTimeError(element)) { |
| 1452 DiagnosticMessage message = | 1452 DiagnosticMessage message = |
| 1453 // If there's more than one error, the first is probably most | 1453 // If there's more than one error, the first is probably most |
| 1454 // informative, as the following errors may be side-effects of the | 1454 // informative, as the following errors may be side-effects of the |
| 1455 // first error. | 1455 // first error. |
| 1456 compiler.elementsWithCompileTimeErrors[element].first; | 1456 compiler.elementsWithCompileTimeErrors[element].first; |
| 1457 String messageText = message.message.computeMessage(); | 1457 String messageText = message.message.computeMessage(); |
| 1458 jsAst.LiteralString messageLiteral = | 1458 jsAst.LiteralString messageLiteral = |
| 1459 js.escapedString("Compile time error in $element: $messageText"); | 1459 js.escapedString("Compile time error in $element: $messageText"); |
| 1460 generatedCode[element] = js( | 1460 generatedCode[element] = |
| 1461 "function () { throw new Error(#); }", [messageLiteral]); | 1461 js("function () { throw new Error(#); }", [messageLiteral]); |
| 1462 return const CodegenImpact(); | 1462 return const CodegenImpact(); |
| 1463 } | 1463 } |
| 1464 var kind = element.kind; | 1464 var kind = element.kind; |
| 1465 if (kind == ElementKind.TYPEDEF) { | 1465 if (kind == ElementKind.TYPEDEF) { |
| 1466 return const WorldImpact(); | 1466 return const WorldImpact(); |
| 1467 } | 1467 } |
| 1468 if (element.isConstructor && | 1468 if (element.isConstructor && |
| 1469 element.enclosingClass == helpers.jsNullClass) { | 1469 element.enclosingClass == helpers.jsNullClass) { |
| 1470 // Work around a problem compiling JSNull's constructor. | 1470 // Work around a problem compiling JSNull's constructor. |
| 1471 return const CodegenImpact(); | 1471 return const CodegenImpact(); |
| (...skipping 1544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3016 | 3016 |
| 3017 @override | 3017 @override |
| 3018 void onImpactUsed(ImpactUseCase impactUse) { | 3018 void onImpactUsed(ImpactUseCase impactUse) { |
| 3019 if (impactUse == DeferredLoadTask.IMPACT_USE && !supportSerialization) { | 3019 if (impactUse == DeferredLoadTask.IMPACT_USE && !supportSerialization) { |
| 3020 // TODO(johnniwinther): Allow emptying when serialization has been | 3020 // TODO(johnniwinther): Allow emptying when serialization has been |
| 3021 // performed. | 3021 // performed. |
| 3022 resolution.emptyCache(); | 3022 resolution.emptyCache(); |
| 3023 } | 3023 } |
| 3024 } | 3024 } |
| 3025 } | 3025 } |
| OLD | NEW |