Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Namespaces | Macros | Functions | Variables
runtime_api.cc File Reference
#include "platform/thread_sanitizer.h"
#include "vm/compiler/runtime_api.h"
#include "vm/object.h"
#include "vm/compiler/backend/flow_graph_compiler.h"
#include "vm/compiler/runtime_offsets_list.h"
#include "vm/dart_api_state.h"
#include "vm/dart_entry.h"
#include "vm/longjump.h"
#include "vm/native_arguments.h"
#include "vm/native_entry.h"
#include "vm/object_store.h"
#include "vm/runtime_entry.h"
#include "vm/symbols.h"
#include "vm/timeline.h"
#include "vm/compiler/runtime_offsets_extracted.h"

Go to the source code of this file.

Namespaces

namespace  dart
 
namespace  dart::compiler
 
namespace  dart::compiler::target
 

Macros

#define DO(clazz)
 
#define DEFINE_ALIAS(name)    const RuntimeEntry& k##name##RuntimeEntry(dart::k##name##RuntimeEntry);
 
#define DEFINE_ALIAS(type, name, ...)    const RuntimeEntry& k##name##RuntimeEntry(dart::k##name##RuntimeEntry);
 
#define HANDLE_CASE(clazz)   case kFfi##clazz##Cid:
 
#define HANDLE_CASE(clazz)
 
#define DEFINE_CONSTANT(Class, Name)   const word Class::Name = Class##_##Name;
 
#define DEFINE_ARRAY_SIZEOF(clazz, name, ElementOffset)
 
#define DEFINE_PAYLOAD_SIZEOF(clazz, name, header)
 
#define DEFINE_JIT_FIELD(clazz, name)
 
#define DEFINE_JIT_ARRAY(clazz, name)
 
#define DEFINE_JIT_SIZEOF(clazz, name, what)
 
#define DEFINE_JIT_RANGE(Class, Getter, Type, First, Last, Filter)
 
#define DEFINE_AOT_FIELD(clazz, name)
 
#define DEFINE_AOT_ARRAY(clazz, name)
 
#define DEFINE_AOT_SIZEOF(clazz, name, what)
 
#define DEFINE_AOT_RANGE(Class, Getter, Type, First, Last, Filter)
 
#define DEFINE_FIELD(clazz, name)
 
#define DEFINE_ARRAY(clazz, name)
 
#define DEFINE_SIZEOF(clazz, name, what)
 
#define DEFINE_RANGE(Class, Getter, Type, First, Last, Filter)
 

Functions

bool dart::compiler::target::IsSmi (int64_t v)
 
bool dart::compiler::target::WillAllocateNewOrRememberedObject (intptr_t instance_size)
 
bool dart::compiler::target::WillAllocateNewOrRememberedContext (intptr_t num_context_variables)
 
bool dart::compiler::target::WillAllocateNewOrRememberedArray (intptr_t length)
 
bool dart::compiler::IsSameObject (const Object &a, const Object &b)
 
bool dart::compiler::IsEqualType (const AbstractType &a, const AbstractType &b)
 
bool dart::compiler::IsDoubleType (const AbstractType &type)
 
bool dart::compiler::IsBoolType (const AbstractType &type)
 
bool dart::compiler::IsSubtypeOfInt (const AbstractType &type)
 
bool dart::compiler::IsSmiType (const AbstractType &type)
 
bool dart::compiler::IsInOldSpace (const Object &obj)
 
intptr_t dart::compiler::ObjectHash (const Object &obj)
 
const char * dart::compiler::ObjectToCString (const Object &obj)
 
void dart::compiler::SetToNull (Object *obj)
 
Objectdart::compiler::NewZoneHandle (Zone *zone)
 
Objectdart::compiler::NewZoneHandle (Zone *zone, const Object &obj)
 
const Objectdart::compiler::NullObject ()
 
const Objectdart::compiler::SentinelObject ()
 
const Booldart::compiler::TrueObject ()
 
const Booldart::compiler::FalseObject ()
 
const Objectdart::compiler::EmptyTypeArguments ()
 
const Typedart::compiler::DynamicType ()
 
const Typedart::compiler::ObjectType ()
 
const Typedart::compiler::VoidType ()
 
const Typedart::compiler::IntType ()
 
const Classdart::compiler::GrowableObjectArrayClass ()
 
const Classdart::compiler::MintClass ()
 
const Classdart::compiler::DoubleClass ()
 
const Classdart::compiler::Float32x4Class ()
 
const Classdart::compiler::Float64x2Class ()
 
const Classdart::compiler::Int32x4Class ()
 
const Classdart::compiler::ClosureClass ()
 
const Arraydart::compiler::ArgumentsDescriptorBoxed (intptr_t type_args_len, intptr_t num_arguments)
 
bool dart::compiler::IsOriginalObject (const Object &object)
 
const Stringdart::compiler::AllocateString (const char *buffer)
 
bool dart::compiler::HasIntegerValue (const dart::Object &object, int64_t *value)
 
int32_t dart::compiler::CreateJitCookie ()
 
word dart::compiler::TypedDataElementSizeInBytes (classid_t cid)
 
word dart::compiler::TypedDataMaxNewSpaceElements (classid_t cid)
 
const Fielddart::compiler::LookupMathRandomStateFieldOffset ()
 
const Fielddart::compiler::LookupConvertUtf8DecoderScanFlagsField ()
 
word dart::compiler::LookupFieldOffsetInBytes (const Field &field)
 
const Codedart::compiler::StubCodeAllocateArray ()
 
const Codedart::compiler::StubCodeSubtype2TestCache ()
 
const Codedart::compiler::StubCodeSubtype3TestCache ()
 
const Codedart::compiler::StubCodeSubtype4TestCache ()
 
const Codedart::compiler::StubCodeSubtype6TestCache ()
 
const Codedart::compiler::StubCodeSubtype7TestCache ()
 
void dart::compiler::BailoutWithBranchOffsetError ()
 
static word dart::compiler::target::TranslateOffsetInWordsToHost (word offset)
 
bool dart::compiler::target::SizeFitsInSizeTag (uword instance_size)
 
uword dart::compiler::target::MakeTagWordForNewSpaceObject (classid_t cid, uword instance_size)
 
bool dart::compiler::target::IsTypedDataClassId (intptr_t cid)
 
static word dart::compiler::target::TranslateOffsetInWords (word offset)
 
