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 3031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3042 registerBackendInstantiation(backend.compiler.stringClass, registry); | 3042 registerBackendInstantiation(backend.compiler.stringClass, registry); |
3043 } | 3043 } |
3044 | 3044 |
3045 void onThrowRuntimeError(Registry registry) { | 3045 void onThrowRuntimeError(Registry registry) { |
3046 assert(registry.isForResolution); | 3046 assert(registry.isForResolution); |
3047 registerBackendStaticInvocation(backend.getThrowRuntimeError(), registry); | 3047 registerBackendStaticInvocation(backend.getThrowRuntimeError(), registry); |
3048 // Also register the types of the arguments passed to this method. | 3048 // Also register the types of the arguments passed to this method. |
3049 registerBackendInstantiation(backend.compiler.stringClass, registry); | 3049 registerBackendInstantiation(backend.compiler.stringClass, registry); |
3050 } | 3050 } |
3051 | 3051 |
| 3052 void onCompileTimeError(Registry registry, ErroneousElement error) { |
| 3053 if (backend.compiler.generateCodeWithCompileTimeErrors) { |
| 3054 // TODO(johnniwinther): This should have its own uncatchable error. |
| 3055 onThrowRuntimeError(registry); |
| 3056 } |
| 3057 } |
| 3058 |
3052 void onSuperNoSuchMethod(Registry registry) { | 3059 void onSuperNoSuchMethod(Registry registry) { |
3053 assert(registry.isForResolution); | 3060 assert(registry.isForResolution); |
3054 registerBackendStaticInvocation( | 3061 registerBackendStaticInvocation( |
3055 backend.getCreateInvocationMirror(), registry); | 3062 backend.getCreateInvocationMirror(), registry); |
3056 registerBackendStaticInvocation( | 3063 registerBackendStaticInvocation( |
3057 backend.compiler.objectClass.lookupLocalMember( | 3064 backend.compiler.objectClass.lookupLocalMember( |
3058 Identifiers.noSuchMethod_), | 3065 Identifiers.noSuchMethod_), |
3059 registry); | 3066 registry); |
3060 registerBackendInstantiation(backend.compiler.listClass, registry); | 3067 registerBackendInstantiation(backend.compiler.listClass, registry); |
3061 registerBackendInstantiation(backend.compiler.stringClass, registry); | 3068 registerBackendInstantiation(backend.compiler.stringClass, registry); |
(...skipping 28 matching lines...) Expand all Loading... |
3090 } | 3097 } |
3091 } | 3098 } |
3092 | 3099 |
3093 /// Records that [constant] is used by the element behind [registry]. | 3100 /// Records that [constant] is used by the element behind [registry]. |
3094 class Dependency { | 3101 class Dependency { |
3095 final ConstantValue constant; | 3102 final ConstantValue constant; |
3096 final Element annotatedElement; | 3103 final Element annotatedElement; |
3097 | 3104 |
3098 const Dependency(this.constant, this.annotatedElement); | 3105 const Dependency(this.constant, this.annotatedElement); |
3099 } | 3106 } |
OLD | NEW |