| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 Element objectEquals; | 100 Element objectEquals; |
| 101 | 101 |
| 102 ClassElement typeLiteralClass; | 102 ClassElement typeLiteralClass; |
| 103 ClassElement mapLiteralClass; | 103 ClassElement mapLiteralClass; |
| 104 ClassElement constMapLiteralClass; | 104 ClassElement constMapLiteralClass; |
| 105 ClassElement typeVariableClass; | 105 ClassElement typeVariableClass; |
| 106 | 106 |
| 107 ClassElement noSideEffectsClass; | 107 ClassElement noSideEffectsClass; |
| 108 ClassElement noThrowsClass; | 108 ClassElement noThrowsClass; |
| 109 ClassElement noInlineClass; | 109 ClassElement noInlineClass; |
| 110 ClassElement irRepresentationClass; |
| 110 | 111 |
| 111 Element getInterceptorMethod; | 112 Element getInterceptorMethod; |
| 112 Element interceptedNames; | 113 Element interceptedNames; |
| 113 | 114 |
| 114 /** | 115 /** |
| 115 * This element is a top-level variable (in generated output) that the | 116 * This element is a top-level variable (in generated output) that the |
| 116 * compiler initializes to a datastructure used to map from a Type to the | 117 * compiler initializes to a datastructure used to map from a Type to the |
| 117 * interceptor. See declaration of `mapTypeToInterceptor` in | 118 * interceptor. See declaration of `mapTypeToInterceptor` in |
| 118 * `interceptors.dart`. | 119 * `interceptors.dart`. |
| 119 */ | 120 */ |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 indexablePrimitiveType = new TypeMask.nonNullSubtype(jsIndexableClass); | 515 indexablePrimitiveType = new TypeMask.nonNullSubtype(jsIndexableClass); |
| 515 readableArrayType = new TypeMask.nonNullSubclass(jsArrayClass); | 516 readableArrayType = new TypeMask.nonNullSubclass(jsArrayClass); |
| 516 mutableArrayType = new TypeMask.nonNullSubclass(jsMutableArrayClass); | 517 mutableArrayType = new TypeMask.nonNullSubclass(jsMutableArrayClass); |
| 517 fixedArrayType = new TypeMask.nonNullExact(jsFixedArrayClass); | 518 fixedArrayType = new TypeMask.nonNullExact(jsFixedArrayClass); |
| 518 extendableArrayType = new TypeMask.nonNullExact(jsExtendableArrayClass); | 519 extendableArrayType = new TypeMask.nonNullExact(jsExtendableArrayClass); |
| 519 nonNullType = compiler.typesTask.dynamicType.nonNullable(); | 520 nonNullType = compiler.typesTask.dynamicType.nonNullable(); |
| 520 | 521 |
| 521 noSideEffectsClass = compiler.findHelper('NoSideEffects'); | 522 noSideEffectsClass = compiler.findHelper('NoSideEffects'); |
| 522 noThrowsClass = compiler.findHelper('NoThrows'); | 523 noThrowsClass = compiler.findHelper('NoThrows'); |
| 523 noInlineClass = compiler.findHelper('NoInline'); | 524 noInlineClass = compiler.findHelper('NoInline'); |
| 525 irRepresentationClass = compiler.findHelper('IrRepresentation'); |
| 524 } | 526 } |
| 525 | 527 |
| 526 void validateInterceptorImplementsAllObjectMethods( | 528 void validateInterceptorImplementsAllObjectMethods( |
| 527 ClassElement interceptorClass) { | 529 ClassElement interceptorClass) { |
| 528 if (interceptorClass == null) return; | 530 if (interceptorClass == null) return; |
| 529 interceptorClass.ensureResolved(compiler); | 531 interceptorClass.ensureResolved(compiler); |
| 530 compiler.objectClass.forEachMember((_, Element member) { | 532 compiler.objectClass.forEachMember((_, Element member) { |
| 531 if (member.isGenerativeConstructor()) return; | 533 if (member.isGenerativeConstructor()) return; |
| 532 Element interceptorMember = interceptorClass.lookupMember(member.name); | 534 Element interceptorMember = interceptorClass.lookupMember(member.name); |
| 533 // Interceptors must override all Object methods due to calling convention | 535 // Interceptors must override all Object methods due to calling convention |
| (...skipping 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1862 copy(constant.values); | 1864 copy(constant.values); |
| 1863 copy(constant.protoValue); | 1865 copy(constant.protoValue); |
| 1864 copy(constant); | 1866 copy(constant); |
| 1865 } | 1867 } |
| 1866 | 1868 |
| 1867 void visitConstructed(ConstructedConstant constant) { | 1869 void visitConstructed(ConstructedConstant constant) { |
| 1868 copy(constant.fields); | 1870 copy(constant.fields); |
| 1869 copy(constant); | 1871 copy(constant); |
| 1870 } | 1872 } |
| 1871 } | 1873 } |
| OLD | NEW |