static uword dart::compiler::target::GetInstanceSizeImpl (const dart::Class &handle)
 
 dart::compiler::target::JIT_OFFSETS_LIST (DEFINE_JIT_FIELD, DEFINE_JIT_ARRAY, DEFINE_JIT_SIZEOF, DEFINE_ARRAY_SIZEOF, DEFINE_PAYLOAD_SIZEOF, DEFINE_JIT_RANGE, DEFINE_CONSTANT) AOT_OFFSETS_LIST(DEFINE_AOT_FIELD
 
static DART_FORCE_INLINE bool dart::compiler::target::BareInstructionsPayloads ()
 
bool dart::compiler::target::CanLoadFromThread (const dart::Object &object, intptr_t *offset)
 
bool dart::compiler::target::IsSmi (const dart::Object &a)
 
word dart::compiler::target::ToRawSmi (const dart::Object &a)
 
word dart::compiler::target::ToRawSmi (intptr_t value)
 
word dart::compiler::target::SmiValue (const dart::Object &a)
 
bool dart::compiler::target::IsDouble (const dart::Object &a)
 
double dart::compiler::target::DoubleValue (const dart::Object &a)
 
void dart::compiler::target::UnboxFieldIfSupported (const dart::Field &field, const dart::AbstractType &type)
 

Variables

const word dart::compiler::target::kPageSize = dart::kPageSize
 
const word dart::compiler::target::kPageSizeInWords = dart::kPageSize / kWordSize
 
const word dart::compiler::target::kPageMask = dart::kPageMask
 
 dart::compiler::target::DEFINE_AOT_ARRAY
 
 dart::compiler::target::DEFINE_AOT_SIZEOF
 
 dart::compiler::target::DEFINE_ARRAY_SIZEOF
 
 dart::compiler::target::DEFINE_PAYLOAD_SIZEOF
 
 dart::compiler::target::DEFINE_AOT_RANGE
 

Macro Definition Documentation

◆ DEFINE_ALIAS [1/2]

#define DEFINE_ALIAS (   name)     const RuntimeEntry& k##name##RuntimeEntry(dart::k##name##RuntimeEntry);

Definition at line 318 of file runtime_api.cc.

328 {
329 Thread::Current()->long_jump_base()->Jump(1, Object::branch_offset_error());
330}
331
332word RuntimeEntry::OffsetFromThread() const {
333 return target::Thread::OffsetFromThread(runtime_entry_);
334}
335
336bool RuntimeEntry::is_leaf() const {
337 return runtime_entry_->is_leaf();
338}
339
340intptr_t RuntimeEntry::argument_count() const {
341 return runtime_entry_->argument_count();
342}
343
344namespace target {
345
349
351 RELEASE_ASSERT((offset % kCompressedWordSize) == 0);
352 return (offset / kCompressedWordSize) * dart::kCompressedWordSize;
353}
354
355bool SizeFitsInSizeTag(uword instance_size) {
357 TranslateOffsetInWordsToHost(instance_size));
358}
359
360uword MakeTagWordForNewSpaceObject(classid_t cid, uword instance_size) {
362 TranslateOffsetInWordsToHost(instance_size)) |
369}
370
371word Object::tags_offset() {
372 return 0;
373}
374
375const word UntaggedObject::kCardRememberedBit =
377
378const word UntaggedObject::kCanonicalBit = dart::UntaggedObject::kCanonicalBit;
379
380const word UntaggedObject::kNewBit = dart::UntaggedObject::kNewBit;
381
382const word UntaggedObject::kOldAndNotRememberedBit =
384
385const word UntaggedObject::kNotMarkedBit = dart::UntaggedObject::kNotMarkedBit;
386
387const word UntaggedObject::kImmutableBit = dart::UntaggedObject::kImmutableBit;
388
389const word UntaggedObject::kSizeTagPos = dart::UntaggedObject::kSizeTagPos;
390
391const word UntaggedObject::kSizeTagSize = dart::UntaggedObject::kSizeTagSize;
392
393const word UntaggedObject::kClassIdTagPos =
395
396const word UntaggedObject::kClassIdTagSize =
398
399const word UntaggedObject::kHashTagPos = dart::UntaggedObject::kHashTagPos;
400
401const word UntaggedObject::kHashTagSize = dart::UntaggedObject::kHashTagSize;
402
403const word UntaggedObject::kSizeTagMaxSizeTag =
405 ObjectAlignment::kObjectAlignment;
406
407const word UntaggedObject::kTagBitsSizeTagPos =
409
410const word UntaggedAbstractType::kTypeStateFinalizedInstantiated =
412const word UntaggedAbstractType::kTypeStateShift =
414const word UntaggedAbstractType::kTypeStateBits =
416const word UntaggedAbstractType::kNullabilityMask =
418
419const word UntaggedType::kTypeClassIdShift =
421
422const word UntaggedTypeParameter::kIsFunctionTypeParameterBit =
424
425const word UntaggedObject::kBarrierOverlapShift =
427
428const word UntaggedObject::kGenerationalBarrierMask =
430
431const word UntaggedObject::kIncrementalBarrierMask =
433
434bool IsTypedDataClassId(intptr_t cid) {
435 return dart::IsTypedDataClassId(cid);
436}
437
438const word Class::kNoTypeArguments = dart::Class::kNoTypeArguments;
439
440classid_t Class::GetId(const dart::Class& handle) {
441 return handle.id();
442}
443
446 return (offset / dart::kWordSize) * kWordSize;
447}
448
449static uword GetInstanceSizeImpl(const dart::Class& handle) {
450 switch (handle.id()) {
451 case kMintCid:
452 return Mint::InstanceSize();
453 case kDoubleCid:
454 return Double::InstanceSize();
455 case kInt32x4Cid:
456 return Int32x4::InstanceSize();
457 case kFloat32x4Cid:
458 return Float32x4::InstanceSize();
459 case kFloat64x2Cid:
460 return Float64x2::InstanceSize();
461 case kObjectCid:
462 return Object::InstanceSize();
463 case kInstanceCid:
464 return Instance::InstanceSize();
465 case kGrowableObjectArrayCid:
466 return GrowableObjectArray::InstanceSize();
467 case kClosureCid:
468 return Closure::InstanceSize();
469 case kTypedDataBaseCid:
470 return TypedDataBase::InstanceSize();
471 case kMapCid:
472 return Map::InstanceSize();
473 case kSetCid:
474 return Set::InstanceSize();
475 case kUnhandledExceptionCid:
476 return UnhandledException::InstanceSize();
477 case kWeakPropertyCid:
478 return WeakProperty::InstanceSize();
479 case kWeakReferenceCid:
480 return WeakReference::InstanceSize();
481 case kFinalizerCid:
482 return Finalizer::InstanceSize();
483 case kFinalizerEntryCid:
484 return FinalizerEntry::InstanceSize();
485 case kNativeFinalizerCid:
486 return NativeFinalizer::InstanceSize();
487 case kByteBufferCid:
488 case kByteDataViewCid:
490 case kPointerCid:
491 case kDynamicLibraryCid:
492#define HANDLE_CASE(clazz) case kFfi##clazz##Cid:
494#undef HANDLE_CASE
495#define HANDLE_CASE(clazz) \
496 case kTypedData##clazz##Cid: \
497 case kTypedData##clazz##ViewCid: \
498 case kExternalTypedData##clazz##Cid: \
499 case kUnmodifiableTypedData##clazz##ViewCid:
501#undef HANDLE_CASE
502 return handle.target_instance_size();
503 default:
504 if (handle.id() >= kNumPredefinedCids) {
505 return handle.target_instance_size();
506 }
507 }
508 FATAL("Unsupported class for size translation: %s (id=%" Pd
509 ", kNumPredefinedCids=%" Pd ")\n",
510 handle.ToCString(), handle.id(), kNumPredefinedCids);
511 return -1;
512}
513
514uword Class::GetInstanceSize(const dart::Class& handle) {
515 return Utils::RoundUp(GetInstanceSizeImpl(handle),
516 ObjectAlignment::kObjectAlignment);
517}
518
519// Currently, we only have compressed pointers on the target if we also have
520// compressed pointers on the host, since only 64-bit architectures can have
521// compressed pointers and there is no 32-bit host/64-bit target combination.
522// Thus, we cheat a little here and use the host information about compressed
523// pointers for the target, instead of storing this information in the extracted
524// offsets information.
525bool Class::HasCompressedPointers(const dart::Class& handle) {
526 return handle.HasCompressedPointers();
527}
528
529intptr_t Class::NumTypeArguments(const dart::Class& klass) {
530 return klass.NumTypeArguments();
531}
532
533bool Class::HasTypeArgumentsField(const dart::Class& klass) {
534 return klass.host_type_arguments_field_offset() !=
536}
537
538intptr_t Class::TypeArgumentsFieldOffset(const dart::Class& klass) {
540}
541
542bool Class::TraceAllocation(const dart::Class& klass) {
544}
545
546word Instance::first_field_offset() {
548}
549
550word Instance::native_fields_array_offset() {
552}
553
554word Instance::DataOffsetFor(intptr_t cid) {
556 // Elements start at offset 0 of the external data.
557 return 0;
558 }
559 if (dart::IsTypedDataClassId(cid)) {
560 return TypedData::payload_offset();
561 }
562 switch (cid) {
563 case kArrayCid:
564 case kImmutableArrayCid:
565 return Array::data_offset();
566 case kTypeArgumentsCid:
567 return TypeArguments::types_offset();
568 case kOneByteStringCid:
569 return OneByteString::data_offset();
570 case kTwoByteStringCid:
571 return TwoByteString::data_offset();
572 case kRecordCid:
573 return Record::field_offset(0);
574 default:
576 return Array::data_offset();
577 }
578}
579
580word Instance::ElementSizeFor(intptr_t cid) {
585 }
586 switch (cid) {
587 case kArrayCid:
588 case kImmutableArrayCid:
589 return kCompressedWordSize;
590 case kTypeArgumentsCid:
591 return kCompressedWordSize;
592 case kOneByteStringCid:
594 case kTwoByteStringCid:
596 default:
598 return 0;
599 }
600}
601
602word ICData::CodeIndexFor(word num_args) {
603 return dart::ICData::CodeIndexFor(num_args);
604}
605
606word ICData::CountIndexFor(word num_args) {
607 return dart::ICData::CountIndexFor(num_args);
608}
609
610word ICData::TargetIndexFor(word num_args) {
611 return dart::ICData::TargetIndexFor(num_args);
612}
613
614word ICData::ExactnessIndexFor(word num_args) {
615 return dart::ICData::ExactnessIndexFor(num_args);
616}
617
618word ICData::TestEntryLengthFor(word num_args, bool exactness_check) {
619 return dart::ICData::TestEntryLengthFor(num_args, exactness_check);
620}
621
622word ICData::EntryPointIndexFor(word num_args) {
623 return dart::ICData::EntryPointIndexFor(num_args);
624}
625
626const word MegamorphicCache::kSpreadFactor =
628
629// Currently we have two different axes for offset generation:
630//
631// * Target architecture
632// * DART_PRECOMPILED_RUNTIME (i.e, AOT vs. JIT)
633//
634// TODO(dartbug.com/43646): Add DART_PRECOMPILER as another axis.
635
636#define DEFINE_CONSTANT(Class, Name) const word Class::Name = Class##_##Name;
637
638#define DEFINE_ARRAY_SIZEOF(clazz, name, ElementOffset) \
639 word clazz::name() { \
640 return 0; \
641 } \
642 word clazz::name(intptr_t length) { \
643 return RoundedAllocationSize(clazz::ElementOffset(length)); \
644 }
645
646#define DEFINE_PAYLOAD_SIZEOF(clazz, name, header) \
647 word clazz::name() { \
648 return 0; \
649 } \
650 word clazz::name(word payload_size) { \
651 return RoundedAllocationSize(clazz::header() + payload_size); \
652 }
653
654#if defined(TARGET_ARCH_IA32)
655
656#define DEFINE_FIELD(clazz, name) \
657 word clazz::name() { \
658 return clazz##_##name; \
659 }
660
661#define DEFINE_ARRAY(clazz, name) \
662 word clazz::name(intptr_t index) { \
663 return clazz##_elements_start_offset + index * clazz##_element_size; \
664 }
665
666#define DEFINE_SIZEOF(clazz, name, what) \
667 word clazz::name() { \
668 return clazz##_##name; \
669 }
670
671#define DEFINE_RANGE(Class, Getter, Type, First, Last, Filter) \
672 word Class::Getter(Type index) { \
673 return Class##_##Getter[static_cast<intptr_t>(index) - \
674 static_cast<intptr_t>(First)]; \
675 }
676
684
692
693#else
694
695#define DEFINE_JIT_FIELD(clazz, name) \
696 word clazz::name() { \
697 if (FLAG_precompiled_mode) { \
698 FATAL("Use of JIT-only field %s in precompiled mode", \
699 #clazz "::" #name); \
700 } \
701 return clazz##_##name; \
702 }
703
704#define DEFINE_JIT_ARRAY(clazz, name) \
705 word clazz::name(intptr_t index) { \
706 if (FLAG_precompiled_mode) { \
707 FATAL("Use of JIT-only array %s in precompiled mode", \
708 #clazz "::" #name); \
709 } \
710 return clazz##_elements_start_offset + index * clazz##_element_size; \
711 }
712
713#define DEFINE_JIT_SIZEOF(clazz, name, what) \
714 word clazz::name() { \
715 if (FLAG_precompiled_mode) { \
716 FATAL("Use of JIT-only sizeof %s in precompiled mode", \
717 #clazz "::" #name); \
718 } \
719 return clazz##_##name; \
720 }
721
722#define DEFINE_JIT_RANGE(Class, Getter, Type, First, Last, Filter) \
723 word Class::Getter(Type index) { \
724 if (FLAG_precompiled_mode) { \
725 FATAL("Use of JIT-only range %s in precompiled mode", \
726 #Class "::" #Getter); \
727 } \
728 return Class##_##Getter[static_cast<intptr_t>(index) - \
729 static_cast<intptr_t>(First)]; \
730 }
731
739
740#undef DEFINE_JIT_FIELD
741#undef DEFINE_JIT_ARRAY
742#undef DEFINE_JIT_SIZEOF
743#undef DEFINE_JIT_RANGE
744
745#if defined(DART_PRECOMPILER)
746// The following could check FLAG_precompiled_mode for more safety, but that
747// causes problems for defining things like native Slots, where the definition
748// cannot be based on a runtime flag. Instead, we limit the visibility of these
749// definitions using DART_PRECOMPILER.
750
751#define DEFINE_AOT_FIELD(clazz, name) \
752 word clazz::name() { \
753 return AOT_##clazz##_##name; \
754 }
755
756#define DEFINE_AOT_ARRAY(clazz, name) \
757 word clazz::name(intptr_t index) { \
758 return AOT_##clazz##_elements_start_offset + \
759 index * AOT_##clazz##_element_size; \
760 }
761
762#define DEFINE_AOT_SIZEOF(clazz, name, what) \
763 word clazz::name() { \
764 return AOT_##clazz##_##name; \
765 }
766
767#define DEFINE_AOT_RANGE(Class, Getter, Type, First, Last, Filter) \
768 word Class::Getter(Type index) { \
769 return AOT_##Class##_##Getter[static_cast<intptr_t>(index) - \
770 static_cast<intptr_t>(First)]; \
771 }
772#else
773#define DEFINE_AOT_FIELD(clazz, name) \
774 word clazz::name() { \
775 FATAL("Use of AOT-only field %s outside of the precompiler", \
776 #clazz "::" #name); \
777 }
778
779#define DEFINE_AOT_ARRAY(clazz, name) \
780 word clazz::name(intptr_t index) { \
781 FATAL("Use of AOT-only array %s outside of the precompiler", \
782 #clazz "::" #name); \
783 }
784
785#define DEFINE_AOT_SIZEOF(clazz, name, what) \
786 word clazz::name() { \
787 FATAL("Use of AOT-only sizeof %s outside of the precompiler", \
788 #clazz "::" #name); \
789 }
790
791#define DEFINE_AOT_RANGE(Class, Getter, Type, First, Last, Filter) \
792 word Class::Getter(Type index) { \
793 FATAL("Use of AOT-only range %s outside of the precompiler", \
794 #Class "::" #Getter); \
795 }
796#endif // defined(DART_PRECOMPILER)
797
805
806#undef DEFINE_AOT_FIELD
807#undef DEFINE_AOT_ARRAY
808#undef DEFINE_AOT_SIZEOF
809#undef DEFINE_AOT_RANGE
810
811#define DEFINE_FIELD(clazz, name) \
812 word clazz::name() { \
813 return FLAG_precompiled_mode ? AOT_##clazz##_##name : clazz##_##name; \
814 }
815
816#define DEFINE_ARRAY(clazz, name) \
817 word clazz::name(intptr_t index) { \
818 if (FLAG_precompiled_mode) { \
819 return AOT_##clazz##_elements_start_offset + \
820 index * AOT_##clazz##_element_size; \
821 } else { \
822 return clazz##_elements_start_offset + index * clazz##_element_size; \
823 } \
824 }
825
826#define DEFINE_SIZEOF(clazz, name, what) \
827 word clazz::name() { \
828 return FLAG_precompiled_mode ? AOT_##clazz##_##name : clazz##_##name; \
829 }
830
831#define DEFINE_RANGE(Class, Getter, Type, First, Last, Filter) \
832 word Class::Getter(Type index) { \
833 if (FLAG_precompiled_mode) { \
834 return AOT_##Class##_##Getter[static_cast<intptr_t>(index) - \
835 static_cast<intptr_t>(First)]; \
836 } else { \
837 return Class##_##Getter[static_cast<intptr_t>(index) - \
838 static_cast<intptr_t>(First)]; \
839 } \
840 }
841
849
850#endif
851
852#undef DEFINE_FIELD
853#undef DEFINE_ARRAY
854#undef DEFINE_SIZEOF
855#undef DEFINE_RANGE
856#undef DEFINE_PAYLOAD_SIZEOF
857#undef DEFINE_CONSTANT
858
859const word StoreBufferBlock::kSize = dart::StoreBufferBlock::kSize;
860
861const word MarkingStackBlock::kSize = dart::MarkingStackBlock::kSize;
862
863// For InstructionsSections and Instructions, we define these by hand, because
864// they depend on flags or #defines.
865
866// Used for InstructionsSection and Instructions methods, since we don't
867// serialize Instructions objects in bare instructions mode, just payloads.
868DART_FORCE_INLINE static bool BareInstructionsPayloads() {
869 return FLAG_precompiled_mode;
870}
871
872word Instructions::HeaderSize() {
874 ? 0
875 : Utils::RoundUp(UnalignedHeaderSize(), kNonBarePayloadAlignment);
876}
877
878word Instructions::InstanceSize() {
879 return 0;
880}
881
882word Instructions::InstanceSize(word payload_size) {
883 const intptr_t alignment = BareInstructionsPayloads()
884 ? kBarePayloadAlignment
885 : ObjectAlignment::kObjectAlignment;
886 return Utils::RoundUp(Instructions::HeaderSize() + payload_size, alignment);
887}
888
889word Thread::stack_overflow_shared_stub_entry_point_offset(bool fpu_regs) {
890 return fpu_regs ? stack_overflow_shared_with_fpu_regs_entry_point_offset()
891 : stack_overflow_shared_without_fpu_regs_entry_point_offset();
892}
893
894uword Thread::full_safepoint_state_unacquired() {
896}
897
898uword Thread::full_safepoint_state_acquired() {
900}
901
902uword Thread::generated_execution_state() {
904}
905
906uword Thread::native_execution_state() {
908}
909
910uword Thread::vm_execution_state() {
912}
913
914uword Thread::vm_tag_dart_id() {
915 return dart::VMTag::kDartTagId;
916}
917
918uword Thread::exit_through_runtime_call() {
920}
921
922uword Thread::exit_through_ffi() {
924}
925
926word Thread::OffsetFromThread(const dart::Object& object) {
927 auto host_offset = dart::Thread::OffsetFromThread(object);
928 return object_null_offset() +
929 TranslateOffsetInWords(host_offset -
930 dart::Thread::object_null_offset());
931}
932
933intptr_t Thread::OffsetFromThread(const dart::RuntimeEntry* runtime_entry) {
934 auto host_offset = dart::Thread::OffsetFromThread(runtime_entry);
935 return AllocateArray_entry_point_offset() +
937 host_offset - dart::Thread::AllocateArray_entry_point_offset());
938}
939
940bool CanLoadFromThread(const dart::Object& object,
941 intptr_t* offset /* = nullptr */) {
943 if (offset != nullptr) {
944 *offset = Thread::OffsetFromThread(object);
945 }
946 return true;
947 }
948 return false;
949}
950
951static_assert(
953 "Expected that size of Smi on HOST is at least as large as on target.");
954
955bool IsSmi(const dart::Object& a) {
956 return a.IsSmi() && IsSmi(dart::Smi::Cast(a).Value());
957}
958
959word ToRawSmi(const dart::Object& a) {
961 return static_cast<compressed_word>(static_cast<intptr_t>(a.ptr()));
962}
963
964word ToRawSmi(intptr_t value) {
965 return dart::Smi::RawValue(value);
966}
967
968word SmiValue(const dart::Object& a) {
970 return static_cast<word>(dart::Smi::Cast(a).Value());
971}
972
973bool IsDouble(const dart::Object& a) {
974 return a.IsDouble();
975}
976
977double DoubleValue(const dart::Object& a) {
979 return dart::Double::Cast(a).value();
980}
981
982#if defined(TARGET_ARCH_IA32)
983uword Code::EntryPointOf(const dart::Code& code) {
984 static_assert(kHostWordSize == kWordSize,
985 "Can't embed raw pointers to runtime objects when host and "
986 "target word sizes are different");
987 return code.EntryPoint();
988}
989
990bool CanEmbedAsRawPointerInGeneratedCode(const dart::Object& obj) {
991 return obj.IsSmi() || obj.InVMIsolateHeap();
992}
993
994word ToRawPointer(const dart::Object& a) {
995 static_assert(kHostWordSize == kWordSize,
996 "Can't embed raw pointers to runtime objects when host and "
997 "target word sizes are different");
998 return static_cast<word>(a.ptr());
999}
1000#endif // defined(TARGET_ARCH_IA32)
1001
1002word RegExp::function_offset(classid_t cid, bool sticky) {
1003#if !defined(DART_COMPRESSED_POINTERS)
1005#else
1006 // TODO(rmacnak): TranslateOffsetInWords doesn't account for, say, header
1007 // being 1 word and slots being half words.
1008 return dart::RegExp::function_offset(cid, sticky);
1009#endif
1010}
1011
1012const word Symbols::kNumberOfOneCharCodeSymbols =
1014const word Symbols::kNullCharCodeSymbolOffset =
1016
1017const word String::kHashBits = dart::String::kHashBits;
1018
1019const uint8_t Nullability::kNullable =
1020 static_cast<uint8_t>(dart::Nullability::kNullable);
1021const uint8_t Nullability::kNonNullable =
1022 static_cast<uint8_t>(dart::Nullability::kNonNullable);
1023const uint8_t Nullability::kLegacy =
1024 static_cast<uint8_t>(dart::Nullability::kLegacy);
1025
1026bool Heap::IsAllocatableInNewSpace(intptr_t instance_size) {
1027 return dart::IsAllocatableInNewSpace(instance_size);
1028}
1029
1030word Field::OffsetOf(const dart::Field& field) {
1031 return field.TargetOffset();
1032}
1033
1034word FieldTable::OffsetOf(const dart::Field& field) {
1037}
1038
1039word FreeListElement::FakeInstance::InstanceSize() {
1040 return 0;
1041}
1042
1043word ForwardingCorpse::FakeInstance::InstanceSize() {
1044 return 0;
1045}
1046
1047word Instance::NextFieldOffset() {
1049}
1050
1051intptr_t Array::index_at_offset(intptr_t offset_in_bytes) {
1053 TranslateOffsetInWordsToHost(offset_in_bytes));
1054}
1055
1056intptr_t Record::field_index_at_offset(intptr_t offset_in_bytes) {
1058 TranslateOffsetInWordsToHost(offset_in_bytes));
1059}
1060
1061word String::InstanceSize(word payload_size) {
1062 return RoundedAllocationSize(String::InstanceSize() + payload_size);
1063}
1064
1065word LocalVarDescriptors::InstanceSize() {
1066 return 0;
1067}
1068
1069word Integer::NextFieldOffset() {
1070 return TranslateOffsetInWords(dart::Integer::NextFieldOffset());
1071}
1072
1073word Smi::InstanceSize() {
1074 return 0;
1075}
1076
1077word Number::NextFieldOffset() {
1078 return TranslateOffsetInWords(dart::Number::NextFieldOffset());
1079}
1080
1081void UnboxFieldIfSupported(const dart::Field& field,
1082 const dart::AbstractType& type) {
1083 if (field.is_static() || field.is_late()) {
1084 return;
1085 }
1086
1087 if (type.IsNullable()) {
1088 return;
1089 }
1090
1092 if (type.IsDoubleType()) {
1093 if (FlowGraphCompiler::SupportsUnboxedDoubles()) {
1094 cid = kDoubleCid;
1095 }
1096 } else if (type.IsFloat32x4Type()) {
1097 if (FlowGraphCompiler::SupportsUnboxedSimd128()) {
1098 cid = kFloat32x4Cid;
1099 }
1100 } else if (type.IsFloat64x2Type()) {
1101 if (FlowGraphCompiler::SupportsUnboxedSimd128()) {
1102 cid = kFloat64x2Cid;
1103 }
1104 }
1105
1106 if (cid != kIllegalCid) {
1107 field.set_guarded_cid(cid);
1108 field.set_is_nullable(false);
1109 field.set_is_unboxed(true);
1113 }
1114}
1115
1116} // namespace target
1117} // namespace compiler
1118} // namespace dart
1119
1120#else
1121
1122namespace dart {
1123namespace compiler {
1124namespace target {
1125
1126const word Array::kMaxElements = Array_kMaxElements;
1127const word Context::kMaxElements = Context_kMaxElements;
1128const word Record::kMaxElements = Record_kMaxElements;
1129
1130const word RecordShape::kNumFieldsMask = RecordShape_kNumFieldsMask;
1131const word RecordShape::kMaxNumFields = RecordShape_kMaxNumFields;
1132const word RecordShape::kFieldNamesIndexShift =
1133 RecordShape_kFieldNamesIndexShift;
1134const word RecordShape::kFieldNamesIndexMask = RecordShape_kFieldNamesIndexMask;
1135const word RecordShape::kMaxFieldNamesIndex = RecordShape_kMaxFieldNamesIndex;
1136
1137} // namespace target
1138} // namespace compiler
1139} // namespace dart
1140
1141#endif // !defined(DART_PRECOMPILED_RUNTIME)
#define RELEASE_ASSERT(cond)
Definition assert.h:327
#define CLASS_LIST_FFI_TYPE_MARKER(V)
Definition class_id.h:165
#define CLASS_LIST_TYPED_DATA(V)
Definition class_id.h:137
static intptr_t index_at_offset(intptr_t offset_in_bytes)
Definition object.h:10821
bool TraceAllocation(IsolateGroup *isolate_group) const
Definition object.cc:4489
intptr_t target_type_arguments_field_offset() const
Definition object.h:1386
intptr_t id() const
Definition object.h:1235
intptr_t target_instance_size() const
Definition object.h:1149
intptr_t NumTypeArguments() const
Definition object.cc:3690
intptr_t host_type_arguments_field_offset() const
Definition object.h:1377
bool HasCompressedPointers() const
Definition object.cc:3007
static constexpr intptr_t kNoTypeArguments
Definition object.h:1376
static intptr_t FieldOffsetFor(intptr_t field_id)
void set_is_unboxed(bool b) const
Definition object.h:4693
@ kUnknownLengthOffset
Definition object.h:4700
@ kNoFixedLength
Definition object.h:4702
intptr_t TargetOffset() const
Definition object.h:13220
bool is_late() const
Definition object.h:4422
bool is_static() const
Definition object.h:4418
void set_guarded_cid(intptr_t cid) const
Definition object.h:4633
void set_guarded_list_length_in_object_offset(intptr_t offset) const
Definition object.h:4661
intptr_t field_id() const
Definition object.h:13258
void set_is_nullable(bool val) const
Definition object.h:4726
void set_guarded_list_length(intptr_t list_length) const
Definition object.h:4651
static intptr_t ExactnessIndexFor(intptr_t num_args)
Definition object.h:2735
static intptr_t CodeIndexFor(intptr_t num_args)
Definition object.h:2733
static intptr_t TargetIndexFor(intptr_t num_args)
Definition object.h:2732
static intptr_t CountIndexFor(intptr_t num_args)
Definition object.h:2729
static intptr_t TestEntryLengthFor(intptr_t num_args, bool tracking_exactness)
Definition object.cc:16610
static intptr_t EntryPointIndexFor(intptr_t num_args)
Definition object.h:2730
static intptr_t NextFieldOffset()
Definition object.h:8326
static intptr_t NativeFieldsOffset()
Definition object.h:8328
static IsolateGroup * Current()
Definition isolate.h:534
static constexpr intptr_t kSpreadFactor
Definition object.h:7571
bool InVMIsolateHeap() const
Definition object.h:395
static bool ShouldHaveImmutabilityBitSet(classid_t class_id)
Definition object.cc:2689
virtual const char * ToCString() const
Definition object.h:366
static constexpr intptr_t kHashBits
Definition object.h:323
static constexpr intptr_t kBytesPerElement
Definition object.h:10521
static intptr_t field_index_at_offset(intptr_t offset_in_bytes)
Definition object.h:11426
static intptr_t function_offset(intptr_t cid, bool sticky)
Definition object.h:12789
static intptr_t RawValue(intptr_t value)
Definition object.h:10001
static constexpr int kNumberOfOneCharCodeSymbols
Definition symbols.h:600
static constexpr int kNullCharCodeSymbolOffset
Definition symbols.h:604
static uword full_safepoint_state_unacquired()
Definition thread.h:1047
static intptr_t OffsetFromThread(const Object &object)
Definition thread.cc:1112
@ kExitThroughRuntimeCall
Definition thread.h:471
@ kExitThroughFfi
Definition thread.h:468
static bool CanLoadFromThread(const Object &object)
Definition thread.cc:1088
static uword full_safepoint_state_acquired()
Definition thread.h:1051
@ kThreadInNative
Definition thread.h:1023
@ kThreadInGenerated
Definition thread.h:1022
static constexpr intptr_t kBytesPerElement
Definition object.h:10662
intptr_t ElementSizeInBytes() const
Definition object.h:11505
static constexpr intptr_t kNullabilityMask
static constexpr intptr_t kTypeStateBits
static constexpr intptr_t kTypeStateShift
static constexpr intptr_t kMaxSizeTagInUnitsOfAlignment
Definition raw_object.h:196
static constexpr bool SizeFits(intptr_t size)
Definition raw_object.h:213
static constexpr uword encode(intptr_t size)
Definition raw_object.h:201
static constexpr intptr_t kIncrementalBarrierMask
Definition raw_object.h:181
static constexpr intptr_t kGenerationalBarrierMask
Definition raw_object.h:180
static constexpr intptr_t kBarrierOverlapShift
Definition raw_object.h:182
static constexpr intptr_t kIsFunctionTypeParameterBit
static constexpr intptr_t kTypeClassIdShift
#define UNIMPLEMENTED
struct MyStruct a[10]
#define FATAL(error)
uint32_t * target
static word TranslateOffsetInWords(word offset)
uword MakeTagWordForNewSpaceObject(classid_t cid, uword instance_size)
static uword GetInstanceSizeImpl(const dart::Class &handle)
static word TranslateOffsetInWordsToHost(word offset)
void UnboxFieldIfSupported(const dart::Field &field, const dart::AbstractType &type)
bool CanLoadFromThread(const dart::Object &object, intptr_t *offset)
double DoubleValue(const dart::Object &a)
word ToRawSmi(const dart::Object &a)
bool IsDouble(const dart::Object &a)
bool IsSmi(int64_t v)
bool SizeFitsInSizeTag(uword instance_size)
word SmiValue(const dart::Object &a)
static DART_FORCE_INLINE bool BareInstructionsPayloads()
InvalidClass kSmiBits
bool IsTypedDataViewClassId(intptr_t index)
Definition class_id.h:439
bool IsTypedDataClassId(intptr_t index)
Definition class_id.h:433
const intptr_t kSmiBits
Definition globals.h:24
static constexpr intptr_t kPageSize
Definition page.h:27
int32_t classid_t
Definition globals.h:524
bool IsUnmodifiableTypedDataViewClassId(intptr_t index)
Definition class_id.h:453
@ kIllegalCid
Definition class_id.h:214
@ kByteDataViewCid
Definition class_id.h:244
@ kByteBufferCid
Definition class_id.h:247
@ kUnmodifiableByteDataViewCid
Definition class_id.h:245
intptr_t compressed_word
Definition globals.h:45
uintptr_t uword
Definition globals.h:501
intptr_t word
Definition globals.h:500
bool IsAllocatableInNewSpace(intptr_t size)
Definition spaces.h:57
const intptr_t cid
static constexpr intptr_t kCompressedWordSize
Definition globals.h:42
constexpr intptr_t kWordSize
Definition globals.h:509
static constexpr intptr_t kPageMask
Definition page.h:29
bool IsExternalTypedDataClassId(intptr_t index)
Definition class_id.h:447
#define Pd
Definition globals.h:408
#define DEFINE_AOT_RANGE(Class, Getter, Type, First, Last, Filter)
#define DEFINE_AOT_SIZEOF(clazz, name, what)
#define DEFINE_ARRAY_SIZEOF(clazz, name, ElementOffset)
#define DEFINE_JIT_SIZEOF(clazz, name, what)
#define DEFINE_ARRAY(clazz, name)
#define DEFINE_CONSTANT(Class, Name)
#define DEFINE_PAYLOAD_SIZEOF(clazz, name, header)
#define DEFINE_AOT_FIELD(clazz, name)
#define DEFINE_FIELD(clazz, name)
#define HANDLE_CASE(clazz)
#define DEFINE_AOT_ARRAY(clazz, name)
#define DEFINE_JIT_RANGE(Class, Getter, Type, First, Last, Filter)
#define DEFINE_JIT_ARRAY(clazz, name)
#define DEFINE_RANGE(Class, Getter, Type, First, Last, Filter)
#define DEFINE_JIT_FIELD(clazz, name)
#define DEFINE_SIZEOF(clazz, name, what)
#define JIT_OFFSETS_LIST(FIELD, ARRAY, SIZEOF, ARRAY_SIZEOF, PAYLOAD_SIZEOF, RANGE, CONSTANT)
#define AOT_OFFSETS_LIST(FIELD, ARRAY, SIZEOF, ARRAY_SIZEOF, PAYLOAD_SIZEOF, RANGE, CONSTANT)
#define COMMON_OFFSETS_LIST(FIELD, ARRAY, SIZEOF, ARRAY_SIZEOF, PAYLOAD_SIZEOF, RANGE, CONSTANT)
Point offset

