| 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 class JavaScriptItemCompilationContext extends ItemCompilationContext { | 7 class JavaScriptItemCompilationContext extends ItemCompilationContext { |
| 8 final Set<HInstruction> boundsChecked; | 8 final Set<HInstruction> boundsChecked; |
| 9 | 9 |
| 10 JavaScriptItemCompilationContext() | 10 JavaScriptItemCompilationContext() |
| (...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 compiler.enqueuer.resolution.registerInstantiatedClass(e, elements); | 751 compiler.enqueuer.resolution.registerInstantiatedClass(e, elements); |
| 752 } | 752 } |
| 753 e = compiler.findHelper(const SourceString('ConstantProtoMap')); | 753 e = compiler.findHelper(const SourceString('ConstantProtoMap')); |
| 754 if (e != null) { | 754 if (e != null) { |
| 755 compiler.enqueuer.resolution.registerInstantiatedClass(e, elements); | 755 compiler.enqueuer.resolution.registerInstantiatedClass(e, elements); |
| 756 } | 756 } |
| 757 } | 757 } |
| 758 | 758 |
| 759 void codegen(CodegenWorkItem work) { | 759 void codegen(CodegenWorkItem work) { |
| 760 Element element = work.element; | 760 Element element = work.element; |
| 761 if (element.kind.category == ElementCategory.VARIABLE) { | 761 var kind = element.kind; |
| 762 if (kind == ElementKind.TYPEDEF) return; |
| 763 if (kind.category == ElementCategory.VARIABLE) { |
| 762 Constant initialValue = compiler.constantHandler.compileWorkItem(work); | 764 Constant initialValue = compiler.constantHandler.compileWorkItem(work); |
| 763 if (initialValue != null) { | 765 if (initialValue != null) { |
| 764 return; | 766 return; |
| 765 } else { | 767 } else { |
| 766 // If the constant-handler was not able to produce a result we have to | 768 // If the constant-handler was not able to produce a result we have to |
| 767 // go through the builder (below) to generate the lazy initializer for | 769 // go through the builder (below) to generate the lazy initializer for |
| 768 // the static variable. | 770 // the static variable. |
| 769 // We also need to register the use of the cyclic-error helper. | 771 // We also need to register the use of the cyclic-error helper. |
| 770 compiler.enqueuer.codegen.registerStaticUse(getCyclicThrowHelper()); | 772 compiler.enqueuer.codegen.registerStaticUse(getCyclicThrowHelper()); |
| 771 } | 773 } |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1081 ClassElement get listImplementation => jsArrayClass; | 1083 ClassElement get listImplementation => jsArrayClass; |
| 1082 ClassElement get constListImplementation => jsArrayClass; | 1084 ClassElement get constListImplementation => jsArrayClass; |
| 1083 ClassElement get fixedListImplementation => jsFixedArrayClass; | 1085 ClassElement get fixedListImplementation => jsFixedArrayClass; |
| 1084 ClassElement get growableListImplementation => jsExtendableArrayClass; | 1086 ClassElement get growableListImplementation => jsExtendableArrayClass; |
| 1085 ClassElement get mapImplementation => mapLiteralClass; | 1087 ClassElement get mapImplementation => mapLiteralClass; |
| 1086 ClassElement get constMapImplementation => constMapLiteralClass; | 1088 ClassElement get constMapImplementation => constMapLiteralClass; |
| 1087 ClassElement get typeImplementation => typeLiteralClass; | 1089 ClassElement get typeImplementation => typeLiteralClass; |
| 1088 ClassElement get boolImplementation => jsBoolClass; | 1090 ClassElement get boolImplementation => jsBoolClass; |
| 1089 ClassElement get nullImplementation => jsNullClass; | 1091 ClassElement get nullImplementation => jsNullClass; |
| 1090 } | 1092 } |
| OLD | NEW |