Skip to content
Permalink
Browse files
Bug 21810: Remove use of static C++ objects that are destroyed at ex…
…it time (destructors)

WebCore:

2008-11-06  Greg Bolsinga  <bolsinga@apple.com>

        Reviewed by Darin Adler.

        Bug 21810: Remove use of static C++ objects that are destroyed at exit time (destructors)
        https://bugs.webkit.org/show_bug.cgi?id=21810

        * bindings/js/GCController.cpp:
        (WebCore::gcController): Changed to leak an object to avoid an exit-time destructor.
        * bindings/js/JSDOMBinding.cpp:
        (WebCore::wrapperSet): Ditto
        * bindings/js/JSInspectedObjectWrapper.cpp:
        (WebCore::wrappers): Ditto
        * bindings/js/JSInspectorCallbackWrapper.cpp:
        (WebCore::wrappers): Ditto
        * bridge/runtime_root.cpp:
        (JSC::Bindings::rootObjectSet): Ditto
        * css/CSSMutableStyleDeclaration.cpp:
        (WebCore::CSSMutableStyleDeclaration::removeProperty): Ditto
        * css/CSSPrimitiveValue.cpp:
        (WebCore::CSSPrimitiveValue::cssText): Ditto
        * css/CSSSelector.cpp:
        (WebCore::CSSSelector::extractPseudoType): Ditto
        * css/CSSStyleSelector.cpp:
        (WebCore::screenEval): Ditto
        (WebCore::printEval): Ditto
        * dom/DOMImplementation.cpp:
        (WebCore::isSVG10Feature): Ditto
        (WebCore::isSVG11Feature): Ditto
        (WebCore::DOMImplementation::isXMLMIMEType): Ditto
        * dom/Document.cpp:
        (WebCore::Document::hasPrefixNamespaceMismatch): Ditto
        * dom/ScriptElement.cpp:
        (WebCore::isSupportedJavaScriptLanguage): Ditto
        * editing/ApplyStyleCommand.cpp:
        (WebCore::styleSpanClassString): Ditto
        * editing/HTMLInterchange.cpp:
        (WebCore::): Ditto
        * editing/IndentOutdentCommand.cpp:
        (WebCore::indentBlockquoteString): Ditto
        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::isInterchangeNewlineNode): Ditto
        (WebCore::isInterchangeConvertedSpaceSpan): Ditto
        * editing/htmlediting.cpp:
        (WebCore::stringWithRebalancedWhitespace): Ditto
        (WebCore::nonBreakingSpaceString): Ditto
        * editing/markup.cpp:
        (WebCore::appendAttributeValue): Ditto
        (WebCore::appendEscapedContent): Ditto
        (WebCore::shouldAddNamespaceAttr): Ditto
        (WebCore::appendNamespace): Ditto
        (WebCore::appendStartMarkup): Ditto
        (WebCore::createMarkup): Ditto
        * html/HTMLButtonElement.cpp:
        (WebCore::HTMLButtonElement::type): Ditto
        * html/HTMLElement.cpp:
        (WebCore::HTMLElement::isRecognizedTagName): Ditto
        (WebCore::inlineTagList): Ditto
        (WebCore::blockTagList): Ditto
        * html/HTMLFieldSetElement.cpp:
        (WebCore::HTMLFieldSetElement::type): Ditto
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::type): Ditto
        * html/HTMLKeygenElement.cpp:
        (WebCore::HTMLKeygenElement::type): Ditto
        * html/HTMLLegendElement.cpp:
        (WebCore::HTMLLegendElement::type): Ditto
        * html/HTMLOptGroupElement.cpp:
        (WebCore::HTMLOptGroupElement::type): Ditto
        * html/HTMLOptionElement.cpp:
        (WebCore::HTMLOptionElement::type): Ditto
        * html/HTMLParser.cpp:
        (WebCore::HTMLParser::getNode): Ditto
        (WebCore::HTMLParser::isHeaderTag): Ditto
        (WebCore::HTMLParser::isResidualStyleTag): Ditto
        (WebCore::HTMLParser::isAffectedByResidualStyle): Ditto
        * html/HTMLSelectElement.cpp:
        (WebCore::HTMLSelectElement::type): Ditto
        * html/HTMLTextAreaElement.cpp:
        (WebCore::HTMLTextAreaElement::type): Ditto
        * inspector/InspectorController.cpp:
        (WebCore::platform): Ditto
        * inspector/JavaScriptDebugServer.cpp:
        (WebCore::JavaScriptDebugServer::shared): Ditto
        * inspector/JavaScriptProfile.cpp:
        (WebCore::profileCache): Ditto
        * inspector/JavaScriptProfileNode.cpp:
        (WebCore::profileNodeCache): Ditto
        * loader/FrameLoader.cpp:
        (WebCore::localSchemes): Ditto
        * loader/appcache/ApplicationCacheStorage.cpp:
        (WebCore::cacheStorage): Ditto
        * loader/archive/ArchiveFactory.cpp:
        (WebCore::archiveMIMETypes): Ditto
        * loader/icon/IconDatabase.cpp:
        (WebCore::IconDatabase::defaultDatabaseFilename): Ditto
        * page/EventHandler.cpp:
        (WebCore::EventHandler::dragState): Ditto
        * page/Frame.cpp:
        (WebCore::createRegExpForLabels): Ditto
        (WebCore::keepAliveSet): Ditto
        * page/Page.cpp:
        (WebCore::Page::groupName): Ditto
        * page/SecurityOrigin.cpp:
        (WebCore::isDefaultPortForProtocol): Ditto
        (WebCore::SecurityOrigin::databaseIdentifier): Ditto
        * page/mac/FrameMac.mm:
        (WebCore::regExpForLabels): Ditto
        * platform/KURL.cpp:
        (WebCore::blankURL): Ditto
        * platform/graphics/FontCache.cpp:
        (WebCore::alternateFamilyName): Ditto
        * platform/graphics/mac/FontCacheMac.mm:
        (WebCore::FontCache::getSimilarFontPlatformData): Ditto
        (WebCore::FontCache::getLastResortFallbackFont): Ditto
        * platform/mac/ScrollbarThemeMac.mm:
        (WebCore::ScrollbarTheme::nativeTheme): Ditto
        * platform/mac/ThemeMac.mm:
        (WebCore::platformTheme): Ditto
        * platform/mac/ThreadCheck.mm:
        (WebCoreReportThreadViolation): Ditto
        * platform/network/NetworkStateNotifier.cpp:
        (WebCore::networkStateNotifier): Ditto
        * platform/network/mac/FormDataStreamMac.mm:
        (WebCore::getStreamFormDataMap): Ditto
        (WebCore::getStreamResourceHandleMap): Ditto
        * platform/network/mac/ResourceResponseMac.mm:
        (WebCore::ResourceResponse::platformLazyInit): Ditto
        * platform/text/TextEncoding.cpp:
        (WebCore::TextEncoding::isJapanese): Ditto
        * rendering/RenderBlock.cpp:
        (WebCore::continuationOutlineTable): Ditto
        * rendering/RenderCounter.cpp:
        (WebCore::counterMaps): Ditto
        * rendering/RenderFlexibleBox.cpp:
        (WebCore::RenderFlexibleBox::layoutVerticalBox): Ditto
        * rendering/RenderListItem.cpp:
        (WebCore::RenderListItem::markerText): Ditto
        * rendering/RenderScrollbarTheme.cpp:
        (WebCore::RenderScrollbarTheme::renderScrollbarTheme): Ditto
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::systemFont): Ditto
        * rendering/bidi.cpp:
        (WebCore::RenderBlock::checkLinesForTextOverflow): Ditto
        * rendering/style/RenderStyle.cpp:
        (WebCore::RenderStyle::initialDashboardRegions): Ditto
        (WebCore::RenderStyle::noneDashboardRegions): Ditto
        * storage/LocalStorage.cpp:
        (WebCore::localStorageMap): Ditto
        * svg/SVGAnimateMotionElement.cpp:
        (WebCore::SVGAnimateMotionElement::rotateMode): Ditto
        * svg/SVGAnimationElement.cpp:
        (WebCore::SVGAnimationElement::calcMode): Ditto
        (WebCore::SVGAnimationElement::attributeType): Ditto
        (WebCore::SVGAnimationElement::isAdditive): Ditto
        (WebCore::SVGAnimationElement::isAccumulated): Ditto
        * svg/SVGLangSpace.cpp:
        (WebCore::SVGLangSpace::xmlspace): Ditto
        * svg/SVGSVGElement.cpp:
        (WebCore::SVGSVGElement::contentScriptType): Ditto
        (WebCore::SVGSVGElement::contentStyleType): Ditto
        * svg/SVGStyleElement.cpp:
        (WebCore::SVGStyleElement::type): Ditto
        (WebCore::SVGStyleElement::media): Ditto
        * svg/SVGTextContentElement.cpp:
        (WebCore::SVGTextContentElement::parseMappedAttribute): Ditto
        * svg/animation/SVGSMILElement.cpp:
        (WebCore::SVGSMILElement::parseClockValue): Ditto
        (WebCore::SVGSMILElement::restart): Ditto
        (WebCore::SVGSMILElement::fill): Ditto
        (WebCore::SVGSMILElement::repeatCount): Ditto
        (WebCore::SVGSMILElement::notifyDependentsIntervalChanged): Ditto
        * svg/graphics/SVGResource.cpp:
        (WebCore::clientMap): Ditto
        * svg/graphics/SVGResourceMarker.cpp:
        (WebCore::SVGResourceMarker::draw): Ditto
        * xml/XMLHttpRequest.cpp:
        (WebCore::preflightResultCache): Ditto
        (WebCore::isSafeRequestHeader): Ditto
        (WebCore::isOnAccessControlResponseHeaderWhitelist): Ditto
        * xml/XPathExpressionNode.cpp:
        (WebCore::XPath::Expression::evaluationContext): Ditto
        * xml/XPathParser.cpp:
        (WebCore::XPath::isAxisName): Ditto
        (WebCore::XPath::isNodeTypeName): Ditto
        * xml/XPathValue.cpp:
        (WebCore::XPath::Value::toNodeSet): Ditto

