Flutter Engine
The Flutter Engine
Classes | Public Member Functions | Friends | List of all members
dart::ParsedFunction Class Reference

#include <parser.h>

Inheritance diagram for dart::ParsedFunction:
dart::ZoneAllocated

Classes

struct  DynamicClosureCallVars
 

Public Member Functions

 ParsedFunction (Thread *thread, const Function &function)
 
const Functionfunction () const
 
const Codecode () const
 
LocalScopescope () const
 
void set_scope (LocalScope *scope)
 
RegExpCompileDataregexp_compile_data () const
 
void SetRegExpCompileData (RegExpCompileData *regexp_compile_data)
 
LocalVariablefunction_type_arguments () const
 
void set_function_type_arguments (LocalVariable *function_type_arguments)
 
LocalVariableparent_type_arguments () const
 
void set_parent_type_arguments (LocalVariable *parent_type_arguments)
 
LocalVariablesuspend_state_var () const
 
void set_suspend_state_var (LocalVariable *suspend_state_var)
 
void set_default_parameter_values (ZoneGrowableArray< const Instance * > *list)
 
const InstanceDefaultParameterValueAt (intptr_t i) const
 
ZoneGrowableArray< const Instance * > * default_parameter_values () const
 
LocalVariablecurrent_context_var () const
 
bool has_arg_desc_var () const
 
LocalVariablearg_desc_var () const
 
LocalVariablereceiver_var () const
 
void set_receiver_var (LocalVariable *value)
 
bool has_receiver_var () const
 
void set_receiver_used ()
 
bool is_receiver_used () const
 
LocalVariableexpression_temp_var () const
 
void set_expression_temp_var (LocalVariable *value)
 
bool has_expression_temp_var () const
 
LocalVariableentry_points_temp_var () const
 
void set_entry_points_temp_var (LocalVariable *value)
 
bool has_entry_points_temp_var () const
 
LocalVariablefinally_return_temp_var () const
 
void set_finally_return_temp_var (LocalVariable *value)
 
bool has_finally_return_temp_var () const
 
void EnsureFinallyReturnTemp (bool is_async)
 
LocalVariableEnsureExpressionTemp ()
 
LocalVariableEnsureEntryPointsTemp ()
 
const FieldSetguarded_fields () const
 
VariableIndex first_parameter_index () const
 
int num_stack_locals () const
 
void AllocateVariables ()
 
void AllocateIrregexpVariables (intptr_t num_stack_locals)
 
void record_await ()
 
bool have_seen_await () const
 
bool is_forwarding_stub () const
 
const Functionforwarding_stub_super_target () const
 
void MarkForwardingStub (const Function *forwarding_target)
 
Threadthread () const
 
Isolateisolate () const
 
Zonezone () const
 
void AddToGuardedFields (const Field *field) const
 
void Bailout (const char *origin, const char *reason) const
 
kernel::ScopeBuildingResultEnsureKernelScopes ()
 
LocalVariableRawTypeArgumentsVariable () const
 
void SetRawTypeArgumentsVariable (LocalVariable *raw_type_arguments_var)
 
void SetRawParameters (ZoneGrowableArray< LocalVariable * > *raw_parameters)
 
LocalVariableRawParameterVariable (intptr_t i) const
 
LocalVariableParameterVariable (intptr_t i) const
 
void SetCovariantParameters (const BitVector *covariant_parameters)
 
void SetGenericCovariantImplParameters (const BitVector *generic_covariant_impl_parameters)
 
bool HasCovariantParametersInfo () const
 
bool IsCovariantParameter (intptr_t i) const
 
bool IsGenericCovariantImplParameter (intptr_t i) const
 
DynamicClosureCallVarsdynamic_closure_call_vars () const
 
DynamicClosureCallVarsEnsureDynamicClosureCallVars ()
 
- 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)
 

Friends

class Parser
 

Detailed Description

Definition at line 69 of file parser.h.

Constructor & Destructor Documentation

◆ ParsedFunction()

dart::ParsedFunction::ParsedFunction ( Thread thread,
const Function function 
)

Definition at line 47 of file parser.cc.

