| 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 dart2js.js_emitter; | 5 part of dart2js.js_emitter; |
| 6 | 6 |
| 7 class NativeEmitter { | 7 class NativeEmitter { |
| 8 | 8 |
| 9 final Map<Element, ClassBuilder> cachedBuilders; | 9 final Map<Element, ClassBuilder> cachedBuilders; |
| 10 | 10 |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 bool needsAccessor(Field field) { | 325 bool needsAccessor(Field field) { |
| 326 return field.needsGetter || | 326 return field.needsGetter || |
| 327 field.needsUncheckedSetter || | 327 field.needsUncheckedSetter || |
| 328 field.needsCheckedSetter; | 328 field.needsCheckedSetter; |
| 329 } | 329 } |
| 330 | 330 |
| 331 builder.isTrivial = | 331 builder.isTrivial = |
| 332 cls.methods.isEmpty && | 332 cls.methods.isEmpty && |
| 333 cls.isChecks.isEmpty && | 333 cls.isChecks.isEmpty && |
| 334 cls.callStubs.isEmpty && | 334 cls.callStubs.isEmpty && |
| 335 superclass is! MixinApplicationElement && | 335 !superclass.isMixinApplication && |
| 336 !cls.fields.any(needsAccessor); | 336 !cls.fields.any(needsAccessor); |
| 337 | 337 |
| 338 return builder; | 338 return builder; |
| 339 } | 339 } |
| 340 | 340 |
| 341 void finishGenerateNativeClasses() { | 341 void finishGenerateNativeClasses() { |
| 342 // TODO(sra): Put specialized version of getNativeMethods on | 342 // TODO(sra): Put specialized version of getNativeMethods on |
| 343 // `Object.prototype` to avoid checking in `getInterceptor` and | 343 // `Object.prototype` to avoid checking in `getInterceptor` and |
| 344 // specializations. | 344 // specializations. |
| 345 } | 345 } |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 targetOutput.add(';'); | 487 targetOutput.add(';'); |
| 488 } | 488 } |
| 489 targetOutput.addBuffer(jsAst.prettyPrint( | 489 targetOutput.addBuffer(jsAst.prettyPrint( |
| 490 new jsAst.ExpressionStatement(init), compiler)); | 490 new jsAst.ExpressionStatement(init), compiler)); |
| 491 targetOutput.add('\n'); | 491 targetOutput.add('\n'); |
| 492 } | 492 } |
| 493 | 493 |
| 494 targetOutput.add('\n'); | 494 targetOutput.add('\n'); |
| 495 } | 495 } |
| 496 } | 496 } |
| OLD | NEW |