Index: runtime/vm/parser.cc |
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc |
index 5bad57247a806ced47b690dfd19c7bf1c34accee..79711bed56e2c05cf0df15ec70147823879e9008 100644 |
--- a/runtime/vm/parser.cc |
+++ b/runtime/vm/parser.cc |
@@ -223,6 +223,24 @@ void ParsedFunction::AllocateVariables() { |
} |
+void ParsedFunction::AllocateIrregexpVariables(intptr_t num_stack_locals) { |
+ const intptr_t num_fixed_params = function().num_fixed_parameters(); |
+ const intptr_t num_opt_params = function().NumOptionalParameters(); |
+ const intptr_t num_params = num_fixed_params + num_opt_params; |
+ // Compute start indices to parameters and locals, and the number of |
+ // parameters to copy. |
+ ASSERT(num_opt_params == 0); |
+ // Parameter i will be at fp[kParamEndSlotFromFp + num_params - i] and |
+ // local variable j will be at fp[kFirstLocalSlotFromFp - j]. |
+ first_parameter_index_ = kParamEndSlotFromFp + num_params; |
+ first_stack_local_index_ = kFirstLocalSlotFromFp; |
+ num_copied_params_ = 0; |
+ |
+ // Frame indices are relative to the frame pointer and are decreasing. |
+ num_stack_locals_ = num_stack_locals; |
+} |
+ |
+ |
struct Parser::Block : public ZoneAllocated { |
Block(Block* outer_block, LocalScope* local_scope, SequenceNode* seq) |
: parent(outer_block), scope(local_scope), statements(seq) { |