48 : thread_(thread),
49 function_(function),
51 scope_(nullptr),
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),
61 guarded_fields_(),
62 default_parameter_values_(nullptr),
63 raw_type_arguments_var_(nullptr),
64 first_parameter_index_(),
65 num_stack_locals_(0),
66 have_seen_await_expr_(false),
67 kernel_scopes_(nullptr) {
68 DEBUG_ASSERT(function.IsNotTemporaryScopedHandle());
69 // Every function has a local variable for the current context.
70 LocalVariable* temp = new (zone())
71 LocalVariable(function.token_pos(), function.token_pos(),
72 Symbols::CurrentContextVar(), Object::dynamic_type());
73 current_context_var_ = temp;
74
76 arg_desc_var_ = new (zone())
77 LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource,
78 Symbols::ArgDescVar(), Object::dynamic_type());
79 }
80
81 // The code generated by the prologue builder for loading optional arguments
82 // requires the expression temporary variable.
85 }
86}
#define DEBUG_ASSERT(cond)
Definition: assert.h:321
bool PrologueNeedsArgumentsDescriptor() const
Definition: object.cc:11437
bool HasOptionalParameters() const
Definition: object.cc:8859
TokenPosition token_pos() const
Definition: object.h:3446
CodePtr unoptimized_code() const
Definition: object.h:3185
static Object & Handle()
Definition: object.h:407
const Function & function() const
Definition: parser.h:73
LocalVariable * EnsureExpressionTemp()
Definition: parser.cc:134
Zone * zone() const
Definition: parser.h:213
Thread * thread() const
Definition: parser.h:211

Member Function Documentation

◆ AddToGuardedFields()

void dart::ParsedFunction::AddToGuardedFields ( const Field field) const

Definition at line 88 of file parser.cc.

88 {
89 if ((field->guarded_cid() == kDynamicCid) ||
90 (field->guarded_cid() == kIllegalCid)) {
91 return;
92 }
93
94 const Field** other = guarded_fields_.Lookup(field);
95 if (other != nullptr) {
96 ASSERT(field->Original() == (*other)->Original());
97 // Abort background compilation early if the guarded state of this field
98 // has changed during compilation. We will not be able to commit
99 // the resulting code anyway.
101 if (!(*other)->IsConsistentWith(*field)) {
103 DeoptId::kNone, "Field's guarded state changed during compilation");
104 }
105 }
106 return;
107 }
108
109 // Note: the list of guarded fields must contain copies during optimizing
110 // compilation because we will look at their guarded_cid when copying
111 // the array of guarded fields from callee into the caller during
112 // inlining.
113 ASSERT(field->IsOriginal() ==
115 guarded_fields_.Insert(&Field::ZoneHandle(Z, field->ptr()));
116}
void Insert(typename KeyValueTrait::Pair kv)
Definition: hash_map.h:230
KeyValueTrait::Pair * Lookup(typename KeyValueTrait::Key key) const
Definition: hash_map.h:130
static CompilerState & Current()
static bool IsBackgroundCompilation()
Definition: compiler.cc:298
static void AbortBackgroundCompilation(intptr_t deopt_id, const char *msg)
Definition: compiler.cc:971
static constexpr intptr_t kNone
Definition: deopt_id.h:27
static Object & ZoneHandle()
Definition: object.h:419
#define ASSERT(E)
@ kIllegalCid
Definition: class_id.h:214
@ kDynamicCid
Definition: class_id.h:253
#define Z
Definition: parser.cc:45

◆ AllocateIrregexpVariables()

void dart::ParsedFunction::AllocateIrregexpVariables ( intptr_t  num_stack_locals)

Definition at line 295 of file parser.cc.

295 {
296 ASSERT(function().IsIrregexpFunction());
297 ASSERT(function().NumOptionalParameters() == 0);
298 const intptr_t num_params = function().num_fixed_parameters();
300 // Compute start indices to parameters and locals, and the number of
301 // parameters to copy.
302 first_parameter_index_ = VariableIndex(num_params);
303
304 // Frame indices are relative to the frame pointer and are decreasing.
305 num_stack_locals_ = num_stack_locals;
306}
intptr_t num_fixed_parameters() const
Definition: object.cc:8856
int num_stack_locals() const
Definition: parser.h:194

◆ AllocateVariables()

void dart::ParsedFunction::AllocateVariables ( )

Definition at line 180 of file parser.cc.

