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

Unified Diff: pkg/compiler/lib/src/native/enqueue.dart

Issue 1809533004: Support serialization of WorldImpact (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Rebased Created 4 years, 9 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 | « pkg/compiler/lib/src/library_loader.dart ('k') | pkg/compiler/lib/src/native/ssa.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/native/enqueue.dart
diff --git a/pkg/compiler/lib/src/native/enqueue.dart b/pkg/compiler/lib/src/native/enqueue.dart
index 630b443a5d5a3c20dffc9d74b74ade30ecba793e..0f5b9854b7fdea5705682df04f0ef50975f6e7c8 100644
--- a/pkg/compiler/lib/src/native/enqueue.dart
+++ b/pkg/compiler/lib/src/native/enqueue.dart
@@ -418,34 +418,40 @@ abstract class NativeEnqueuerBase implements NativeEnqueuer {
});
}
- handleFieldAnnotations(Element element) {
+ void handleFieldAnnotations(Element element) {
+ if (compiler.serialization.isDeserialized(element)) {
+ return;
+ }
if (backend.isNative(element.enclosingElement)) {
// Exclude non-instance (static) fields - they not really native and are
// compiled as isolate globals. Access of a property of a constructor
// function or a non-method property in the prototype chain, must be coded
// using a JS-call.
if (element.isInstanceMember) {
- setNativeName(element);
+ _setNativeName(element);
}
}
}
- handleMethodAnnotations(Element method) {
+ void handleMethodAnnotations(Element method) {
+ if (compiler.serialization.isDeserialized(method)) {
+ return;
+ }
if (isNativeMethod(method)) {
if (method.isStatic) {
- setNativeNameForStaticMethod(method);
+ _setNativeNameForStaticMethod(method);
} else {
- setNativeName(method);
+ _setNativeName(method);
}
}
}
/// Sets the native name of [element], either from an annotation, or
/// defaulting to the Dart name.
- void setNativeName(MemberElement element) {
+ void _setNativeName(MemberElement element) {
String name = findJsNameFromAnnotation(element);
if (name == null) name = element.name;
- backend.setNativeMemberName(element, name);
+ backend.nativeData.setNativeMemberName(element, name);
}
/// Sets the native name of the static native method [element], using the
@@ -456,20 +462,21 @@ abstract class NativeEnqueuerBase implements NativeEnqueuer {
/// use the declared @JSName as the expression
/// 3. If [element] does not have a @JSName annotation, qualify the name of
/// the method with the @Native name of the enclosing class.
- void setNativeNameForStaticMethod(MethodElement element) {
+ void _setNativeNameForStaticMethod(MethodElement element) {
String name = findJsNameFromAnnotation(element);
if (name == null) name = element.name;
if (isIdentifier(name)) {
List<String> nativeNames =
- backend.getNativeTagsOfClassRaw(element.enclosingClass);
+ backend.nativeData.getNativeTagsOfClassRaw(element.enclosingClass);
if (nativeNames.length != 1) {
reporter.internalError(element,
'Unable to determine a native name for the enclosing class, '
'options: $nativeNames');
}
- backend.setNativeMemberName(element, '${nativeNames[0]}.$name');
+ backend.nativeData.setNativeMemberName(
+ element, '${nativeNames[0]}.$name');
} else {
- backend.setNativeMemberName(element, name);
+ backend.nativeData.setNativeMemberName(element, name);
}
}
@@ -604,7 +611,7 @@ class NativeResolutionEnqueuer extends NativeEnqueuerBase {
if (backend.isJsInterop(classElement)) return;
// Since we map from dispatch tags to classes, a dispatch tag must be used
// on only one native class.
- for (String tag in backend.getNativeTagsOfClass(classElement)) {
+ for (String tag in backend.nativeData.getNativeTagsOfClass(classElement)) {
ClassElement owner = tagOwner[tag];
if (owner != null) {
if (owner != classElement) {
« no previous file with comments | « pkg/compiler/lib/src/library_loader.dart ('k') | pkg/compiler/lib/src/native/ssa.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698