Use the JITAddGenerator snippet in the FTL.
authormark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Dec 2015 19:20:12 +0000 (19:20 +0000)
committermark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Dec 2015 19:20:12 +0000 (19:20 +0000)
commit871edc3982ad404a50393a3f35a173fb932de3a6
treee35cbb01cd39af31633d98a679e3c564d5c4d641
parentdbc803fc0f5addcb3560ab815f018ad674ae204d
Use the JITAddGenerator snippet in the FTL.
https://bugs.webkit.org/show_bug.cgi?id=151519

Reviewed by Geoffrey Garen.

One detail about how we choosing to handle operands to the binary snippets that
may be constant: the slow path call to a C++ function still needs the constant
operand loaded in a register.  To simplify things, we're choosing to always tell
LLVM to load the operands into registers even if they may be constant.  However,
even though a constant operand is preloaded in a register, the snippet generator
will not be made aware of it.  It will continue to load the constant as an
immediate.

* ftl/FTLCompile.cpp:
* ftl/FTLCompileBinaryOp.cpp:
(JSC::FTL::generateArithSubFastPath):
(JSC::FTL::generateValueAddFastPath):
- generateValueAddFastPath() currently is an exact copy of generateArithSubFastPath()
  except that it uses JITAddGenerator instead of JITSubGenerator.  When we add
  support for JITMulGenerator later, the code will start to vary.  We'll refactor
  these functions then when we have more insight into what needs to vary between
  the implementations.

* ftl/FTLCompileBinaryOp.h:
* ftl/FTLInlineCacheDescriptor.h:
* ftl/FTLInlineCacheDescriptorInlines.h:
(JSC::FTL::ValueAddDescriptor::ValueAddDescriptor):
(JSC::FTL::ValueAddDescriptor::icSize):
* ftl/FTLInlineCacheSize.cpp:
(JSC::FTL::sizeOfValueAdd):
* ftl/FTLInlineCacheSize.h:
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::lower):
(JSC::FTL::DFG::LowerDFGToLLVM::compileValueAdd):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192950 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/ftl/FTLCompile.cpp
Source/JavaScriptCore/ftl/FTLCompileBinaryOp.cpp
Source/JavaScriptCore/ftl/FTLCompileBinaryOp.h
Source/JavaScriptCore/ftl/FTLInlineCacheDescriptor.h
Source/JavaScriptCore/ftl/FTLInlineCacheDescriptorInlines.h
Source/JavaScriptCore/ftl/FTLInlineCacheSize.cpp
Source/JavaScriptCore/ftl/FTLInlineCacheSize.h
Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp