Flutter Engine
The Flutter Engine
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 134 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 136 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 162 of file bitfield.h.

162{ 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 171 of file bitfield.h.

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

◆ 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 165 of file bitfield.h.

165 {
167 return encode_unchecked(value);
168 }
static constexpr bool is_valid(T value)
Definition: bitfield.h:146
#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 146 of file bitfield.h.

146 {
147 return decode(encode_unchecked(value)) == value;
148 }
static constexpr T decode(S value)
Definition: bitfield.h:171

◆ 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 151 of file bitfield.h.

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

◆ 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 155 of file bitfield.h.

155{ 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 159 of file bitfield.h.

159{ 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 188 of file bitfield.h.

188 {
189 return encode(value) | (~mask_in_place() & original);
190 }
static constexpr S encode(T value)
Definition: bitfield.h:165

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 143 of file bitfield.h.


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