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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart

Issue 23618043: dart:typed_data type hierarchy changes try 3 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix by adding !nonleaf annotation Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/typed_data/dart2js/typed_data_dart2js.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart b/sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart
index 13cc42b9cab04eb484b4db8e810383084580cb5f..8a2ab78ca2e963a6d8bafe774f77a257f958ef15 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart
@@ -105,11 +105,25 @@ class NativeEmitter {
return backend.namer.isolateAccess(element);
}
- List<String> nativeTagsOfClass(ClassElement cls) {
+ // The tags string contains comma-separated 'words' which are either dispatch
+ // tags (having JavaScript identifier syntax) and directives that begin with
+ // `!`.
+ List<String> nativeTagsOfClassRaw(ClassElement cls) {
String quotedName = cls.nativeTagInfo.slowToString();
return quotedName.substring(1, quotedName.length - 1).split(',');
}
+ List<String> nativeTagsOfClass(ClassElement cls) {
+ return nativeTagsOfClassRaw(cls).where((s) => !s.startsWith('!')).toList();
+ }
+
+ bool nativeHasTagsMarker(ClassElement cls, String marker) {
+ return nativeTagsOfClassRaw(cls).contains(marker);
+ }
+
+ bool nativeForcedNonLeaf(ClassElement cls) =>
+ nativeHasTagsMarker(cls, '!nonleaf');
+
/**
* Writes the class definitions for the interceptors to [mainBuffer].
* Writes code to associate dispatch tags with interceptors to [nativeBuffer].
@@ -197,6 +211,10 @@ class NativeEmitter {
} else if (extensionPoints.containsKey(classElement)) {
needed = true;
}
+ if (classElement.isNative() && nativeForcedNonLeaf(classElement)) {
+ needed = true;
+ nonleafClasses.add(classElement);
+ }
if (needed || neededClasses.contains(classElement)) {
neededClasses.add(classElement);
« no previous file with comments | « no previous file | sdk/lib/typed_data/dart2js/typed_data_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698