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

Unified Diff: runtime/vm/ast.h

Issue 2859673002: Pass type argument vector to generic functions (if --reify-generic-functions is (Closed)
Patch Set: address review comments and sync Created 3 years, 7 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 | « runtime/vm/assembler_dbc_test.cc ('k') | runtime/vm/code_patcher_arm64_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/ast.h
diff --git a/runtime/vm/ast.h b/runtime/vm/ast.h
index ead710e1ad99cbfa54aabf71cf7b65711955b2b5..3f2f70b897dbd1089aff73931d0f3d4d2d5a5744 100644
--- a/runtime/vm/ast.h
+++ b/runtime/vm/ast.h
@@ -285,12 +285,45 @@ class CloneContextNode : public AstNode {
class ArgumentListNode : public AstNode {
public:
explicit ArgumentListNode(TokenPosition token_pos)
- : AstNode(token_pos), nodes_(4), names_(Array::ZoneHandle()) {}
+ : AstNode(token_pos),
+ type_args_var_(NULL),
+ type_arguments_(TypeArguments::ZoneHandle()),
+ type_args_len_(0),
+ nodes_(4),
+ names_(Array::ZoneHandle()) {}
+
+ ArgumentListNode(TokenPosition token_pos, const TypeArguments& type_arguments)
+ : AstNode(token_pos),
+ type_args_var_(NULL),
+ type_arguments_(type_arguments),
+ type_args_len_(type_arguments.Length()),
+ nodes_(4),
+ names_(Array::ZoneHandle()) {
+ ASSERT(type_arguments_.IsZoneHandle());
+ }
+
+ ArgumentListNode(TokenPosition token_pos,
+ LocalVariable* type_args_var,
+ intptr_t type_args_len)
+ : AstNode(token_pos),
+ type_args_var_(type_args_var),
+ type_arguments_(TypeArguments::ZoneHandle()),
+ type_args_len_(type_args_len),
+ nodes_(4),
+ names_(Array::ZoneHandle()) {
+ ASSERT((type_args_var_ == NULL) == (type_args_len_ == 0));
+ }
void VisitChildren(AstNodeVisitor* visitor) const;
+ LocalVariable* type_args_var() const { return type_args_var_; }
+ const TypeArguments& type_arguments() const { return type_arguments_; }
+ intptr_t type_args_len() const { return type_args_len_; }
void Add(AstNode* node) { nodes_.Add(node); }
intptr_t length() const { return nodes_.length(); }
+ intptr_t LengthWithTypeArgs() const {
+ return length() + (type_args_len() > 0 ? 1 : 0);
+ }
AstNode* NodeAt(intptr_t index) const { return nodes_[index]; }
void SetNodeAt(intptr_t index, AstNode* node) { nodes_[index] = node; }
const Array& names() const { return names_; }
@@ -300,6 +333,10 @@ class ArgumentListNode : public AstNode {
DECLARE_COMMON_NODE_FUNCTIONS(ArgumentListNode);
private:
+ // At most one of type_args_var_ and type_arguments_ can be set, not both.
+ LocalVariable* type_args_var_;
+ const TypeArguments& type_arguments_;
+ intptr_t type_args_len_;
GrowableArray<AstNode*> nodes_;
Array& names_;
« no previous file with comments | « runtime/vm/assembler_dbc_test.cc ('k') | runtime/vm/code_patcher_arm64_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698