| 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 typedef void Recompile(Element element); | 7 typedef void Recompile(Element element); |
| 8 | 8 |
| 9 class ReturnInfo { | 9 class ReturnInfo { |
| 10 HType returnType; | 10 HType returnType; |
| (...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 857 } else { | 857 } else { |
| 858 specializedGetInterceptors[name] = classes; | 858 specializedGetInterceptors[name] = classes; |
| 859 } | 859 } |
| 860 } | 860 } |
| 861 | 861 |
| 862 void initializeNoSuchMethod() { | 862 void initializeNoSuchMethod() { |
| 863 // In case the emitter generates noSuchMethod calls, we need to | 863 // In case the emitter generates noSuchMethod calls, we need to |
| 864 // make sure all [noSuchMethod] methods know they might take a | 864 // make sure all [noSuchMethod] methods know they might take a |
| 865 // [JsInvocationMirror] as parameter. | 865 // [JsInvocationMirror] as parameter. |
| 866 HTypeList types = new HTypeList(1); | 866 HTypeList types = new HTypeList(1); |
| 867 types[0] = new HType.fromBoundedType( | 867 types[0] = new HBoundedType.exact( |
| 868 compiler.jsInvocationMirrorClass.computeType(compiler), | 868 compiler.jsInvocationMirrorClass.computeType(compiler)); |
| 869 compiler, | |
| 870 false); | |
| 871 argumentTypes.registerDynamicInvocation(types, new Selector.noSuchMethod()); | 869 argumentTypes.registerDynamicInvocation(types, new Selector.noSuchMethod()); |
| 872 } | 870 } |
| 873 | 871 |
| 874 void registerInstantiatedClass(ClassElement cls, Enqueuer enqueuer) { | 872 void registerInstantiatedClass(ClassElement cls, Enqueuer enqueuer) { |
| 875 if (!seenAnyClass) { | 873 if (!seenAnyClass) { |
| 876 initializeInterceptorElements(); | 874 initializeInterceptorElements(); |
| 877 initializeNoSuchMethod(); | 875 initializeNoSuchMethod(); |
| 878 seenAnyClass = true; | 876 seenAnyClass = true; |
| 879 } | 877 } |
| 880 ClassElement result = null; | 878 ClassElement result = null; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 904 addInterceptors(jsNullClass, enqueuer); | 902 addInterceptors(jsNullClass, enqueuer); |
| 905 } else if (cls == compiler.numClass) { | 903 } else if (cls == compiler.numClass) { |
| 906 addInterceptors(jsIntClass, enqueuer); | 904 addInterceptors(jsIntClass, enqueuer); |
| 907 addInterceptors(jsDoubleClass, enqueuer); | 905 addInterceptors(jsDoubleClass, enqueuer); |
| 908 addInterceptors(jsNumberClass, enqueuer); | 906 addInterceptors(jsNumberClass, enqueuer); |
| 909 } else if (cls == compiler.mapClass) { | 907 } else if (cls == compiler.mapClass) { |
| 910 // The backend will use a literal list to initialize the entries | 908 // The backend will use a literal list to initialize the entries |
| 911 // of the map. | 909 // of the map. |
| 912 if (enqueuer.isResolutionQueue) { | 910 if (enqueuer.isResolutionQueue) { |
| 913 enqueuer.registerInstantiatedClass(compiler.listClass); | 911 enqueuer.registerInstantiatedClass(compiler.listClass); |
| 912 enqueuer.registerInstantiatedClass(compiler.mapLiteralClass); |
| 914 } | 913 } |
| 915 } | 914 } |
| 916 } | 915 } |
| 917 | 916 |
| 918 Element get cyclicThrowHelper { | 917 Element get cyclicThrowHelper { |
| 919 return compiler.findHelper(const SourceString("throwCyclicInit")); | 918 return compiler.findHelper(const SourceString("throwCyclicInit")); |
| 920 } | 919 } |
| 921 | 920 |
| 922 JavaScriptItemCompilationContext createItemCompilationContext() { | 921 JavaScriptItemCompilationContext createItemCompilationContext() { |
| 923 return new JavaScriptItemCompilationContext(); | 922 return new JavaScriptItemCompilationContext(); |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1253 * | 1252 * |
| 1254 * Invariant: [element] must be a declaration element. | 1253 * Invariant: [element] must be a declaration element. |
| 1255 */ | 1254 */ |
| 1256 void eagerRecompile(Element element) { | 1255 void eagerRecompile(Element element) { |
| 1257 assert(invariant(element, element.isDeclaration)); | 1256 assert(invariant(element, element.isDeclaration)); |
| 1258 generatedCode.remove(element); | 1257 generatedCode.remove(element); |
| 1259 generatedBailoutCode.remove(element); | 1258 generatedBailoutCode.remove(element); |
| 1260 compiler.enqueuer.codegen.addToWorkList(element); | 1259 compiler.enqueuer.codegen.addToWorkList(element); |
| 1261 } | 1260 } |
| 1262 } | 1261 } |
| OLD | NEW |