5#ifndef RUNTIME_VM_PARSER_H_
6#define RUNTIME_VM_PARSER_H_
28class ScopeBuildingResult;
32class ArgumentsDescriptor;
37struct RegExpCompileData;
56 return token_pos.
Hash();
58 return key->kernel_offset();
84 return regexp_compile_data_;
89 return function_type_arguments_;
96 return parent_type_arguments_;
110 default_parameter_values_ = list;
112 if (list ==
nullptr)
return;
113 for (intptr_t
i = 0;
i < list->
length();
i++) {
120 ASSERT(default_parameter_values_ !=
nullptr);
121 return *default_parameter_values_->At(
i);
125 return default_parameter_values_;
134 ASSERT(receiver_var_ !=
nullptr);
135 return receiver_var_;
138 ASSERT(receiver_var_ ==
nullptr);
140 receiver_var_ =
value;
146 ASSERT(kernel_scopes_ !=
nullptr);
148 return receiver_used_;
153 return expression_temp_var_;
157 expression_temp_var_ =
value;
160 return expression_temp_var_ !=
nullptr;
165 return entry_points_temp_var_;
169 entry_points_temp_var_ =
value;
172 return entry_points_temp_var_ !=
nullptr;
177 return finally_return_temp_var_;
181 finally_return_temp_var_ =
value;
184 return finally_return_temp_var_ !=
nullptr;
202 return forwarding_stub_super_target_ !=
nullptr;
205 return forwarding_stub_super_target_;
208 forwarding_stub_super_target_ = forwarding_target;
219 void Bailout(
const char* origin,
const char* reason)
const;
224 return raw_type_arguments_var_;
228 raw_type_arguments_var_ = raw_type_arguments_var;
232 raw_parameters_ = raw_parameters;
236 return raw_parameters_->At(
i);
252 const BitVector* generic_covariant_impl_parameters);
255 return covariant_parameters_ !=
nullptr;
273#define FOR_EACH_DYNAMIC_CLOSURE_CALL_VARIABLE(V) \
274 V(current_function, Function, CurrentFunction) \
275 V(current_num_processed, Smi, CurrentNumProcessed) \
276 V(current_param_index, Smi, CurrentParamIndex) \
277 V(current_type_param, Dynamic, CurrentTypeParam) \
278 V(function_type_args, Dynamic, FunctionTypeArgs)
280#define DEFINE_FIELD(Name, _, __) LocalVariable* Name = nullptr;
290 return dynamic_closure_call_vars_;
309 DynamicClosureCallVars* dynamic_closure_call_vars_;
312 bool receiver_used_ =
false;
318 int num_stack_locals_;
319 bool have_seen_await_expr_;
321 const Function* forwarding_stub_super_target_ =
nullptr;
324 const BitVector* covariant_parameters_ =
nullptr;
325 const BitVector* generic_covariant_impl_parameters_ =
nullptr;
347 DISALLOW_COPY_AND_ASSIGN(
Parser);
#define DEBUG_ASSERT(cond)
const T & At(intptr_t index) const
static uword Hash(Key key)
static Value ValueOf(Pair kv)
static bool IsKeyEqual(Pair pair, Key key)
static Key KeyOf(Pair kv)
FieldPtr Original() const
intptr_t NumParameters() const
LocalVariable * VariableAt(intptr_t index) const
void Bailout(const char *origin, const char *reason) const
bool is_receiver_used() const
void set_function_type_arguments(LocalVariable *function_type_arguments)
bool has_entry_points_temp_var() const
void SetRegExpCompileData(RegExpCompileData *regexp_compile_data)
LocalVariable * expression_temp_var() const
ParsedFunction(Thread *thread, const Function &function)
const Function & function() const
LocalVariable * RawTypeArgumentsVariable() const
ZoneGrowableArray< const Instance * > * default_parameter_values() const
int num_stack_locals() const
VariableIndex first_parameter_index() const
LocalScope * scope() const
kernel::ScopeBuildingResult * EnsureKernelScopes()
void SetRawTypeArgumentsVariable(LocalVariable *raw_type_arguments_var)
void AddToGuardedFields(const Field *field) const
void set_parent_type_arguments(LocalVariable *parent_type_arguments)
void set_default_parameter_values(ZoneGrowableArray< const Instance * > *list)
LocalVariable * EnsureExpressionTemp()
void MarkForwardingStub(const Function *forwarding_target)
const Function * forwarding_stub_super_target() const
LocalVariable * parent_type_arguments() const
const FieldSet * guarded_fields() const
void set_expression_temp_var(LocalVariable *value)
LocalVariable * EnsureEntryPointsTemp()
void EnsureFinallyReturnTemp(bool is_async)
bool has_receiver_var() const
void AllocateIrregexpVariables(intptr_t num_stack_locals)
LocalVariable * arg_desc_var() const
void set_entry_points_temp_var(LocalVariable *value)
LocalVariable * entry_points_temp_var() const
bool IsGenericCovariantImplParameter(intptr_t i) const
void SetCovariantParameters(const BitVector *covariant_parameters)
RegExpCompileData * regexp_compile_data() const
bool has_arg_desc_var() const
const Instance & DefaultParameterValueAt(intptr_t i) const
bool is_forwarding_stub() const
Isolate * isolate() const
DynamicClosureCallVars * dynamic_closure_call_vars() const
void set_receiver_var(LocalVariable *value)
void set_scope(LocalScope *scope)
LocalVariable * ParameterVariable(intptr_t i) const
LocalVariable * current_context_var() const
void set_finally_return_temp_var(LocalVariable *value)
LocalVariable * suspend_state_var() const
LocalVariable * RawParameterVariable(intptr_t i) const
bool IsCovariantParameter(intptr_t i) const
LocalVariable * receiver_var() const
bool has_expression_temp_var() const
void SetRawParameters(ZoneGrowableArray< LocalVariable * > *raw_parameters)
void set_suspend_state_var(LocalVariable *suspend_state_var)
LocalVariable * finally_return_temp_var() const
bool HasCovariantParametersInfo() const
bool has_finally_return_temp_var() const
void SetGenericCovariantImplParameters(const BitVector *generic_covariant_impl_parameters)
const Code & code() const
LocalVariable * function_type_arguments() const
DynamicClosureCallVars * EnsureDynamicClosureCallVars()
bool have_seen_await() const
@ kParameterDefaultValueOffset
@ kParameterIsFinalOffset
@ kParameterMetadataOffset
Isolate * isolate() const
DirectChainedHashMap< FieldKeyValueTrait > FieldSet
#define FOR_EACH_DYNAMIC_CLOSURE_CALL_VARIABLE(V)
#define DEFINE_FIELD(Name, _, __)
DynamicClosureCallVars(Zone *zone, intptr_t num_named)
ZoneGrowableArray< LocalVariable * > named_argument_parameter_indices