WebKit/mac:

2008-11-06  Greg Bolsinga  <bolsinga@apple.com>

        Reviewed by Darin Adler.

        Bug 21810: Remove use of static C++ objects that are destroyed at exit time (destructors)
        https://bugs.webkit.org/show_bug.cgi?id=21810

        * History/WebBackForwardList.mm:
        (backForwardLists): Changed to leak an object to avoid an exit-time destructor.
        * History/WebHistoryItem.mm:
        (historyItemWrappers): Ditto
        * Misc/WebStringTruncator.m:
        (fontFromNSFont): Ditto
        * Plugins/WebBaseNetscapePluginStream.mm:
        (streams): Ditto
        * WebView/WebView.mm:
        (aeDescFromJSValue): Ditto

WebKitTools:

2008-11-06  Greg Bolsinga  <bolsinga@apple.com>

        Reviewed by Darin Adler.

        Bug 21810: Remove use of static C++ objects that are destroyed at exit time (destructors)
        https://bugs.webkit.org/show_bug.cgi?id=21810

        Remove .o files from the exclude list that have had their exit-time destructors removed.

        * Scripts/check-for-exit-time-destructors:

Canonical link: https://commits.webkit.org/30407@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@38189 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
ddkilzer committed Nov 6, 2008
1 parent 5c1efa9 commit bb3a4c781e626f971e13769fcdb822d351d071c9
Showing 83 changed files with 457 additions and 312 deletions.
@@ -1,3 +1,191 @@
2008-11-06 Greg Bolsinga <bolsinga@apple.com>