◆ DEFINE_ALIAS [2/2]

#define DEFINE_ALIAS (   type,
  name,
  ... 
)     const RuntimeEntry& k##name##RuntimeEntry(dart::k##name##RuntimeEntry);

Definition at line 318 of file runtime_api.cc.

◆ DEFINE_AOT_ARRAY

#define DEFINE_AOT_ARRAY (   clazz,
  name 
)
Value:
word clazz::name(intptr_t index) { \
FATAL("Use of AOT-only array %s outside of the precompiler", \
#clazz "::" #name); \
}
const char * name
Definition fuchsia.cc:50

◆ DEFINE_AOT_FIELD

#define DEFINE_AOT_FIELD (   clazz,
  name 
)
Value:
word clazz::name() { \
FATAL("Use of AOT-only field %s outside of the precompiler", \
#clazz "::" #name); \
}

◆ DEFINE_AOT_RANGE

#define DEFINE_AOT_RANGE (   Class,
  Getter,
  Type,
  First,
  Last,
  Filter 
)
Value:
word Class::Getter(Type index) { \
FATAL("Use of AOT-only range %s outside of the precompiler", \
#Class "::" #Getter); \
}

◆ DEFINE_AOT_SIZEOF

#define DEFINE_AOT_SIZEOF (   clazz,
  name,
  what 
)
Value:
word clazz::name() { \
FATAL("Use of AOT-only sizeof %s outside of the precompiler", \
#clazz "::" #name); \
}

◆ DEFINE_ARRAY

#define DEFINE_ARRAY (   clazz,
  name 
)
Value:
word clazz::name(intptr_t index) { \
if (FLAG_precompiled_mode) { \
return AOT_##clazz##_elements_start_offset + \
index * AOT_##clazz##_element_size; \
} else { \
return clazz##_elements_start_offset + index * clazz##_element_size; \
} \
}

