Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::IrregexpCompilationPipeline Class Reference

#include <compiler.h>

Inheritance diagram for dart::IrregexpCompilationPipeline:
dart::CompilationPipeline dart::ZoneAllocated

Public Member Functions

 IrregexpCompilationPipeline ()
 
void ParseFunction (ParsedFunction *parsed_function) override
 
FlowGraphBuildFlowGraph (Zone *zone, ParsedFunction *parsed_function, ZoneGrowableArray< const ICData * > *ic_data_array, intptr_t osr_id, bool optimized) override
 
- Public Member Functions inherited from dart::CompilationPipeline
virtual void ParseFunction (ParsedFunction *parsed_function)=0
 
virtual FlowGraphBuildFlowGraph (Zone *zone, ParsedFunction *parsed_function, ZoneGrowableArray< const ICData * > *ic_data_array, intptr_t osr_id, bool optimized)=0
 
virtual ~CompilationPipeline ()
 
- Public Member Functions inherited from dart::ZoneAllocated
 ZoneAllocated ()
 
void * operator new (size_t size)
 
void * operator new (size_t size, Zone *zone)
 
void operator delete (void *pointer)
 

Additional Inherited Members

- Static Public Member Functions inherited from dart::CompilationPipeline
static CompilationPipelineNew (Zone *zone, const Function &function)
 

Detailed Description

Definition at line 55 of file compiler.h.

Constructor & Destructor Documentation

◆ IrregexpCompilationPipeline()

dart::IrregexpCompilationPipeline::IrregexpCompilationPipeline ( )
inline

Definition at line 57 of file compiler.h.

57: backtrack_goto_(nullptr) {}

Member Function Documentation

◆ BuildFlowGraph()

FlowGraph * dart::IrregexpCompilationPipeline::BuildFlowGraph ( Zone zone,
ParsedFunction parsed_function,
ZoneGrowableArray< const ICData * > *  ic_data_array,
intptr_t  osr_id,
bool  optimized 
)
overridevirtual

Implements dart::CompilationPipeline.

Definition at line 169 of file compiler.cc.

174 {
175 // Compile to the dart IR.
176 RegExpEngine::CompilationResult result =
177 RegExpEngine::CompileIR(parsed_function->regexp_compile_data(),
178 parsed_function, *ic_data_array, osr_id);
179 if (result.error_message != nullptr) {
181 LanguageError::New(String::Handle(String::New(result.error_message)))));
182 }
183 backtrack_goto_ = result.backtrack_goto;
184
185 // Allocate variables now that we know the number of locals.
186 parsed_function->AllocateIrregexpVariables(result.num_stack_locals);
187
188 // When compiling for OSR, use a depth first search to find the OSR
189 // entry and make graph entry jump to it instead of normal entry.
190 // Catch entries are always considered reachable, even if they
191 // become unreachable after OSR.
192 if (osr_id != Compiler::kNoOSRDeoptId) {
193 result.graph_entry->RelinkToOsrEntry(zone, result.num_blocks);
194 }
195 PrologueInfo prologue_info(-1, -1);
196 return new (zone)
197 FlowGraph(*parsed_function, result.graph_entry, result.num_blocks,
198 prologue_info, FlowGraph::CompilationModeFrom(optimized));
199}
static constexpr intptr_t kNoOSRDeoptId
Definition: compiler.h:73
static constexpr CompilationMode CompilationModeFrom(bool is_optimizing)
Definition: flow_graph.h:585
static Object & Handle()
Definition: object.h:407
static CompilationResult CompileIR(RegExpCompileData *input, const ParsedFunction *parsed_function, const ZoneGrowableArray< const ICData * > &ic_data_array, intptr_t osr_id)
Definition: regexp.cc:5298
static DART_NORETURN void LongJump(const Error &error)
Definition: report.cc:86
static StringPtr New(const char *cstr, Heap::Space space=Heap::kNew)
Definition: object.cc:23698
GAsyncResult * result

◆ ParseFunction()

void dart::IrregexpCompilationPipeline::ParseFunction ( ParsedFunction parsed_function)
overridevirtual

Implements dart::CompilationPipeline.

Definition at line 143 of file compiler.cc.

144 {
145 VMTagScope tagScope(parsed_function->thread(),
146 VMTag::kCompileParseRegExpTagId);
147 Zone* zone = parsed_function->zone();
148 RegExp& regexp = RegExp::Handle(parsed_function->function().regexp());
149
150 const String& pattern = String::Handle(regexp.pattern());
151
152 RegExpCompileData* compile_data = new (zone) RegExpCompileData();
153 // Parsing failures are handled in the RegExp factory constructor.
154 RegExpParser::ParseRegExp(pattern, regexp.flags(), compile_data);
155
156 regexp.set_num_bracket_expressions(compile_data->capture_count);
157 regexp.set_capture_name_map(compile_data->capture_name_map);
158 if (compile_data->simple) {
159 regexp.set_is_simple();
160 } else {
161 regexp.set_is_complex();
162 }
163
164 parsed_function->SetRegExpCompileData(compile_data);
165
166 // Variables are allocated after compilation.
167}
static void ParseRegExp(const String &input, RegExpFlags regexp_flags, RegExpCompileData *result)

The documentation for this class was generated from the following files: