Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Functions | Variables
dart::compiler::target Namespace Reference

Functions

bool IsSmi (int64_t v)
 
bool WillAllocateNewOrRememberedObject (intptr_t instance_size)
 
bool WillAllocateNewOrRememberedContext (intptr_t num_context_variables)
 
bool WillAllocateNewOrRememberedArray (intptr_t length)
 
static word TranslateOffsetInWordsToHost (word offset)
 
bool SizeFitsInSizeTag (uword instance_size)
 
uword MakeTagWordForNewSpaceObject (classid_t cid, uword instance_size)
 
bool IsTypedDataClassId (intptr_t cid)
 
static word TranslateOffsetInWords (word offset)
 
static uword GetInstanceSizeImpl (const dart::Class &handle)
 
 JIT_OFFSETS_LIST (DEFINE_JIT_FIELD, DEFINE_JIT_ARRAY, DEFINE_JIT_SIZEOF, DEFINE_ARRAY_SIZEOF, DEFINE_PAYLOAD_SIZEOF, DEFINE_JIT_RANGE, DEFINE_CONSTANT) AOT_OFFSETS_LIST(DEFINE_AOT_FIELD
 
static DART_FORCE_INLINE bool BareInstructionsPayloads ()
 
bool CanLoadFromThread (const dart::Object &object, intptr_t *offset)
 
bool IsSmi (const dart::Object &a)
 
word ToRawSmi (const dart::Object &a)
 
word ToRawSmi (intptr_t value)
 
word SmiValue (const dart::Object &a)
 
bool IsDouble (const dart::Object &a)
 
double DoubleValue (const dart::Object &a)
 
void UnboxFieldIfSupported (const dart::Field &field, const dart::AbstractType &type)
 

Variables

const word kPageSize = dart::kPageSize
 
const word kPageSizeInWords = dart::kPageSize / kWordSize
 
const word kPageMask = dart::kPageMask
 
 DEFINE_AOT_ARRAY
 
 DEFINE_AOT_SIZEOF
 
 DEFINE_ARRAY_SIZEOF
 
 DEFINE_PAYLOAD_SIZEOF
 
 DEFINE_AOT_RANGE
 

Function Documentation

◆ BareInstructionsPayloads()

static DART_FORCE_INLINE bool dart::compiler::target::BareInstructionsPayloads ( )
static

Definition at line 868 of file runtime_api.cc.

868 {
869 return FLAG_precompiled_mode;
870}

◆ CanLoadFromThread()

bool dart::compiler::target::CanLoadFromThread ( const dart::Object object,
intptr_t *  offset 
)

Definition at line 940 of file runtime_api.cc.

941 {
943 if (offset != nullptr) {
944 *offset = Thread::OffsetFromThread(object);
945 }
946 return true;
947 }
948 return false;
949}
static bool CanLoadFromThread(const Object &object)
Definition thread.cc:1088
Point offset

◆ DoubleValue()

double dart::compiler::target::DoubleValue ( const dart::Object a)

Definition at line 977 of file runtime_api.cc.

977 {
979 return dart::Double::Cast(a).value();
980}
#define RELEASE_ASSERT(cond)
Definition assert.h:327
struct MyStruct a[10]
bool IsDouble(const dart::Object &a)

◆ GetInstanceSizeImpl()

static uword dart::compiler::target::GetInstanceSizeImpl ( const dart::Class handle)
static

Definition at line 449 of file runtime_api.cc.

449 {
450 switch (handle.id()) {
451 case kMintCid:
452 return Mint::InstanceSize();
453 case kDoubleCid:
454 return Double::InstanceSize();
455 case kInt32x4Cid:
456 return Int32x4::InstanceSize();
457 case kFloat32x4Cid:
458 return Float32x4::InstanceSize();
459 case kFloat64x2Cid:
460 return Float64x2::InstanceSize();
461 case kObjectCid:
462 return Object::InstanceSize();
463 case kInstanceCid:
464 return Instance::InstanceSize();
465 case kGrowableObjectArrayCid:
466 return GrowableObjectArray::InstanceSize();
467 case kClosureCid:
468 return Closure::InstanceSize();
469 case kTypedDataBaseCid:
470 return TypedDataBase::InstanceSize();
471 case kMapCid:
472 return Map::InstanceSize();
473 case kSetCid:
474 return Set::InstanceSize();
475 case kUnhandledExceptionCid:
476 return UnhandledException::InstanceSize();
477 case kWeakPropertyCid:
478 return WeakProperty::InstanceSize();
479 case kWeakReferenceCid:
480 return WeakReference::InstanceSize();
481 case kFinalizerCid:
482 return Finalizer::InstanceSize();
483 case kFinalizerEntryCid:
484 return FinalizerEntry::InstanceSize();
485 case kNativeFinalizerCid:
486 return NativeFinalizer::InstanceSize();
487 case kByteBufferCid:
488 case kByteDataViewCid:
490 case kPointerCid:
491 case kDynamicLibraryCid:
492#define HANDLE_CASE(clazz) case kFfi##clazz##Cid:
494#undef HANDLE_CASE
495#define HANDLE_CASE(clazz) \
496 case kTypedData##clazz##Cid: \
497 case kTypedData##clazz##ViewCid: \
498 case kExternalTypedData##clazz##Cid: \
499 case kUnmodifiableTypedData##clazz##ViewCid:
501#undef HANDLE_CASE
502 return handle.target_instance_size();
503 default:
504 if (handle.id() >= kNumPredefinedCids) {
505 return handle.target_instance_size();
506 }
507 }
508 FATAL("Unsupported class for size translation: %s (id=%" Pd
509 ", kNumPredefinedCids=%" Pd ")\n",
510 handle.ToCString(), handle.id(), kNumPredefinedCids);
511 return -1;
512}
#define CLASS_LIST_FFI_TYPE_MARKER(V)
Definition class_id.h:165
#define CLASS_LIST_TYPED_DATA(V)
Definition class_id.h:137
intptr_t id() const
Definition object.h:1235
intptr_t target_instance_size() const
Definition object.h:1149
virtual const char * ToCString() const
Definition object.h:366
#define FATAL(error)
@ kByteDataViewCid
Definition class_id.h:244
@ kByteBufferCid
Definition class_id.h:247
@ kUnmodifiableByteDataViewCid
Definition class_id.h:245
#define Pd
Definition globals.h:408
#define HANDLE_CASE(clazz)