Reviewed by Darin Adler.

Bug 21810: Remove use of static C++ objects that are destroyed at exit time (destructors)
https://bugs.webkit.org/show_bug.cgi?id=21810

* bindings/js/GCController.cpp:
(WebCore::gcController): Changed to leak an object to avoid an exit-time destructor.
* bindings/js/JSDOMBinding.cpp:
(WebCore::wrapperSet): Ditto
* bindings/js/JSInspectedObjectWrapper.cpp:
(WebCore::wrappers): Ditto
* bindings/js/JSInspectorCallbackWrapper.cpp:
(WebCore::wrappers): Ditto
* bridge/runtime_root.cpp:
(JSC::Bindings::rootObjectSet): Ditto
* css/CSSMutableStyleDeclaration.cpp:
(WebCore::CSSMutableStyleDeclaration::removeProperty): Ditto
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::cssText): Ditto
* css/CSSSelector.cpp:
(WebCore::CSSSelector::extractPseudoType): Ditto
* css/CSSStyleSelector.cpp:
(WebCore::screenEval): Ditto
(WebCore::printEval): Ditto
* dom/DOMImplementation.cpp:
(WebCore::isSVG10Feature): Ditto
(WebCore::isSVG11Feature): Ditto
(WebCore::DOMImplementation::isXMLMIMEType): Ditto
* dom/Document.cpp:
(WebCore::Document::hasPrefixNamespaceMismatch): Ditto
* dom/ScriptElement.cpp:
(WebCore::isSupportedJavaScriptLanguage): Ditto
* editing/ApplyStyleCommand.cpp:
(WebCore::styleSpanClassString): Ditto
* editing/HTMLInterchange.cpp:
(WebCore::): Ditto
* editing/IndentOutdentCommand.cpp:
(WebCore::indentBlockquoteString): Ditto
* editing/ReplaceSelectionCommand.cpp:
(WebCore::isInterchangeNewlineNode): Ditto
(WebCore::isInterchangeConvertedSpaceSpan): Ditto
* editing/htmlediting.cpp:
(WebCore::stringWithRebalancedWhitespace): Ditto
(WebCore::nonBreakingSpaceString): Ditto
* editing/markup.cpp:
(WebCore::appendAttributeValue): Ditto
(WebCore::appendEscapedContent): Ditto
(WebCore::shouldAddNamespaceAttr): Ditto
(WebCore::appendNamespace): Ditto
(WebCore::appendStartMarkup): Ditto
(WebCore::createMarkup): Ditto
* html/HTMLButtonElement.cpp:
(WebCore::HTMLButtonElement::type): Ditto
* html/HTMLElement.cpp:
(WebCore::HTMLElement::isRecognizedTagName): Ditto
(WebCore::inlineTagList): Ditto
(WebCore::blockTagList): Ditto
* html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::type): Ditto
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::type): Ditto
* html/HTMLKeygenElement.cpp:
(WebCore::HTMLKeygenElement::type): Ditto
* html/HTMLLegendElement.cpp:
(WebCore::HTMLLegendElement::type): Ditto
* html/HTMLOptGroupElement.cpp:
(WebCore::HTMLOptGroupElement::type): Ditto
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::type): Ditto
* html/HTMLParser.cpp:
(WebCore::HTMLParser::getNode): Ditto
(WebCore::HTMLParser::isHeaderTag): Ditto
(WebCore::HTMLParser::isResidualStyleTag): Ditto
(WebCore::HTMLParser::isAffectedByResidualStyle): Ditto
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::type): Ditto
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::type): Ditto
* inspector/InspectorController.cpp:
(WebCore::platform): Ditto
* inspector/JavaScriptDebugServer.cpp:
(WebCore::JavaScriptDebugServer::shared): Ditto
* inspector/JavaScriptProfile.cpp:
(WebCore::profileCache): Ditto
* inspector/JavaScriptProfileNode.cpp:
(WebCore::profileNodeCache): Ditto
* loader/FrameLoader.cpp:
(WebCore::localSchemes): Ditto
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::cacheStorage): Ditto
* loader/archive/ArchiveFactory.cpp:
(WebCore::archiveMIMETypes): Ditto
* loader/icon/IconDatabase.cpp:
(WebCore::IconDatabase::defaultDatabaseFilename): Ditto
* page/EventHandler.cpp:
(WebCore::EventHandler::dragState): Ditto
* page/Frame.cpp:
(WebCore::createRegExpForLabels): Ditto
(WebCore::keepAliveSet): Ditto
* page/Page.cpp:
(WebCore::Page::groupName): Ditto
* page/SecurityOrigin.cpp:
(WebCore::isDefaultPortForProtocol): Ditto
(WebCore::SecurityOrigin::databaseIdentifier): Ditto
* page/mac/FrameMac.mm:
(WebCore::regExpForLabels): Ditto
* platform/KURL.cpp:
(WebCore::blankURL): Ditto
* platform/graphics/FontCache.cpp:
(WebCore::alternateFamilyName): Ditto
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::FontCache::getSimilarFontPlatformData): Ditto
(WebCore::FontCache::getLastResortFallbackFont): Ditto
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarTheme::nativeTheme): Ditto
* platform/mac/ThemeMac.mm:
(WebCore::platformTheme): Ditto
* platform/mac/ThreadCheck.mm:
(WebCoreReportThreadViolation): Ditto
* platform/network/NetworkStateNotifier.cpp:
(WebCore::networkStateNotifier): Ditto
* platform/network/mac/FormDataStreamMac.mm:
(WebCore::getStreamFormDataMap): Ditto
(WebCore::getStreamResourceHandleMap): Ditto
* platform/network/mac/ResourceResponseMac.mm:
(WebCore::ResourceResponse::platformLazyInit): Ditto
* platform/text/TextEncoding.cpp:
(WebCore::TextEncoding::isJapanese): Ditto
* rendering/RenderBlock.cpp:
(WebCore::continuationOutlineTable): Ditto
* rendering/RenderCounter.cpp:
(WebCore::counterMaps): Ditto
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutVerticalBox): Ditto
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::markerText): Ditto
* rendering/RenderScrollbarTheme.cpp:
(WebCore::RenderScrollbarTheme::renderScrollbarTheme): Ditto
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::systemFont): Ditto
* rendering/bidi.cpp:
(WebCore::RenderBlock::checkLinesForTextOverflow): Ditto
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::initialDashboardRegions): Ditto
(WebCore::RenderStyle::noneDashboardRegions): Ditto
* storage/LocalStorage.cpp:
(WebCore::localStorageMap): Ditto
* svg/SVGAnimateMotionElement.cpp:
(WebCore::SVGAnimateMotionElement::rotateMode): Ditto
* svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::calcMode): Ditto
(WebCore::SVGAnimationElement::attributeType): Ditto
(WebCore::SVGAnimationElement::isAdditive): Ditto
(WebCore::SVGAnimationElement::isAccumulated): Ditto
* svg/SVGLangSpace.cpp:
(WebCore::SVGLangSpace::xmlspace): Ditto
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::contentScriptType): Ditto
(WebCore::SVGSVGElement::contentStyleType): Ditto
* svg/SVGStyleElement.cpp:
(WebCore::SVGStyleElement::type): Ditto
(WebCore::SVGStyleElement::media): Ditto
* svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::parseMappedAttribute): Ditto
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::parseClockValue): Ditto
(WebCore::SVGSMILElement::restart): Ditto
(WebCore::SVGSMILElement::fill): Ditto
(WebCore::SVGSMILElement::repeatCount): Ditto
(WebCore::SVGSMILElement::notifyDependentsIntervalChanged): Ditto
* svg/graphics/SVGResource.cpp:
(WebCore::clientMap): Ditto
* svg/graphics/SVGResourceMarker.cpp:
(WebCore::SVGResourceMarker::draw): Ditto
* xml/XMLHttpRequest.cpp:
(WebCore::preflightResultCache): Ditto
(WebCore::isSafeRequestHeader): Ditto
(WebCore::isOnAccessControlResponseHeaderWhitelist): Ditto
* xml/XPathExpressionNode.cpp:
(WebCore::XPath::Expression::evaluationContext): Ditto
* xml/XPathParser.cpp:
(WebCore::XPath::isAxisName): Ditto
(WebCore::XPath::isNodeTypeName): Ditto
* xml/XPathValue.cpp:
(WebCore::XPath::Value::toNodeSet): Ditto

