v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::base::internal Namespace Reference

Classes

struct  ArithmeticOrIntegralConstant
 
struct  ArithmeticOrIntegralConstant< T >
 
struct  BigEnoughPromotionImpl
 
struct  BigEnoughPromotionImpl< Lhs, Rhs, false, false >
 
struct  BigEnoughPromotionImpl< Lhs, Rhs, true, false >
 
struct  CheckedAddFastOp
 
struct  CheckedAddOp
 
struct  CheckedAddOp< T, U >
 
struct  CheckedAndOp
 
struct  CheckedAndOp< T, U >
 
struct  CheckedDivOp
 
struct  CheckedDivOp< T, U >
 
struct  CheckedLshOp
 
struct  CheckedLshOp< T, U >
 
struct  CheckedMaxOp
 
struct  CheckedMaxOp< T, U >
 
struct  CheckedMinOp
 
struct  CheckedMinOp< T, U >
 
struct  CheckedModOp
 
struct  CheckedModOp< T, U >
 
struct  CheckedMulFastAsmOp
 
struct  CheckedMulFastOp
 
struct  CheckedMulOp
 
struct  CheckedMulOp< T, U >
 
class  CheckedNumeric
 
class  CheckedNumericState
 
class  CheckedNumericState< T, NUMERIC_FLOATING >
 
class  CheckedNumericState< T, NUMERIC_INTEGER >
 
struct  CheckedOrOp
 
struct  CheckedOrOp< T, U >
 
struct  CheckedRshOp
 
struct  CheckedRshOp< T, U >
 
struct  CheckedSubFastOp
 
struct  CheckedSubOp
 
struct  CheckedSubOp< T, U >
 
struct  CheckedXorOp
 
struct  CheckedXorOp< T, U >
 
struct  CheckOnFailure
 
struct  ClampedAddFastAsmOp
 
struct  ClampedAddFastOp
 
struct  ClampedAddOp
 
struct  ClampedAddOp< T, U >
 
struct  ClampedAndOp
 
struct  ClampedAndOp< T, U >
 
struct  ClampedDivOp
 
struct  ClampedDivOp< T, U >
 
struct  ClampedLshOp
 
struct  ClampedLshOp< T, U >
 
struct  ClampedMaxOp
 
struct  ClampedMaxOp< T, U >
 
struct  ClampedMinOp
 
struct  ClampedMinOp< T, U >
 
struct  ClampedModOp
 
struct  ClampedModOp< T, U >
 
struct  ClampedMulFastAsmOp
 
struct  ClampedMulFastOp
 
struct  ClampedMulOp
 
struct  ClampedMulOp< T, U >
 
struct  ClampedNegFastOp
 
class  ClampedNumeric
 
struct  ClampedOrOp
 
struct  ClampedOrOp< T, U >
 
struct  ClampedRshOp
 
struct  ClampedRshOp< T, U >
 
struct  ClampedSubFastAsmOp
 
struct  ClampedSubFastOp
 
struct  ClampedSubOp
 
struct  ClampedSubOp< T, U >
 
struct  ClampedXorOp
 
struct  ClampedXorOp< T, U >
 
struct  DstRangeRelationToSrcRangeImpl
 
struct  DstRangeRelationToSrcRangeImpl< Dst, Src, Bounds, IntegerRepresentation::kSigned, IntegerRepresentation::kSigned, NumericRangeRepresentation::kNotContained >
 
struct  DstRangeRelationToSrcRangeImpl< Dst, Src, Bounds, IntegerRepresentation::kSigned, IntegerRepresentation::kUnsigned, NumericRangeRepresentation::kNotContained >
 
struct  DstRangeRelationToSrcRangeImpl< Dst, Src, Bounds, IntegerRepresentation::kUnsigned, IntegerRepresentation::kSigned, NumericRangeRepresentation::kNotContained >
 
struct  DstRangeRelationToSrcRangeImpl< Dst, Src, Bounds, IntegerRepresentation::kUnsigned, IntegerRepresentation::kUnsigned, NumericRangeRepresentation::kNotContained >
 
struct  FastIntegerArithmeticPromotionImpl
 
struct  FastIntegerArithmeticPromotionImpl< Lhs, Rhs >
 
struct  GetNumericRepresentation
 
struct  has_key_equal
 
struct  IntegerForDigitsAndSignImpl
 
struct  IsEqual
 
struct  IsGreater
 
struct  IsGreaterOrEqual
 
struct  IsLess
 
struct  IsLessOrEqual
 
struct  IsNotEqual
 
struct  IsValueInRangeFastOp
 
struct  IsValueInRangeFastOp< Dst, Src >
 
struct  MathWrapper
 
struct  NarrowingRange
 
class  RangeCheck
 
struct  SaturateFastAsmOp
 
struct  SaturateFastOp
 
struct  SaturateFastOp< Dst, Src >
 
struct  SaturationDefaultLimits
 
struct  select_equal_key
 
struct  select_equal_key< M, true >
 
class  SmallMapDefaultInit
 
class  StrictNumeric
 
struct  UnderlyingTypeImpl
 
struct  UnderlyingTypeImpl< CheckedNumeric< T > >
 
struct  UnderlyingTypeImpl< ClampedNumeric< T > >
 
struct  UnderlyingTypeImpl< StrictNumeric< T > >
 