180 {
181 ASSERT(!function().IsIrregexpFunction());
182 LocalScope* scope = this->scope();
183 const intptr_t num_fixed_params = function().num_fixed_parameters();
184 const intptr_t num_opt_params = function().NumOptionalParameters();
185 const intptr_t num_params = num_fixed_params + num_opt_params;
186 const bool copy_parameters = function().MakesCopyOfParameters();
187
188 // Before we start allocating indices to variables, we'll setup the
189 // parameters array, which can be used to access the raw parameters (i.e. not
190 // the potentially variables which are in the context)
191
192 raw_parameters_ = new (Z) ZoneGrowableArray<LocalVariable*>(Z, num_params);
193 for (intptr_t param = 0; param < num_params; ++param) {
194 LocalVariable* variable = ParameterVariable(param);
195 LocalVariable* raw_parameter = variable;
196 if (variable->is_captured()) {
197 String& tmp = String::ZoneHandle(Z);
198 tmp = Symbols::FromConcat(T, Symbols::OriginalParam(), variable->name());
199
201 tmp, variable->kernel_offset()) == nullptr);
202 raw_parameter = new LocalVariable(
203 variable->declaration_token_pos(), variable->token_pos(), tmp,
204 variable->static_type(), variable->kernel_offset(),
205 variable->inferred_type(), variable->inferred_arg_type(),
206 variable->inferred_arg_value());
207 raw_parameter->set_annotations_offset(variable->annotations_offset());
208 if (variable->is_explicit_covariant_parameter()) {
209 raw_parameter->set_is_explicit_covariant_parameter();
210 }
211 if (variable->needs_covariant_check_in_method()) {
212 raw_parameter->set_needs_covariant_check_in_method();
213 }
214 raw_parameter->set_type_check_mode(variable->type_check_mode());
215 if (copy_parameters) {
216 bool ok = scope->AddVariable(raw_parameter);
217 ASSERT(ok);
218
219 // Currently our optimizer cannot prove liveness of variables properly
220 // when a function has try/catch. It therefore makes the conservative
221 // estimate that all [LocalVariable]s in the frame are live and spills
222 // them before call sites (in some shape or form).
223 //
224 // Since we are guaranteed to not need that, we tell the try/catch
225 // sync moves mechanism not to care about this variable.
226 //
227 // Receiver (this variable) is an exception from this rule because
228 // it is immutable and we don't reload captured it from the context but
229 // instead use raw_parameter to access it. This means we must still
230 // consider it when emitting the catch entry moves.
231 const bool is_receiver_var =
232 function().HasThisParameter() && receiver_var_ == variable;
233 if (!is_receiver_var) {
234 raw_parameter->set_is_captured_parameter(true);
235 }
236
237 } else {
238 raw_parameter->set_index(
239 VariableIndex(function().NumParameters() - param));
240 }
241 }
242 raw_parameters_->Add(raw_parameter);
243 }
244 if (function_type_arguments_ != nullptr) {
245 LocalVariable* raw_type_args_parameter = function_type_arguments_;
246 if (function_type_arguments_->is_captured()) {
247 String& tmp = String::ZoneHandle(Z);
248 tmp = Symbols::FromConcat(T, Symbols::OriginalParam(),
249 function_type_arguments_->name());
250
252 tmp, function_type_arguments_->kernel_offset()) == nullptr);
253 raw_type_args_parameter =
254 new LocalVariable(function_type_arguments_->declaration_token_pos(),
255 function_type_arguments_->token_pos(), tmp,
256 function_type_arguments_->static_type(),
257 function_type_arguments_->kernel_offset());
258 bool ok = scope->AddVariable(raw_type_args_parameter);
259 ASSERT(ok);
260 }
261 raw_type_arguments_var_ = raw_type_args_parameter;
262 }
263
264 // The copy parameters implementation will still write to local variables
265 // which we assign indices as with the old CopyParams implementation.
266 VariableIndex first_local_index;
267 {
268 // Compute start indices to parameters and locals, and the number of
269 // parameters to copy.
270 if (!copy_parameters) {
271 ASSERT(suspend_state_var() == nullptr);
272 first_parameter_index_ = VariableIndex(num_params);
273 first_local_index = VariableIndex(0);
274 } else {
275 // :suspend_state variable is inserted at the fixed slot
276 // before the copied parameters.
277 const intptr_t reserved_var_slot_count =
278 (suspend_state_var() != nullptr) ? 1 : 0;
279 first_parameter_index_ = VariableIndex(-reserved_var_slot_count);
280 first_local_index =
281 VariableIndex(first_parameter_index_.value() - num_params);
282 }
283 }
284
285 // Allocate parameters and local variables, either in the local frame or
286 // in the context(s).
287 bool found_captured_variables = false;
288 VariableIndex next_free_index = scope->AllocateVariables(
289 function(), first_parameter_index_, num_params, first_local_index,
290 nullptr, &found_captured_variables);
291
292 num_stack_locals_ = -next_free_index.value();
293}
static bool ok(int result)
#define RELEASE_ASSERT(cond)
Definition: assert.h:327
intptr_t NumOptionalParameters() const
Definition: object.cc:8868
bool MakesCopyOfParameters() const
Definition: object.h:3514
bool HasThisParameter() const
Definition: object.h:3369
VariableIndex AllocateVariables(const Function &function, VariableIndex first_parameter_index, int num_parameters, VariableIndex first_local_index, LocalScope *context_owner, bool *found_captured_variables)
Definition: scopes.cc:133
bool AddVariable(LocalVariable *variable)
Definition: scopes.cc:57
LocalVariable * LocalLookupVariable(const String &name, intptr_t kernel_offset) const
Definition: scopes.cc:336
bool is_captured() const
Definition: scopes.h:143
TokenPosition declaration_token_pos() const
Definition: scopes.h:118
TokenPosition token_pos() const
Definition: scopes.h:117
const AbstractType & static_type() const
Definition: scopes.h:134
intptr_t kernel_offset() const
Definition: scopes.h:120
const String & name() const
Definition: scopes.h:119
void set_is_captured_parameter(bool value)
Definition: scopes.h:223
LocalScope * scope() const
Definition: parser.h:76
LocalVariable * ParameterVariable(intptr_t i) const
Definition: parser.h:239
LocalVariable * suspend_state_var() const
Definition: parser.h:103
static StringPtr FromConcat(Thread *thread, const String &str1, const String &str2)
Definition: symbols.cc:235
int value() const
Definition: scopes.h:69
#define T
Definition: parser.cc:43

