Ignore:
Timestamp:
Oct 10, 2013, 3:57:10 PM (12 years ago)
Author:
[email protected]
Message:

OSR exit using llvm.webkit.stackmap should pass more tests
https://bugs.webkit.org/show_bug.cgi?id=122518

Reviewed by Mark Hahnenberg.

  • Make the X86Assembler capable of dealing with all XMM registers.


  • Make the StackMaps code on WebKit's side capable of dealing with XMM registers.


  • Factor out most of the smarts of StackMaps::Location into a self-contained object. Previously you needed both StackMaps::Location and a StackMaps reference to do most things since the Location might have referred to a constant. Now you can just get a self-contained Location object.


  • Fix a bug where OSR exit generation thunk generator was assuming that the call frame register is already in argumentGPR0. In the future, the call frame will just be the machine FP and we won't have to do anything special. But for now the "call frame" is just a normal value in LLVM IR and may end up in any register. Make the OSR exit generation thunk generator polymorphic over the call frame argument's Location.


  • Move the stuff that depends on the polymorphic OSR exit generation thunk generator into the finalizer, since generating and linking one of those thunks requires a cache flush and we need to do that on the main thread.
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • assembler/ARMv7Assembler.h:

(JSC::ARMv7Assembler::firstRegister):
(JSC::ARMv7Assembler::lastRegister):
(JSC::ARMv7Assembler::firstFPRegister):
(JSC::ARMv7Assembler::lastFPRegister):

  • assembler/AbstractMacroAssembler.h:

(JSC::AbstractMacroAssembler::firstFPRegister):
(JSC::AbstractMacroAssembler::lastFPRegister):

  • assembler/MacroAssembler.h:

(JSC::MacroAssembler::nextFPRegister):

  • assembler/MacroAssemblerARMv7.h:
  • assembler/MacroAssemblerX86Common.h:
  • assembler/X86Assembler.h:

(JSC::X86Assembler::firstFPRegister):
(JSC::X86Assembler::lastFPRegister):

  • dfg/DFGDriver.cpp:

(JSC::DFG::compileImpl):

  • ftl/FTLCompile.cpp:

(JSC::FTL::fixFunctionBasedOnStackMaps):

  • ftl/FTLExitThunkGenerator.cpp:

(JSC::FTL::ExitThunkGenerator::emitThunk):
(JSC::FTL::ExitThunkGenerator::emitThunks):

  • ftl/FTLJITFinalizer.cpp:

(JSC::FTL::JITFinalizer::finalizeFunction):

  • ftl/FTLJITFinalizer.h:
  • ftl/FTLLink.cpp:

(JSC::FTL::link):

  • ftl/FTLLocation.cpp: Added.

(JSC::FTL::Location::forStackmaps):
(JSC::FTL::Location::dump):
(JSC::FTL::Location::involvesGPR):
(JSC::FTL::Location::isGPR):
(JSC::FTL::Location::gpr):
(JSC::FTL::Location::isFPR):
(JSC::FTL::Location::fpr):
(JSC::FTL::Location::restoreInto):
(WTF::printInternal):

  • ftl/FTLLocation.h: Added.

(JSC::FTL::Location::Location):
(JSC::FTL::Location::forRegister):
(JSC::FTL::Location::forIndirect):
(JSC::FTL::Location::forConstant):
(JSC::FTL::Location::kind):
(JSC::FTL::Location::hasDwarfRegNum):
(JSC::FTL::Location::dwarfRegNum):
(JSC::FTL::Location::hasOffset):
(JSC::FTL::Location::offset):
(JSC::FTL::Location::hasConstant):
(JSC::FTL::Location::constant):
(JSC::FTL::Location::operator!):
(JSC::FTL::Location::isHashTableDeletedValue):
(JSC::FTL::Location::operator==):
(JSC::FTL::Location::hash):
(JSC::FTL::LocationHash::hash):
(JSC::FTL::LocationHash::equal):

  • ftl/FTLLowerDFGToLLVM.cpp:

(JSC::FTL::LowerDFGToLLVM::appendOSRExit):
(JSC::FTL::LowerDFGToLLVM::linkOSRExitsAndCompleteInitializationBlocks):

  • ftl/FTLSaveRestore.cpp:

(JSC::FTL::bytesForFPRs):
(JSC::FTL::requiredScratchMemorySizeInBytes):
(JSC::FTL::offsetOfFPR):
(JSC::FTL::saveAllRegisters):
(JSC::FTL::restoreAllRegisters):

  • ftl/FTLSaveRestore.h:
  • ftl/FTLStackMaps.cpp:

(JSC::FTL::StackMaps::Location::restoreInto):

  • ftl/FTLStackMaps.h:
  • ftl/FTLState.h:
  • ftl/FTLThunks.cpp:

(JSC::FTL::osrExitGenerationWithoutStackMapThunkGenerator):
(JSC::FTL::osrExitGenerationWithStackMapThunkGenerator):

  • ftl/FTLThunks.h:

(JSC::FTL::generateIfNecessary):
(JSC::FTL::Thunks::getOSRExitGenerationThunk):

  • runtime/VM.cpp:

(JSC::VM::VM):

  • runtime/VM.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/assembler/X86Assembler.h

    r157209 r157264  
    7575        xmm6,
    7676        xmm7,
     77
     78#if CPU(X86_64)
     79        xmm8,
     80        xmm9,
     81        xmm10,
     82        xmm11,
     83        xmm12,
     84        xmm13,
     85        xmm14,
     86        xmm15,
     87#endif
    7788    } XMMRegisterID;
    7889
     
    127138public:
    128139    typedef X86Registers::RegisterID RegisterID;
     140   
    129141    static RegisterID firstRegister() { return X86Registers::eax; }
    130142    static RegisterID lastRegister()
     
    139151    typedef X86Registers::XMMRegisterID XMMRegisterID;
    140152    typedef XMMRegisterID FPRegisterID;
     153   
     154    static FPRegisterID firstFPRegister() { return X86Registers::xmm0; }
     155    static FPRegisterID lastFPRegister()
     156    {
     157#if CPU(X86_64)
     158        return X86Registers::xmm15;
     159#else
     160        return X86Registers::xmm7;
     161#endif
     162    }
    141163
    142164    typedef enum {
Note: See TracChangeset for help on using the changeset viewer.