2008-11-06 Tor Arne Vestbø <tavestbo@trolltech.com>

Rubber-stamped by Simon Hausmann.
@@ -52,7 +52,7 @@ static void* collect(void*)

GCController& gcController()
{
static GCController staticGCController;
static GCController& staticGCController = *new GCController;
return staticGCController;
}

@@ -97,10 +97,10 @@ static inline void removeWrappers(const JSWrapperCache&)
static HashSet<DOMObject*>& wrapperSet()
{
#if ENABLE(WORKERS)
static ThreadSpecific<HashSet<DOMObject*> > staticWrapperSet;
static ThreadSpecific<HashSet<DOMObject*> >& staticWrapperSet = *new ThreadSpecific<HashSet<DOMObject*> >;
return *staticWrapperSet;
#else
static HashSet<DOMObject*> staticWrapperSet;
static HashSet<DOMObject*>& staticWrapperSet = *new HashSet<DOMObject*>;
return staticWrapperSet;
#endif
}
@@ -40,7 +40,7 @@ typedef HashMap<JSGlobalObject*, WrapperMap*> GlobalObjectWrapperMap;

static GlobalObjectWrapperMap& wrappers()
{
static GlobalObjectWrapperMap map;
static GlobalObjectWrapperMap& map = *new GlobalObjectWrapperMap;
return map;
}

