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()); }
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()); }
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()); }