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

Unified Diff: runtime/vm/parser.h

Issue 2736733005: Manage and capture class and function instantiators in the parser. (Closed)
Patch Set: work in progress Created 3 years, 9 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
Index: runtime/vm/parser.h
diff --git a/runtime/vm/parser.h b/runtime/vm/parser.h
index 539435b11e45d372a97365d8fb769dd0a7fa8927..a696a2814e9e19fba2629635a918b847b2aa7cfa 100644
--- a/runtime/vm/parser.h
+++ b/runtime/vm/parser.h
@@ -96,6 +96,7 @@ class ParsedFunction : public ZoneAllocated {
node_sequence_(NULL),
regexp_compile_data_(NULL),
instantiator_(NULL),
+ function_instantiator_(NULL),
current_context_var_(NULL),
expression_temp_var_(NULL),
finally_return_temp_var_(NULL),
@@ -130,9 +131,16 @@ class ParsedFunction : public ZoneAllocated {
LocalVariable* instantiator() const { return instantiator_; }
void set_instantiator(LocalVariable* instantiator) {
- // May be NULL.
+ ASSERT(instantiator != NULL);
instantiator_ = instantiator;
}
+ LocalVariable* function_instantiator() const {
+ return function_instantiator_;
+ }
+ void set_function_instantiator(LocalVariable* function_instantiator) {
+ ASSERT(function_instantiator != NULL);
+ function_instantiator_ = function_instantiator;
+ }
void set_default_parameter_values(ZoneGrowableArray<const Instance*>* list) {
default_parameter_values_ = list;
@@ -224,6 +232,7 @@ class ParsedFunction : public ZoneAllocated {
SequenceNode* node_sequence_;
RegExpCompileData* regexp_compile_data_;
LocalVariable* instantiator_;
+ LocalVariable* function_instantiator_;
LocalVariable* current_context_var_;
LocalVariable* expression_temp_var_;
LocalVariable* finally_return_temp_var_;
@@ -670,7 +679,8 @@ class Parser : public ValueObject {
LocalVariable* LookupTypeArgumentsParameter(LocalScope* from_scope,
bool test_only);
void CaptureInstantiator();
- void CaptureFunctionInstantiator();
+ void CaptureFunctionInstantiators();
+ void CaptureAllInstantiators();
AstNode* LoadReceiver(TokenPosition token_pos);
AstNode* LoadFieldIfUnresolved(AstNode* node);
AstNode* LoadClosure(PrimaryNode* primary);
@@ -834,6 +844,8 @@ class Parser : public ValueObject {
bool ParsingStaticMember() const;
const AbstractType* ReceiverType(const Class& cls);
bool IsInstantiatorRequired() const;
+ bool AreFunctionInstantiatorsRequired() const;
+ bool InGenericFunctionScope() const;
bool ResolveIdentInLocalScope(TokenPosition ident_pos,
const String& ident,
AstNode** node,
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/parser.cc » ('j') | runtime/vm/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698