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

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: about to land Created 5 years, 2 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 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 class NativeResolutionEnqueuer extends NativeEnqueuerBase { 537 class NativeResolutionEnqueuer extends NativeEnqueuerBase {
538 538
539 Map<String, ClassElement> tagOwner = new Map<String, ClassElement>(); 539 Map<String, ClassElement> tagOwner = new Map<String, ClassElement>();
540 540
541 NativeResolutionEnqueuer(Enqueuer world, Compiler compiler) 541 NativeResolutionEnqueuer(Enqueuer world, Compiler compiler)
542 : super(world, compiler, compiler.enableNativeLiveTypeAnalysis); 542 : super(world, compiler, compiler.enableNativeLiveTypeAnalysis);
543 543
544 void processNativeClass(ClassElement classElement) { 544 void processNativeClass(ClassElement classElement) {
545 super.processNativeClass(classElement); 545 super.processNativeClass(classElement);
546 546
547 // Js Interop interfaces do not have tags.
548 if (classElement.isJsInterop) return;
547 // Since we map from dispatch tags to classes, a dispatch tag must be used 549 // Since we map from dispatch tags to classes, a dispatch tag must be used
548 // on only one native class. 550 // on only one native class.
549 for (String tag in nativeTagsOfClass(classElement)) { 551 for (String tag in nativeTagsOfClass(classElement)) {
550 ClassElement owner = tagOwner[tag]; 552 ClassElement owner = tagOwner[tag];
551 if (owner != null) { 553 if (owner != null) {
552 if (owner != classElement) { 554 if (owner != classElement) {
553 reporter.internalError( 555 reporter.internalError(
554 classElement, "Tag '$tag' already in use by '${owner.name}'"); 556 classElement, "Tag '$tag' already in use by '${owner.name}'");
555 } 557 }
556 } else { 558 } else {
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 superclass, 676 superclass,
675 () => <ClassElement>[]); 677 () => <ClassElement>[]);
676 directSubtypes.add(cls); 678 directSubtypes.add(cls);
677 } 679 }
678 680
679 void logSummary(log(message)) { 681 void logSummary(log(message)) {
680 log('Compiled ${registeredClasses.length} native classes, ' 682 log('Compiled ${registeredClasses.length} native classes, '
681 '${unusedClasses.length} native classes omitted.'); 683 '${unusedClasses.length} native classes omitted.');
682 } 684 }
683 } 685 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart ('k') | pkg/compiler/lib/src/patch_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698