bool DynamicTypeHandler::CheckHeuristicsForFixedDataProps(DynamicObject* instance, const PropertyRecord * propertyRecord, Var value)
    {
        if (PHASE_FORCE1(Js::FixDataPropsPhase))
        {
            return true;
        }

        if (Js::TaggedInt::Is(value) &&
            ((instance->GetTypeId() == TypeIds_GlobalObject && instance->GetScriptContext()->IsIntConstPropertyOnGlobalObject(propertyRecord->GetPropertyId())) ||
            (instance->GetTypeId() == TypeIds_Object && instance->GetScriptContext()->IsIntConstPropertyOnGlobalUserObject(propertyRecord->GetPropertyId()))))
        {
            return true;
        }

        // Disabled by default
        if (PHASE_ON1(Js::FixDataVarPropsPhase))
        {
            if (instance->GetTypeHandler()->GetFlags() & IsPrototypeFlag)
            {
                return true;
            }
            if (instance->GetType()->GetTypeId() == TypeIds_GlobalObject)
            {
                // if we have statically seen multiple stores - we should not do this optimization
                RootObjectInlineCache* cache = (static_cast<Js::RootObjectBase*>(instance))->GetRootInlineCache(propertyRecord, /*isLoadMethod*/ false, /*isStore*/ true);
                uint refCount = cache->Release();
                return refCount <= 1;
            }
        }
        return false;
    }
Beispiel #2
0
 template<> void PrintTmpRegisterDeAllocation<AsmJsSIMDValue>(RegSlot loc)
 {
     if (PHASE_ON1(AsmjsTmpRegisterAllocationPhase))
         Output::Print(L"-SIMD%d\n", loc);
 }
Beispiel #3
0
 template<> void PrintTmpRegisterDeAllocation<float>(RegSlot loc)
 {
     if (PHASE_ON1(AsmjsTmpRegisterAllocationPhase))
         Output::Print(_u("-F%d\n"), loc);
 }
Beispiel #4
0
 template<> void PrintTmpRegisterDeAllocation<int>(RegSlot loc)
 {
     if (PHASE_ON1(AsmjsTmpRegisterAllocationPhase))
         Output::Print(L"-I%d\n", loc);
 }
Beispiel #5
0
 template<> void PrintTmpRegisterAllocation<double>(RegSlot loc)
 {
     if (PHASE_ON1(AsmjsTmpRegisterAllocationPhase))
         Output::Print(_u("+D%d\n"), loc);
 }