Definition at line 816 of file runtime_api.cc.

817 { \
818 if (FLAG_precompiled_mode) { \
819 return AOT_##clazz##_elements_start_offset + \
820 index * AOT_##clazz##_element_size; \
821 } else { \
822 return clazz##_elements_start_offset + index * clazz##_element_size; \
823 } \
824 }

◆ DEFINE_ARRAY_SIZEOF

#define DEFINE_ARRAY_SIZEOF (   clazz,
  name,
  ElementOffset 
)
Value:
word clazz::name() { \
return 0; \
} \
word clazz::name(intptr_t length) { \
return RoundedAllocationSize(clazz::ElementOffset(length)); \
}
size_t length

Definition at line 638 of file runtime_api.cc.

639 { \
640 return 0; \
641 } \
642 word clazz::name(intptr_t length) { \
643 return RoundedAllocationSize(clazz::ElementOffset(length)); \
644 }

◆ DEFINE_CONSTANT

#define DEFINE_CONSTANT (   Class,
  Name 
)    const word Class::Name = Class##_##Name;

Definition at line 636 of file runtime_api.cc.

◆ DEFINE_FIELD

#define DEFINE_FIELD (   clazz,
  name 
)
Value:
word clazz::name() { \
return FLAG_precompiled_mode ? AOT_##clazz##_##name : clazz##_##name; \
}

