Move all Structure out-of-line inline methods to StructureInlines.h
authorfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Feb 2013 06:28:54 +0000 (06:28 +0000)
committerfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Feb 2013 06:28:54 +0000 (06:28 +0000)
commit5f843abbe788b91d269acdb197134d270ea883ac
treef80e47abb74c1cadcb8657873bdeec7a859e8a61
parentcd0c19a6798c4deae4b8bb484db219eb1cddce72
Move all Structure out-of-line inline methods to StructureInlines.h
https://bugs.webkit.org/show_bug.cgi?id=110024

Source/JavaScriptCore:

Rubber stamped by Mark Hahnenberg and Sam Weinig.

This was supposed to be easy.

But, initially, there was a Structure inline method in CodeBlock.h, and moving that
into StructureInlines.h meant that Operations.h included CodeBlock.h. This would
cause WebCore build failures, because CodeBlock.h transitively included the JSC
parser (via many, many paths), and the JSC parser defines tokens using enumeration
elements that CSSGrammar.cpp (generated by bison) would #define. For example,
bison would give CSSGrammar.cpp a #define FUNCTION 123, and would do so before
including anything interesting. The JSC parser would have an enum that included
FUNCTION as an element. Hence the JSC parser included into CSSGrammar.cpp would have
a token element called FUNCTION declared in an enumeration, but FUNCTION was
#define'd to 123, leading to a parser error.

Wow.

So I removed all transitive include paths from CodeBlock.h to the JSC Parser. I
believe I was able to do so without out-of-lining anything interesting or performance
critical. This is probably a purely good thing to have done: it will be nice to be
able to make changes to the parser without having to compile the universe.

Of course, doing this caused a bunch of other things to not compile, since a bunch of
headers relied on things being implicitly included for them when they transitively
included the parser. I fixed a lot of that.

Finally, I ended up removing the method that depended on CodeBlock.h from
StructureInlines.h, and putting it in Structure.cpp. That might seem like all of this
was a waste of time, except that I suspect it was a worthwhile forcing function for
cleaning up a bunch of cruft.

* API/JSCallbackFunction.cpp:
* CMakeLists.txt:
* GNUmakefile.list.am:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Target.pri:
* bytecode/CodeBlock.h:
(JSC):
* bytecode/EvalCodeCache.h:
* bytecode/SamplingTool.h:
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedFunctionExecutable::parameterCount):
(JSC):
* bytecode/UnlinkedCodeBlock.h:
(UnlinkedFunctionExecutable):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/Label.h:
(JSC):
* dfg/DFGByteCodeParser.cpp:
* dfg/DFGByteCodeParser.h:
* dfg/DFGFPRInfo.h:
* dfg/DFGRegisterBank.h:
* heap/HandleStack.cpp:
* jit/JITWriteBarrier.h:
* parser/Nodes.h:
(JSC):
* parser/Parser.h:
* parser/ParserError.h: Added.
(JSC):
(JSC::ParserError::ParserError):
(ParserError):
(JSC::ParserError::toErrorObject):
* parser/ParserModes.h:
* parser/SourceProvider.cpp: Added.
(JSC):
(JSC::SourceProvider::SourceProvider):
(JSC::SourceProvider::~SourceProvider):
* parser/SourceProvider.h:
(JSC):
(SourceProvider):
* runtime/ArrayPrototype.cpp:
* runtime/DatePrototype.cpp:
* runtime/Executable.h:
* runtime/JSGlobalObject.cpp:
* runtime/JSGlobalObject.h:
(JSC):
* runtime/Operations.h:
* runtime/Structure.cpp:
(JSC::Structure::prototypeForLookup):
(JSC):
* runtime/Structure.h:
(JSC):
* runtime/StructureInlines.h: Added.
(JSC):
(JSC::Structure::create):
(JSC::Structure::createStructure):
(JSC::Structure::get):
(JSC::Structure::masqueradesAsUndefined):
(JSC::SlotVisitor::internalAppend):
(JSC::Structure::transitivelyTransitionedFrom):
(JSC::Structure::setEnumerationCache):
(JSC::Structure::enumerationCache):
(JSC::Structure::prototypeForLookup):
(JSC::Structure::prototypeChain):
(JSC::Structure::isValid):
* runtime/StructureRareData.cpp:

Source/WebCore:

Rubber stamped by Sam Weinig.

No new tests because no new behavior. Just rewiring includes.

* ForwardingHeaders/parser/SourceProviderCache.h: Added.
* loader/cache/CachedScript.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@143147 268f45cc-cd09-0410-ab3c-d52691b4dbfc
39 files changed:
Source/JavaScriptCore/API/JSCallbackFunction.cpp
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/GNUmakefile.list.am
Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/Target.pri
Source/JavaScriptCore/bytecode/CodeBlock.h
Source/JavaScriptCore/bytecode/EvalCodeCache.h
Source/JavaScriptCore/bytecode/SamplingTool.h
Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp
Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h
Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
Source/JavaScriptCore/bytecompiler/Label.h
Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
Source/JavaScriptCore/dfg/DFGByteCodeParser.h
Source/JavaScriptCore/dfg/DFGFPRInfo.h
Source/JavaScriptCore/dfg/DFGRegisterBank.h
Source/JavaScriptCore/heap/HandleStack.cpp
Source/JavaScriptCore/jit/JITWriteBarrier.h
Source/JavaScriptCore/parser/Nodes.h
Source/JavaScriptCore/parser/Parser.h
Source/JavaScriptCore/parser/ParserError.h [new file with mode: 0644]
Source/JavaScriptCore/parser/ParserModes.h
Source/JavaScriptCore/parser/SourceProvider.cpp [new file with mode: 0644]
Source/JavaScriptCore/parser/SourceProvider.h
Source/JavaScriptCore/runtime/ArrayPrototype.cpp
Source/JavaScriptCore/runtime/DatePrototype.cpp
Source/JavaScriptCore/runtime/Executable.h
Source/JavaScriptCore/runtime/JSGlobalObject.cpp
Source/JavaScriptCore/runtime/JSGlobalObject.h
Source/JavaScriptCore/runtime/Operations.h
Source/JavaScriptCore/runtime/Structure.cpp
Source/JavaScriptCore/runtime/Structure.h
Source/JavaScriptCore/runtime/StructureInlines.h [new file with mode: 0644]
Source/JavaScriptCore/runtime/StructureRareData.cpp
Source/WebCore/ChangeLog
Source/WebCore/ForwardingHeaders/parser/SourceProviderCache.h [new file with mode: 0644]
Source/WebCore/loader/cache/CachedScript.cpp