• oliver@apple.com's avatar
    fourthTier: JSC's disassembly infrastructure should be able to disassemble the... · 49a2bafa
    oliver@apple.com authored
    fourthTier: JSC's disassembly infrastructure should be able to disassemble the code that LLVM generates
    Reviewed by Anders Carlsson.
    Oh boy. UDis86 cannot disassemble the AVX (or whatever it's called) stuff
    that LLVM generates for floating point. So the right decision is to
    switch to the LLVM disassembler, right? Wrong!! LLVM's disassembler
    cannot disassemble the load-from-absolute-address-into-%rax instructions
    that our JIT generates quite a lot of.
    So, this keeps the UDis86 disassembler, but adds the LLVM disassembler,
    and requires the caller of disassemble() to hint which one is likely to
    be less wrong for the given code.
    Maybe in the future LLVM will catch up to UDis86, but it's definitely not
    there right now.
    This now allows us to disassemble all of the code that LLVM generates.
    * JavaScriptCore.xcodeproj/project.pbxproj:
    * disassembler/Disassembler.cpp:
    * disassembler/Disassembler.h:
    * disassembler/LLVMDisassembler.cpp: Added.
    * disassembler/LLVMDisassembler.h: Added.
    * disassembler/UDis86Disassembler.cpp:
    * disassembler/UDis86Disassembler.h: Added.
    * disassembler/X86Disassembler.cpp: Added.
    * ftl/FTLAbbreviatedTypes.h:
    * ftl/FTLCompile.cpp:
    * ftl/FTLJITCode.h:
    * ftl/FTLJITFinalizer.h:
    * ftl/FTLLLVMHeaders.h: Removed.
    * ftl/FTLLink.cpp:
    * runtime/InitializeThreading.cpp:
    * runtime/Options.h:
    Reviewed by Anders Carlsson.
    We now use LLVM for two things: disassembler and FTL. Separate out the question
    of whether we have LLVM (HAVE(LLVM)) from whether we want to use the LLVM
    disassembler (USE(LLVM_DISASSEMBLER)) and whether we enable the FTL
    Also move the cruft for including LLVM headers into WTF since now we use it in
    a bunch of places, not all related to FTL. There's no obvious place to put that
    file in JSC so I put it in WTF.
    * WTF.xcodeproj/project.pbxproj:
    * wtf/LLVMHeaders.h: Copied from Source/JavaScriptCore/ftl/FTLLLVMHeaders.h.
    * wtf/Platform.h:
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153256 268f45cc-cd09-0410-ab3c-d52691b4dbfc