@@ -38,7 +38,7 @@ typedef HashMap<JSObject*, JSInspectorCallbackWrapper*> WrapperMap;

static WrapperMap& wrappers()
{
static WrapperMap map;
static WrapperMap& map = *new WrapperMap;
return map;
}

@@ -42,7 +42,7 @@ typedef HashSet<RootObject*> RootObjectSet;

static RootObjectSet* rootObjectSet()
{
static RootObjectSet staticRootObjectSet;
static RootObjectSet& staticRootObjectSet = *new RootObjectSet;
return &staticRootObjectSet;
}

@@ -501,7 +501,7 @@ String CSSMutableStyleDeclaration::removeProperty(int propertyID, bool notifyCha
{
ec = 0;

static HashMap<int, PropertyLonghand> shorthandMap;
static HashMap<int, PropertyLonghand>& shorthandMap = *new HashMap<int, PropertyLonghand>;
if (shorthandMap.isEmpty())
initShorthandMap(shorthandMap);

@@ -686,7 +686,7 @@ String CSSPrimitiveValue::cssText() const
// FIXME: Add list-style and separator
break;
case CSS_RECT: {
static const String rectParen("rect(");
static const String& rectParen = *new String("rect(");

Rect* rectVal = getRectValue();
Vector<UChar> result;
@@ -709,9 +709,9 @@ String CSSPrimitiveValue::cssText() const
}
case CSS_RGBCOLOR:
case CSS_PARSER_HEXCOLOR: {
static const String commaSpace(", ");
static const String rgbParen("rgb(");
static const String rgbaParen("rgba(");
static const String& commaSpace = *new String(", ");
static const String& rgbParen = *new String("rgb(");
static const String& rgbaParen = *new String("rgba(");

RGBA32 rgbColor = m_value.rgbcolor;
if (m_type == CSS_PARSER_HEXCOLOR)

0 comments on commit bb3a4c7

Please sign in to comment.