Chromium Code Reviews| 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. |