◆ arg_desc_var()

LocalVariable * dart::ParsedFunction::arg_desc_var ( ) const
inline

Definition at line 131 of file parser.h.

131{ return arg_desc_var_; }

◆ Bailout()

void dart::ParsedFunction::Bailout ( const char *  origin,
const char *  reason 
) const

Definition at line 118 of file parser.cc.

118 {
120 function_.token_pos(), Report::AtLocation,
121 "%s Bailout in %s: %s", origin,
122 String::Handle(function_.name()).ToCString(), reason);
123 UNREACHABLE();
124}
#define UNREACHABLE()
Definition: assert.h:248
StringPtr name() const
Definition: object.h:2992
ScriptPtr script() const
Definition: object.cc:10881
virtual const char * ToCString() const
Definition: object.h:366
static void MessageF(Kind kind, const Script &script, TokenPosition token_pos, bool report_after_token, const char *format,...) PRINTF_ATTRIBUTE(5
Definition: report.cc:123
@ kBailout
Definition: report.h:26
static constexpr bool AtLocation
Definition: report.h:29

◆ code()

const Code & dart::ParsedFunction::code ( ) const
inline

Definition at line 74 of file parser.h.

74{ return code_; }

◆ current_context_var()

LocalVariable * dart::ParsedFunction::current_context_var ( ) const
inline

Definition at line 128 of file parser.h.

128{ return current_context_var_; }

◆ default_parameter_values()

ZoneGrowableArray< const Instance * > * dart::ParsedFunction::default_parameter_values ( ) const
inline

Definition at line 124 of file parser.h.

124 {
125 return default_parameter_values_;
126 }

◆ DefaultParameterValueAt()

const Instance & dart::ParsedFunction::DefaultParameterValueAt ( intptr_t  i) const
inline

Definition at line 119 of file parser.h.

119 {
120 ASSERT(default_parameter_values_ != nullptr);
121 return *default_parameter_values_->At(i);
122 }

◆ dynamic_closure_call_vars()

DynamicClosureCallVars * dart::ParsedFunction::dynamic_closure_call_vars ( ) const
inline

Definition at line 289 of file parser.h.

289 {
290 return dynamic_closure_call_vars_;
291 }

◆ EnsureDynamicClosureCallVars()

ParsedFunction::DynamicClosureCallVars * dart::ParsedFunction::EnsureDynamicClosureCallVars ( )

Definition at line 336 of file parser.cc.

336 {
337 ASSERT(function().IsDynamicClosureCallDispatcher(thread()));
338 if (dynamic_closure_call_vars_ != nullptr) return dynamic_closure_call_vars_;
339 const auto& saved_args_desc =
340 Array::Handle(zone(), function().saved_args_desc());
341 const ArgumentsDescriptor descriptor(saved_args_desc);
342
343 dynamic_closure_call_vars_ =
344 new (zone()) DynamicClosureCallVars(zone(), descriptor.NamedCount());
345
346 auto const pos = function().token_pos();
347 const auto& type_Dynamic = Object::dynamic_type();
348 const auto& type_Function =
350 const auto& type_Smi = Type::ZoneHandle(zone(), Type::SmiType());
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);
355#undef INIT_FIELD
356
357 for (intptr_t i = 0; i < descriptor.NamedCount(); i++) {
358 auto const name = OS::SCreate(
359 zone(), ":dyn_call_named_argument_%" Pd "_parameter_index", i);
360 auto const var = new (zone()) LocalVariable(
362 type_Smi);
363 dynamic_closure_call_vars_->named_argument_parameter_indices.Add(var);
364 }
365
366 return dynamic_closure_call_vars_;
367}
SkPoint pos
static char * SCreate(Zone *zone, const char *format,...) PRINTF_ATTRIBUTE(2
static StringPtr New(Thread *thread, const char *cstr)
Definition: symbols.h:723
static TypePtr DartFunctionType()
static TypePtr SmiType()
const char *const name
#define INIT_FIELD(Name, TypeName, Symbol)
#define FOR_EACH_DYNAMIC_CLOSURE_CALL_VARIABLE(V)
Definition: parser.h:273
#define Pd
Definition: globals.h:408
ZoneGrowableArray< LocalVariable * > named_argument_parameter_indices
Definition: parser.h:286

◆ EnsureEntryPointsTemp()

LocalVariable * dart::ParsedFunction::EnsureEntryPointsTemp ( )

Definition at line 146 of file parser.cc.

146 {
148 LocalVariable* temp = new (Z)
149 LocalVariable(function_.token_pos(), function_.token_pos(),
150 Symbols::EntryPointsTemp(), Object::dynamic_type());
151 ASSERT(temp != nullptr);
153 }
155 return entry_points_temp_var();
156}
bool has_entry_points_temp_var() const
Definition: parser.h:171
void set_entry_points_temp_var(LocalVariable *value)
Definition: parser.h:167
LocalVariable * entry_points_temp_var() const
Definition: parser.h:163