◆ IsDouble()

bool dart::compiler::target::IsDouble ( const dart::Object a)

Definition at line 973 of file runtime_api.cc.

973 {
974 return a.IsDouble();
975}

◆ IsSmi() [1/2]

bool dart::compiler::target::IsSmi ( const dart::Object a)

Definition at line 955 of file runtime_api.cc.

955 {
956 return a.IsSmi() && IsSmi(dart::Smi::Cast(a).Value());
957}
bool IsSmi(int64_t v)

◆ IsSmi() [2/2]

bool dart::compiler::target::IsSmi ( int64_t  v)

Definition at line 31 of file runtime_api.cc.

31 {
32 return Utils::IsInt(kSmiBits + 1, v);
33}

◆ IsTypedDataClassId()

bool dart::compiler::target::IsTypedDataClassId ( intptr_t  cid)

Definition at line 434 of file runtime_api.cc.

434 {
435 return dart::IsTypedDataClassId(cid);
436}
bool IsTypedDataClassId(intptr_t index)
Definition class_id.h:433

◆ JIT_OFFSETS_LIST()

dart::compiler::target::JIT_OFFSETS_LIST ( DEFINE_JIT_FIELD  ,
DEFINE_JIT_ARRAY  ,
DEFINE_JIT_SIZEOF  ,
DEFINE_ARRAY_SIZEOF  ,
DEFINE_PAYLOAD_SIZEOF  ,
DEFINE_JIT_RANGE  ,
DEFINE_CONSTANT   
)

◆ MakeTagWordForNewSpaceObject()

uword dart::compiler::target::MakeTagWordForNewSpaceObject ( classid_t  cid,
uword  instance_size 
)

Definition at line 360 of file runtime_api.cc.

◆ SizeFitsInSizeTag()

bool dart::compiler::target::SizeFitsInSizeTag ( uword  instance_size)

Definition at line 355 of file runtime_api.cc.

355 {
357 TranslateOffsetInWordsToHost(instance_size));
358}
static constexpr bool SizeFits(intptr_t size)
Definition raw_object.h:213

◆ SmiValue()

word dart::compiler::target::SmiValue ( const dart::Object a)

Definition at line 968 of file runtime_api.cc.

968 {
970 return static_cast<word>(dart::Smi::Cast(a).Value());
971}
intptr_t word
Definition globals.h:500

◆ ToRawSmi() [1/2]

word dart::compiler::target::ToRawSmi ( const dart::Object a)

Definition at line 959 of file runtime_api.cc.

959 {
961 return static_cast<compressed_word>(static_cast<intptr_t>(a.ptr()));
962}
intptr_t compressed_word
Definition globals.h:45

◆ ToRawSmi() [2/2]

word dart::compiler::target::ToRawSmi ( intptr_t  value)

Definition at line 964 of file runtime_api.cc.

964 {
965 return dart::Smi::RawValue(value);
966}
static intptr_t RawValue(intptr_t value)
Definition object.h:10001

◆ TranslateOffsetInWords()

static word dart::compiler::target::TranslateOffsetInWords ( word  offset)
static

Definition at line 444 of file runtime_api.cc.

444 {
446 return (offset / dart::kWordSize) * kWordSize;
447}
constexpr intptr_t kWordSize
Definition globals.h:509

◆ TranslateOffsetInWordsToHost()

static word dart::compiler::target::TranslateOffsetInWordsToHost ( word  offset)
static

Definition at line 350 of file runtime_api.cc.

