X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/2d39b0e377c0896910ee49ae70082ba665faf986..refs/heads/master:/dfg/DFGSlowPathGenerator.h diff --git a/dfg/DFGSlowPathGenerator.h b/dfg/DFGSlowPathGenerator.h index 4e87d4f..add1a23 100644 --- a/dfg/DFGSlowPathGenerator.h +++ b/dfg/DFGSlowPathGenerator.h @@ -32,7 +32,6 @@ #include "DFGSilentRegisterSavePlan.h" #include "DFGSpeculativeJIT.h" #include -#include namespace JSC { namespace DFG { @@ -329,94 +328,77 @@ protected: }; template -inline PassOwnPtr slowPathCall( +inline std::unique_ptr slowPathCall( JumpType from, SpeculativeJIT* jit, FunctionType function, ResultType result, SpillRegistersMode spillMode = NeedToSpill) { - return adoptPtr( - new CallResultAndNoArgumentsSlowPathGenerator< - JumpType, FunctionType, ResultType>( - from, jit, function, spillMode, result)); + return std::make_unique>( + from, jit, function, spillMode, result); } template< typename JumpType, typename FunctionType, typename ResultType, typename ArgumentType1> -inline PassOwnPtr slowPathCall( +inline std::unique_ptr slowPathCall( JumpType from, SpeculativeJIT* jit, FunctionType function, ResultType result, ArgumentType1 argument1, SpillRegistersMode spillMode = NeedToSpill) { - return adoptPtr( - new CallResultAndOneArgumentSlowPathGenerator< - JumpType, FunctionType, ResultType, ArgumentType1>( - from, jit, function, spillMode, result, argument1)); + return std::make_unique>( + from, jit, function, spillMode, result, argument1); } template< typename JumpType, typename FunctionType, typename ResultType, typename ArgumentType1, typename ArgumentType2> -inline PassOwnPtr slowPathCall( +inline std::unique_ptr slowPathCall( JumpType from, SpeculativeJIT* jit, FunctionType function, ResultType result, ArgumentType1 argument1, ArgumentType2 argument2, SpillRegistersMode spillMode = NeedToSpill) { - return adoptPtr( - new CallResultAndTwoArgumentsSlowPathGenerator< - JumpType, FunctionType, ResultType, ArgumentType1, ArgumentType2>( - from, jit, function, spillMode, result, argument1, argument2)); + return std::make_unique>( + from, jit, function, spillMode, result, argument1, argument2); } template< typename JumpType, typename FunctionType, typename ResultType, typename ArgumentType1, typename ArgumentType2, typename ArgumentType3> -inline PassOwnPtr slowPathCall( +inline std::unique_ptr slowPathCall( JumpType from, SpeculativeJIT* jit, FunctionType function, ResultType result, ArgumentType1 argument1, ArgumentType2 argument2, ArgumentType3 argument3, SpillRegistersMode spillMode = NeedToSpill) { - return adoptPtr( - new CallResultAndThreeArgumentsSlowPathGenerator< - JumpType, FunctionType, ResultType, ArgumentType1, ArgumentType2, - ArgumentType3>( - from, jit, function, spillMode, result, argument1, argument2, - argument3)); + return std::make_unique>(from, jit, function, spillMode, result, argument1, argument2, argument3); } template< typename JumpType, typename FunctionType, typename ResultType, typename ArgumentType1, typename ArgumentType2, typename ArgumentType3, typename ArgumentType4> -inline PassOwnPtr slowPathCall( +inline std::unique_ptr slowPathCall( JumpType from, SpeculativeJIT* jit, FunctionType function, ResultType result, ArgumentType1 argument1, ArgumentType2 argument2, ArgumentType3 argument3, ArgumentType4 argument4, SpillRegistersMode spillMode = NeedToSpill) { - return adoptPtr( - new CallResultAndFourArgumentsSlowPathGenerator< - JumpType, FunctionType, ResultType, ArgumentType1, ArgumentType2, - ArgumentType3, ArgumentType4>( - from, jit, function, spillMode, result, argument1, argument2, - argument3, argument4)); + return std::make_unique>(from, jit, function, spillMode, result, argument1, argument2, argument3, argument4); } template< typename JumpType, typename FunctionType, typename ResultType, typename ArgumentType1, typename ArgumentType2, typename ArgumentType3, typename ArgumentType4, typename ArgumentType5> -inline PassOwnPtr slowPathCall( +inline std::unique_ptr slowPathCall( JumpType from, SpeculativeJIT* jit, FunctionType function, ResultType result, ArgumentType1 argument1, ArgumentType2 argument2, ArgumentType3 argument3, ArgumentType4 argument4, ArgumentType5 argument5, SpillRegistersMode spillMode = NeedToSpill) { - return adoptPtr( - new CallResultAndFiveArgumentsSlowPathGenerator< - JumpType, FunctionType, ResultType, ArgumentType1, ArgumentType2, - ArgumentType3, ArgumentType4, ArgumentType5>( - from, jit, function, spillMode, result, argument1, argument2, - argument3, argument4, argument5)); + return std::make_unique>(from, jit, function, spillMode, result, argument1, argument2, argument3, + argument4, argument5); } template @@ -449,37 +431,31 @@ private: }; template -inline PassOwnPtr slowPathMove( +inline std::unique_ptr slowPathMove( JumpType from, SpeculativeJIT* jit, SourceType source[numberOfAssignments], DestinationType destination[numberOfAssignments]) { - return adoptPtr( - new AssigningSlowPathGenerator< - JumpType, DestinationType, SourceType, numberOfAssignments>( - from, jit, destination, source)); + return std::make_unique>( + from, jit, destination, source); } template -inline PassOwnPtr slowPathMove( +inline std::unique_ptr slowPathMove( JumpType from, SpeculativeJIT* jit, SourceType source, DestinationType destination) { SourceType sourceArray[1] = { source }; DestinationType destinationArray[1] = { destination }; - return adoptPtr( - new AssigningSlowPathGenerator< - JumpType, DestinationType, SourceType, 1>( - from, jit, destinationArray, sourceArray)); + return std::make_unique>( + from, jit, destinationArray, sourceArray); } template -inline PassOwnPtr slowPathMove( +inline std::unique_ptr slowPathMove( JumpType from, SpeculativeJIT* jit, SourceType source1, DestinationType destination1, SourceType source2, DestinationType destination2) { SourceType sourceArray[2] = { source1, source2 }; DestinationType destinationArray[2] = { destination1, destination2 }; - return adoptPtr( - new AssigningSlowPathGenerator< - JumpType, DestinationType, SourceType, 2>( - from, jit, destinationArray, sourceArray)); + return std::make_unique>( + from, jit, destinationArray, sourceArray); } } } // namespace JSC::DFG