mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:19:48 +00:00
[kernel] Add flag on Procedures for forwarding semi stubs.
Change-Id: I6e39557e9ed2e636a8f43e8835ae797e3fd8b0c2 Reviewed-on: https://dart-review.googlesource.com/29721 Reviewed-by: Paul Berry <paulberry@google.com> Reviewed-by: Kevin Millikin <kmillikin@google.com> Commit-Queue: Samir Jindel <sjindel@google.com>
This commit is contained in:
parent
31a0fe292d
commit
075720c352
|
@ -349,7 +349,7 @@ type Procedure extends Member {
|
||||||
FileOffset fileEndOffset;
|
FileOffset fileEndOffset;
|
||||||
Byte kind; // Index into the ProcedureKind enum above.
|
Byte kind; // Index into the ProcedureKind enum above.
|
||||||
Byte flags (isStatic, isAbstract, isExternal, isConst, isForwardingStub,
|
Byte flags (isStatic, isAbstract, isExternal, isConst, isForwardingStub,
|
||||||
isGenericContravariant);
|
isGenericContravariant, isForwardingSemiStub);
|
||||||
Name name;
|
Name name;
|
||||||
// An absolute path URI to the .dart file from which the class was created.
|
// An absolute path URI to the .dart file from which the class was created.
|
||||||
UriReference fileUri;
|
UriReference fileUri;
|
||||||
|
|
|
@ -1496,6 +1496,7 @@ class Procedure extends Member implements FileUriNode {
|
||||||
bool isExternal: false,
|
bool isExternal: false,
|
||||||
bool isConst: false,
|
bool isConst: false,
|
||||||
bool isForwardingStub: false,
|
bool isForwardingStub: false,
|
||||||
|
bool isForwardingSemiStub: false,
|
||||||
int transformerFlags: 0,
|
int transformerFlags: 0,
|
||||||
this.fileUri,
|
this.fileUri,
|
||||||
Reference reference})
|
Reference reference})
|
||||||
|
@ -1515,6 +1516,7 @@ class Procedure extends Member implements FileUriNode {
|
||||||
static const int FlagConst = 1 << 3; // Only for external const factories.
|
static const int FlagConst = 1 << 3; // Only for external const factories.
|
||||||
static const int FlagForwardingStub = 1 << 4;
|
static const int FlagForwardingStub = 1 << 4;
|
||||||
static const int FlagGenericContravariant = 1 << 5;
|
static const int FlagGenericContravariant = 1 << 5;
|
||||||
|
static const int FlagForwardingSemiStub = 1 << 6;
|
||||||
|
|
||||||
bool get isStatic => flags & FlagStatic != 0;
|
bool get isStatic => flags & FlagStatic != 0;
|
||||||
bool get isAbstract => flags & FlagAbstract != 0;
|
bool get isAbstract => flags & FlagAbstract != 0;
|
||||||
|
@ -1534,6 +1536,10 @@ class Procedure extends Member implements FileUriNode {
|
||||||
/// front end computational overhead.
|
/// front end computational overhead.
|
||||||
bool get isGenericContravariant => flags & FlagGenericContravariant != 0;
|
bool get isGenericContravariant => flags & FlagGenericContravariant != 0;
|
||||||
|
|
||||||
|
/// If set, this flag indicates that although this function is a forwarding
|
||||||
|
/// stub, it was present in the original source as an abstract method.
|
||||||
|
bool get isForwardingSemiStub => flags & FlagForwardingSemiStub != 0;
|
||||||
|
|
||||||
void set isStatic(bool value) {
|
void set isStatic(bool value) {
|
||||||
flags = value ? (flags | FlagStatic) : (flags & ~FlagStatic);
|
flags = value ? (flags | FlagStatic) : (flags & ~FlagStatic);
|
||||||
}
|
}
|
||||||
|
@ -1561,6 +1567,12 @@ class Procedure extends Member implements FileUriNode {
|
||||||
: (flags & ~FlagGenericContravariant);
|
: (flags & ~FlagGenericContravariant);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void set isForwardingSemiStub(bool value) {
|
||||||
|
flags = value
|
||||||
|
? (flags | FlagForwardingSemiStub)
|
||||||
|
: (flags & ~FlagForwardingSemiStub);
|
||||||
|
}
|
||||||
|
|
||||||
bool get isInstanceMember => !isStatic;
|
bool get isInstanceMember => !isStatic;
|
||||||
bool get isGetter => kind == ProcedureKind.Getter;
|
bool get isGetter => kind == ProcedureKind.Getter;
|
||||||
bool get isSetter => kind == ProcedureKind.Setter;
|
bool get isSetter => kind == ProcedureKind.Setter;
|
||||||
|
|
|
@ -401,9 +401,11 @@ class CloneVisitor extends TreeVisitor {
|
||||||
isExternal: node.isExternal,
|
isExternal: node.isExternal,
|
||||||
isConst: node.isConst,
|
isConst: node.isConst,
|
||||||
isForwardingStub: node.isForwardingStub,
|
isForwardingStub: node.isForwardingStub,
|
||||||
|
isForwardingSemiStub: node.isForwardingSemiStub,
|
||||||
transformerFlags: node.transformerFlags,
|
transformerFlags: node.transformerFlags,
|
||||||
fileUri: node.fileUri)
|
fileUri: node.fileUri)
|
||||||
..fileEndOffset = node.fileEndOffset;
|
..fileEndOffset = node.fileEndOffset
|
||||||
|
..isGenericContravariant = node.isGenericContravariant;
|
||||||
}
|
}
|
||||||
|
|
||||||
visitField(Field node) {
|
visitField(Field node) {
|
||||||
|
|
|
@ -904,6 +904,7 @@ class Printer extends Visitor<Null> {
|
||||||
writeModifier(node.isStatic, 'static');
|
writeModifier(node.isStatic, 'static');
|
||||||
writeModifier(node.isAbstract, 'abstract');
|
writeModifier(node.isAbstract, 'abstract');
|
||||||
writeModifier(node.isForwardingStub, 'forwarding-stub');
|
writeModifier(node.isForwardingStub, 'forwarding-stub');
|
||||||
|
writeModifier(node.isForwardingSemiStub, 'forwarding-semi-stub');
|
||||||
writeModifier(node.isGenericContravariant, 'generic-contravariant');
|
writeModifier(node.isGenericContravariant, 'generic-contravariant');
|
||||||
writeWord(procedureKindToString(node.kind));
|
writeWord(procedureKindToString(node.kind));
|
||||||
if ((node.enclosingClass == null &&
|
if ((node.enclosingClass == null &&
|
||||||
|
|
Loading…
Reference in a new issue