Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
dart::DeoptInfo Class Reference

#include <deopt_instructions.h>

Inheritance diagram for dart::DeoptInfo:
dart::AllStatic

Static Public Member Functions

static intptr_t FrameSize (const TypedData &packed)
 
static intptr_t NumMaterializations (const GrowableArray< DeoptInstr * > &)
 
static void Unpack (const Array &table, const TypedData &packed, GrowableArray< DeoptInstr * > *instructions)
 
static const char * ToCString (const Array &table, const TypedData &packed)
 
static bool VerifyDecompression (const GrowableArray< DeoptInstr * > &original, const Array &deopt_table, const TypedData &packed)
 

Detailed Description

Definition at line 609 of file deopt_instructions.h.

Member Function Documentation

◆ FrameSize()

intptr_t dart::DeoptInfo::FrameSize ( const TypedData packed)
static

Definition at line 1349 of file deopt_instructions.cc.

1349 {
1350 NoSafepointScope no_safepoint;
1351 typedef ReadStream::Raw<sizeof(intptr_t), intptr_t> Reader;
1352 ReadStream read_stream(reinterpret_cast<uint8_t*>(packed.DataAddr(0)),
1353 packed.LengthInBytes());
1354 return Reader::Read(&read_stream);
1355}

◆ NumMaterializations()

intptr_t dart::DeoptInfo::NumMaterializations ( const GrowableArray< DeoptInstr * > &  unpacked)
static

Definition at line 1357 of file deopt_instructions.cc.

1358 {
1359 intptr_t num = 0;
1360 while (unpacked[num]->kind() == DeoptInstr::kMaterializeObject) {
1361 num++;
1362 }
1363 return num;
1364}

◆ ToCString()

const char * dart::DeoptInfo::ToCString ( const Array table,
const TypedData packed 
)
static

Definition at line 1409 of file deopt_instructions.cc.

1410 {
1411#define FORMAT "[%s]"
1412 GrowableArray<DeoptInstr*> deopt_instrs;
1413 Unpack(deopt_table, packed, &deopt_instrs);
1414
1415 // Compute the buffer size required.
1416 intptr_t len = 1; // Trailing '\0'.
1417 for (intptr_t i = 0; i < deopt_instrs.length(); i++) {
1418 len += Utils::SNPrint(nullptr, 0, FORMAT, deopt_instrs[i]->ToCString());
1419 }
1420
1421 // Allocate the buffer.
1422 char* buffer = Thread::Current()->zone()->Alloc<char>(len);
1423
1424 // Layout the fields in the buffer.
1425 intptr_t index = 0;
1426 for (intptr_t i = 0; i < deopt_instrs.length(); i++) {
1427 index += Utils::SNPrint((buffer + index), (len - index), FORMAT,
1428 deopt_instrs[i]->ToCString());
1429 }
1430
1431 return buffer;
1432#undef FORMAT
1433}
static void Unpack(const Array &table, const TypedData &packed, GrowableArray< DeoptInstr * > *instructions)
static const char * ToCString(const Array &table, const TypedData &packed)
Zone * zone() const
static Thread * Current()
Definition thread.h:361
static int SNPrint(char *str, size_t size, const char *format,...) PRINTF_ATTRIBUTE(3
ElementType * Alloc(intptr_t length)
#define FORMAT
static const uint8_t buffer[]

◆ Unpack()

void dart::DeoptInfo::Unpack ( const Array table,
const TypedData packed,
GrowableArray< DeoptInstr * > *  instructions 
)
static

Definition at line 1397 of file deopt_instructions.cc.

1399 {
1400 ASSERT(unpacked->is_empty());
1401
1402 // Pass kMaxInt32 as the length to unpack all instructions from the
1403 // packed stream.
1404 UnpackInto(table, packed, unpacked, kMaxInt32);
1405
1406 unpacked->Reverse();
1407}
SI F table(const skcms_Curve *curve, F v)
#define ASSERT(E)
constexpr int32_t kMaxInt32
Definition globals.h:483

◆ VerifyDecompression()

bool dart::DeoptInfo::VerifyDecompression ( const GrowableArray< DeoptInstr * > &  original,
const Array deopt_table,
const TypedData packed 
)
static

Definition at line 1436 of file deopt_instructions.cc.

1438 {
1439 GrowableArray<DeoptInstr*> unpacked;
1440 Unpack(deopt_table, packed, &unpacked);
1441 ASSERT(unpacked.length() == original.length());
1442 for (intptr_t i = 0; i < unpacked.length(); ++i) {
1443 ASSERT(unpacked[i]->Equals(*original[i]));
1444 }
1445 return true;
1446}
static bool Equals(const Object &expected, const Object &actual)

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