• fpizlo@apple.com's avatar
    Move all Structure out-of-line inline methods to StructureInlines.h · bb8aa756
    fpizlo@apple.com authored
    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: http://svn.webkit.org/repository/webkit/trunk@143147 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    bb8aa756
JSGlobalObject.h 22.6 KB