fourthTier: FTL should be able to generate LLVM IR that uses an intrinsic for OSR...
authoroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Jul 2013 04:05:18 +0000 (04:05 +0000)
committeroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Jul 2013 04:05:18 +0000 (04:05 +0000)
commit8dfa41db5b630be989eec875b52befe5fc41f347
tree4f588839463056175cf3f00deebf3894efac0528
parentceaf5a437e500032285c5896730589155631aa5c
fourthTier: FTL should be able to generate LLVM IR that uses an intrinsic for OSR exit
https://bugs.webkit.org/show_bug.cgi?id=118948

Source/JavaScriptCore:

Reviewed by Sam Weinig.

- Add the ability to generate LLVM IR but then not use it, via --llvmAlwaysFails=true.
  This allows doing "what if" experiments with IR generation, even if the generated IR
  can't yet execute.

- Add an OSR exit path that just calls an intrinsic that combines the branch and the
  off-ramp.

* JavaScriptCore.xcodeproj/project.pbxproj:
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::compileInThreadImpl):
* ftl/FTLFail.cpp: Added.
(FTL):
(JSC::FTL::fail):
* ftl/FTLFail.h: Added.
(FTL):
* ftl/FTLIntrinsicRepository.h:
(FTL):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::appendOSRExit):
(JSC::FTL::LowerDFGToLLVM::emitOSRExitCall):
* runtime/Options.h:
(JSC):

Tools:

Reviewed by Sam Weinig.

- Make ReducedFTL capable of dealing with code that uses the fake OSR exit intrinsic,
  by exporting it as a function.

- Make combineModules.rb idempotent. Sometimes it's convenient to run a file through
  it even if you know that you've already done so. See processIRDump.sh.

- Add a script, processIRDump.sh, that takes the output of --dumpLLVMIR=true and
  runs it through ReducedFTL automatically. You typically want to say something like:

  jsc --dumpLLVMIR=true <program(s)> > jsc-output.txt
  ./processIRDump.sh --timing < jsc-output.txt

* ReducedFTL/ReducedFTL.c:
(webkit_osr_exit):
* ReducedFTL/combineModules.rb:
* ReducedFTL/processIRDump.sh: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153289 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/dfg/DFGPlan.cpp
Source/JavaScriptCore/ftl/FTLFail.cpp [new file with mode: 0644]
Source/JavaScriptCore/ftl/FTLFail.h [new file with mode: 0644]
Source/JavaScriptCore/ftl/FTLIntrinsicRepository.h
Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp
Source/JavaScriptCore/runtime/Options.h
Tools/ChangeLog
Tools/ReducedFTL/ReducedFTL.c
Tools/ReducedFTL/combineModules.rb
Tools/ReducedFTL/processIRDump.sh [new file with mode: 0755]