Chromium Code Reviews| 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 (element.isConstructor() && element.getEnclosingClass() == jsNullClass) { | |
| 764 // Work around a problem compiling JSNull's constructor. | |
|
ahe
2013/06/11 15:43:00
I had to move the work around here to make it more
| |
| 765 return; | |
| 766 } | |
| 767 if (kind.category == ElementCategory.VARIABLE) { | |
| 762 Constant initialValue = compiler.constantHandler.compileWorkItem(work); | 768 Constant initialValue = compiler.constantHandler.compileWorkItem(work); |
| 763 if (initialValue != null) { | 769 if (initialValue != null) { |
| 764 return; | 770 return; |
| 765 } else { | 771 } else { |
| 766 // If the constant-handler was not able to produce a result we have to | 772 // 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 | 773 // go through the builder (below) to generate the lazy initializer for |
| 768 // the static variable. | 774 // the static variable. |
| 769 // We also need to register the use of the cyclic-error helper. | 775 // We also need to register the use of the cyclic-error helper. |
| 770 compiler.enqueuer.codegen.registerStaticUse(getCyclicThrowHelper()); | 776 compiler.enqueuer.codegen.registerStaticUse(getCyclicThrowHelper()); |
| 771 } | 777 } |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1081 ClassElement get listImplementation => jsArrayClass; | 1087 ClassElement get listImplementation => jsArrayClass; |
| 1082 ClassElement get constListImplementation => jsArrayClass; | 1088 ClassElement get constListImplementation => jsArrayClass; |
| 1083 ClassElement get fixedListImplementation => jsFixedArrayClass; | 1089 ClassElement get fixedListImplementation => jsFixedArrayClass; |
| 1084 ClassElement get growableListImplementation => jsExtendableArrayClass; | 1090 ClassElement get growableListImplementation => jsExtendableArrayClass; |
| 1085 ClassElement get mapImplementation => mapLiteralClass; | 1091 ClassElement get mapImplementation => mapLiteralClass; |
| 1086 ClassElement get constMapImplementation => constMapLiteralClass; | 1092 ClassElement get constMapImplementation => constMapLiteralClass; |
| 1087 ClassElement get typeImplementation => typeLiteralClass; | 1093 ClassElement get typeImplementation => typeLiteralClass; |
| 1088 ClassElement get boolImplementation => jsBoolClass; | 1094 ClassElement get boolImplementation => jsBoolClass; |
| 1089 ClassElement get nullImplementation => jsNullClass; | 1095 ClassElement get nullImplementation => jsNullClass; |
| 1090 } | 1096 } |
| OLD | NEW |