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

Unified Diff: runtime/vm/parser.h

Issue 1307943008: Make default_parameter_values a ZoneGrowableArray instead of an array in new space (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: r Created 5 years, 4 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/flow_graph_inliner.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.h
diff --git a/runtime/vm/parser.h b/runtime/vm/parser.h
index 827626aea9d098227406b70df6f752b3b227648b..1d7dbf751e35761b3499bae96cb5a6358e42c865 100644
--- a/runtime/vm/parser.h
+++ b/runtime/vm/parser.h
@@ -47,12 +47,12 @@ class ParsedFunction : public ZoneAllocated {
node_sequence_(NULL),
regexp_compile_data_(NULL),
instantiator_(NULL),
- default_parameter_values_(Array::ZoneHandle(zone(), Array::null())),
current_context_var_(NULL),
expression_temp_var_(NULL),
finally_return_temp_var_(NULL),
deferred_prefixes_(new ZoneGrowableArray<const LibraryPrefix*>()),
guarded_fields_(new ZoneGrowableArray<const Field*>()),
+ default_parameter_values_(NULL),
first_parameter_index_(0),
first_stack_local_index_(0),
num_copied_params_(0),
@@ -85,13 +85,19 @@ class ParsedFunction : public ZoneAllocated {
instantiator_ = instantiator;
}
- const Array& default_parameter_values() const {
- return default_parameter_values_;
+ void set_default_parameter_values(ZoneGrowableArray<const Instance*>* list) {
+ default_parameter_values_ = list;
+#if defined(DEBUG)
+ for (intptr_t i = 0; i < list->length(); i++) {
+ ASSERT(list->At(i)->IsZoneHandle() || list->At(i)->InVMHeap());
+ }
+#endif
}
- void set_default_parameter_values(const Array& default_parameter_values) {
- ASSERT(default_parameter_values.IsZoneHandle() ||
- default_parameter_values.InVMHeap());
- default_parameter_values_ = default_parameter_values.raw();
+
+
+ const Instance& DefaultParameterValueAt(intptr_t i) const {
+ ASSERT(default_parameter_values_ != NULL);
+ return *default_parameter_values_->At(i);
}
LocalVariable* current_context_var() const {
@@ -161,12 +167,12 @@ class ParsedFunction : public ZoneAllocated {
SequenceNode* node_sequence_;
RegExpCompileData* regexp_compile_data_;
LocalVariable* instantiator_;
- Array& default_parameter_values_;
LocalVariable* current_context_var_;
LocalVariable* expression_temp_var_;
LocalVariable* finally_return_temp_var_;
ZoneGrowableArray<const LibraryPrefix*>* deferred_prefixes_;
ZoneGrowableArray<const Field*>* guarded_fields_;
+ ZoneGrowableArray<const Instance*>* default_parameter_values_;
int first_parameter_index_;
int first_stack_local_index_;
@@ -512,8 +518,9 @@ class Parser : public ValueObject {
static bool ParseFormalParameters(const Function& func, ParamList* params);
- static void SetupDefaultsForOptionalParams(const ParamList& params,
- Array* default_values);
+ static void SetupDefaultsForOptionalParams(
+ const ParamList& params,
+ ZoneGrowableArray<const Instance*>* default_values);
ClosureNode* CreateImplicitClosureNode(const Function& func,
intptr_t token_pos,
AstNode* receiver);
@@ -521,10 +528,10 @@ class Parser : public ValueObject {
const Function& func);
void AddFormalParamsToScope(const ParamList* params, LocalScope* scope);
- SequenceNode* ParseConstructor(const Function& func,
- Array* default_parameter_values);
- SequenceNode* ParseFunc(const Function& func,
- Array* default_parameter_values);
+ SequenceNode* ParseConstructor(
+ const Function& func, ZoneGrowableArray<const Instance*>* default_values);
+ SequenceNode* ParseFunc(
+ const Function& func, ZoneGrowableArray<const Instance*>* default_values);
void ParseNativeFunctionBlock(const ParamList* params, const Function& func);
@@ -533,18 +540,18 @@ class Parser : public ValueObject {
SequenceNode* ParseStaticFinalGetter(const Function& func);
SequenceNode* ParseStaticInitializer();
SequenceNode* ParseMethodExtractor(const Function& func);
- SequenceNode* ParseNoSuchMethodDispatcher(const Function& func,
- Array* default_values);
- SequenceNode* ParseInvokeFieldDispatcher(const Function& func,
- Array* default_values);
- SequenceNode* ParseImplicitClosure(const Function& func,
- Array* default_values);
- SequenceNode* ParseConstructorClosure(const Function& func,
- Array* default_values);
+ SequenceNode* ParseNoSuchMethodDispatcher(
+ const Function& func, ZoneGrowableArray<const Instance*>* default_values);
+ SequenceNode* ParseInvokeFieldDispatcher(
+ const Function& func, ZoneGrowableArray<const Instance*>* default_values);
+ SequenceNode* ParseImplicitClosure(
+ const Function& func, ZoneGrowableArray<const Instance*>* default_values);
+ SequenceNode* ParseConstructorClosure(
+ const Function& func, ZoneGrowableArray<const Instance*>* default_values);
void BuildDispatcherScope(const Function& func,
const ArgumentsDescriptor& desc,
- Array* default_values);
+ ZoneGrowableArray<const Instance*>* default_values);
void EnsureHasReturnStatement(SequenceNode* seq, intptr_t return_pos);
void ChainNewBlock(LocalScope* outer_scope);
« no previous file with comments | « runtime/vm/flow_graph_inliner.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698