Flutter Engine
The Flutter Engine
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 607 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}
SK_API bool Read(SkStreamSeekable *src, SkDocumentPage *dstArray, int dstArrayCount, const SkDeserialProcs *=nullptr)

◆ 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
Definition: thread_state.h:37
static Thread * Current()
Definition: thread.h:362
static int SNPrint(char *str, size_t size, const char *format,...) PRINTF_ATTRIBUTE(3
ElementType * Alloc(intptr_t length)
#define FORMAT
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
Definition: switches.h:126

◆ 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: