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

Unified Diff: pkg/compiler/lib/src/js_emitter/native_emitter.dart

Issue 868483006: dart2js: remove additionalProperties and store it directly as nativeBlob. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rename nativeBlob to nativeInfo 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 side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/js_emitter/native_emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/native_emitter.dart b/pkg/compiler/lib/src/js_emitter/native_emitter.dart
index 34a604d598f13e5fd9e442a451f3dfb43f9cbf02..b53c911a279667f15c954da266b59b361c3e8657 100644
--- a/pkg/compiler/lib/src/js_emitter/native_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/native_emitter.dart
@@ -48,6 +48,9 @@ class NativeEmitter {
* Removes trivial classes (that can be represented by a super type) and
* generates properties that have to be added to classes (native or not).
*
+ * Updates the `nativeInfo` field of the given classes. This data
+ * must be emitted with the corresponding classes.
+ *
* The interceptors are filtered to avoid emitting trivial interceptors. For
* example, if the program contains no code that can distinguish between the
* numerous subclasses of `Element` then we can pretend that `Element` is a
@@ -61,13 +64,8 @@ class NativeEmitter {
*
* [classes] contains native classes, mixin applications, and user subclasses
* of native classes.
- *
- * [allAdditionalProperties] is used to collect properties that are pushed up
- * from the above optimizations onto a non-native class, e.g, `Interceptor`.
*/
- Set<Class> prepareNativeClasses(
- List<Class> classes,
- Map<Class, Map<String, jsAst.Expression>> allAdditionalProperties) {
+ Set<Class> prepareNativeClasses(List<Class> classes) {
assert(classes.every((Class cls) => cls != null));
hasNativeClasses = classes.isNotEmpty;
@@ -208,10 +206,8 @@ class NativeEmitter {
String encoding = sb.toString();
if (cls.isNative || encoding != '') {
- Map<String, jsAst.Expression> properties =
- allAdditionalProperties.putIfAbsent(cls,
- () => new Map<String, jsAst.Expression>());
- properties[backend.namer.nativeSpecProperty] = js.string(encoding);
+ assert(cls.nativeInfo == null);
+ cls.nativeInfo = encoding;
}
}
generateClassInfo(jsInterceptorClass);
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/model.dart ('k') | pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698