Changeset 206899 in webkit for trunk/Source/JavaScriptCore/dfg/DFGDOMJITPatchpointParams.cpp
- Timestamp:
- Oct 6, 2016, 10:07:13 PM (9 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/dfg/DFGDOMJITPatchpointParams.cpp
r206898 r206899 24 24 */ 25 25 26 #pragma once 26 #include "config.h" 27 #include "DFGDOMJITPatchpointParams.h" 27 28 28 #if ENABLE( JIT)29 #if ENABLE(DFG_JIT) 29 30 30 #include "CCallHelpers.h" 31 #include "DOMJITReg.h" 32 #include "RegisterSet.h" 31 #include "DFGSlowPathGenerator.h" 32 #include "DFGSpeculativeJIT.h" 33 33 34 namespace JSC { namespace D OMJIT{34 namespace JSC { namespace DFG { 35 35 36 class PatchpointParams { 37 WTF_MAKE_NONCOPYABLE(PatchpointParams); 38 public: 39 virtual ~PatchpointParams() { } 36 template<typename OperationType, typename ResultType, typename Arguments, size_t... ArgumentsIndex> 37 static void dispatch(SpeculativeJIT* jit, CCallHelpers::JumpList from, OperationType operation, ResultType result, Arguments arguments, std::index_sequence<ArgumentsIndex...>) 38 { 39 jit->addSlowPathGenerator(slowPathCall(from, jit, operation, result, std::get<ArgumentsIndex>(arguments)...)); 40 } 40 41 41 unsigned size() const { return m_regs.size(); } 42 const Reg& at(unsigned index) const { return m_regs[index]; } 43 const Reg& operator[](unsigned index) const { return at(index); } 42 #define JSC_DEFINE_CALL_OPERATIONS(OperationType, ResultType, ...) \ 43 void DOMJITPatchpointParams::addSlowPathCallImpl(CCallHelpers::JumpList from, CCallHelpers&, OperationType operation, ResultType result, std::tuple<__VA_ARGS__> args) const \ 44 { \ 45 dispatch(m_jit, from, operation, result, args, std::make_index_sequence<std::tuple_size<decltype(args)>::value>()); \ 46 } \ 44 47 45 GPRReg gpScratch(unsigned index) const { return m_gpScratch[index]; } 46 FPRReg fpScratch(unsigned index) const { return m_fpScratch[index]; } 47 48 PatchpointParams(Vector<Reg>&& regs, Vector<GPRReg>&& gpScratch, Vector<FPRReg>&& fpScratch) 49 : m_regs(WTFMove(regs)) 50 , m_gpScratch(WTFMove(gpScratch)) 51 , m_fpScratch(WTFMove(fpScratch)) 52 { 53 } 54 55 private: 56 57 Vector<Reg> m_regs; 58 Vector<GPRReg> m_gpScratch; 59 Vector<FPRReg> m_fpScratch; 60 }; 48 DOMJIT_SLOW_PATH_CALLS(JSC_DEFINE_CALL_OPERATIONS) 49 #undef JSC_DEFINE_CALL_OPERATIONS 61 50 62 51 } }
Note:
See TracChangeset
for help on using the changeset viewer.