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

Unified Diff: runtime/vm/parser.cc

Issue 2958833003: Allocate local variable holding type arguments in generic functions in Kernel. (Closed)
Patch Set: Created 3 years, 6 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/kernel_binary_flowgraph.cc ('k') | tests/language/generic_function_typedef_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 7eb318147ebbcfbfb4d7b4adc1a9a4a8d6a03a24..32c3ff7bb5d4f2cf6d787db2a26e9aa2310f4611 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -12135,7 +12135,13 @@ AstNode* Parser::ParseSelectors(AstNode* primary, bool is_cascade) {
ReportError("generic type arguments not supported.");
}
func_type_args = ParseTypeArguments(ClassFinalizer::kCanonicalize);
- if (!FLAG_reify_generic_functions) {
+ if (FLAG_reify_generic_functions) {
+ if (!func_type_args.IsNull() && !func_type_args.IsInstantiated() &&
+ (FunctionLevel() > 0)) {
+ // Make sure that the instantiators are captured.
+ CaptureAllInstantiators();
+ }
+ } else {
func_type_args = TypeArguments::null();
}
}
@@ -12228,7 +12234,13 @@ AstNode* Parser::ParseSelectors(AstNode* primary, bool is_cascade) {
ReportError("generic type arguments not supported.");
}
func_type_args = ParseTypeArguments(ClassFinalizer::kCanonicalize);
- if (!FLAG_reify_generic_functions) {
+ if (FLAG_reify_generic_functions) {
+ if (!func_type_args.IsNull() && !func_type_args.IsInstantiated() &&
+ (FunctionLevel() > 0)) {
+ // Make sure that the instantiators are captured.
+ CaptureAllInstantiators();
+ }
+ } else {
func_type_args = TypeArguments::null();
}
}
@@ -14839,7 +14851,13 @@ AstNode* Parser::ParsePrimary() {
ReportError("generic type arguments not supported.");
}
func_type_args = ParseTypeArguments(ClassFinalizer::kCanonicalize);
- if (!FLAG_reify_generic_functions) {
+ if (FLAG_reify_generic_functions) {
+ if (!func_type_args.IsNull() && !func_type_args.IsInstantiated() &&
+ (FunctionLevel() > 0)) {
+ // Make sure that the instantiators are captured.
+ CaptureAllInstantiators();
+ }
+ } else {
func_type_args = TypeArguments::null();
}
}
« no previous file with comments | « runtime/vm/kernel_binary_flowgraph.cc ('k') | tests/language/generic_function_typedef_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698