-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[vm/kernel] Add a transformation that annotates invocations with rece…
…iver type. Currently we only annotate those call-sites that would result in generic covariant checks performed on the callee side. Bug: #31798 Change-Id: Ifcf60032036575f615015d716276484a7c1236b3 Reviewed-on: https://dart-review.googlesource.com/69580 Commit-Queue: Vyacheslav Egorov <[email protected]> Reviewed-by: Kevin Millikin <[email protected]> Reviewed-by: Martin Kustermann <[email protected]>
- Loading branch information
1 parent
da428bb
commit aa8145a
Showing
19 changed files
with
238 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
library vm.metadata.call_site_attributes; | ||
|
||
import 'package:kernel/ast.dart'; | ||
|
||
/// Metadata for annotating call sites with various attributes. | ||
class CallSiteAttributesMetadata { | ||
final DartType receiverType; | ||
|
||
const CallSiteAttributesMetadata({this.receiverType}); | ||
|
||
@override | ||
String toString() => "receiverType:$receiverType"; | ||
} | ||
|
||
/// Repository for [CallSiteAttributesMetadata]. | ||
class CallSiteAttributesMetadataRepository | ||
extends MetadataRepository<CallSiteAttributesMetadata> { | ||
static final repositoryTag = 'vm.call-site-attributes.metadata'; | ||
|
||
@override | ||
final String tag = repositoryTag; | ||
|
||
@override | ||
final Map<TreeNode, CallSiteAttributesMetadata> mapping = | ||
<TreeNode, CallSiteAttributesMetadata>{}; | ||
|
||
@override | ||
void writeToBinary( | ||
CallSiteAttributesMetadata metadata, Node node, BinarySink sink) { | ||
sink.writeDartType(metadata.receiverType); | ||
} | ||
|
||
@override | ||
CallSiteAttributesMetadata readFromBinary(Node node, BinarySource source) { | ||
final type = source.readDartType(); | ||
return new CallSiteAttributesMetadata(receiverType: type); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.