| 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 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1186 properties.__MAGIC_SLOW_PROPERTY = 1; | 1186 properties.__MAGIC_SLOW_PROPERTY = 1; |
| 1187 delete properties.__MAGIC_SLOW_PROPERTY; | 1187 delete properties.__MAGIC_SLOW_PROPERTY; |
| 1188 return properties; | 1188 return properties; |
| 1189 }'''); | 1189 }'''); |
| 1190 | 1190 |
| 1191 output.addBuffer(jsAst.prettyPrint(convertToSlowObject, compiler)); | 1191 output.addBuffer(jsAst.prettyPrint(convertToSlowObject, compiler)); |
| 1192 output.add(N); | 1192 output.add(N); |
| 1193 } | 1193 } |
| 1194 | 1194 |
| 1195 void emitSupportsDirectProtoAccess(CodeOutput output) { | 1195 void emitSupportsDirectProtoAccess(CodeOutput output) { |
| 1196 jsAst.Statement supportsDirectProtoAccess = js.statement(r''' | 1196 jsAst.Statement supportsDirectProtoAccess; |
| 1197 var supportsDirectProtoAccess = (function () { | 1197 |
| 1198 var cls = function () {}; | 1198 if (compiler.hasIncrementalSupport) { |
| 1199 cls.prototype = {'p': {}}; | 1199 supportsDirectProtoAccess = js.statement(r''' |
| 1200 var object = new cls(); | 1200 var supportsDirectProtoAccess = false; |
| 1201 return object.__proto__ && | 1201 '''); |
| 1202 object.__proto__.p === cls.prototype.p; | 1202 } else { |
| 1203 })(); | 1203 supportsDirectProtoAccess = js.statement(r''' |
| 1204 '''); | 1204 var supportsDirectProtoAccess = (function () { |
| 1205 var cls = function () {}; |
| 1206 cls.prototype = {'p': {}}; |
| 1207 var object = new cls(); |
| 1208 return object.__proto__ && |
| 1209 object.__proto__.p === cls.prototype.p; |
| 1210 })(); |
| 1211 '''); |
| 1212 } |
| 1205 | 1213 |
| 1206 output.addBuffer(jsAst.prettyPrint(supportsDirectProtoAccess, compiler)); | 1214 output.addBuffer(jsAst.prettyPrint(supportsDirectProtoAccess, compiler)); |
| 1207 output.add(N); | 1215 output.add(N); |
| 1208 } | 1216 } |
| 1209 | 1217 |
| 1210 void writeLibraryDescriptor(CodeOutput output, LibraryElement library) { | 1218 void writeLibraryDescriptor(CodeOutput output, LibraryElement library) { |
| 1211 var uri = ""; | 1219 var uri = ""; |
| 1212 if (!compiler.enableMinification || backend.mustPreserveUris) { | 1220 if (!compiler.enableMinification || backend.mustPreserveUris) { |
| 1213 uri = library.canonicalUri; | 1221 uri = library.canonicalUri; |
| 1214 if (uri.scheme == 'file' && compiler.outputUri != null) { | 1222 if (uri.scheme == 'file' && compiler.outputUri != null) { |
| (...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2120 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { | 2128 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { |
| 2121 if (element.isInstanceMember) { | 2129 if (element.isInstanceMember) { |
| 2122 cachedClassBuilders.remove(element.enclosingClass); | 2130 cachedClassBuilders.remove(element.enclosingClass); |
| 2123 | 2131 |
| 2124 nativeEmitter.cachedBuilders.remove(element.enclosingClass); | 2132 nativeEmitter.cachedBuilders.remove(element.enclosingClass); |
| 2125 | 2133 |
| 2126 } | 2134 } |
| 2127 } | 2135 } |
| 2128 } | 2136 } |
| 2129 } | 2137 } |
| OLD | NEW |