struct  UnsignedOrFloatForSize
 
struct  UnsignedOrFloatForSize< Numeric >
 

Concepts

concept  IsCheckedNumeric
 
concept  IsClampedNumeric
 
concept  IsStrictNumeric
 
concept  IsNumeric
 
concept  IsCheckedOp
 
concept  IsClampedOp
 
concept  IsStrictOp
 

Typedefs

template<class T >
using MathType
 
template<size_t Size, bool IsSigned>
using IntegerForDigitsAndSign
 
template<typename Integer , bool IsSigned = std::is_signed_v<Integer>>
using TwiceWiderInteger
 
template<typename Lhs , typename Rhs >
using MaxExponentPromotion
 
template<typename Lhs , typename Rhs >
using LowestValuePromotion
 
template<typename Lhs , typename Rhs >
using BigEnoughPromotion = BigEnoughPromotionImpl<Lhs, Rhs>::type
 
template<typename Lhs , typename Rhs >
using FastIntegerArithmeticPromotion
 
template<typename T >
using ArithmeticOrUnderlyingEnum
 
template<typename T >
using UnderlyingType = UnderlyingTypeImpl<T>::type
 

Enumerations

enum  NumericRepresentation { NUMERIC_INTEGER , NUMERIC_FLOATING , NUMERIC_UNKNOWN }
 
enum class  IntegerRepresentation { kUnsigned , kSigned }
 
enum class  NumericRangeRepresentation { kNotContained , kContained }
 

Functions

template<class T >
requires (std::is_unsigned_v<T> && std::is_integral_v<T>)
constexpr T SwapBytes (T value)
 
template<class T >
requires (std::is_signed_v<T> && std::is_integral_v<T>)
constexpr T SwapBytes (T value)
 
template<class T >
requires (std::is_unsigned_v<T> && std::is_integral_v<T>)
constexpr T FromLittleEndian (std::span< const uint8_t, sizeof(T)> bytes)
 
template<class T >
requires (std::is_signed_v<T> && std::is_integral_v<T>)
constexpr T FromLittleEndian (std::span< const uint8_t, sizeof(T)> bytes)
 
template<class T >
requires (std::is_unsigned_v<T> && std::is_integral_v<T>)
constexpr std::array< uint8_t, sizeof(T)> ToLittleEndian (T val)
 
template<class T >
requires (std::is_signed_v<T> && std::is_integral_v<T>)
constexpr std::array< uint8_t, sizeof(T)> ToLittleEndian (T val)
 
template<typename T >
 CheckedNumeric (T) -> CheckedNumeric< T >
 
template<typename Dst , typename Src >
constexpr bool IsValidForType (const CheckedNumeric< Src > value)
 
template<typename Dst , typename Src >
constexpr StrictNumeric< Dst > ValueOrDieForType (const CheckedNumeric< Src > value)
 
template<typename Dst , typename Src , typename Default >
constexpr StrictNumeric< Dst > ValueOrDefaultForType (CheckedNumeric< Src > value, Default default_value)
 
template<typename T >
constexpr CheckedNumeric< UnderlyingType< T > > MakeCheckedNum (T value)
 
template<template< typename, typename > class M, typename L , typename R >
constexpr CheckedNumeric< typename MathWrapper< M, L, R >::type > CheckMathOp (L lhs, R rhs)
 
template<template< typename, typename > class M, typename L , typename R , typename... Args>
constexpr auto CheckMathOp (L lhs, R rhs, Args... args)
 
template<typename L , typename R >
L * operator+ (L *lhs, StrictNumeric< R > rhs)
 
template<typename L , typename R >
L * operator- (L *lhs, StrictNumeric< R > rhs)
 
template<typename T >
constexpr bool CheckedAddImpl (T x, T y, T *result)
 
template<typename T >
constexpr bool CheckedSubImpl (T x, T y, T *result)
 
template<typename T >
constexpr bool CheckedMulImpl (T x, T y, T *result)
 
template<typename T >
 ClampedNumeric (T) -> ClampedNumeric< T >
 
template<typename T >
constexpr ClampedNumeric< UnderlyingType< T > > MakeClampedNum (T value)
 
template<template< typename, typename > class M, typename L , typename R >
constexpr ClampedNumeric< typename MathWrapper< M, L, R >::type > ClampMathOp (L lhs, R rhs)
 
template<template< typename, typename > class M, typename L , typename R , typename... Args>
constexpr auto ClampMathOp (L lhs, R rhs, Args... args)
 
template<typename T >
requires (std::signed_integral<T>)
constexpr T SaturatedNegWrapper (T value)
 
template<typename T >
requires (std::unsigned_integral<T>)
constexpr T SaturatedNegWrapper (T value)
 
template<typename T >
requires (std::floating_point<T>)
constexpr T SaturatedNegWrapper (T value)
 
template<typename T >
requires (std::integral<T>)
constexpr T SaturatedAbsWrapper (T value)
 
template<typename T >
requires (std::floating_point<T>)
constexpr T SaturatedAbsWrapper (T value)
 
template<typename T >
std::ostream & operator<< (std::ostream &os, const StrictNumeric< T > &value)
 
template<typename T >
std::ostream & operator<< (std::ostream &os, const ClampedNumeric< T > &value)
 
