Changeset 192989 in webkit
- Timestamp:
- Dec 2, 2015 7:29:24 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r192983 r192989 1 2015-12-02 Alex Christensen <achristensen@webkit.org> 2 3 Reduce size of ScriptElement 4 https://bugs.webkit.org/show_bug.cgi?id=151786 5 6 Reviewed by Andreas Kling. 7 8 * dom/ScriptElement.cpp: 9 (WebCore::ScriptElement::ScriptElement): 10 (WebCore::ScriptElement::requestScript): 11 * dom/ScriptElement.h: 12 Use callOnMainThread instead of a Timer to save memory on a timer that is rarely used. 13 Use bit fields for the boolean values to save another 8 bytes per ScriptElement. 14 This reduces sizeof(ScriptElement) from 168 to 48 bytes. 15 1 16 2015-12-02 Alex Christensen <achristensen@webkit.org> 2 17 -
trunk/Source/WebCore/dom/ScriptElement.cpp
r192983 r192989 60 60 , m_startLineNumber(WTF::OrdinalNumber::beforeFirst()) 61 61 , m_parserInserted(parserInserted) 62 , m_isExternalScript(false) 62 63 , m_alreadyStarted(alreadyStarted) 64 , m_haveFiredLoad(false) 65 , m_willBeParserExecuted(false) 66 , m_readyToBeParserExecuted(false) 67 , m_willExecuteWhenDocumentFinishedParsing(false) 63 68 , m_forceAsync(!parserInserted) 64 , m_errorEventTimer(*this, &ScriptElement::dispatchErrorEvent) 69 , m_willExecuteInOrder(false) 70 , m_requestUsesAccessControl(false) 65 71 { 66 72 if (parserInserted && m_element.document().scriptableDocumentParser() && !m_element.document().isInDocumentWrite()) … … 270 276 return true; 271 277 272 m_errorEventTimer.startOneShot(0); 278 RefPtr<Element> element = &m_element; 279 callOnMainThread([this, element] { 280 dispatchErrorEvent(); 281 }); 273 282 return false; 274 283 } -
trunk/Source/WebCore/dom/ScriptElement.h
r192983 r192989 99 99 CachedResourceHandle<CachedScript> m_cachedScript; 100 100 WTF::OrdinalNumber m_startLineNumber; 101 bool m_parserInserted { false };102 bool m_isExternalScript { false };103 bool m_alreadyStarted { false };104 bool m_haveFiredLoad { false };105 bool m_willBeParserExecuted { false }; // Same as "The parser will handle executing the script."106 bool m_readyToBeParserExecuted { false };107 bool m_willExecuteWhenDocumentFinishedParsing { false };108 bool m_forceAsync { false };109 bool m_willExecuteInOrder { false };110 bool m_requestUsesAccessControl { false };101 bool m_parserInserted : 1; 102 bool m_isExternalScript : 1; 103 bool m_alreadyStarted : 1; 104 bool m_haveFiredLoad : 1; 105 bool m_willBeParserExecuted : 1; // Same as "The parser will handle executing the script." 106 bool m_readyToBeParserExecuted : 1; 107 bool m_willExecuteWhenDocumentFinishedParsing : 1; 108 bool m_forceAsync : 1; 109 bool m_willExecuteInOrder : 1; 110 bool m_requestUsesAccessControl : 1; 111 111 String m_characterEncoding; 112 112 String m_fallbackCharacterEncoding; 113 Timer m_errorEventTimer;114 113 }; 115 114
Note: See TracChangeset
for help on using the changeset viewer.