2819 {
2820 const bool is_canonical = false;
2822 switch (object->
type) {
2825 return true;
2828 return true;
2831 break;
2834 break;
2837 break;
2840 const uint8_t* utf8_str =
2841 reinterpret_cast<const uint8_t*>(object->value.as_string);
2844 return Fail(
"invalid utf8");
2845 }
2849 return Fail(
"invalid string length");
2850 }
2852 break;
2853 }
2857 return Fail(
"invalid array length");
2858 }
2859 break;
2863 cid = kTypedDataInt8ArrayCid;
2864 break;
2866 cid = kTypedDataUint8ArrayCid;
2867 break;
2869 cid = kTypedDataUint8ClampedArrayCid;
2870 break;
2872 cid = kTypedDataInt16ArrayCid;
2873 break;
2875 cid = kTypedDataUint16ArrayCid;
2876 break;
2878 cid = kTypedDataInt32ArrayCid;
2879 break;
2881 cid = kTypedDataUint32ArrayCid;
2882 break;
2884 cid = kTypedDataInt64ArrayCid;
2885 break;
2887 cid = kTypedDataUint64ArrayCid;
2888 break;
2890 cid = kTypedDataFloat32ArrayCid;
2891 break;
2893 cid = kTypedDataFloat64ArrayCid;
2894 break;
2896 cid = kTypedDataInt32x4ArrayCid;
2897 break;
2899 cid = kTypedDataFloat32x4ArrayCid;
2900 break;
2902 cid = kTypedDataFloat64x2ArrayCid;
2903 break;
2904 default:
2905 return Fail(
"invalid TypedData type");
2906 }
2907 {
2908 intptr_t
len =
object->value.as_typed_data.length;
2910 return Fail(
"invalid typeddata length");
2911 }
2912 }
2913 break;
2917 cid = kExternalTypedDataInt8ArrayCid;
2918 break;
2920 cid = kExternalTypedDataUint8ArrayCid;
2921 break;
2923 cid = kExternalTypedDataUint8ClampedArrayCid;
2924 break;
2926 cid = kExternalTypedDataInt16ArrayCid;
2927 break;
2929 cid = kExternalTypedDataUint16ArrayCid;
2930 break;
2932 cid = kExternalTypedDataInt32ArrayCid;
2933 break;
2935 cid = kExternalTypedDataUint32ArrayCid;
2936 break;
2938 cid = kExternalTypedDataInt64ArrayCid;
2939 break;
2941 cid = kExternalTypedDataUint64ArrayCid;
2942 break;
2944 cid = kExternalTypedDataFloat32ArrayCid;
2945 break;
2947 cid = kExternalTypedDataFloat64ArrayCid;
2948 break;
2950 cid = kExternalTypedDataInt32x4ArrayCid;
2951 break;
2953 cid = kExternalTypedDataFloat32x4ArrayCid;
2954 break;
2956 cid = kExternalTypedDataFloat64x2ArrayCid;
2957 break;
2958 default:
2959 return Fail(
"invalid TypedData type");
2960 }
2961 {
2962 intptr_t
len =
object->value.as_typed_data.length;
2964 return Fail(
"invalid typeddata length");
2965 }
2966 }
2967 break;
2971 cid = kUnmodifiableTypedDataInt8ArrayViewCid;
2972 break;
2974 cid = kUnmodifiableTypedDataUint8ArrayViewCid;
2975 break;
2977 cid = kUnmodifiableTypedDataUint8ClampedArrayViewCid;
2978 break;
2980 cid = kUnmodifiableTypedDataInt16ArrayViewCid;
2981 break;
2983 cid = kUnmodifiableTypedDataUint16ArrayViewCid;
2984 break;
2986 cid = kUnmodifiableTypedDataInt32ArrayViewCid;
2987 break;
2989 cid = kUnmodifiableTypedDataUint32ArrayViewCid;
2990 break;
2992 cid = kUnmodifiableTypedDataInt64ArrayViewCid;
2993 break;
2995 cid = kUnmodifiableTypedDataUint64ArrayViewCid;
2996 break;
2998 cid = kUnmodifiableTypedDataFloat32ArrayViewCid;
2999 break;
3001 cid = kUnmodifiableTypedDataFloat64ArrayViewCid;
3002 break;
3004 cid = kUnmodifiableTypedDataInt32x4ArrayViewCid;
3005 break;
3007 cid = kUnmodifiableTypedDataFloat32x4ArrayViewCid;
3008 break;
3010 cid = kUnmodifiableTypedDataFloat64x2ArrayViewCid;
3011 break;
3012 default:
3013 return Fail(
"invalid TypedData type");
3014 }
3015 {
3016 intptr_t
len =
object->value.as_typed_data.length;
3020 return Fail(
"invalid typeddata length");
3021 }
3022 }
3023 break;
3026 break;
3028 cid = kCapabilityCid;
3029 break;
3032 break;
3033 default:
3034 return Fail(
"invalid Dart_CObject type");
3035 }
3036
3037 MessageSerializationCluster* cluster = nullptr;
3038 for (MessageSerializationCluster* c :
clusters_) {
3039 if (c->cid() ==
cid) {
3040 cluster = c;
3041 break;
3042 }
3043 }
3044 if (cluster == nullptr) {
3047 }
3048
3049 cluster->TraceApi(this, object);
3050 return true;
3051}
#define RELEASE_ASSERT(cond)
void ForwardRef(Dart_CObject *old, Dart_CObject *nue)
bool Fail(const char *message)
static constexpr bool IsValidLength(intptr_t len)
MessageSerializationCluster * NewClusterForClass(intptr_t cid, bool is_canonical)
static intptr_t MaxElements(intptr_t class_id)
static bool IsValid(int64_t value)
static constexpr intptr_t kMaxElements
static intptr_t MaxElements(intptr_t class_id)
static intptr_t CodeUnitCount(const uint8_t *utf8_array, intptr_t array_len, Type *type)
static bool IsValid(const uint8_t *utf8_array, intptr_t array_len)
@ Dart_TypedData_kFloat32x4
@ Dart_TypedData_kInt32x4
@ Dart_TypedData_kFloat64x2
@ Dart_TypedData_kFloat32
@ Dart_TypedData_kFloat64
@ Dart_TypedData_kUint8Clamped
@ Dart_CObject_kNativePointer
@ Dart_CObject_kUnmodifiableExternalTypedData
@ Dart_CObject_kTypedData
@ Dart_CObject_kExternalTypedData
@ Dart_CObject_kCapability
const int kTypedDataCidRemainderUnmodifiable
const int kTypedDataCidRemainderInternal
union _Dart_CObject::@86 value
struct _Dart_CObject::@86::@90 as_typed_data
struct _Dart_CObject::@86::@91 as_external_typed_data
struct _Dart_CObject::@86::@89 as_array