• fpizlo@apple.com's avatar
    CodeBlock::jettison() should be implicit · 195d7b84
    fpizlo@apple.com authored
    Reviewed by Oliver Hunt.
    This is a risky change from a performance standpoint, but I believe it's
    necessary. This makes all CodeBlocks get swept by GC. Nobody but the GC
    can delete CodeBlocks because the GC always holds a reference to them.
    Once a CodeBlock reaches just one reference (i.e. the one from the GC)
    then the GC will free it only if it's not on the stack.
    This allows me to get rid of the jettisoning logic. We need this for FTL
    tier-up. Well; we don't need it, but it will help prevent a lot of bugs.
    Previously, if you wanted to to replace one code block with another, you
    had to remember to tell the GC that the previous code block is
    "jettisoned". We would need to do this when tiering up from DFG to FTL
    and when dealing with DFG-to-FTL OSR entry code blocks. There are a lot
    of permutations here - tiering up to the FTL, OSR entering into the FTL,
    deciding that an OSR entry code block is not relevant anymore - just to
    name a few. In each of these cases we'd have to jettison the previous
    code block. It smells like a huge source of future bugs.
    So I made jettisoning implicit by making the GC always watch out for a
    CodeBlock being owned solely by the GC.
    This change is performance neutral.
    * CMakeLists.txt:
    * GNUmakefile.list.am:
    * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
    * JavaScriptCore.xcodeproj/project.pbxproj:
    * Target.pri:
    * bytecode/CodeBlock.cpp:
    * bytecode/CodeBlock.h:
    * dfg/DFGCommonData.h:
    * heap/CodeBlockSet.cpp: Added.
    * heap/CodeBlockSet.h: Added.
    * heap/ConservativeRoots.cpp:
    * heap/ConservativeRoots.h:
    * heap/DFGCodeBlocks.cpp: Removed.
    * heap/DFGCodeBlocks.h: Removed.
    * heap/Heap.cpp:
    * heap/Heap.h:
    * interpreter/JSStack.cpp:
    * interpreter/JSStack.h:
    * runtime/Executable.cpp:
    * runtime/Executable.h:
    * runtime/VM.h:
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154986 268f45cc-cd09-0410-ab3c-d52691b4dbfc
GNUmakefile.list.am 54.9 KB