Exemplo n.º 1
0
void JSObject::removeDirect(const Identifier& propertyName)
{
    size_t offset;
    if (m_structure->isUncacheableDictionary()) {
        offset = m_structure->removePropertyWithoutTransition(propertyName);
        if (offset != WTF::notFound)
            putDirectOffset(offset, jsUndefined());
        return;
    }

    RefPtr<Structure> structure = Structure::removePropertyTransition(m_structure, propertyName, offset);
    setStructure(structure.release());
    if (offset != WTF::notFound)
        putDirectOffset(offset, jsUndefined());
}
Exemplo n.º 2
0
void JSFunction::finishCreation(ExecState* exec, FunctionExecutable* executable, ScopeChainNode* scopeChainNode)
{
    Base::finishCreation(exec->globalData());
    ASSERT(inherits(&s_info));

    // Switching the structure here is only safe if we currently have the function structure!
    ASSERT(structure() == scopeChainNode->globalObject->functionStructure());
    setStructure(exec->globalData(), scopeChainNode->globalObject->namedFunctionStructure());
    putDirectOffset(exec->globalData(), scopeChainNode->globalObject->functionNameOffset(), executable->nameValue());
}
Exemplo n.º 3
0
void JSFunction::finishCreation(ExecState* exec, FunctionExecutable* executable, JSScope* scope)
{
    JSGlobalData& globalData = exec->globalData();
    Base::finishCreation(globalData);
    ASSERT(inherits(&s_info));

    // Switching the structure here is only safe if we currently have the function structure!
    ASSERT(structure() == scope->globalObject()->functionStructure());
    setStructureAndReallocateStorageIfNecessary(
        globalData,
        scope->globalObject()->namedFunctionStructure());
    putDirectOffset(globalData, scope->globalObject()->functionNameOffset(), executable->nameValue());
}