diff --git a/pkg/kernel/binary.md b/pkg/kernel/binary.md index f307f05d1393..519bd6d68901 100644 --- a/pkg/kernel/binary.md +++ b/pkg/kernel/binary.md @@ -356,6 +356,7 @@ type Procedure extends Member { List annotations; // Only present if the 'isForwardingStub' flag is set. Option forwardingStubSuperTarget; + Option forwardingStubInterfaceTarget; // Can only be absent if abstract, but tag is there anyway. Option function; } diff --git a/pkg/kernel/lib/ast.dart b/pkg/kernel/lib/ast.dart index 89a16437eb27..eb61c33ddf19 100644 --- a/pkg/kernel/lib/ast.dart +++ b/pkg/kernel/lib/ast.dart @@ -1491,6 +1491,7 @@ class Procedure extends Member implements FileUriNode { Uri fileUri; Reference forwardingStubSuperTarget; + Reference forwardingStubInterfaceTarget; Procedure(Name name, this.kind, this.function, {bool isAbstract: false, @@ -1502,7 +1503,8 @@ class Procedure extends Member implements FileUriNode { int transformerFlags: 0, this.fileUri, Reference reference, - this.forwardingStubSuperTarget}) + this.forwardingStubSuperTarget, + this.forwardingStubInterfaceTarget}) : super(name, reference) { function?.parent = this; this.isAbstract = isAbstract; diff --git a/pkg/kernel/lib/binary/ast_from_binary.dart b/pkg/kernel/lib/binary/ast_from_binary.dart index 83c5af18da3b..d43b7ffb4489 100644 --- a/pkg/kernel/lib/binary/ast_from_binary.dart +++ b/pkg/kernel/lib/binary/ast_from_binary.dart @@ -932,6 +932,8 @@ class BinaryBuilder { _disableLazyReading; var forwardingStubSuperTarget = readAndCheckOptionTag() ? readMemberReference() : null; + var forwardingStubInterfaceTarget = + readAndCheckOptionTag() ? readMemberReference() : null; var function = readFunctionNodeOption(!readFunctionNodeNow, endOffset); var transformerFlags = getAndResetTransformerFlags(); assert(((_) => true)(debugPath.removeLast())); @@ -947,6 +949,7 @@ class BinaryBuilder { function?.parent = node; node.setTransformerFlagsWithoutLazyLoading(transformerFlags); node.forwardingStubSuperTarget = forwardingStubSuperTarget; + node.forwardingStubInterfaceTarget = forwardingStubInterfaceTarget; assert((node.forwardingStubSuperTarget != null) || !(node.isForwardingStub && node.function.body != null)); diff --git a/pkg/kernel/lib/binary/ast_to_binary.dart b/pkg/kernel/lib/binary/ast_to_binary.dart index 3d127073f596..ef1edea359ee 100644 --- a/pkg/kernel/lib/binary/ast_to_binary.dart +++ b/pkg/kernel/lib/binary/ast_to_binary.dart @@ -766,6 +766,7 @@ class BinaryPrinter extends Visitor implements BinarySink { writeUriReference(node.fileUri); writeAnnotationList(node.annotations); writeOptionalReference(node.forwardingStubSuperTarget); + writeOptionalReference(node.forwardingStubInterfaceTarget); writeOptionalNode(node.function); _variableIndexer = null; diff --git a/pkg/kernel/lib/clone.dart b/pkg/kernel/lib/clone.dart index e461650f0bc0..1d0f38f57817 100644 --- a/pkg/kernel/lib/clone.dart +++ b/pkg/kernel/lib/clone.dart @@ -404,7 +404,8 @@ class CloneVisitor extends TreeVisitor { isForwardingSemiStub: node.isForwardingSemiStub, transformerFlags: node.transformerFlags, fileUri: node.fileUri, - forwardingStubSuperTarget: node.forwardingStubSuperTarget) + forwardingStubSuperTarget: node.forwardingStubSuperTarget, + forwardingStubInterfaceTarget: node.forwardingStubInterfaceTarget) ..fileEndOffset = node.fileEndOffset ..isGenericContravariant = node.isGenericContravariant; } diff --git a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc index e37bd1c24fc9..b16c8f146044 100644 --- a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc +++ b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc @@ -231,6 +231,11 @@ void ProcedureHelper::ReadUntilExcluding(Field field) { forwarding_stub_super_target_ = builder_->ReadCanonicalNameReference(); } if (++next_read_ == field) return; + case kForwardingStubInterfaceTarget: + if (builder_->ReadTag() == kSomething) { + builder_->ReadCanonicalNameReference(); + } + if (++next_read_ == field) return; case kFunction: if (builder_->ReadTag() == kSomething) builder_->SkipFunctionNode(); // read function node. diff --git a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h index 89b569ff6fff..9971757ff697 100644 --- a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h +++ b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h @@ -246,6 +246,7 @@ class ProcedureHelper { kSourceUriIndex, kAnnotations, kForwardingStubSuperTarget, + kForwardingStubInterfaceTarget, kFunction, kEnd, };