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

Unified Diff: pkg/compiler/lib/src/kernel/elements.dart

Issue 2731173002: Add ClassEntity.library, MemberEntity.library and FunctionEntity.isExternal (Closed)
Patch Set: Updated cf. comments. Created 3 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/js_backend/native_data.dart ('k') | pkg/compiler/lib/src/kernel/world_builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/kernel/elements.dart
diff --git a/pkg/compiler/lib/src/kernel/elements.dart b/pkg/compiler/lib/src/kernel/elements.dart
index 7f3fc4cfd029b4c8e6d759a5b4cde2b466eca1f8..997c0e37d00f8145016076dc199a35da442fd3a0 100644
--- a/pkg/compiler/lib/src/kernel/elements.dart
+++ b/pkg/compiler/lib/src/kernel/elements.dart
@@ -18,11 +18,13 @@ class KLibrary implements LibraryEntity {
}
class KClass implements ClassEntity {
+ final KLibrary library;
+
/// Class index used for fast lookup in [KernelWorldBuilder].
final int classIndex;
final String name;
- KClass(this.classIndex, this.name);
+ KClass(this.library, this.classIndex, this.name);
@override
bool get isClosure => false;
@@ -31,11 +33,12 @@ class KClass implements ClassEntity {
}
abstract class KMember implements MemberEntity {
+ final KLibrary library;
final KClass enclosingClass;
final Name _name;
final bool _isStatic;
- KMember(this.enclosingClass, this._name, {bool isStatic: false})
+ KMember(this.library, this.enclosingClass, this._name, {bool isStatic: false})
: _isStatic = isStatic;
String get name => _name.text;
@@ -74,16 +77,21 @@ abstract class KMember implements MemberEntity {
}
abstract class KFunction extends KMember implements FunctionEntity {
- KFunction(KClass enclosingClass, Name name, {bool isStatic: false})
- : super(enclosingClass, name, isStatic: isStatic);
+ final bool isExternal;
+
+ KFunction(KLibrary library, KClass enclosingClass, Name name,
+ {bool isStatic: false, this.isExternal: false})
+ : super(library, enclosingClass, name, isStatic: isStatic);
}
abstract class KConstructor extends KFunction implements ConstructorEntity {
/// Constructor index used for fast lookup in [KernelWorldBuilder].
final int constructorIndex;
- KConstructor(this.constructorIndex, KClass enclosingClass, Name name)
- : super(enclosingClass, name);
+ KConstructor(this.constructorIndex, KClass enclosingClass, Name name,
+ {bool isExternal})
+ : super(enclosingClass.library, enclosingClass, name,
+ isExternal: isExternal);
@override
bool get isConstructor => true;
@@ -101,8 +109,9 @@ abstract class KConstructor extends KFunction implements ConstructorEntity {
}
class KGenerativeConstructor extends KConstructor {
- KGenerativeConstructor(int constructorIndex, KClass enclosingClass, Name name)
- : super(constructorIndex, enclosingClass, name);
+ KGenerativeConstructor(int constructorIndex, KClass enclosingClass, Name name,
+ {bool isExternal})
+ : super(constructorIndex, enclosingClass, name, isExternal: isExternal);
@override
bool get isFactoryConstructor => false;
@@ -112,8 +121,9 @@ class KGenerativeConstructor extends KConstructor {
}
class KFactoryConstructor extends KConstructor {
- KFactoryConstructor(int constructorIndex, KClass enclosingClass, Name name)
- : super(constructorIndex, enclosingClass, name);
+ KFactoryConstructor(int constructorIndex, KClass enclosingClass, Name name,
+ {bool isExternal})
+ : super(constructorIndex, enclosingClass, name, isExternal: isExternal);
@override
bool get isFactoryConstructor => true;
@@ -123,8 +133,10 @@ class KFactoryConstructor extends KConstructor {
}
class KMethod extends KFunction {
- KMethod(KClass enclosingClass, Name name, {bool isStatic})
- : super(enclosingClass, name, isStatic: isStatic);
+ KMethod(KLibrary library, KClass enclosingClass, Name name,
+ {bool isStatic, bool isExternal})
+ : super(library, enclosingClass, name,
+ isStatic: isStatic, isExternal: isExternal);
@override
bool get isFunction => true;
@@ -133,8 +145,10 @@ class KMethod extends KFunction {
}
class KGetter extends KFunction {
- KGetter(KClass enclosingClass, Name name, {bool isStatic})
- : super(enclosingClass, name, isStatic: isStatic);
+ KGetter(KLibrary library, KClass enclosingClass, Name name,
+ {bool isStatic, bool isExternal})
+ : super(library, enclosingClass, name,
+ isStatic: isStatic, isExternal: isExternal);
@override
bool get isGetter => true;
@@ -143,8 +157,10 @@ class KGetter extends KFunction {
}
class KSetter extends KFunction {
- KSetter(KClass enclosingClass, Name name, {bool isStatic})
- : super(enclosingClass, name, isStatic: isStatic);
+ KSetter(KLibrary library, KClass enclosingClass, Name name,
+ {bool isStatic, bool isExternal})
+ : super(library, enclosingClass, name,
+ isStatic: isStatic, isExternal: isExternal);
@override
bool get isAssignable => true;
@@ -160,9 +176,9 @@ class KField extends KMember implements FieldEntity {
final int fieldIndex;
final bool isAssignable;
- KField(this.fieldIndex, KClass enclosingClass, Name name,
+ KField(this.fieldIndex, KLibrary library, KClass enclosingClass, Name name,
{bool isStatic, this.isAssignable})
- : super(enclosingClass, name, isStatic: isStatic);
+ : super(library, enclosingClass, name, isStatic: isStatic);
@override
bool get isField => true;
« no previous file with comments | « pkg/compiler/lib/src/js_backend/native_data.dart ('k') | pkg/compiler/lib/src/kernel/world_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698