#include <datastream.h>
|
| BaseWriteStream (intptr_t initial_size) |
|
virtual | ~BaseWriteStream () |
|
DART_FORCE_INLINE intptr_t | bytes_written () const |
|
virtual intptr_t | Position () const |
|
intptr_t | Align (intptr_t alignment, intptr_t offset=0) |
|
void | WriteWordWith32BitWrites (uword value) |
|
template<typename T > |
void | WriteUnsigned (T value) |
|
void | WriteRefId (intptr_t value) |
|
void | WriteBytes (const void *addr, intptr_t len) |
|
void | WriteWord (uword value) |
|
void | WriteTargetWord (word value) |
|
void | Printf (const char *format,...) PRINTF_ATTRIBUTE(2 |
|
void | va_start (args, format) |
|
| VPrintf (format, args) |
|
| va_end (args) |
|
void | VPrintf (const char *format, va_list args) |
|
template<typename T > |
void | Write (T value) |
|
template<typename T > |
void | WriteFixed (T value) |
|
DART_FORCE_INLINE void | WriteByte (uint8_t value) |
|
void | WriteString (const char *cstr) |
|
template<typename T > |
C::only_if_unsigned< T, void > | WriteLEB128 (T value) |
|
template<typename T > |
C::only_if_signed< T, void > | WriteLEB128 (T value) |
|
template<typename T > |
C::only_if_signed< T, void > | WriteSLEB128 (T value) |
|
template<typename T > |
C::only_if_unsigned< T, void > | WriteSLEB128 (T value) |
|
| ValueObject () |
|
| ~ValueObject () |
|
Definition at line 332 of file datastream.h.
◆ BaseWriteStream()
dart::BaseWriteStream::BaseWriteStream |
( |
intptr_t |
initial_size | ) |
|
|
inlineexplicit |
Definition at line 334 of file datastream.h.
const intptr_t initial_size_
static constexpr uintptr_t RoundUpToPowerOfTwo(uintptr_t x)
◆ ~BaseWriteStream()
virtual dart::BaseWriteStream::~BaseWriteStream |
( |
| ) |
|
|
inlinevirtual |
◆ Align()
intptr_t dart::BaseWriteStream::Align |
( |
intptr_t |
alignment, |
|
|
intptr_t |
offset = 0 |
|
) |
| |
|
inline |
Definition at line 341 of file datastream.h.
341 {
342 const intptr_t position_before =
Position();
343 const intptr_t position_after =
345 const intptr_t
length = position_after - position_before;
350 }
352 }
virtual void SetPosition(intptr_t value)
void EnsureSpace(intptr_t size_needed)
virtual intptr_t Position() const
static constexpr T RoundUp(T x, uintptr_t alignment, uintptr_t offset=0)
◆ bytes_written()
DART_FORCE_INLINE intptr_t dart::BaseWriteStream::bytes_written |
( |
| ) |
const |
|
inline |
◆ DISALLOW_COPY_AND_ASSIGN()
◆ EnsureSpace()
void dart::BaseWriteStream::EnsureSpace |
( |
intptr_t |
size_needed | ) |
|
|
inlineprotected |
Definition at line 564 of file datastream.h.
564 {
567 if (size_needed > increment_size) {
569 }
570 intptr_t new_size =
capacity_ + increment_size;
575 }
577 }
virtual void Realloc(intptr_t new_capacity)=0
DART_FORCE_INLINE intptr_t Remaining() const
static DART_NORETURN void ThrowOOM()
◆ Position()
virtual intptr_t dart::BaseWriteStream::Position |
( |
| ) |
const |
|
inlinevirtual |
◆ Printf()
void dart::BaseWriteStream::Printf |
( |
const char * |
format, |
|
|
|
... |
|
) |
| |
◆ Realloc()
virtual void dart::BaseWriteStream::Realloc |
( |
intptr_t |
new_capacity | ) |
|
|
protectedpure virtual |
◆ Remaining()
DART_FORCE_INLINE intptr_t dart::BaseWriteStream::Remaining |
( |
| ) |
const |
|
inlineprotected |
◆ SetPosition()
virtual void dart::BaseWriteStream::SetPosition |
( |
intptr_t |
value | ) |
|
|
inlineprotectedvirtual |
◆ va_end()
dart::BaseWriteStream::va_end |
( |
args |
| ) |
|
◆ va_start()
void dart::BaseWriteStream::va_start |
( |
args |
, |
|
|
format |
|
|
) |
| |
◆ VPrintf() [1/2]
void dart::BaseWriteStream::VPrintf |
( |
const char * |
format, |
|
|
va_list |
args |
|
) |
| |
|
inline |
Definition at line 443 of file datastream.h.
443 {
444
445 va_list measure_args;
446 va_copy(measure_args,
args);
449
450
452
453
454 va_list print_args;
455 va_copy(print_args,
args);
457 print_args);
460 }
static int static int VSNPrint(char *str, size_t size, const char *format, va_list args)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
uint32_t uint32_t * format
◆ VPrintf() [2/2]
◆ Write()
void dart::BaseWriteStream::Write |
( |
T |
value | ) |
|
|
inline |
Definition at line 463 of file datastream.h.
463 {
468 }
470 }
DART_FORCE_INLINE void WriteByte(uint8_t value)
static constexpr int8_t kByteMask
static constexpr int8_t kMaxDataPerByte
static constexpr int8_t kDataBitsPerByte
static constexpr uint8_t kEndByteMarker
◆ WriteByte()
DART_FORCE_INLINE void dart::BaseWriteStream::WriteByte |
( |
uint8_t |
value | ) |
|
|
inline |
◆ WriteBytes()
void dart::BaseWriteStream::WriteBytes |
( |
const void * |
addr, |
|
|
intptr_t |
len |
|
) |
| |
|
inline |
◆ WriteFixed()
void dart::BaseWriteStream::WriteFixed |
( |
T |
value | ) |
|
|
inline |
Definition at line 473 of file datastream.h.
473 {
475 }
void WriteBytes(const void *addr, intptr_t len)
◆ WriteLEB128() [1/2]
Definition at line 489 of file datastream.h.
489 {
491 bool is_last_part;
492 do {
495
496 is_last_part = remainder ==
static_cast<T>(0);
497 if (!is_last_part) {
498
500 }
502 } while (!is_last_part);
503 }
static constexpr uint8_t kDataBitsPerByte
static constexpr uint8_t kDataByteMask
static constexpr uint8_t kMoreDataMask
◆ WriteLEB128() [2/2]
Definition at line 506 of file datastream.h.
506 {
507
508
511 }
C::only_if_unsigned< T, void > WriteLEB128(T value)
DART_FORCE_INLINE D bit_cast(const S &source)
◆ WriteRefId()
void dart::BaseWriteStream::WriteRefId |
( |
intptr_t |
value | ) |
|
|
inline |
Definition at line 409 of file datastream.h.
409 {
412 if ((
value >> 21) != 0) {
414 }
415 if ((
value >> 14) != 0) {
417 }
418 if ((
value >> 7) != 0) {
420 }
422 }
static bool IsUint(intptr_t N, T value)
◆ WriteSLEB128() [1/2]
Definition at line 514 of file datastream.h.
514 {
517
518 const bool is_negative =
value < 0;
520 bool is_last_part;
521 do {
524
525
526
527
528
529
530
531 if (is_negative) {
532
533
534
536
538 ~static_cast<T>((static_cast<Unsigned>(1) << preserved_bits) - 1);
539
540
543 is_last_part =
544 remainder == ~static_cast<T>(0) && (part &
C::kSignMask) != 0;
545 } else {
547 is_last_part =
548 (remainder ==
static_cast<T>(0) && (part &
C::kSignMask) == 0);
549 }
550 if (!is_last_part) {
551
553 }
555 } while (!is_last_part);
556 }
constexpr intptr_t kBitsPerByte
intx_t sign_extend(int32_t x)
static constexpr uint8_t kSignMask
◆ WriteSLEB128() [2/2]
Definition at line 559 of file datastream.h.
559 {
561 }
C::only_if_signed< T, void > WriteSLEB128(T value)
◆ WriteString()
void dart::BaseWriteStream::WriteString |
( |
const char * |
cstr | ) |
|
|
inline |
◆ WriteTargetWord()
void dart::BaseWriteStream::WriteTargetWord |
( |
word |
value | ) |
|
Definition at line 12 of file datastream.cc.
12 {
15}
static constexpr size_t BitLength(int64_t value)
static constexpr word kBitsPerWord
◆ WriteUnsigned()
void dart::BaseWriteStream::WriteUnsigned |
( |
T |
value | ) |
|
|
inline |
Definition at line 400 of file datastream.h.
400 {
405 }
407 }
static constexpr int8_t kMaxUnsignedDataPerByte
static constexpr uint8_t kEndUnsignedByteMarker
◆ WriteWord()
void dart::BaseWriteStream::WriteWord |
( |
uword |
value | ) |
|
|
inline |
◆ WriteWordWith32BitWrites()
void dart::BaseWriteStream::WriteWordWith32BitWrites |
( |
uword |
value | ) |
|
|
inline |
Definition at line 389 of file datastream.h.
389 {
391
393 for (intptr_t j = 0; j < kNumWrite32PerWord; j++) {
395 Raw<kInt32Size, uint32_t>::Write(this, shifted_value & mask);
396 }
397 }
static constexpr T NBitMask(size_t n)
constexpr intptr_t kBitsPerWord
constexpr intptr_t kBitsPerInt32
◆ buffer_
uint8_t* dart::BaseWriteStream::buffer_ = nullptr |
|
protected |
◆ capacity_
intptr_t dart::BaseWriteStream::capacity_ = 0 |
|
protected |
◆ current_
uint8_t* dart::BaseWriteStream::current_ = nullptr |
|
protected |
◆ initial_size_
const intptr_t dart::BaseWriteStream::initial_size_ |
|
protected |
The documentation for this class was generated from the following files: