Beispiel #1
0
void FuncInfo::EnsureThisScopeSlot(Scope* scope)
{
    if (this->thisScopeSlot == Js::Constants::NoRegister)
    {
        Scope* currentScope = scope->IsGlobalEvalBlockScope() ? this->GetGlobalEvalBlockScope() : scope;
        this->thisScopeSlot = currentScope->AddScopeSlot();
    }
}
Beispiel #2
0
void FuncInfo::EnsureNewTargetScopeSlot()
{
    if (this->newTargetScopeSlot == Js::Constants::NoProperty)
    {
        // In case of split scope param and body has separate closures. So we have to use different scope slots for them.
        bool isSplitScope = this->paramScope && !this->paramScope->GetCanMergeWithBodyScope();
        Scope* scope = isSplitScope ? this->paramScope : this->bodyScope;

        this->newTargetScopeSlot = scope->AddScopeSlot();
        if (isSplitScope)
        {
            this->innerNewTargetScopeSlot = this->bodyScope->AddScopeSlot();
        }
    }
}
Beispiel #3
0
void FuncInfo::EnsureThisScopeSlot()
{
    if (this->thisScopeSlot == Js::Constants::NoProperty)
    {
        // In case of split scope param and body has separate closures. So we have to use different scope slots for them.
        bool isSplitScope = this->paramScope && !this->paramScope->GetCanMergeWithBodyScope();
        Scope* scope = isSplitScope ? this->paramScope : this->bodyScope;
        Scope* currentScope = scope->IsGlobalEvalBlockScope() ? this->GetGlobalEvalBlockScope() : scope;

        this->thisScopeSlot = currentScope->AddScopeSlot();
        if (isSplitScope)
        {
            this->innerThisScopeSlot = this->bodyScope->AddScopeSlot();
        }
    }
}