template<typename Dst , typename Src >
requires (IsNumeric<Src> && std::is_arithmetic_v<Dst> && std::numeric_limits<Dst>::lowest() < std::numeric_limits<Dst>::max())
constexpr bool IsValueInRangeForNumericType (Src value)
 
template<typename Dst , class CheckHandler = internal::CheckOnFailure, typename Src >
requires (IsNumeric<Src> && std::is_arithmetic_v<Dst> && std::numeric_limits<Dst>::lowest() < std::numeric_limits<Dst>::max())
constexpr Dst checked_cast (Src value)
 
template<typename Dst , template< typename > class S, typename Src >
constexpr Dst saturated_cast_impl (Src value, RangeCheck constraint)
 
template<typename Dst , template< typename > class SaturationHandler = SaturationDefaultLimits, typename Src >
constexpr Dst saturated_cast (Src value)
 
template<typename Dst , typename Src , typename SrcType = UnderlyingType<Src>>
requires ( IsNumeric<Src> && std::is_arithmetic_v<Dst> && // If you got here from a compiler error, it's because you tried to assign // from a source type to a destination type that has insufficient range. // The solution may be to change the destination type you're assigning to, // and use one large enough to represent the source. // Alternatively, you may be better served with the checked_cast<> or // saturated_cast<> template functions for your particular use case. kStaticDstRangeRelationToSrcRange<Dst, SrcType> == NumericRangeRepresentation::kContained)
constexpr Dst strict_cast (Src value)
 
template<typename T >
 StrictNumeric (T) -> StrictNumeric< T >
 
template<typename T >
constexpr StrictNumeric< UnderlyingType< T > > MakeStrictNum (const T value)
 
template<typename T >
requires (std::is_arithmetic_v<T>)
constexpr bool IsValueNegative (T value)
 
template<typename T >
requires std::is_integral_v<T>
constexpr auto ConditionalNegate (T x, bool is_negative)
 
template<typename T >
requires std::is_integral_v<T>
constexpr auto SafeUnsignedAbs (T value)
 
template<typename Dst , template< typename > class Bounds = std::numeric_limits, typename Src >
requires (std::is_arithmetic_v<Src> && std::is_arithmetic_v<Dst> && Bounds<Dst>::lowest() < Bounds<Dst>::max())
constexpr RangeCheck DstRangeRelationToSrcRange (Src value)
 
 INTEGER_FOR_DIGITS_AND_SIGN (int8_t)
 
 INTEGER_FOR_DIGITS_AND_SIGN (uint8_t)
 
 INTEGER_FOR_DIGITS_AND_SIGN (int16_t)
 
 INTEGER_FOR_DIGITS_AND_SIGN (uint16_t)
 
 INTEGER_FOR_DIGITS_AND_SIGN (int32_t)
 
 INTEGER_FOR_DIGITS_AND_SIGN (uint32_t)
 
 INTEGER_FOR_DIGITS_AND_SIGN (int64_t)
 
 INTEGER_FOR_DIGITS_AND_SIGN (uint64_t)
 
template<typename Src , typename Dst = std::make_signed_t<UnderlyingType<Src>>>
requires std::integral<Dst>
constexpr auto as_signed (Src value)
 
template<typename Src , typename Dst = std::make_unsigned_t<UnderlyingType<Src>>>
requires std::integral<Dst>
constexpr auto as_unsigned (Src value)
 
template<template< typename, typename > typename C, typename L , typename R >
requires std::is_arithmetic_v<L> && std::is_arithmetic_v<R>
constexpr bool SafeCompare (L lhs, R rhs)
 
template<typename Dst , typename Src = Dst>
constexpr Dst CommonMaxOrMin (bool is_min)
 
template<typename T >
requires (std::integral<T>)
constexpr T NegateWrapper (T value)
 
template<typename T >
requires (std::floating_point<T>)
constexpr T NegateWrapper (T value)
 
template<typename T >
requires (std::integral<T>)
constexpr std::make_unsigned< T >::type InvertWrapper (T value)
 
template<typename T >
requires (std::integral<T>)
constexpr T AbsWrapper (T value)
 
template<typename T >
requires (std::floating_point<T>)
constexpr T AbsWrapper (T value)
 

Variables

template<typename Dst , typename Src >
constexpr bool kIsNumericRangeContained = false
 
template<typename Dst , typename Src >
constexpr bool kIsNumericRangeContained< Dst, Src >
 
template<typename NumericType >
constexpr int kMaxExponent
 
template<typename NumericType >
constexpr int kIntegerBitsPlusSign
 
constexpr bool kEnableAsmCode = false
 
template<typename Dst , typename Src , IntegerRepresentation DstSign = std::is_signed_v<Dst> ? IntegerRepresentation::kSigned : IntegerRepresentation::kUnsigned, IntegerRepresentation SrcSign = std::is_signed_v<Src> ? IntegerRepresentation::kSigned : IntegerRepresentation::kUnsigned>
constexpr auto kStaticDstRangeRelationToSrcRange
 
template<typename Dst , typename Src >
constexpr bool kIsTypeInRangeForNumericType
 
template<typename Lhs , typename Rhs >
constexpr bool kIsBigEnoughPromotionContained
 
template<typename T , typename Lhs , typename Rhs = Lhs>
constexpr bool kIsIntegerArithmeticSafe
 
template<typename Lhs , typename Rhs >
constexpr bool kIsFastIntegerArithmeticPromotionContained
 
template<typename T >
constexpr bool kIsCheckedNumeric = false
 
template<typename T >
constexpr bool kIsCheckedNumeric< CheckedNumeric< T > > = true
 
template<typename T >
constexpr bool kIsClampedNumeric = false
 
template<typename T >
constexpr bool kIsClampedNumeric< ClampedNumeric< T > > = true
 
template<typename T >
constexpr bool kIsStrictNumeric = false
 
template<typename T >
constexpr bool kIsStrictNumeric< StrictNumeric< T > > = true
 
template<typename T >
constexpr bool kIsNumeric = std::is_arithmetic_v<UnderlyingType<T>>
 
template<typename T >
constexpr bool kIsNumeric< T > = true
 
template<typename Dst , typename Src >
constexpr bool kIsMaxInRangeForNumericType
 
template<typename Dst , typename Src >
constexpr bool kIsMinInRangeForNumericType
 
template<typename Dst , typename Src >
constexpr Dst kCommonMax
 
template<typename Dst , typename Src >
constexpr Dst kCommonMin
 

Typedef Documentation

◆ ArithmeticOrUnderlyingEnum

Initial value:
typename std::conditional_t<std::is_enum_v<T>, std::underlying_type<T>,
ArithmeticOrIntegralConstant<T>>::type

Definition at line 478 of file safe_conversions_impl.h.

◆ BigEnoughPromotion

template<typename Lhs , typename Rhs >
using v8::base::internal::BigEnoughPromotion = BigEnoughPromotionImpl<Lhs, Rhs>::type

Definition at line 417 of file safe_conversions_impl.h.

◆ FastIntegerArithmeticPromotion

template<typename Lhs , typename Rhs >
using v8::base::internal::FastIntegerArithmeticPromotion
Initial value:
FastIntegerArithmeticPromotionImpl<Lhs, Rhs>::type

Definition at line 458 of file safe_conversions_impl.h.

◆ IntegerForDigitsAndSign

template<size_t Size, bool IsSigned>
using v8::base::internal::IntegerForDigitsAndSign
Initial value:
IntegerForDigitsAndSignImpl<Size, IsSigned>::type

Definition at line 355 of file safe_conversions_impl.h.

◆ LowestValuePromotion

template<typename Lhs , typename Rhs >
using v8::base::internal::LowestValuePromotion
Initial value:
std::conditional_t<
std::is_signed_v<Lhs>
? (!std::is_signed_v<Rhs> || kMaxExponent<Lhs> > kMaxExponent<Rhs>)
: (!std::is_signed_v<Rhs> && kMaxExponent<Lhs> < kMaxExponent<Rhs>),
Lhs, Rhs>
STL namespace.

Definition at line 375 of file safe_conversions_impl.h.

◆ MathType

template<class T >
using v8::base::internal::MathType
Initial value:
std::conditional_t<
sizeof(T) >= sizeof(int), T,
std::conditional_t<std::is_signed_v<T>, int, unsigned int>>
#define T

Definition at line 30 of file basic_ops_impl.h.

◆ MaxExponentPromotion

template<typename Lhs , typename Rhs >
using v8::base::internal::MaxExponentPromotion
Initial value:
std::conditional_t<(kMaxExponent<Lhs> > kMaxExponent<Rhs>), Lhs, Rhs>

Definition at line 370 of file safe_conversions_impl.h.

◆ TwiceWiderInteger

template<typename Integer , bool IsSigned = std::is_signed_v<Integer>>
using v8::base::internal::TwiceWiderInteger
Initial value:
IntegerForDigitsAndSign<kIntegerBitsPlusSign<Integer> * 2, IsSigned>

Definition at line 365 of file safe_conversions_impl.h.

◆ UnderlyingType

template<typename T >
using v8::base::internal::UnderlyingType = UnderlyingTypeImpl<T>::type

Definition at line 534 of file safe_conversions_impl.h.

Enumeration Type Documentation

◆ IntegerRepresentation

Enumerator
kUnsigned 
kSigned 

Definition at line 100 of file safe_conversions_impl.h.

◆ NumericRangeRepresentation

Enumerator
kNotContained 
kContained 

Definition at line 107 of file safe_conversions_impl.h.

◆ NumericRepresentation

Enumerator
NUMERIC_INTEGER 
NUMERIC_FLOATING 
NUMERIC_UNKNOWN 

Definition at line 479 of file checked_math_impl.h.

Function Documentation

◆ AbsWrapper() [1/2]

template<typename T >
requires (std::integral<T>)
T v8::base::internal::AbsWrapper ( T value)
constexpr

Definition at line 157 of file safe_math_shared_impl.h.

Here is the call graph for this function:

◆ AbsWrapper() [2/2]

template<typename T >
requires (std::floating_point<T>)
T v8::base::internal::AbsWrapper ( T value)
constexpr

Definition at line 163 of file safe_math_shared_impl.h.

◆ as_signed()

template<typename Src , typename Dst = std::make_signed_t<UnderlyingType<Src>>>
requires std::integral<Dst>
auto v8::base::internal::as_signed ( Src value)
constexpr

Definition at line 563 of file safe_conversions_impl.h.

◆ as_unsigned()

template<typename Src , typename Dst = std::make_unsigned_t<UnderlyingType<Src>>>
requires std::integral<Dst>
auto v8::base::internal::as_unsigned ( Src value)
constexpr

Definition at line 573 of file safe_conversions_impl.h.

Here is the caller graph for this function:

◆ checked_cast()

template<typename Dst , class CheckHandler = internal::CheckOnFailure, typename Src >
requires (IsNumeric<Src> && std::is_arithmetic_v<Dst> && std::numeric_limits<Dst>::lowest() < std::numeric_limits<Dst>::max())
Dst v8::base::internal::checked_cast ( Src value)
constexpr

Definition at line 103 of file safe_conversions.h.

Here is the caller graph for this function:

◆ CheckedAddImpl()

template<typename T >
bool v8::base::internal::CheckedAddImpl ( T x,
T y,
T * result )
constexpr

Definition at line 27 of file checked_math_impl.h.

Here is the caller graph for this function:

◆ CheckedMulImpl()

template<typename T >
bool v8::base::internal::CheckedMulImpl ( T x,
T y,
T * result )
constexpr

Definition at line 153 of file checked_math_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckedNumeric()

template<typename T >
v8::base::internal::CheckedNumeric ( T ) -> CheckedNumeric< T >

◆ CheckedSubImpl()

template<typename T >
bool v8::base::internal::CheckedSubImpl ( T x,
T y,
T * result )
constexpr

Definition at line 90 of file checked_math_impl.h.

Here is the caller graph for this function:

◆ CheckMathOp() [1/2]

template<template< typename, typename > class M, typename L , typename R >
CheckedNumeric< typename MathWrapper< M, L, R >::type > v8::base::internal::CheckMathOp ( L lhs,
R rhs )
constexpr

Definition at line 307 of file checked_math.h.

Here is the caller graph for this function:

◆ CheckMathOp() [2/2]

template<template< typename, typename > class M, typename L , typename R , typename... Args>
auto v8::base::internal::CheckMathOp ( L lhs,
R rhs,
Args... args )
constexpr

Definition at line 317 of file checked_math.h.

Here is the call graph for this function:

◆ ClampedNumeric()

template<typename T >
v8::base::internal::ClampedNumeric ( T ) -> ClampedNumeric< T >

◆ ClampMathOp() [1/2]

template<template< typename, typename > class M, typename L , typename R >
ClampedNumeric< typename MathWrapper< M, L, R >::type > v8::base::internal::ClampMathOp ( L lhs,
R rhs )
constexpr

Definition at line 195 of file clamped_math.h.

Here is the caller graph for this function:

◆ ClampMathOp() [2/2]

template<template< typename, typename > class M, typename L , typename R , typename... Args>
auto v8::base::internal::ClampMathOp ( L lhs,
R rhs,
Args... args )
constexpr

Definition at line 205 of file clamped_math.h.

Here is the call graph for this function:

◆ CommonMaxOrMin()

template<typename Dst , typename Src = Dst>
Dst v8::base::internal::CommonMaxOrMin ( bool is_min)
constexpr

Definition at line 691 of file safe_conversions_impl.h.

Here is the caller graph for this function:

◆ ConditionalNegate()

template<typename T >
requires std::is_integral_v<T>
auto v8::base::internal::ConditionalNegate ( T x,
bool is_negative )
constexpr

Definition at line 56 of file safe_conversions_impl.h.

Here is the caller graph for this function:

◆ DstRangeRelationToSrcRange()

template<typename Dst , template< typename > class Bounds = std::numeric_limits, typename Src >
requires (std::is_arithmetic_v<Src> && std::is_arithmetic_v<Dst> && Bounds<Dst>::lowest() < Bounds<Dst>::max())
RangeCheck v8::base::internal::DstRangeRelationToSrcRange ( Src value)
constexpr

Definition at line 329 of file safe_conversions_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FromLittleEndian() [1/2]

template<class T >
requires (std::is_unsigned_v<T> && std::is_integral_v<T>)
T v8::base::internal::FromLittleEndian ( std::span< const uint8_t, sizeof(T)> bytes)
inlineconstexpr

Definition at line 108 of file basic_ops_impl.h.

Here is the caller graph for this function:

◆ FromLittleEndian() [2/2]

template<class T >
requires (std::is_signed_v<T> && std::is_integral_v<T>)
T v8::base::internal::FromLittleEndian ( std::span< const uint8_t, sizeof(T)> bytes)
inlineconstexpr

Definition at line 127 of file basic_ops_impl.h.

Here is the call graph for this function:

◆ INTEGER_FOR_DIGITS_AND_SIGN() [1/8]

v8::base::internal::INTEGER_FOR_DIGITS_AND_SIGN ( int16_t )

◆ INTEGER_FOR_DIGITS_AND_SIGN() [2/8]

v8::base::internal::INTEGER_FOR_DIGITS_AND_SIGN ( int32_t )

◆ INTEGER_FOR_DIGITS_AND_SIGN() [3/8]

v8::base::internal::INTEGER_FOR_DIGITS_AND_SIGN ( int64_t )

◆ INTEGER_FOR_DIGITS_AND_SIGN() [4/8]

v8::base::internal::INTEGER_FOR_DIGITS_AND_SIGN ( int8_t )

◆ INTEGER_FOR_DIGITS_AND_SIGN() [5/8]

v8::base::internal::INTEGER_FOR_DIGITS_AND_SIGN ( uint16_t )

◆ INTEGER_FOR_DIGITS_AND_SIGN() [6/8]

v8::base::internal::INTEGER_FOR_DIGITS_AND_SIGN ( uint32_t )

◆ INTEGER_FOR_DIGITS_AND_SIGN() [7/8]

v8::base::internal::INTEGER_FOR_DIGITS_AND_SIGN ( uint64_t )

◆ INTEGER_FOR_DIGITS_AND_SIGN() [8/8]

v8::base::internal::INTEGER_FOR_DIGITS_AND_SIGN ( uint8_t )

◆ InvertWrapper()

template<typename T >
requires (std::integral<T>)
std::make_unsigned< T >::type v8::base::internal::InvertWrapper ( T value)
constexpr

Definition at line 151 of file safe_math_shared_impl.h.

Here is the caller graph for this function:

◆ IsValidForType()

template<typename Dst , typename Src >
bool v8::base::internal::IsValidForType ( const CheckedNumeric< Src > value)
constexpr

Definition at line 282 of file checked_math.h.

◆ IsValueInRangeForNumericType()

template<typename Dst , typename Src >
requires (IsNumeric<Src> && std::is_arithmetic_v<Dst> && std::numeric_limits<Dst>::lowest() < std::numeric_limits<Dst>::max())
bool v8::base::internal::IsValueInRangeForNumericType ( Src value)
constexpr

Definition at line 86 of file safe_conversions.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsValueNegative()

template<typename T >
requires (std::is_arithmetic_v<T>)
bool v8::base::internal::IsValueNegative ( T value)
constexpr

Definition at line 43 of file safe_conversions_impl.h.

Here is the caller graph for this function:

◆ MakeCheckedNum()

template<typename T >
CheckedNumeric< UnderlyingType< T > > v8::base::internal::MakeCheckedNum ( T value)
constexpr

Definition at line 301 of file checked_math.h.

◆ MakeClampedNum()

template<typename T >
ClampedNumeric< UnderlyingType< T > > v8::base::internal::MakeClampedNum ( T value)
constexpr

Definition at line 189 of file clamped_math.h.

◆ MakeStrictNum()

template<typename T >
StrictNumeric< UnderlyingType< T > > v8::base::internal::MakeStrictNum ( const T value)
constexpr

Definition at line 310 of file safe_conversions.h.

◆ NegateWrapper() [1/2]

template<typename T >
requires (std::integral<T>)
T v8::base::internal::NegateWrapper ( T value)
constexpr

Definition at line 137 of file safe_math_shared_impl.h.

Here is the caller graph for this function:

◆ NegateWrapper() [2/2]

template<typename T >
requires (std::floating_point<T>)
T v8::base::internal::NegateWrapper ( T value)
constexpr

Definition at line 145 of file safe_math_shared_impl.h.

◆ operator+()

template<typename L , typename R >
L * v8::base::internal::operator+ ( L * lhs,
StrictNumeric< R > rhs )

Definition at line 338 of file checked_math.h.

◆ operator-()

template<typename L , typename R >
L * v8::base::internal::operator- ( L * lhs,
StrictNumeric< R > rhs )

Definition at line 346 of file checked_math.h.

◆ operator<<() [1/2]

template<typename T >
std::ostream & v8::base::internal::operator<< ( std::ostream & os,
const ClampedNumeric< T > & value )

Definition at line 33 of file ostream_operators.h.

◆ operator<<() [2/2]

template<typename T >
std::ostream & v8::base::internal::operator<< ( std::ostream & os,
const StrictNumeric< T > & value )

Definition at line 26 of file ostream_operators.h.

◆ SafeCompare()

template<template< typename, typename > typename C, typename L , typename R >
requires std::is_arithmetic_v<L> && std::is_arithmetic_v<R>
bool v8::base::internal::SafeCompare ( L lhs,
R rhs )
constexpr

Definition at line 655 of file safe_conversions_impl.h.

◆ SafeUnsignedAbs()

template<typename T >
requires std::is_integral_v<T>
auto v8::base::internal::SafeUnsignedAbs ( T value)
constexpr

Definition at line 67 of file safe_conversions_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ saturated_cast()

template<typename Dst , template< typename > class SaturationHandler = SaturationDefaultLimits, typename Src >
Dst v8::base::internal::saturated_cast ( Src value)
constexpr

Definition at line 203 of file safe_conversions.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ saturated_cast_impl()

template<typename Dst , template< typename > class S, typename Src >
Dst v8::base::internal::saturated_cast_impl ( Src value,
RangeCheck constraint )
constexpr

Definition at line 143 of file safe_conversions.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SaturatedAbsWrapper() [1/2]

template<typename T >
requires (std::integral<T>)
T v8::base::internal::SaturatedAbsWrapper ( T value)
constexpr

Definition at line 48 of file clamped_math_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SaturatedAbsWrapper() [2/2]

template<typename T >
requires (std::floating_point<T>)
T v8::base::internal::SaturatedAbsWrapper ( T value)
constexpr

Definition at line 64 of file clamped_math_impl.h.

◆ SaturatedNegWrapper() [1/3]

template<typename T >
requires (std::signed_integral<T>)
T v8::base::internal::SaturatedNegWrapper ( T value)
constexpr

Definition at line 26 of file clamped_math_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SaturatedNegWrapper() [2/3]

template<typename T >
requires (std::unsigned_integral<T>)
T v8::base::internal::SaturatedNegWrapper ( T value)
constexpr

Definition at line 36 of file clamped_math_impl.h.

◆ SaturatedNegWrapper() [3/3]

template<typename T >
requires (std::floating_point<T>)
T v8::base::internal::SaturatedNegWrapper ( T value)
constexpr

Definition at line 42 of file clamped_math_impl.h.

◆ strict_cast()

template<typename Dst , typename Src , typename SrcType = UnderlyingType<Src>>
requires ( IsNumeric<Src> && std::is_arithmetic_v<Dst> && // If you got here from a compiler error, it's because you tried to assign // from a source type to a destination type that has insufficient range. // The solution may be to change the destination type you're assigning to, // and use one large enough to represent the source. // Alternatively, you may be better served with the checked_cast<> or // saturated_cast<> template functions for your particular use case. kStaticDstRangeRelationToSrcRange<Dst, SrcType> == NumericRangeRepresentation::kContained)
Dst v8::base::internal::strict_cast ( Src value)
constexpr

Definition at line 231 of file safe_conversions.h.

◆ StrictNumeric()

template<typename T >
v8::base::internal::StrictNumeric ( T ) -> StrictNumeric< T >

◆ SwapBytes() [1/2]

template<class T >
requires (std::is_unsigned_v<T> && std::is_integral_v<T>)
T v8::base::internal::SwapBytes ( T value)
inlineconstexpr

Definition at line 37 of file basic_ops_impl.h.

Here is the caller graph for this function:

◆ SwapBytes() [2/2]

template<class T >
requires (std::is_signed_v<T> && std::is_integral_v<T>)
T v8::base::internal::SwapBytes ( T value)
inlineconstexpr

Definition at line 101 of file basic_ops_impl.h.

Here is the call graph for this function:

◆ ToLittleEndian() [1/2]

template<class T >
requires (std::is_unsigned_v<T> && std::is_integral_v<T>)
std::array< uint8_t, sizeof(T)> v8::base::internal::ToLittleEndian ( T val)
inlineconstexpr

Definition at line 134 of file basic_ops_impl.h.

Here is the caller graph for this function:

◆ ToLittleEndian() [2/2]

template<class T >
requires (std::is_signed_v<T> && std::is_integral_v<T>)
std::array< uint8_t, sizeof(T)> v8::base::internal::ToLittleEndian ( T val)
inlineconstexpr

Definition at line 157 of file basic_ops_impl.h.

Here is the call graph for this function:

◆ ValueOrDefaultForType()

template<typename Dst , typename Src , typename Default >
StrictNumeric< Dst > v8::base::internal::ValueOrDefaultForType ( CheckedNumeric< Src > value,
Default default_value )
constexpr

Definition at line 293 of file checked_math.h.

◆ ValueOrDieForType()

template<typename Dst , typename Src >
StrictNumeric< Dst > v8::base::internal::ValueOrDieForType ( const CheckedNumeric< Src > value)
constexpr

Definition at line 287 of file checked_math.h.

Variable Documentation

◆ kCommonMax

template<typename Dst , typename Src >
Dst v8::base::internal::kCommonMax
inlineconstexpr
Initial value:
=
kIsMaxInRangeForNumericType<Dst, Src>
? static_cast<Dst>(std::numeric_limits<Src>::max())
: std::numeric_limits<Dst>::max()

Definition at line 676 of file safe_conversions_impl.h.

◆ kCommonMin

template<typename Dst , typename Src >
Dst v8::base::internal::kCommonMin
inlineconstexpr
Initial value:
=
kIsMinInRangeForNumericType<Dst, Src>
? static_cast<Dst>(std::numeric_limits<Src>::lowest())
: std::numeric_limits<Dst>::lowest()

Definition at line 682 of file safe_conversions_impl.h.

◆ kEnableAsmCode

bool v8::base::internal::kEnableAsmCode = false
inlineconstexpr

Definition at line 80 of file safe_conversions_impl.h.

◆ kIntegerBitsPlusSign

template<typename NumericType >
int v8::base::internal::kIntegerBitsPlusSign
inlineconstexpr
Initial value:
=
std::numeric_limits<NumericType>::digits + std::is_signed_v<NumericType>

Definition at line 36 of file safe_conversions_impl.h.

◆ kIsBigEnoughPromotionContained

template<typename Lhs , typename Rhs >
bool v8::base::internal::kIsBigEnoughPromotionContained
inlineconstexpr
Initial value:
=
BigEnoughPromotionImpl<Lhs, Rhs>::kContained

Definition at line 420 of file safe_conversions_impl.h.

◆ kIsCheckedNumeric

template<typename T >
bool v8::base::internal::kIsCheckedNumeric = false
inlineconstexpr

Definition at line 497 of file safe_conversions_impl.h.

◆ kIsCheckedNumeric< CheckedNumeric< T > >

template<typename T >
bool v8::base::internal::kIsCheckedNumeric< CheckedNumeric< T > > = true
inlineconstexpr

Definition at line 499 of file safe_conversions_impl.h.

◆ kIsClampedNumeric

template<typename T >
bool v8::base::internal::kIsClampedNumeric = false
inlineconstexpr

Definition at line 504 of file safe_conversions_impl.h.

◆ kIsClampedNumeric< ClampedNumeric< T > >

template<typename T >
bool v8::base::internal::kIsClampedNumeric< ClampedNumeric< T > > = true
inlineconstexpr

Definition at line 506 of file safe_conversions_impl.h.

◆ kIsFastIntegerArithmeticPromotionContained

template<typename Lhs , typename Rhs >
bool v8::base::internal::kIsFastIntegerArithmeticPromotionContained
inlineconstexpr
Initial value:
=
FastIntegerArithmeticPromotionImpl<Lhs, Rhs>::kContained

Definition at line 462 of file safe_conversions_impl.h.

◆ kIsIntegerArithmeticSafe

template<typename T , typename Lhs , typename Rhs = Lhs>
bool v8::base::internal::kIsIntegerArithmeticSafe
inlineconstexpr
Initial value:
=
!std::is_floating_point_v<T> && !std::is_floating_point_v<Lhs> &&
!std::is_floating_point_v<Rhs> &&
std::is_signed_v<T> >= std::is_signed_v<Lhs> &&
kIntegerBitsPlusSign<T> >= (2 * kIntegerBitsPlusSign<Lhs>) &&
std::is_signed_v<T> >= std::is_signed_v<Rhs> &&
kIntegerBitsPlusSign<T> >= (2 * kIntegerBitsPlusSign<Rhs>)

Definition at line 428 of file safe_conversions_impl.h.

◆ kIsMaxInRangeForNumericType

template<typename Dst , typename Src >
bool v8::base::internal::kIsMaxInRangeForNumericType
inlineconstexpr
Initial value:
=
IsGreaterOrEqual<Dst, Src>::Test(std::numeric_limits<Dst>::max(),
std::numeric_limits<Src>::max())

Definition at line 666 of file safe_conversions_impl.h.

◆ kIsMinInRangeForNumericType

template<typename Dst , typename Src >
bool v8::base::internal::kIsMinInRangeForNumericType
inlineconstexpr
Initial value:
=
IsLessOrEqual<Dst, Src>::Test(std::numeric_limits<Dst>::lowest(),
std::numeric_limits<Src>::lowest())

Definition at line 671 of file safe_conversions_impl.h.

◆ kIsNumeric

template<typename T >
bool v8::base::internal::kIsNumeric = std::is_arithmetic_v<UnderlyingType<T>>
inlineconstexpr

Definition at line 537 of file safe_conversions_impl.h.

◆ kIsNumeric< T >

template<typename T >
bool v8::base::internal::kIsNumeric< T > = true
inlineconstexpr

Definition at line 540 of file safe_conversions_impl.h.

◆ kIsNumericRangeContained

template<typename Dst , typename Src >
bool v8::base::internal::kIsNumericRangeContained = false
inlineconstexpr

Definition at line 237 of file safe_conversions.h.

◆ kIsNumericRangeContained< Dst, Src >

template<typename Dst , typename Src >
bool v8::base::internal::kIsNumericRangeContained< Dst, Src >
inlineconstexpr
Initial value:
=
kStaticDstRangeRelationToSrcRange<Dst, Src> ==
NumericRangeRepresentation::kContained

Definition at line 242 of file safe_conversions.h.

◆ kIsStrictNumeric

template<typename T >
bool v8::base::internal::kIsStrictNumeric = false
inlineconstexpr

Definition at line 511 of file safe_conversions_impl.h.

◆ kIsStrictNumeric< StrictNumeric< T > >

template<typename T >
bool v8::base::internal::kIsStrictNumeric< StrictNumeric< T > > = true
inlineconstexpr

Definition at line 513 of file safe_conversions_impl.h.

◆ kIsTypeInRangeForNumericType

template<typename Dst , typename Src >
bool v8::base::internal::kIsTypeInRangeForNumericType
inlineconstexpr
Initial value:
=
kStaticDstRangeRelationToSrcRange<Dst, Src> ==
NumericRangeRepresentation::kContained

Definition at line 321 of file safe_conversions_impl.h.

◆ kMaxExponent

template<typename NumericType >
int v8::base::internal::kMaxExponent
inlineconstexpr
Initial value:
=
std::is_floating_point_v<NumericType>
? std::numeric_limits<NumericType>::max_exponent
: std::numeric_limits<NumericType>::digits + 1

Definition at line 28 of file safe_conversions_impl.h.

◆ kStaticDstRangeRelationToSrcRange

template<typename Dst , typename Src , IntegerRepresentation DstSign = std::is_signed_v<Dst> ? IntegerRepresentation::kSigned : IntegerRepresentation::kUnsigned, IntegerRepresentation SrcSign = std::is_signed_v<Src> ? IntegerRepresentation::kSigned : IntegerRepresentation::kUnsigned>
auto v8::base::internal::kStaticDstRangeRelationToSrcRange
inlineconstexpr
Initial value:
=
kMaxExponent<Dst> >= kMaxExponent<Src>
? NumericRangeRepresentation::kContained
: NumericRangeRepresentation::kNotContained

Definition at line 121 of file safe_conversions_impl.h.