◆ EnsureExpressionTemp()

LocalVariable * dart::ParsedFunction::EnsureExpressionTemp ( )

Definition at line 134 of file parser.cc.

134 {
136 LocalVariable* temp =
137 new (Z) LocalVariable(function_.token_pos(), function_.token_pos(),
138 Symbols::ExprTemp(), Object::dynamic_type());
139 ASSERT(temp != nullptr);
141 }
143 return expression_temp_var();
144}
LocalVariable * expression_temp_var() const
Definition: parser.h:151
void set_expression_temp_var(LocalVariable *value)
Definition: parser.h:155
bool has_expression_temp_var() const
Definition: parser.h:159

◆ EnsureFinallyReturnTemp()

void dart::ParsedFunction::EnsureFinallyReturnTemp ( bool  is_async)

Definition at line 158 of file parser.cc.

158 {
160 LocalVariable* temp =
161 new (Z) LocalVariable(function_.token_pos(), function_.token_pos(),
162 Symbols::FinallyRetVal(), Object::dynamic_type());
163 ASSERT(temp != nullptr);
164 temp->set_is_final();
165 if (is_async) {
166 temp->set_is_captured();
167 }
169 }
171}
void set_finally_return_temp_var(LocalVariable *value)
Definition: parser.h:179
bool has_finally_return_temp_var() const
Definition: parser.h:183

◆ EnsureKernelScopes()

kernel::ScopeBuildingResult * dart::ParsedFunction::EnsureKernelScopes ( )

Definition at line 126 of file parser.cc.