Definition at line 811 of file runtime_api.cc.

812 { \
813 return FLAG_precompiled_mode ? AOT_##clazz##_##name : clazz##_##name; \
814 }

◆ DEFINE_JIT_ARRAY

#define DEFINE_JIT_ARRAY (   clazz,
  name 
)
Value:
word clazz::name(intptr_t index) { \
if (FLAG_precompiled_mode) { \
FATAL("Use of JIT-only array %s in precompiled mode", \
#clazz "::" #name); \
} \
return clazz##_elements_start_offset + index * clazz##_element_size; \
}

Definition at line 704 of file runtime_api.cc.

705 { \
706 if (FLAG_precompiled_mode) { \
707 FATAL("Use of JIT-only array %s in precompiled mode", \
708 #clazz "::" #name); \
709 } \
710 return clazz##_elements_start_offset + index * clazz##_element_size; \
711 }

◆ DEFINE_JIT_FIELD

#define DEFINE_JIT_FIELD (   clazz,
  name 
)
Value:
word clazz::name() { \
if (FLAG_precompiled_mode) { \
FATAL("Use of JIT-only field %s in precompiled mode", \
#clazz "::" #name); \
} \
return clazz##_##name; \
}

Definition at line 695 of file runtime_api.cc.

696 { \
697 if (FLAG_precompiled_mode) { \
698 FATAL("Use of JIT-only field %s in precompiled mode", \
699 #clazz "::" #name); \
700 } \
701 return clazz##_##name; \
702 }

◆ DEFINE_JIT_RANGE

#define DEFINE_JIT_RANGE (   Class,
  Getter,
  Type,
  First,
  Last,
  Filter 
)
Value:
word Class::Getter(Type index) { \
if (FLAG_precompiled_mode) { \
FATAL("Use of JIT-only range %s in precompiled mode", \
#Class "::" #Getter); \
} \
return Class##_##Getter[static_cast<intptr_t>(index) - \
static_cast<intptr_t>(First)]; \
}

Definition at line 722 of file runtime_api.cc.

723 { \
724 if (FLAG_precompiled_mode) { \
725 FATAL("Use of JIT-only range %s in precompiled mode", \
726 #Class "::" #Getter); \
727 } \
728 return Class##_##Getter[static_cast<intptr_t>(index) - \
729 static_cast<intptr_t>(First)]; \
730 }

◆ DEFINE_JIT_SIZEOF

#define DEFINE_JIT_SIZEOF (   clazz,
  name,
  what 
)
Value:
word clazz::name() { \
if (FLAG_precompiled_mode) { \
FATAL("Use of JIT-only sizeof %s in precompiled mode", \
#clazz "::" #name); \
} \
return clazz##_##name; \
}

Definition at line 713 of file runtime_api.cc.

714 { \
715 if (FLAG_precompiled_mode) { \
716 FATAL("Use of JIT-only sizeof %s in precompiled mode", \
717 #clazz "::" #name); \
718 } \
719 return clazz##_##name; \
720 }

◆ DEFINE_PAYLOAD_SIZEOF

#define DEFINE_PAYLOAD_SIZEOF (   clazz,
  name,
  header 
)
Value:
word clazz::name() { \
return 0; \
} \
word clazz::name(word payload_size) { \
return RoundedAllocationSize(clazz::header() + payload_size); \
}

Definition at line 646 of file runtime_api.cc.

647 { \
648 return 0; \
649 } \
650 word clazz::name(word payload_size) { \
651 return RoundedAllocationSize(clazz::header() + payload_size); \
652 }

◆ DEFINE_RANGE

#define DEFINE_RANGE (   Class,
  Getter,
  Type,
  First,
  Last,
  Filter 
)
Value:
word Class::Getter(Type index) { \
if (FLAG_precompiled_mode) { \
return AOT_##Class##_##Getter[static_cast<intptr_t>(index) - \
static_cast<intptr_t>(First)]; \
} else { \
return Class##_##Getter[static_cast<intptr_t>(index) - \
static_cast<intptr_t>(First)]; \
} \
}

