| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 dart2js.js_emitter; | 5 part of dart2js.js_emitter; |
| 6 | 6 |
| 7 | 7 |
| 8 class OldEmitter implements Emitter { | 8 class OldEmitter implements Emitter { |
| 9 final Compiler compiler; | 9 final Compiler compiler; |
| 10 final CodeEmitterTask task; | 10 final CodeEmitterTask task; |
| (...skipping 1685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1696 getReflectionDataParser(classesCollector, backend), | 1696 getReflectionDataParser(classesCollector, backend), |
| 1697 compiler)) | 1697 compiler)) |
| 1698 ..write(')') | 1698 ..write(')') |
| 1699 ..write('([$n') | 1699 ..write('([$n') |
| 1700 ..add(libraryBuffer) | 1700 ..add(libraryBuffer) |
| 1701 ..write('])$N'); | 1701 ..write('])$N'); |
| 1702 | 1702 |
| 1703 emitFinishClassesInvocationIfNecessary(mainBuffer); | 1703 emitFinishClassesInvocationIfNecessary(mainBuffer); |
| 1704 } | 1704 } |
| 1705 | 1705 |
| 1706 typeTestEmitter.emitRuntimeTypeSupport(mainBuffer, mainOutputUnit); | |
| 1707 interceptorEmitter.emitGetInterceptorMethods(mainBuffer); | 1706 interceptorEmitter.emitGetInterceptorMethods(mainBuffer); |
| 1708 interceptorEmitter.emitOneShotInterceptors(mainBuffer); | 1707 interceptorEmitter.emitOneShotInterceptors(mainBuffer); |
| 1709 | 1708 |
| 1710 if (task.outputContainsConstantList) { | 1709 if (task.outputContainsConstantList) { |
| 1711 emitMakeConstantList(mainBuffer); | 1710 emitMakeConstantList(mainBuffer); |
| 1712 } | 1711 } |
| 1713 | 1712 |
| 1714 // Constants in checked mode call into RTI code to set type information | 1713 // Constants in checked mode call into RTI code to set type information |
| 1715 // which may need getInterceptor (and one-shot interceptor) methods, so | 1714 // which may need getInterceptor (and one-shot interceptor) methods, so |
| 1716 // we have to make sure that [emitGetInterceptorMethods] and | 1715 // we have to make sure that [emitGetInterceptorMethods] and |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2165 // Set the currentIsolate variable to the current isolate (which is | 2164 // Set the currentIsolate variable to the current isolate (which is |
| 2166 // provided as second argument). | 2165 // provided as second argument). |
| 2167 // We need to do this, because we use the same variable for setting up | 2166 // We need to do this, because we use the same variable for setting up |
| 2168 // the isolate-properties and for storing the current isolate. During | 2167 // the isolate-properties and for storing the current isolate. During |
| 2169 // the setup (the code above this lines) we must set the variable to | 2168 // the setup (the code above this lines) we must set the variable to |
| 2170 // the isolate-properties. | 2169 // the isolate-properties. |
| 2171 // After we have done the setup (finishing with `finishClasses`) it must | 2170 // After we have done the setup (finishing with `finishClasses`) it must |
| 2172 // point to the current Isolate. Otherwise all methods/functions | 2171 // point to the current Isolate. Otherwise all methods/functions |
| 2173 // accessing isolate variables will access the wrong object. | 2172 // accessing isolate variables will access the wrong object. |
| 2174 outputBuffer.write("${namer.currentIsolate}$_=${_}arguments[1]$N"); | 2173 outputBuffer.write("${namer.currentIsolate}$_=${_}arguments[1]$N"); |
| 2175 typeTestEmitter.emitRuntimeTypeSupport(outputBuffer, outputUnit); | |
| 2176 | 2174 |
| 2177 emitCompileTimeConstants(outputBuffer, outputUnit); | 2175 emitCompileTimeConstants(outputBuffer, outputUnit); |
| 2178 emitStaticNonFinalFieldInitializations(outputBuffer, outputUnit); | 2176 emitStaticNonFinalFieldInitializations(outputBuffer, outputUnit); |
| 2179 outputBuffer.write('}$N'); | 2177 outputBuffer.write('}$N'); |
| 2180 | 2178 |
| 2181 if (compiler.useContentSecurityPolicy) { | 2179 if (compiler.useContentSecurityPolicy) { |
| 2182 jsAst.FunctionDeclaration precompiledFunctionAst = | 2180 jsAst.FunctionDeclaration precompiledFunctionAst = |
| 2183 buildCspPrecompiledFunctionFor(outputUnit); | 2181 buildCspPrecompiledFunctionFor(outputUnit); |
| 2184 | 2182 |
| 2185 outputBuffer.write( | 2183 outputBuffer.write( |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2261 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { | 2259 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { |
| 2262 if (element.isInstanceMember) { | 2260 if (element.isInstanceMember) { |
| 2263 cachedClassBuilders.remove(element.enclosingClass); | 2261 cachedClassBuilders.remove(element.enclosingClass); |
| 2264 | 2262 |
| 2265 nativeEmitter.cachedBuilders.remove(element.enclosingClass); | 2263 nativeEmitter.cachedBuilders.remove(element.enclosingClass); |
| 2266 | 2264 |
| 2267 } | 2265 } |
| 2268 } | 2266 } |
| 2269 } | 2267 } |
| 2270 } | 2268 } |
| OLD | NEW |