126 {
127 if (kernel_scopes_ == nullptr) {
128 kernel::ScopeBuilder builder(this);
129 kernel_scopes_ = builder.BuildScopes();
130 }
131 return kernel_scopes_;
132}

◆ entry_points_temp_var()

LocalVariable * dart::ParsedFunction::entry_points_temp_var ( ) const
inline

Definition at line 163 of file parser.h.

163 {
165 return entry_points_temp_var_;
166 }

◆ expression_temp_var()

LocalVariable * dart::ParsedFunction::expression_temp_var ( ) const
inline

Definition at line 151 of file parser.h.

151 {
153 return expression_temp_var_;
154 }

◆ finally_return_temp_var()

LocalVariable * dart::ParsedFunction::finally_return_temp_var ( ) const
inline

Definition at line 175 of file parser.h.

175 {
177 return finally_return_temp_var_;
178 }

◆ first_parameter_index()

VariableIndex dart::ParsedFunction::first_parameter_index ( ) const
inline

Definition at line 193 of file parser.h.

193{ return first_parameter_index_; }

◆ forwarding_stub_super_target()

const Function * dart::ParsedFunction::forwarding_stub_super_target ( ) const
inline

Definition at line 204 of file parser.h.

204 {
205 return forwarding_stub_super_target_;
206 }

◆ function()

const Function & dart::ParsedFunction::function ( ) const
inline

Definition at line 73 of file parser.h.

73{ return function_; }

◆ function_type_arguments()

LocalVariable * dart::ParsedFunction::function_type_arguments ( ) const
inline

Definition at line 88 of file parser.h.

88 {
89 return function_type_arguments_;
90 }

◆ guarded_fields()

const FieldSet * dart::ParsedFunction::guarded_fields ( ) const
inline

Definition at line 191 of file parser.h.

191{ return &guarded_fields_; }

◆ has_arg_desc_var()

bool dart::ParsedFunction::has_arg_desc_var ( ) const
inline

Definition at line 130 of file parser.h.

130{ return arg_desc_var_ != nullptr; }

◆ has_entry_points_temp_var()

bool dart::ParsedFunction::has_entry_points_temp_var ( ) const
inline

Definition at line 171 of file parser.h.

171 {
172 return entry_points_temp_var_ != nullptr;
173 }

◆ has_expression_temp_var()

bool dart::ParsedFunction::has_expression_temp_var ( ) const
inline

Definition at line 159 of file parser.h.

159 {
160 return expression_temp_var_ != nullptr;
161 }

◆ has_finally_return_temp_var()

bool dart::ParsedFunction::has_finally_return_temp_var ( ) const
inline

Definition at line 183 of file parser.h.

183 {
184 return finally_return_temp_var_ != nullptr;
185 }

◆ has_receiver_var()

bool dart::ParsedFunction::has_receiver_var ( ) const
inline

Definition at line 142 of file parser.h.

142{ return receiver_var_ != nullptr; }

◆ HasCovariantParametersInfo()

bool dart::ParsedFunction::HasCovariantParametersInfo ( ) const
inline

Definition at line 254 of file parser.h.

254 {
255 return covariant_parameters_ != nullptr;
256 }

◆ have_seen_await()

bool dart::ParsedFunction::have_seen_await ( ) const
inline

Definition at line 200 of file parser.h.

200{ return have_seen_await_expr_; }

◆ is_forwarding_stub()

bool dart::ParsedFunction::is_forwarding_stub ( ) const
inline

Definition at line 201 of file parser.h.

201 {
202 return forwarding_stub_super_target_ != nullptr;
203 }

◆ is_receiver_used()

bool dart::ParsedFunction::is_receiver_used ( ) const
inline

Definition at line 145 of file parser.h.

145 {
146 ASSERT(kernel_scopes_ != nullptr);
147 ASSERT(!receiver_used_ || receiver_var() != nullptr);
148 return receiver_used_;
149 }
LocalVariable * receiver_var() const
Definition: parser.h:133

◆ IsCovariantParameter()

bool dart::ParsedFunction::IsCovariantParameter ( intptr_t  i) const

Definition at line 323 of file parser.cc.

323 {
324 ASSERT(covariant_parameters_ != nullptr);
325 ASSERT((i >= 0) && (i < function_.NumParameters()));
326 return covariant_parameters_->Contains(i);
327}
bool Contains(intptr_t i) const
Definition: bit_vector.h:91
intptr_t NumParameters() const
Definition: object.cc:8877

