8#if !defined(DART_PRECOMPILED_RUNTIME)
50 code_(
Code::Handle(zone(),
function.unoptimized_code())),
52 regexp_compile_data_(nullptr),
53 function_type_arguments_(nullptr),
54 parent_type_arguments_(nullptr),
55 current_context_var_(nullptr),
56 arg_desc_var_(nullptr),
57 expression_temp_var_(nullptr),
58 entry_points_temp_var_(nullptr),
59 finally_return_temp_var_(nullptr),
60 dynamic_closure_call_vars_(nullptr),
62 default_parameter_values_(nullptr),
63 raw_type_arguments_var_(nullptr),
64 first_parameter_index_(),
66 have_seen_await_expr_(
false),
67 kernel_scopes_(nullptr) {
72 Symbols::CurrentContextVar(), Object::dynamic_type());
73 current_context_var_ = temp;
76 arg_desc_var_ =
new (
zone())
77 LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource,
78 Symbols::ArgDescVar(), Object::dynamic_type());
94 const Field** other = guarded_fields_.
Lookup(field);
95 if (other !=
nullptr) {
101 if (!(*other)->IsConsistentWith(*field)) {
103 DeoptId::kNone,
"Field's guarded state changed during compilation");
121 "%s Bailout in %s: %s", origin,
127 if (kernel_scopes_ ==
nullptr) {
129 kernel_scopes_ =
builder.BuildScopes();
131 return kernel_scopes_;
138 Symbols::ExprTemp(), Object::dynamic_type());
150 Symbols::EntryPointsTemp(), Object::dynamic_type());
162 Symbols::FinallyRetVal(), Object::dynamic_type());
175 ASSERT(regexp_compile_data_ ==
nullptr);
185 const intptr_t num_params = num_fixed_params + num_opt_params;
193 for (intptr_t param = 0; param < num_params; ++param) {
215 if (copy_parameters) {
231 const bool is_receiver_var =
233 if (!is_receiver_var) {
242 raw_parameters_->Add(raw_parameter);
244 if (function_type_arguments_ !=
nullptr) {
245 LocalVariable* raw_type_args_parameter = function_type_arguments_;
249 function_type_arguments_->
name());
253 raw_type_args_parameter =
255 function_type_arguments_->
token_pos(), tmp,
261 raw_type_arguments_var_ = raw_type_args_parameter;
270 if (!copy_parameters) {
277 const intptr_t reserved_var_slot_count =
279 first_parameter_index_ =
VariableIndex(-reserved_var_slot_count);
287 bool found_captured_variables =
false;
289 function(), first_parameter_index_, num_params, first_local_index,
290 nullptr, &found_captured_variables);
292 num_stack_locals_ = -next_free_index.
value();
310 ASSERT(covariant_parameters_ ==
nullptr);
312 covariant_parameters_ = covariant_parameters;
316 const BitVector* generic_covariant_impl_parameters) {
317 ASSERT(generic_covariant_impl_parameters_ ==
nullptr);
320 generic_covariant_impl_parameters_ = generic_covariant_impl_parameters;
324 ASSERT(covariant_parameters_ !=
nullptr);
326 return covariant_parameters_->
Contains(
i);
330 ASSERT(generic_covariant_impl_parameters_ !=
nullptr);
332 return generic_covariant_impl_parameters_->
Contains(
i);
338 if (dynamic_closure_call_vars_ !=
nullptr)
return dynamic_closure_call_vars_;
339 const auto& saved_args_desc =
343 dynamic_closure_call_vars_ =
347 const auto& type_Dynamic = Object::dynamic_type();
348 const auto& type_Function =
351#define INIT_FIELD(Name, TypeName, Symbol) \
352 dynamic_closure_call_vars_->Name = new (zone()) LocalVariable( \
353 pos, pos, Symbols::DynamicCall##Symbol##Var(), type_##TypeName);
359 zone(),
":dyn_call_named_argument_%" Pd "_parameter_index",
i);
366 return dynamic_closure_call_vars_;
static bool ok(int result)
#define DEBUG_ASSERT(cond)
#define RELEASE_ASSERT(cond)
intptr_t NamedCount() const
void Insert(typename KeyValueTrait::Pair kv)
KeyValueTrait::Pair * Lookup(typename KeyValueTrait::Key key) const
bool Contains(intptr_t i) const
bool should_clone_fields()
static CompilerState & Current()
static bool IsBackgroundCompilation()
static void AbortBackgroundCompilation(intptr_t deopt_id, const char *msg)
static constexpr intptr_t kNone
FieldPtr Original() const
intptr_t guarded_cid() const
bool PrologueNeedsArgumentsDescriptor() const
intptr_t NumOptionalParameters() const
bool MakesCopyOfParameters() const
bool HasOptionalParameters() const
TokenPosition token_pos() const
bool HasThisParameter() const
intptr_t num_fixed_parameters() const
intptr_t NumParameters() const
VariableIndex AllocateVariables(const Function &function, VariableIndex first_parameter_index, int num_parameters, VariableIndex first_local_index, LocalScope *context_owner, bool *found_captured_variables)
bool AddVariable(LocalVariable *variable)
LocalVariable * LocalLookupVariable(const String &name, intptr_t kernel_offset) const
CompileType * inferred_type() const
void set_needs_covariant_check_in_method()
intptr_t annotations_offset() const
void set_is_explicit_covariant_parameter()
void set_type_check_mode(TypeCheckMode mode)
TokenPosition declaration_token_pos() const
TokenPosition token_pos() const
void set_index(VariableIndex index)
TypeCheckMode type_check_mode() const
const Object * inferred_arg_value() const
void set_annotations_offset(intptr_t offset)
const AbstractType & static_type() const
intptr_t kernel_offset() const
const String & name() const
void set_is_captured_parameter(bool value)
bool needs_covariant_check_in_method() const
CompileType * inferred_arg_type() const
bool is_explicit_covariant_parameter() const
static char * SCreate(Zone *zone, const char *format,...) PRINTF_ATTRIBUTE(2
virtual const char * ToCString() const
static Object & ZoneHandle()
void Bailout(const char *origin, const char *reason) const
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
int num_stack_locals() const
LocalScope * scope() const
kernel::ScopeBuildingResult * EnsureKernelScopes()
void AddToGuardedFields(const Field *field) const
LocalVariable * EnsureExpressionTemp()
void set_expression_temp_var(LocalVariable *value)
LocalVariable * EnsureEntryPointsTemp()
void EnsureFinallyReturnTemp(bool is_async)
void AllocateIrregexpVariables(intptr_t num_stack_locals)
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
LocalVariable * ParameterVariable(intptr_t i) const
void set_finally_return_temp_var(LocalVariable *value)
LocalVariable * suspend_state_var() const
bool IsCovariantParameter(intptr_t i) const
bool has_expression_temp_var() const
bool has_finally_return_temp_var() const
void SetGenericCovariantImplParameters(const BitVector *generic_covariant_impl_parameters)
DynamicClosureCallVars * EnsureDynamicClosureCallVars()
static void MessageF(Kind kind, const Script &script, TokenPosition token_pos, bool report_after_token, const char *format,...) PRINTF_ATTRIBUTE(5
static constexpr bool AtLocation
static StringPtr FromConcat(Thread *thread, const String &str1, const String &str2)
static StringPtr New(Thread *thread, const char *cstr)
static TypePtr DartFunctionType()
Dart_NativeFunction function
#define INIT_FIELD(Name, TypeName, Symbol)
#define FOR_EACH_DYNAMIC_CLOSURE_CALL_VARIABLE(V)
ZoneGrowableArray< LocalVariable * > named_argument_parameter_indices