Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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 8445 of file il.h.

Member Function Documentation

◆ BoxCid()

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

Definition at line 491 of file il.cc.

491 {
493 if (!Boxing::RequiresAllocation(rep)) {
494 return kSmiCid;
495 } else if (RepresentationUtils::ValueSize(rep) <= sizeof(int64_t)) {
496 return kMintCid;
497 }
498 }
499 switch (rep) {
501 default:
502 UNREACHABLE();
503 return kIllegalCid;
504 }
505}
#define UNREACHABLE()
Definition assert.h:248
#define FOR_EACH_NON_INT_BOXED_REPRESENTATION(M)
Definition il.cc:440
#define BOXING_CID_CASE(unboxed, boxed)
Definition il.cc:453
@ kIllegalCid
Definition class_id.h:214
static bool RequiresAllocation(Representation rep)
Definition il.cc:468
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 8456 of file il.h.

8456 {
8457 // Only change integer representations.
8458 if (!RepresentationUtils::IsUnboxedInteger(rep)) return rep;
8459 // Use signed word-sized integers for representations smaller than 4 bytes.
8460 return RepresentationUtils::ValueSize(rep) < 4 ? kUnboxedIntPtr : rep;
8461 }
static constexpr Representation kUnboxedIntPtr
Definition locations.h:176

◆ RequiresAllocation()

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

Definition at line 468 of file il.cc.

468 {
471 compiler::target::kSmiBits;
472 }
473 return true;
474}
constexpr intptr_t kBitsPerByte
Definition globals.h:463

◆ Supports()

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

Definition at line 457 of file il.cc.

457 {
459 return true;
460 }
461 switch (rep) {
463 default:
464 return false;
465 }
466}
#define BOXING_IN_SET_CASE(unboxed, boxed)
Definition il.cc:447

◆ ValueOffset()

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

Definition at line 476 of file il.cc.

476 {
479 RepresentationUtils::ValueSize(rep) <= sizeof(int64_t)) {
480 return compiler::target::Mint::value_offset();
481 }
482 switch (rep) {
484 default:
485 UNREACHABLE();
486 return 0;
487 }
488}
#define BOXING_VALUE_OFFSET_CASE(unboxed, boxed)
Definition il.cc:450

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