| 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 const bool USE_CPS_IR = const bool.fromEnvironment("USE_CPS_IR"); | 9 const bool USE_CPS_IR = const bool.fromEnvironment("USE_CPS_IR"); |
| 10 | 10 |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 Element interceptedNames; | 175 Element interceptedNames; |
| 176 | 176 |
| 177 ClassElement jsInvocationMirrorClass; | 177 ClassElement jsInvocationMirrorClass; |
| 178 | 178 |
| 179 /// If [true], the compiler will emit code that writes the name of the current | 179 /// If [true], the compiler will emit code that writes the name of the current |
| 180 /// method together with its class and library to the console the first time | 180 /// method together with its class and library to the console the first time |
| 181 /// the method is called. | 181 /// the method is called. |
| 182 static const bool TRACE_CALLS = false; | 182 static const bool TRACE_CALLS = false; |
| 183 Element traceHelper; | 183 Element traceHelper; |
| 184 | 184 |
| 185 /** | |
| 186 * This element is a top-level variable (in generated output) that the | |
| 187 * compiler initializes to a datastructure used to map from a Type to the | |
| 188 * interceptor. See declaration of `mapTypeToInterceptor` in | |
| 189 * `interceptors.dart`. | |
| 190 */ | |
| 191 Element mapTypeToInterceptor; | |
| 192 | |
| 193 TypeMask get stringType => compiler.typesTask.stringType; | 185 TypeMask get stringType => compiler.typesTask.stringType; |
| 194 TypeMask get doubleType => compiler.typesTask.doubleType; | 186 TypeMask get doubleType => compiler.typesTask.doubleType; |
| 195 TypeMask get intType => compiler.typesTask.intType; | 187 TypeMask get intType => compiler.typesTask.intType; |
| 196 TypeMask get uint32Type => compiler.typesTask.uint32Type; | 188 TypeMask get uint32Type => compiler.typesTask.uint32Type; |
| 197 TypeMask get uint31Type => compiler.typesTask.uint31Type; | 189 TypeMask get uint31Type => compiler.typesTask.uint31Type; |
| 198 TypeMask get positiveIntType => compiler.typesTask.positiveIntType; | 190 TypeMask get positiveIntType => compiler.typesTask.positiveIntType; |
| 199 TypeMask get numType => compiler.typesTask.numType; | 191 TypeMask get numType => compiler.typesTask.numType; |
| 200 TypeMask get boolType => compiler.typesTask.boolType; | 192 TypeMask get boolType => compiler.typesTask.boolType; |
| 201 TypeMask get dynamicType => compiler.typesTask.dynamicType; | 193 TypeMask get dynamicType => compiler.typesTask.dynamicType; |
| 202 TypeMask get nullType => compiler.typesTask.nullType; | 194 TypeMask get nullType => compiler.typesTask.nullType; |
| (...skipping 1532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1735 return find(library, name); | 1727 return find(library, name); |
| 1736 } | 1728 } |
| 1737 | 1729 |
| 1738 ClassElement findClass(String name) { | 1730 ClassElement findClass(String name) { |
| 1739 return find(library, name); | 1731 return find(library, name); |
| 1740 } | 1732 } |
| 1741 | 1733 |
| 1742 if (uri == DART_INTERCEPTORS) { | 1734 if (uri == DART_INTERCEPTORS) { |
| 1743 getInterceptorMethod = findMethod('getInterceptor'); | 1735 getInterceptorMethod = findMethod('getInterceptor'); |
| 1744 interceptedNames = findVariable('interceptedNames'); | 1736 interceptedNames = findVariable('interceptedNames'); |
| 1745 mapTypeToInterceptor = findVariable('mapTypeToInterceptor'); | |
| 1746 getNativeInterceptorMethod = findMethod('getNativeInterceptor'); | 1737 getNativeInterceptorMethod = findMethod('getNativeInterceptor'); |
| 1747 | 1738 |
| 1748 List<ClassElement> classes = [ | 1739 List<ClassElement> classes = [ |
| 1749 jsInterceptorClass = findClass('Interceptor'), | 1740 jsInterceptorClass = findClass('Interceptor'), |
| 1750 jsStringClass = findClass('JSString'), | 1741 jsStringClass = findClass('JSString'), |
| 1751 jsArrayClass = findClass('JSArray'), | 1742 jsArrayClass = findClass('JSArray'), |
| 1752 // The int class must be before the double class, because the | 1743 // The int class must be before the double class, because the |
| 1753 // emitter relies on this list for the order of type checks. | 1744 // emitter relies on this list for the order of type checks. |
| 1754 jsIntClass = findClass('JSInt'), | 1745 jsIntClass = findClass('JSInt'), |
| 1755 jsPositiveIntClass = findClass('JSPositiveInt'), | 1746 jsPositiveIntClass = findClass('JSPositiveInt'), |
| (...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2507 } | 2498 } |
| 2508 } | 2499 } |
| 2509 | 2500 |
| 2510 /// Records that [constant] is used by the element behind [registry]. | 2501 /// Records that [constant] is used by the element behind [registry]. |
| 2511 class Dependency { | 2502 class Dependency { |
| 2512 final ConstantValue constant; | 2503 final ConstantValue constant; |
| 2513 final Element annotatedElement; | 2504 final Element annotatedElement; |
| 2514 | 2505 |
| 2515 const Dependency(this.constant, this.annotatedElement); | 2506 const Dependency(this.constant, this.annotatedElement); |
| 2516 } | 2507 } |
| OLD | NEW |