Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
dart::kernel::InferredTypeMetadata Struct Reference

#include <kernel_translation_helper.h>

Public Types

enum  Flag {
  kFlagNullable = 1 << 0 , kFlagInt = 1 << 1 , kFlagSkipCheck = 1 << 2 , kFlagConstant = 1 << 3 ,
  kFlagReceiverNotInt = 1 << 4
}
 

Public Member Functions

 InferredTypeMetadata (intptr_t cid_, uint8_t flags_, const Object &constant_value_=Object::null_object())
 
bool IsTrivial () const
 
bool IsNullable () const
 
bool IsInt () const
 
bool IsSkipCheck () const
 
bool IsConstant () const
 
bool ReceiverNotInt () const
 
CompileType ToCompileType (Zone *zone, const AbstractType *static_type=nullptr, bool can_be_sentinel=false) const
 

Public Attributes

const intptr_t cid
 
const uint8_t flags
 
const Objectconstant_value
 

Static Public Attributes

static constexpr intptr_t kCompileTypeFlagsMask = kFlagNullable | kFlagInt
 

Detailed Description

Definition at line 1013 of file kernel_translation_helper.h.

Member Enumeration Documentation

◆ Flag

Enumerator
kFlagNullable 
kFlagInt 
kFlagSkipCheck 
kFlagConstant 
kFlagReceiverNotInt 

Definition at line 1014 of file kernel_translation_helper.h.

Constructor & Destructor Documentation

◆ InferredTypeMetadata()

dart::kernel::InferredTypeMetadata::InferredTypeMetadata ( intptr_t  cid_,
uint8_t  flags_,
const Object constant_value_ = Object::null_object() 
)
inline

Member Function Documentation

◆ IsConstant()

bool dart::kernel::InferredTypeMetadata::IsConstant ( ) const
inline

Definition at line 1043 of file kernel_translation_helper.h.

1043{ return (flags & kFlagConstant) != 0; }

◆ IsInt()

bool dart::kernel::InferredTypeMetadata::IsInt ( ) const
inline

Definition at line 1039 of file kernel_translation_helper.h.

1039 {
1040 return (flags & kFlagInt) != 0 || cid == kMintCid || cid == kSmiCid;
1041 }

◆ IsNullable()

bool dart::kernel::InferredTypeMetadata::IsNullable ( ) const
inline

Definition at line 1038 of file kernel_translation_helper.h.

1038{ return (flags & kFlagNullable) != 0; }

◆ IsSkipCheck()

bool dart::kernel::InferredTypeMetadata::IsSkipCheck ( ) const
inline

Definition at line 1042 of file kernel_translation_helper.h.

1042{ return (flags & kFlagSkipCheck) != 0; }

◆ IsTrivial()

bool dart::kernel::InferredTypeMetadata::IsTrivial ( ) const
inline

Definition at line 1034 of file kernel_translation_helper.h.

1034 {
1035 return (cid == kDynamicCid) &&
1037 }
@ kDynamicCid
Definition class_id.h:253

◆ ReceiverNotInt()

bool dart::kernel::InferredTypeMetadata::ReceiverNotInt ( ) const
inline

Definition at line 1044 of file kernel_translation_helper.h.

1044{ return (flags & kFlagReceiverNotInt) != 0; }

◆ ToCompileType()

CompileType dart::kernel::InferredTypeMetadata::ToCompileType ( Zone zone,
const AbstractType static_type = nullptr,
bool  can_be_sentinel = false 
) const
inline

Definition at line 1048 of file kernel_translation_helper.h.

1050 {
1051 if (IsInt() && cid == kDynamicCid) {
1054 zone, (IsNullable() ? Type::NullableIntType() : Type::IntType())),
1055 IsNullable(), can_be_sentinel);
1056 } else {
1057 return CompileType(IsNullable(), can_be_sentinel, cid, static_type);
1058 }
1059 }
static CompileType FromAbstractType(const AbstractType &type, bool can_be_null, bool can_be_sentinel)
static Object & ZoneHandle()
Definition object.h:419
static TypePtr NullableIntType()
Definition object.cc:21890
const Type & IntType()

Member Data Documentation

◆ cid

const intptr_t dart::kernel::InferredTypeMetadata::cid

Definition at line 1030 of file kernel_translation_helper.h.

◆ constant_value

const Object& dart::kernel::InferredTypeMetadata::constant_value

Definition at line 1032 of file kernel_translation_helper.h.

◆ flags

const uint8_t dart::kernel::InferredTypeMetadata::flags

Definition at line 1031 of file kernel_translation_helper.h.

◆ kCompileTypeFlagsMask

constexpr intptr_t dart::kernel::InferredTypeMetadata::kCompileTypeFlagsMask = kFlagNullable | kFlagInt
staticconstexpr

Definition at line 1023 of file kernel_translation_helper.h.


The documentation for this struct was generated from the following file: