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

Unified Diff: runtime/vm/parser.cc

Issue 10115053: Assign ids to incoming arguments (to be used in checked mode). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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/parser.h ('k') | runtime/vm/unit_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 6717)
+++ runtime/vm/parser.cc (working copy)
@@ -112,6 +112,23 @@
}
+void ParsedFunction::SetNodeSequence(SequenceNode* node_sequence) {
+ ASSERT(node_sequence_ == NULL);
+ ASSERT(node_sequence != NULL);
+ node_sequence_ = node_sequence;
+ const int num_fixed_params = function().num_fixed_parameters();
+ const int num_opt_params = function().num_optional_parameters();
+ // Allocated ids for parameters.
+ intptr_t parameter_id = AstNode::kNoId;
+ for (intptr_t i = 0; i < num_fixed_params + num_opt_params; i++) {
+ parameter_id = AstNode::GetNextId();
+ if (i == 0) {
+ node_sequence_->set_first_parameter_id(parameter_id);
+ }
+ }
+ node_sequence_->set_last_parameter_id(parameter_id);
regis 2012/04/18 23:59:13 It is strange to call set_last_parameter_id, but n
srdjan 2012/04/19 00:04:20 Discussed off-line: last parameter id is set to kN
+}
+
void ParsedFunction::AllocateVariables() {
LocalScope* scope = node_sequence()->scope();
const int fixed_parameter_count = function().num_fixed_parameters();
@@ -666,7 +683,7 @@
// Add implicit return node.
node_sequence->Add(new ReturnNode(parser.token_index_));
}
- parsed_function->set_node_sequence(node_sequence);
+ parsed_function->SetNodeSequence(node_sequence);
// The instantiator may be required at run time for generic type checks or
// allocation of generic types.
« no previous file with comments | « runtime/vm/parser.h ('k') | runtime/vm/unit_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698