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

Side by Side Diff: pkg/compiler/lib/src/native/enqueue.dart

Issue 1318043005: Support user generated custom native JS classes. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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
OLDNEW
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 native; 5 part of native;
6 6
7 /** 7 /**
8 * This could be an abstract class but we use it as a stub for the dart_backend. 8 * This could be an abstract class but we use it as a stub for the dart_backend.
9 */ 9 */
10 class NativeEnqueuer { 10 class NativeEnqueuer {
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 class NativeResolutionEnqueuer extends NativeEnqueuerBase { 601 class NativeResolutionEnqueuer extends NativeEnqueuerBase {
602 602
603 Map<String, ClassElement> tagOwner = new Map<String, ClassElement>(); 603 Map<String, ClassElement> tagOwner = new Map<String, ClassElement>();
604 604
605 NativeResolutionEnqueuer(Enqueuer world, Compiler compiler) 605 NativeResolutionEnqueuer(Enqueuer world, Compiler compiler)
606 : super(world, compiler, compiler.enableNativeLiveTypeAnalysis); 606 : super(world, compiler, compiler.enableNativeLiveTypeAnalysis);
607 607
608 void processNativeClass(ClassElement classElement) { 608 void processNativeClass(ClassElement classElement) {
609 super.processNativeClass(classElement); 609 super.processNativeClass(classElement);
610 610
611 // Js Interop interfaces do not have tags.
612 if (classElement.isJsInterop) return;
611 // Since we map from dispatch tags to classes, a dispatch tag must be used 613 // Since we map from dispatch tags to classes, a dispatch tag must be used
612 // on only one native class. 614 // on only one native class.
613 for (String tag in nativeTagsOfClass(classElement)) { 615 for (String tag in nativeTagsOfClass(classElement)) {
614 ClassElement owner = tagOwner[tag]; 616 ClassElement owner = tagOwner[tag];
615 if (owner != null) { 617 if (owner != null) {
616 if (owner != classElement) { 618 if (owner != classElement) {
617 compiler.internalError( 619 compiler.internalError(
618 classElement, "Tag '$tag' already in use by '${owner.name}'"); 620 classElement, "Tag '$tag' already in use by '${owner.name}'");
619 } 621 }
620 } else { 622 } else {
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 superclass, 690 superclass,
689 () => <ClassElement>[]); 691 () => <ClassElement>[]);
690 directSubtypes.add(cls); 692 directSubtypes.add(cls);
691 } 693 }
692 694
693 void logSummary(log(message)) { 695 void logSummary(log(message)) {
694 log('Compiled ${registeredClasses.length} native classes, ' 696 log('Compiled ${registeredClasses.length} native classes, '
695 '${unusedClasses.length} native classes omitted.'); 697 '${unusedClasses.length} native classes omitted.');
696 } 698 }
697 } 699 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698