◆ IsGenericCovariantImplParameter()

bool dart::ParsedFunction::IsGenericCovariantImplParameter ( intptr_t  i) const

Definition at line 329 of file parser.cc.

329 {
330 ASSERT(generic_covariant_impl_parameters_ != nullptr);
331 ASSERT((i >= 0) && (i < function_.NumParameters()));
332 return generic_covariant_impl_parameters_->Contains(i);
333}

◆ isolate()

Isolate * dart::ParsedFunction::isolate ( ) const
inline

Definition at line 212 of file parser.h.

212{ return thread_->isolate(); }
Isolate * isolate() const
Definition: thread.h:534

◆ MarkForwardingStub()

void dart::ParsedFunction::MarkForwardingStub ( const Function forwarding_target)
inline

Definition at line 207 of file parser.h.

207 {
208 forwarding_stub_super_target_ = forwarding_target;
209 }

◆ num_stack_locals()

int dart::ParsedFunction::num_stack_locals ( ) const
inline

Definition at line 194 of file parser.h.

194{ return num_stack_locals_; }

◆ ParameterVariable()

LocalVariable * dart::ParsedFunction::ParameterVariable ( intptr_t  i) const
inline

Definition at line 239 of file parser.h.

239 {
240 ASSERT((i >= 0) && (i < function_.NumParameters()));
241 ASSERT(scope() != nullptr);
242 return scope()->VariableAt(i);
243 }
LocalVariable * VariableAt(intptr_t index) const
Definition: scopes.h:398

◆ parent_type_arguments()

LocalVariable * dart::ParsedFunction::parent_type_arguments ( ) const
inline

Definition at line 95 of file parser.h.

95 {
96 return parent_type_arguments_;
97 }

◆ RawParameterVariable()

LocalVariable * dart::ParsedFunction::RawParameterVariable ( intptr_t  i) const
inline

Definition at line 235 of file parser.h.

235 {
236 return raw_parameters_->At(i);
237 }

◆ RawTypeArgumentsVariable()

LocalVariable * dart::ParsedFunction::RawTypeArgumentsVariable ( ) const
inline

Definition at line 223 of file parser.h.

223 {
224 return raw_type_arguments_var_;
225 }

◆ receiver_var()

LocalVariable * dart::ParsedFunction::receiver_var ( ) const
inline

Definition at line 133 of file parser.h.

133 {
134 ASSERT(receiver_var_ != nullptr);
135 return receiver_var_;
136 }

◆ record_await()

void dart::ParsedFunction::record_await ( )
inline

Definition at line 199 of file parser.h.

199{ have_seen_await_expr_ = true; }

◆ regexp_compile_data()

RegExpCompileData * dart::ParsedFunction::regexp_compile_data ( ) const
inline

Definition at line 83 of file parser.h.

83 {
84 return regexp_compile_data_;
85 }

◆ scope()

LocalScope * dart::ParsedFunction::scope ( ) const
inline

Definition at line 76 of file parser.h.

76{ return scope_; }

◆ set_default_parameter_values()

void dart::ParsedFunction::set_default_parameter_values ( ZoneGrowableArray< const Instance * > *  list)
inline

Definition at line 109 of file parser.h.

109 {
110 default_parameter_values_ = list;
111#if defined(DEBUG)
112 if (list == nullptr) return;
113 for (intptr_t i = 0; i < list->length(); i++) {
114 DEBUG_ASSERT(list->At(i)->IsNotTemporaryScopedHandle());
115 }
116#endif
117 }

◆ set_entry_points_temp_var()

void dart::ParsedFunction::set_entry_points_temp_var ( LocalVariable value)
inline

Definition at line 167 of file parser.h.

167 {
169 entry_points_temp_var_ = value;
170 }
uint8_t value

◆ set_expression_temp_var()

void dart::ParsedFunction::set_expression_temp_var ( LocalVariable value)
inline

Definition at line 155 of file parser.h.

155 {
157 expression_temp_var_ = value;
158 }

◆ set_finally_return_temp_var()

void dart::ParsedFunction::set_finally_return_temp_var ( LocalVariable value)
inline

Definition at line 179 of file parser.h.

179 {
181 finally_return_temp_var_ = value;
182 }

◆ set_function_type_arguments()

