Esempio n. 1
0
    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;
    }
Esempio n. 2
0
 template<> void PrintTmpRegisterDeAllocation<AsmJsSIMDValue>(RegSlot loc)
 {
     if (PHASE_ON1(AsmjsTmpRegisterAllocationPhase))
         Output::Print(L"-SIMD%d\n", loc);
 }
Esempio n. 3
0
 template<> void PrintTmpRegisterDeAllocation<float>(RegSlot loc)
 {
     if (PHASE_ON1(AsmjsTmpRegisterAllocationPhase))
         Output::Print(_u("-F%d\n"), loc);
 }
Esempio n. 4
0
 template<> void PrintTmpRegisterDeAllocation<int>(RegSlot loc)
 {
     if (PHASE_ON1(AsmjsTmpRegisterAllocationPhase))
         Output::Print(L"-I%d\n", loc);
 }
Esempio n. 5
0
 template<> void PrintTmpRegisterAllocation<double>(RegSlot loc)
 {
     if (PHASE_ON1(AsmjsTmpRegisterAllocationPhase))
         Output::Print(_u("+D%d\n"), loc);
 }