| 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 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1011 jsAst.Expression finishedClassesAccess = | 1011 jsAst.Expression finishedClassesAccess = |
| 1012 generateEmbeddedGlobalAccess(embeddedNames.FINISHED_CLASSES); | 1012 generateEmbeddedGlobalAccess(embeddedNames.FINISHED_CLASSES); |
| 1013 jsAst.Expression cyclicThrow = | 1013 jsAst.Expression cyclicThrow = |
| 1014 staticFunctionAccess(backend.getCyclicThrowHelper()); | 1014 staticFunctionAccess(backend.getCyclicThrowHelper()); |
| 1015 jsAst.Expression laziesAccess = | 1015 jsAst.Expression laziesAccess = |
| 1016 generateEmbeddedGlobalAccess(embeddedNames.LAZIES); | 1016 generateEmbeddedGlobalAccess(embeddedNames.LAZIES); |
| 1017 | 1017 |
| 1018 jsAst.FunctionDeclaration decl = js.statement(''' | 1018 jsAst.FunctionDeclaration decl = js.statement(''' |
| 1019 function init() { | 1019 function init() { |
| 1020 $isolateProperties = Object.create(null); | 1020 $isolateProperties = Object.create(null); |
| 1021 (function(){ | 1021 #allClasses = Object.create(null); |
| 1022 #allClasses = Object.create(null); | 1022 #interceptorsByTag = Object.create(null); |
| 1023 #interceptorsByTag = Object.create(null); | 1023 #leafTags = Object.create(null); |
| 1024 #leafTags = Object.create(null); | 1024 #finishedClasses = Object.create(null); |
| 1025 #finishedClasses = Object.create(null); | |
| 1026 })(); | |
| 1027 | 1025 |
| 1028 if (#needsLazyInitializer) { | 1026 if (#needsLazyInitializer) { |
| 1029 $lazyInitializerName = function (prototype, staticName, fieldName, | 1027 $lazyInitializerName = function (prototype, staticName, fieldName, |
| 1030 getterName, lazyValue) { | 1028 getterName, lazyValue) { |
| 1031 if (!#lazies) #lazies = Object.create(null); | 1029 if (!#lazies) #lazies = Object.create(null); |
| 1032 #lazies[fieldName] = getterName; | 1030 #lazies[fieldName] = getterName; |
| 1033 | 1031 |
| 1034 var sentinelUndefined = {}; | 1032 var sentinelUndefined = {}; |
| 1035 var sentinelInProgress = {}; | 1033 var sentinelInProgress = {}; |
| 1036 prototype[fieldName] = sentinelUndefined; | 1034 prototype[fieldName] = sentinelUndefined; |
| (...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2030 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { | 2028 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { |
| 2031 if (element.isInstanceMember) { | 2029 if (element.isInstanceMember) { |
| 2032 cachedClassBuilders.remove(element.enclosingClass); | 2030 cachedClassBuilders.remove(element.enclosingClass); |
| 2033 | 2031 |
| 2034 nativeEmitter.cachedBuilders.remove(element.enclosingClass); | 2032 nativeEmitter.cachedBuilders.remove(element.enclosingClass); |
| 2035 | 2033 |
| 2036 } | 2034 } |
| 2037 } | 2035 } |
| 2038 } | 2036 } |
| 2039 } | 2037 } |
| OLD | NEW |