void dart::ParsedFunction::set_function_type_arguments ( LocalVariable function_type_arguments)
inline

Definition at line 91 of file parser.h.

91 {
93 function_type_arguments_ = function_type_arguments;
94 }
LocalVariable * function_type_arguments() const
Definition: parser.h:88

◆ set_parent_type_arguments()

void dart::ParsedFunction::set_parent_type_arguments ( LocalVariable parent_type_arguments)
inline

Definition at line 98 of file parser.h.

98 {
99 ASSERT(parent_type_arguments != nullptr);
100 parent_type_arguments_ = parent_type_arguments;
101 }
LocalVariable * parent_type_arguments() const
Definition: parser.h:95

◆ set_receiver_used()

void dart::ParsedFunction::set_receiver_used ( )
inline

Definition at line 144 of file parser.h.

144{ receiver_used_ = true; }

◆ set_receiver_var()

void dart::ParsedFunction::set_receiver_var ( LocalVariable value)
inline

Definition at line 137 of file parser.h.

137 {
138 ASSERT(receiver_var_ == nullptr);
139 ASSERT(value != nullptr);
140 receiver_var_ = value;
141 }

◆ set_scope()

void dart::ParsedFunction::set_scope ( LocalScope scope)
inline

Definition at line 77 of file parser.h.

77 {
78 ASSERT(scope_ == nullptr);
79 ASSERT(scope != nullptr);
80 scope_ = scope;
81 }

◆ set_suspend_state_var()

void dart::ParsedFunction::set_suspend_state_var ( LocalVariable suspend_state_var)
inline

Definition at line 104 of file parser.h.

104 {
105 ASSERT(suspend_state_var != nullptr);
106 suspend_state_var_ = suspend_state_var;
107 }

◆ SetCovariantParameters()

void dart::ParsedFunction::SetCovariantParameters ( const BitVector covariant_parameters)

Definition at line 308 of file parser.cc.

309 {
310 ASSERT(covariant_parameters_ == nullptr);
311 ASSERT(covariant_parameters->length() == function_.NumParameters());
312 covariant_parameters_ = covariant_parameters;
313}

◆ SetGenericCovariantImplParameters()

void dart::ParsedFunction::SetGenericCovariantImplParameters ( const BitVector generic_covariant_impl_parameters)

Definition at line 315 of file parser.cc.

316 {
317 ASSERT(generic_covariant_impl_parameters_ == nullptr);
318 ASSERT(generic_covariant_impl_parameters->length() ==
319 function_.NumParameters());
320 generic_covariant_impl_parameters_ = generic_covariant_impl_parameters;
321}

◆ SetRawParameters()

void dart::ParsedFunction::SetRawParameters ( ZoneGrowableArray< LocalVariable * > *  raw_parameters)
inline

Definition at line 231 of file parser.h.

231 {
232 raw_parameters_ = raw_parameters;
233 }

◆ SetRawTypeArgumentsVariable()

void dart::ParsedFunction::SetRawTypeArgumentsVariable ( LocalVariable raw_type_arguments_var)
inline

Definition at line 227 of file parser.h.

227 {
228 raw_type_arguments_var_ = raw_type_arguments_var;
229 }

◆ SetRegExpCompileData()

void dart::ParsedFunction::SetRegExpCompileData ( RegExpCompileData regexp_compile_data)

Definition at line 173 of file parser.cc.

174 {
175 ASSERT(regexp_compile_data_ == nullptr);
176 ASSERT(regexp_compile_data != nullptr);
177 regexp_compile_data_ = regexp_compile_data;
178}
RegExpCompileData * regexp_compile_data() const
Definition: parser.h:83

◆ suspend_state_var()

LocalVariable * dart::ParsedFunction::suspend_state_var ( ) const
inline

Definition at line 103 of file parser.h.

103{ return suspend_state_var_; }

◆ thread()

Thread * dart::ParsedFunction::thread ( ) const
inline

Definition at line 211 of file parser.h.

211{ return thread_; }

◆ zone()

Zone * dart::ParsedFunction::zone ( ) const
inline

Definition at line 213 of file parser.h.

213{ return thread_->zone(); }
Zone * zone() const
Definition: thread_state.h:37

Friends And Related Function Documentation

◆ Parser

friend class Parser
friend

Definition at line 327 of file parser.h.


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