Flutter Engine
The Flutter Engine
Static Public Member Functions | List of all members
dart::Boxing Struct Reference

#include <il.h>

Inheritance diagram for dart::Boxing:
dart::AllStatic

Static Public Member Functions

static bool Supports (Representation rep)
 
static constexpr Representation NativeRepresentation (Representation rep)
 
static bool RequiresAllocation (Representation rep)
 
static intptr_t ValueOffset (Representation rep)
 
static intptr_t BoxCid (Representation rep)
 

Detailed Description

Definition at line 8493 of file il.h.

Member Function Documentation

◆ BoxCid()

intptr_t dart::Boxing::BoxCid ( Representation  rep)
static

Definition at line 493 of file il.cc.

493 {
495 if (!Boxing::RequiresAllocation(rep)) {
496 return kSmiCid;
497 } else if (RepresentationUtils::ValueSize(rep) <= sizeof(int64_t)) {
498 return kMintCid;
499 }
500 }
501 switch (rep) {
503 default:
504 UNREACHABLE();
505 return kIllegalCid;
506 }
507}
#define UNREACHABLE()
Definition: assert.h:248
#define FOR_EACH_NON_INT_BOXED_REPRESENTATION(M)
Definition: il.cc:442
#define BOXING_CID_CASE(unboxed, boxed)
Definition: il.cc:455
@ kIllegalCid
Definition: class_id.h:214
static bool RequiresAllocation(Representation rep)
Definition: il.cc:470
static constexpr size_t ValueSize(Representation rep)
Definition: locations.h:112
static constexpr bool IsUnboxedInteger(Representation rep)
Definition: locations.h:92

◆ NativeRepresentation()

static constexpr Representation dart::Boxing::NativeRepresentation ( Representation  rep)
inlinestaticconstexpr

Definition at line 8504 of file il.h.

8504 {
8505 // Only change integer representations.
8506 if (!RepresentationUtils::IsUnboxedInteger(rep)) return rep;
8507 // Use signed word-sized integers for representations smaller than 4 bytes.
8508 return RepresentationUtils::ValueSize(rep) < 4 ? kUnboxedIntPtr : rep;
8509 }
static constexpr Representation kUnboxedIntPtr
Definition: locations.h:176

◆ RequiresAllocation()

bool dart::Boxing::RequiresAllocation ( Representation  rep)
static

Definition at line 470 of file il.cc.

470 {
474 }
475 return true;
476}
constexpr intptr_t kSmiBits
Definition: runtime_api.h:301
constexpr intptr_t kBitsPerByte
Definition: globals.h:463

◆ Supports()

bool dart::Boxing::Supports ( Representation  rep)
static

Definition at line 459 of file il.cc.

459 {
461 return true;
462 }
463 switch (rep) {
465 default:
466 return false;
467 }
468}
#define BOXING_IN_SET_CASE(unboxed, boxed)
Definition: il.cc:449

◆ ValueOffset()

intptr_t dart::Boxing::ValueOffset ( Representation  rep)
static

Definition at line 478 of file il.cc.

478 {
481 RepresentationUtils::ValueSize(rep) <= sizeof(int64_t)) {
483 }
484 switch (rep) {
486 default:
487 UNREACHABLE();
488 return 0;
489 }
490}
#define BOXING_VALUE_OFFSET_CASE(unboxed, boxed)
Definition: il.cc:452

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