示例#1
0
 void NullTypeHandlerBase::SetIsPrototype(DynamicObject* instance)
 {
     if (!this->isPrototype)
     {
         // We don't force a type transition even when ChangeTypeOnProto() == true, because objects with NullTypeHandlers don't
         // have any properties, so there is nothing to invalidate.  Types with NullTypeHandlers also aren't cached in typeWithoutProperty
         // caches, so there will be no fast property add path that could skip prototype cache invalidation.
         NullTypeHandler<true>* protoTypeHandler = NullTypeHandler<true>::GetDefaultInstance();
         AssertMsg(protoTypeHandler->GetFlags() == (GetFlags() | IsPrototypeFlag), "Why did we change the flags of a NullTypeHandler?");
         Assert(this->GetIsInlineSlotCapacityLocked() == protoTypeHandler->GetIsInlineSlotCapacityLocked());
         protoTypeHandler->SetPropertyTypes(PropertyTypesWritableDataOnly | PropertyTypesWritableDataOnlyDetection, GetPropertyTypes());
         SetInstanceTypeHandler(instance, protoTypeHandler);
     }
 }
示例#2
0
 void
 DynamicTypeHandler::SetInstanceTypeHandler(DynamicObject * instance, bool hasChanged)
 {
     SetInstanceTypeHandler(instance, this, hasChanged);
 }