Index: runtime/vm/parser.cc |
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc |
index 9417eefdabb528c916c0b201d89ba02a1f94c92a..4414b0d4ca3390db40b871d1536f957f2fec993a 100644 |
--- a/runtime/vm/parser.cc |
+++ b/runtime/vm/parser.cc |
@@ -148,6 +148,14 @@ void ParsedFunction::SetNodeSequence(SequenceNode* node_sequence) { |
} |
+void ParsedFunction::SetRegExpCompileData( |
+ RegExpCompileData* regexp_compile_data) { |
+ ASSERT(regexp_compile_data_ == NULL); |
+ ASSERT(regexp_compile_data != NULL); |
+ regexp_compile_data_ = regexp_compile_data; |
+} |
+ |
+ |
void ParsedFunction::AddDeferredPrefix(const LibraryPrefix& prefix) { |
ASSERT(prefix.is_deferred_load()); |
ASSERT(!prefix.is_loaded()); |
@@ -161,6 +169,7 @@ void ParsedFunction::AddDeferredPrefix(const LibraryPrefix& prefix) { |
void ParsedFunction::AllocateVariables() { |
+ ASSERT(!function().IsIrregexpFunction()); |
LocalScope* scope = node_sequence()->scope(); |
const intptr_t num_fixed_params = function().num_fixed_parameters(); |
const intptr_t num_opt_params = function().NumOptionalParameters(); |
@@ -233,6 +242,23 @@ struct CatchParamDesc { |
}; |
+void ParsedFunction::AllocateIrregexpVariables(intptr_t num_stack_locals) { |
+ ASSERT(function().IsIrregexpFunction()); |
+ ASSERT(function().NumOptionalParameters() == 0); |
+ const intptr_t num_params = function().num_fixed_parameters();; |
+ // Compute start indices to parameters and locals, and the number of |
+ // parameters to copy. |
+ // 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) { |
@@ -853,6 +879,8 @@ void Parser::ParseFunction(ParsedFunction* parsed_function) { |
node_sequence = |
parser.ParseInvokeFieldDispatcher(func, &default_parameter_values); |
break; |
+ case RawFunction::kIrregexpFunction: |
+ UNREACHABLE(); // Irregexp functions have their own parser. |
default: |
UNREACHABLE(); |
} |