5#ifndef RUNTIME_VM_SCOPES_H_
6#define RUNTIME_VM_SCOPES_H_
64 return value_ == other.value_;
69 int value()
const {
return value_; }
93 : declaration_pos_(declaration_pos),
103 covariance_mode_(kNotCovariant),
104 late_init_offset_(0),
107 is_awaiter_link_(IsAwaiterLink::kNotLink) {
112 if (IsFilteredIdentifier(
name)) {
124 ASSERT(owner_ ==
nullptr);
129 annotations_offset_ =
offset;
131 : IsAwaiterLink::kUnknown;
148 is_awaiter_link_ =
value ? IsAwaiterLink::kLink : IsAwaiterLink::kNotLink;
169 return covariance_mode_ == kExplicit;
174 return covariance_mode_ != kNotCovariant;
177 if (covariance_mode_ == kNotCovariant) {
178 covariance_mode_ = kImplicit;
236 using IsCapturedParameterBit =
238 using IsForcedStackBit =
242 enum CovarianceMode {
248 static constexpr int kUninitializedIndex = INT_MIN;
250 static bool IsFilteredIdentifier(
const String&
name);
252 const TokenPosition declaration_pos_;
253 const TokenPosition token_pos_;
255 const intptr_t kernel_offset_;
256 intptr_t annotations_offset_;
259 const AbstractType& static_type_;
262 CompileType*
const inferred_type_;
264 CompileType*
const inferred_arg_type_;
266 const Object*
const inferred_arg_value_;
268 uint32_t bitfield_ = 0;
269 CovarianceMode covariance_mode_;
270 intptr_t late_init_offset_;
272 VariableIndex index_;
274 enum class IsAwaiterLink {
279 IsAwaiterLink is_awaiter_link_;
309 LocalVarDescriptorsPtr
Done();
331 return context_level_ != kUninitializedContextLevel;
335 return context_level_;
352 return context_variables_;
356 return *context_slots_;
379 intptr_t kernel_offset)
const;
387 intptr_t kernel_offset,
399 ASSERT((index >= 0) && (index < variables_.length()));
400 return variables_[index];
421 bool* found_captured_variables);
432 intptr_t current_context_level)
const;
460 static constexpr int kUninitializedContextLevel = INT_MIN;
#define DEBUG_ASSERT(cond)
static constexpr T decode(S value)
static constexpr S update(T value, S original)
int context_level() const
LocalScope * parent() const
LocalScope(LocalScope *parent, int function_level, int loop_level)
const GrowableArray< LocalVariable * > & context_variables() const
const ZoneGrowableArray< const Slot * > & context_slots() const
void set_begin_token_pos(TokenPosition value)
bool IsNestedWithin(LocalScope *scope) const
void set_end_token_pos(TokenPosition value)
TokenPosition end_token_pos() const
LocalScope * sibling() const
static ContextScopePtr CreateImplicitClosureScope(const Function &func)
int NumCapturedVariables() const
int function_level() const
static LocalScope * RestoreOuterScope(const ContextScope &context_scope)
VariableIndex AllocateVariables(const Function &function, VariableIndex first_parameter_index, int num_parameters, VariableIndex first_local_index, LocalScope *context_owner, bool *found_captured_variables)
LocalVarDescriptorsPtr GetVarDescriptors(const Function &func, ZoneGrowableArray< intptr_t > *context_level_array)
LocalVariable * LookupVariableByName(const String &name)
LocalVariable * VariableAt(intptr_t index) const
intptr_t num_variables() const
bool HasContextLevel() const
TokenPosition begin_token_pos() const
LocalVariable * LookupVariable(const String &name, intptr_t kernel_offset, bool test_only)
bool AddVariable(LocalVariable *variable)
LocalScope * child() const
void CaptureVariable(LocalVariable *variable)
bool InsertParameterAt(intptr_t pos, LocalVariable *parameter)
int num_context_variables() const
ContextScopePtr PreserveOuterScope(const Function &function, intptr_t current_context_level) const
LocalVariable * LocalLookupVariable(const String &name, intptr_t kernel_offset) const
void set_context_level(int context_level)
void AddContextVariable(LocalVariable *var)
void CaptureLocalVariables(LocalScope *top_scope)
void AddAll(Zone *zone, const LocalVarDescriptors &var_descs)
LocalVarDescriptorsBuilder()
LocalVarDescriptorsPtr Done()
void Add(const VarDesc &var_desc)
void AddDeoptIdToContextLevelMappings(ZoneGrowableArray< intptr_t > *context_level_array)
CompileType * inferred_type() const
VariableIndex index() const
void set_needs_covariant_check_in_method()
void set_late_init_offset(intptr_t late_init_offset)
LocalScope * owner() const
bool ComputeIfIsAwaiterLink(const Library &library)
intptr_t annotations_offset() const
LocalVariable(TokenPosition declaration_pos, TokenPosition token_pos, const String &name, const AbstractType &static_type, intptr_t kernel_offset, CompileType *inferred_type, CompileType *inferred_arg_type=nullptr, const Object *inferred_arg_value=nullptr)
void set_is_explicit_covariant_parameter()
bool is_forced_stack() const
void set_type_check_mode(TypeCheckMode mode)
TokenPosition declaration_token_pos() const
TokenPosition token_pos() const
void set_index(VariableIndex index)
void set_invisible(bool value)
bool is_invisible() const
TypeCheckMode type_check_mode() const
const Object * inferred_arg_value() const
void set_annotations_offset(intptr_t offset)
bool needs_type_check() const
const AbstractType & static_type() const
intptr_t kernel_offset() const
bool Equals(const LocalVariable &other) const
bool is_captured_parameter() const
static constexpr intptr_t kNoKernelOffset
intptr_t late_init_offset() const
const String & name() const
void set_is_forced_stack()
bool was_type_checked_by_caller() const
void set_is_captured_parameter(bool value)
void set_is_awaiter_link(bool value)
void set_owner(LocalScope *owner)
bool needs_covariant_check_in_method() const
LocalVariable(TokenPosition declaration_pos, TokenPosition token_pos, const String &name, const AbstractType &static_type, intptr_t kernel_offset=kNoKernelOffset)
CompileType * inferred_arg_type() const
bool is_explicit_covariant_parameter() const
static constexpr int kInvalidIndex
VariableIndex(int value=kInvalidIndex)
bool operator==(const VariableIndex &other) const
Dart_NativeFunction function
static float min(float r, float g, float b)
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive mode
UntaggedLocalVarDescriptors::VarInfo info