MCPcopy Create free account
hub / github.com/NativeScript/android / Build

Function Build

test-app/runtime/src/main/cpp/include/v8-fast-api-calls.h:738–773  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

736 using BaseType = T;
737
738 static constexpr CTypeInfo Build() {
739 constexpr CTypeInfo::Flags kFlags =
740 MergeFlags(internal::TypeInfoHelper<T>::Flags(), Flags...);
741 constexpr CTypeInfo::Type kType = internal::TypeInfoHelper<T>::Type();
742 constexpr CTypeInfo::SequenceType kSequenceType =
743 internal::TypeInfoHelper<T>::SequenceType();
744
745 STATIC_ASSERT_IMPLIES(
746 uint8_t(kFlags) & uint8_t(CTypeInfo::Flags::kAllowSharedBit),
747 (kSequenceType == CTypeInfo::SequenceType::kIsTypedArray ||
748 kSequenceType == CTypeInfo::SequenceType::kIsArrayBuffer),
749 "kAllowSharedBit is only allowed for TypedArrays and ArrayBuffers.");
750 STATIC_ASSERT_IMPLIES(
751 uint8_t(kFlags) & uint8_t(CTypeInfo::Flags::kEnforceRangeBit),
752 CTypeInfo::IsIntegralType(kType),
753 "kEnforceRangeBit is only allowed for integral types.");
754 STATIC_ASSERT_IMPLIES(
755 uint8_t(kFlags) & uint8_t(CTypeInfo::Flags::kClampBit),
756 CTypeInfo::IsIntegralType(kType),
757 "kClampBit is only allowed for integral types.");
758 STATIC_ASSERT_IMPLIES(
759 uint8_t(kFlags) & uint8_t(CTypeInfo::Flags::kIsRestrictedBit),
760 CTypeInfo::IsFloatingPointType(kType),
761 "kIsRestrictedBit is only allowed for floating point types.");
762 STATIC_ASSERT_IMPLIES(kSequenceType == CTypeInfo::SequenceType::kIsSequence,
763 kType == CTypeInfo::Type::kVoid,
764 "Sequences are only supported from void type.");
765 STATIC_ASSERT_IMPLIES(
766 kSequenceType == CTypeInfo::SequenceType::kIsTypedArray,
767 CTypeInfo::IsPrimitive(kType) || kType == CTypeInfo::Type::kVoid,
768 "TypedArrays are only supported from primitive types or void.");
769
770 // Return the same type with the merged flags.
771 return CTypeInfo(internal::TypeInfoHelper<T>::Type(),
772 internal::TypeInfoHelper<T>::SequenceType(), kFlags);
773 }
774
775 private:
776 template <typename... Rest>

Callers 3

CFunctionInfoImplMethod · 0.85

Calls 5

MergeFlagsFunction · 0.85
SequenceTypeEnum · 0.85
CTypeInfoClass · 0.85
FlagsEnum · 0.70
TypeEnum · 0.70

Tested by

no test coverage detected