350 {
351 RELEASE_ASSERT((offset % kCompressedWordSize) == 0);
352 return (offset / kCompressedWordSize) * dart::kCompressedWordSize;
353}
static constexpr intptr_t kCompressedWordSize
Definition globals.h:42

◆ UnboxFieldIfSupported()

void dart::compiler::target::UnboxFieldIfSupported ( const dart::Field field,
const dart::AbstractType type 
)

Definition at line 1081 of file runtime_api.cc.

1082 {
1083 if (field.is_static() || field.is_late()) {
1084 return;
1085 }
1086
1087 if (type.IsNullable()) {
1088 return;
1089 }
1090
1092 if (type.IsDoubleType()) {
1093 if (FlowGraphCompiler::SupportsUnboxedDoubles()) {
1094 cid = kDoubleCid;
1095 }
1096 } else if (type.IsFloat32x4Type()) {
1097 if (FlowGraphCompiler::SupportsUnboxedSimd128()) {
1098 cid = kFloat32x4Cid;
1099 }
1100 } else if (type.IsFloat64x2Type()) {
1101 if (FlowGraphCompiler::SupportsUnboxedSimd128()) {
1102 cid = kFloat64x2Cid;
1103 }
1104 }
1105
1106 if (cid != kIllegalCid) {
1107 field.set_guarded_cid(cid);
1108 field.set_is_nullable(false);
1109 field.set_is_unboxed(true);
1113 }
1114}
void set_is_unboxed(bool b) const
Definition object.h:4693
@ kUnknownLengthOffset
Definition object.h:4700
@ kNoFixedLength
Definition object.h:4702
bool is_late() const
Definition object.h:4422
bool is_static() const
Definition object.h:4418
void set_guarded_cid(intptr_t cid) const
Definition object.h:4633
void set_guarded_list_length_in_object_offset(intptr_t offset) const
Definition object.h:4661
void set_is_nullable(bool val) const
Definition object.h:4726
void set_guarded_list_length(intptr_t list_length) const
Definition object.h:4651
int32_t classid_t
Definition globals.h:524
@ kIllegalCid
Definition class_id.h:214
const intptr_t cid

◆ WillAllocateNewOrRememberedArray()

bool dart::compiler::target::WillAllocateNewOrRememberedArray ( intptr_t  length)

Definition at line 46 of file runtime_api.cc.

46 {
47 if (!dart::Array::IsValidLength(length)) return false;
49}
static constexpr bool UseCardMarkingForAllocation(const intptr_t array_length)
Definition object.h:10797
static constexpr bool IsValidLength(intptr_t len)
Definition object.h:10906
size_t length

◆ WillAllocateNewOrRememberedContext()

bool dart::compiler::target::WillAllocateNewOrRememberedContext ( intptr_t  num_context_variables)

Definition at line 40 of file runtime_api.cc.

40 {
41 if (!dart::Context::IsValidLength(num_context_variables)) return false;
43 dart::Context::InstanceSize(num_context_variables));
44}
static bool IsValidLength(intptr_t len)
Definition object.h:7415
static intptr_t InstanceSize()
Definition object.h:7419
bool IsAllocatableInNewSpace(intptr_t size)
Definition spaces.h:57

◆ WillAllocateNewOrRememberedObject()

bool dart::compiler::target::WillAllocateNewOrRememberedObject ( intptr_t  instance_size)

Definition at line 35 of file runtime_api.cc.

35 {
36 ASSERT(Utils::IsAligned(instance_size, ObjectAlignment::kObjectAlignment));
37 return dart::IsAllocatableInNewSpace(instance_size);
38}
#define ASSERT(E)

Variable Documentation

◆ DEFINE_AOT_ARRAY

dart::compiler::target::DEFINE_AOT_ARRAY

Definition at line 799 of file runtime_api.cc.

◆ DEFINE_AOT_RANGE

dart::compiler::target::DEFINE_AOT_RANGE

Definition at line 803 of file runtime_api.cc.

◆ DEFINE_AOT_SIZEOF

dart::compiler::target::DEFINE_AOT_SIZEOF

Definition at line 800 of file runtime_api.cc.

◆ DEFINE_ARRAY_SIZEOF

dart::compiler::target::DEFINE_ARRAY_SIZEOF

Definition at line 801 of file runtime_api.cc.

◆ DEFINE_PAYLOAD_SIZEOF

dart::compiler::target::DEFINE_PAYLOAD_SIZEOF

Definition at line 802 of file runtime_api.cc.

◆ kPageMask

const word dart::compiler::target::kPageMask = dart::kPageMask

Definition at line 348 of file runtime_api.cc.

◆ kPageSize

const word dart::compiler::target::kPageSize = dart::kPageSize

Definition at line 346 of file runtime_api.cc.

◆ kPageSizeInWords

const word dart::compiler::target::kPageSizeInWords = dart::kPageSize / kWordSize

Definition at line 347 of file runtime_api.cc.