Definition at line 831 of file runtime_api.cc.

832 { \
833 if (FLAG_precompiled_mode) { \
834 return AOT_##Class##_##Getter[static_cast<intptr_t>(index) - \
835 static_cast<intptr_t>(First)]; \
836 } else { \
837 return Class##_##Getter[static_cast<intptr_t>(index) - \
838 static_cast<intptr_t>(First)]; \
839 } \
840 }

◆ DEFINE_SIZEOF

#define DEFINE_SIZEOF (   clazz,
  name,
  what 
)
Value:
word clazz::name() { \
return FLAG_precompiled_mode ? AOT_##clazz##_##name : clazz##_##name; \
}

Definition at line 826 of file runtime_api.cc.

827 { \
828 return FLAG_precompiled_mode ? AOT_##clazz##_##name : clazz##_##name; \
829 }

◆ DO

#define DO (   clazz)
Value:
bool Is##clazz##Handle(const Object& obj) { \
return obj.Is##clazz(); \
}

Definition at line 94 of file runtime_api.cc.

95 { \
96 return obj.Is##clazz(); \
97 }

◆ HANDLE_CASE [1/2]

#define HANDLE_CASE (   clazz)    case kFfi##clazz##Cid:

◆ HANDLE_CASE [2/2]

#define HANDLE_CASE (   clazz)
Value:
case kTypedData##clazz##Cid: \
case kTypedData##clazz##ViewCid: \
case kExternalTypedData##clazz##Cid: \
case kUnmodifiableTypedData##clazz##ViewCid: