Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
dart::BitField< S, T, position, size, sign_extend, Enable > Class Template Reference

#include <bitfield.h>

Public Types

typedef T Type
 

Static Public Member Functions

static constexpr bool is_valid (T value)
 
static constexpr S mask ()
 
static constexpr S mask_in_place ()
 
static constexpr int shift ()
 
static constexpr int bitsize ()
 
static constexpr S encode (T value)
 
static constexpr T decode (S value)
 
static constexpr S update (T value, S original)
 

Static Public Attributes

static constexpr intptr_t kNextBit = position + size
 

Detailed Description

template<typename S, typename T, int position, int size = (sizeof(S) * kBitsPerByte) - position, bool sign_extend = false, typename Enable = void>
class dart::BitField< S, T, position, size, sign_extend, Enable >

Definition at line 136 of file bitfield.h.

Member Typedef Documentation

◆ Type

template<typename S , typename T , int position, int size = (sizeof(S) * kBitsPerByte) - position, bool sign_extend = false, typename Enable = void>
typedef T dart::BitField< S, T, position, size, sign_extend, Enable >::Type

Definition at line 138 of file bitfield.h.

Member Function Documentation

◆ bitsize()

template<typename S , typename T , int position, int size = (sizeof(S) * kBitsPerByte) - position, bool sign_extend = false, typename Enable = void>
static constexpr int dart::BitField< S, T, position, size, sign_extend, Enable >::bitsize ( )
inlinestaticconstexpr

Definition at line 164 of file bitfield.h.

164{ return size; }
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition switches.h:259

◆ decode()

template<typename S , typename T , int position, int size = (sizeof(S) * kBitsPerByte) - position, bool sign_extend = false, typename Enable = void>
static constexpr T dart::BitField< S, T, position, size, sign_extend, Enable >::decode ( S  value)
inlinestaticconstexpr

Definition at line 173 of file bitfield.h.

173 {
174 // Ensure we slide down the sign bit if the value in the bit field is signed
175 // and negative. We use 64-bit ints inside the expression since we can have
176 // both cases: sizeof(S) > sizeof(T) or sizeof(S) < sizeof(T).
177 if constexpr (sign_extend) {
178 auto const u = static_cast<uint64_t>(value);
179 return static_cast<T>((static_cast<int64_t>(u << (64 - kNextBit))) >>
180 (64 - size));
181 } else {
182 auto const u = static_cast<typename std::make_unsigned<S>::type>(value);
183 return static_cast<T>((u >> position) & mask());
184 }
185 }
static constexpr intptr_t kNextBit
Definition bitfield.h:145
static constexpr S mask()
Definition bitfield.h:153
uint8_t value
intx_t sign_extend(int32_t x)
#define T

◆ encode()

template<typename S , typename T , int position, int size = (sizeof(S) * kBitsPerByte) - position, bool sign_extend = false, typename Enable = void>
static constexpr S dart::BitField< S, T, position, size, sign_extend, Enable >::encode ( T  value)
inlinestaticconstexpr

Definition at line 167 of file bitfield.h.

167 {
168 ASSERT(is_valid(value));
169 return encode_unchecked(value);
170 }
static constexpr bool is_valid(T value)
Definition bitfield.h:148
#define ASSERT(E)

◆ is_valid()

template<typename S , typename T , int position, int size = (sizeof(S) * kBitsPerByte) - position, bool sign_extend = false, typename Enable = void>
static constexpr bool dart::BitField< S, T, position, size, sign_extend, Enable >::is_valid ( T  value)
inlinestaticconstexpr

Definition at line 148 of file bitfield.h.

148 {
149 return decode(encode_unchecked(value)) == value;
150 }
static constexpr T decode(S value)
Definition bitfield.h:173

◆ mask()

template<typename S , typename T , int position, int size = (sizeof(S) * kBitsPerByte) - position, bool sign_extend = false, typename Enable = void>
static constexpr S dart::BitField< S, T, position, size, sign_extend, Enable >::mask ( )
inlinestaticconstexpr

Definition at line 153 of file bitfield.h.

153{ return (kUwordOne << size) - 1; }
static constexpr uword kUwordOne
Definition bitfield.h:126

◆ mask_in_place()

template<typename S , typename T , int position, int size = (sizeof(S) * kBitsPerByte) - position, bool sign_extend = false, typename Enable = void>
static constexpr S dart::BitField< S, T, position, size, sign_extend, Enable >::mask_in_place ( )
inlinestaticconstexpr

Definition at line 157 of file bitfield.h.

157{ return mask() << position; }

◆ shift()

template<typename S , typename T , int position, int size = (sizeof(S) * kBitsPerByte) - position, bool sign_extend = false, typename Enable = void>
static constexpr int dart::BitField< S, T, position, size, sign_extend, Enable >::shift ( )
inlinestaticconstexpr

Definition at line 161 of file bitfield.h.

161{ return position; }

◆ update()

template<typename S , typename T , int position, int size = (sizeof(S) * kBitsPerByte) - position, bool sign_extend = false, typename Enable = void>
static constexpr S dart::BitField< S, T, position, size, sign_extend, Enable >::update ( T  value,
S  original 
)
inlinestaticconstexpr

Definition at line 190 of file bitfield.h.

190 {
191 return encode(value) | (~mask_in_place() & original);
192 }
static constexpr S encode(T value)
Definition bitfield.h:167

Member Data Documentation

◆ kNextBit

template<typename S , typename T , int position, int size = (sizeof(S) * kBitsPerByte) - position, bool sign_extend = false, typename Enable = void>
constexpr intptr_t dart::BitField< S, T, position, size, sign_extend, Enable >::kNextBit = position + size
staticconstexpr

Definition at line 145 of file bitfield.h.


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