Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: pkg/compiler/lib/src/js_emitter/native_emitter.dart

Issue 867963003: dart2js: Fix bad is-check in native_emitter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698