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

#include <code_descriptors.h>

Inheritance diagram for dart::CodeSourceMapOps:
dart::AllStatic

Static Public Member Functions

static uint8_t Read (ReadStream *stream, int32_t *arg1, int32_t *arg2=nullptr)
 
static void Write (BaseWriteStream *stream, uint8_t op, int32_t arg1=0, int32_t arg2=0)
 

Static Public Attributes

static constexpr uint8_t kChangePosition = 0
 
static constexpr uint8_t kAdvancePC = 1
 
static constexpr uint8_t kPushFunction = 2
 
static constexpr uint8_t kPopFunction = 3
 
static constexpr uint8_t kNullCheck = 4
 

Detailed Description

Definition at line 193 of file code_descriptors.h.

Member Function Documentation

◆ Read()

uint8_t dart::CodeSourceMapOps::Read ( ReadStream stream,
int32_t *  arg1,
int32_t *  arg2 = nullptr 
)
static

Definition at line 243 of file code_descriptors.cc.

245 {
246 ASSERT(stream != nullptr && arg1 != nullptr);
247 const int32_t n = stream->Read<int32_t>();
248 const uint8_t op = OpField::decode(n);
249 *arg1 = ArgField::decode(n);
250 if (*arg1 > kMaxArgValue) {
251 *arg1 |= kSignBits;
252 }
253#if defined(DART_PRECOMPILER)
254 // The special handling for non-symbolic stack trace mode only needs to
255 // happen in the precompiler, because those CSMs are not serialized in
256 // precompiled snapshots.
257 if (op == kChangePosition && FLAG_dwarf_stack_traces_mode) {
258 const int32_t m = stream->Read<int32_t>();
259 if (arg2 != nullptr) {
260 *arg2 = m;
261 }
262 }
263#endif
264 return op;
265}
static constexpr T decode(S value)
Definition bitfield.h:173
#define ASSERT(E)
static constexpr uint8_t kChangePosition

◆ Write()

void dart::CodeSourceMapOps::Write ( BaseWriteStream stream,
uint8_t  op,
int32_t  arg1 = 0,
int32_t  arg2 = 0 
)
static

Definition at line 267 of file code_descriptors.cc.

270 {
271 ASSERT(stream != nullptr);
272 ASSERT(arg1 >= kMinArgValue && arg1 <= kMaxArgValue);
273 if (arg1 < 0) {
274 arg1 &= ~kSignBits;
275 }
276 const int32_t n = OpField::encode(op) | ArgField::encode(arg1);
277 stream->Write(n);
278#if defined(DART_PRECOMPILER)
279 if (op == kChangePosition && FLAG_dwarf_stack_traces_mode) {
280 // For non-symbolic stack traces, the CodeSourceMaps are not serialized,
281 // so we need not worry about increasing snapshot size by including more
282 // information here.
283 stream->Write(arg2);
284 }
285#endif
286}
static constexpr S encode(T value)
Definition bitfield.h:167

Member Data Documentation

◆ kAdvancePC

constexpr uint8_t dart::CodeSourceMapOps::kAdvancePC = 1
staticconstexpr

Definition at line 195 of file code_descriptors.h.

◆ kChangePosition

constexpr uint8_t dart::CodeSourceMapOps::kChangePosition = 0
staticconstexpr

Definition at line 194 of file code_descriptors.h.

◆ kNullCheck

constexpr uint8_t dart::CodeSourceMapOps::kNullCheck = 4
staticconstexpr

Definition at line 198 of file code_descriptors.h.

◆ kPopFunction

constexpr uint8_t dart::CodeSourceMapOps::kPopFunction = 3
staticconstexpr

Definition at line 197 of file code_descriptors.h.

◆ kPushFunction

constexpr uint8_t dart::CodeSourceMapOps::kPushFunction = 2
staticconstexpr

Definition at line 196 of file code_descriptors.h.


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