RESOLVED FIXED 162978
[DOMJIT] Support slow path call
https://bugs.webkit.org/show_bug.cgi?id=162978
Summary [DOMJIT] Support slow path call
Yusuke Suzuki
Reported 2016-10-05 10:39:00 PDT
DOMJIT::Patchpoint (Maybe, DOMJIT::PatchpointParams) should have ability to request slow path call in both DFG and FTL!
Attachments
Patch (38.12 KB, patch)
2016-10-06 02:51 PDT, Yusuke Suzuki
saam: review+
Yusuke Suzuki
Comment 1 2016-10-05 10:49:10 PDT
If we expose variadic template-ed slow path generator that calls DFG / FTL slow path generators, it exposes almost all the DFG and FTL. For example, I tested the above design. And I ends up with exposing DFGSpeculativeJIT! That's bad. Instead, I'll take callOperation like design. We list up necessary calls in DFGSlowPathCall.h. And it will invoke DFG / FTL's appropriate functionality in DFGSlowPathCall.cpp.
Yusuke Suzuki
Comment 2 2016-10-06 02:51:05 PDT
Saam Barati
Comment 3 2016-10-06 19:15:53 PDT
Comment on attachment 290802 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=290802&action=review > Source/JavaScriptCore/domjit/DOMJITSlowPathCalls.h:32 > +#define DOMJIT_SLOW_PATH_CALLS(macro) \ > + macro(J_JITOperation_EP, JSValueRegs, GPRReg) \ I wonder if it ever makes sense to expose a call API that's more abstract like this: class Call { struct Argument { Argument(GPRReg); Argument(JSValueRegs); Argument(immediate type: int32/int64/pointer); } Type m_resultType; Vector<Arguments> m_arguments; FunctionPtr m_function; }; and then have a function like: setupCallWithExecState(const Call& call); > Source/JavaScriptCore/ftl/FTLDOMJITPatchpointParams.cpp:41 > + params.addLatePath([=] (CCallHelpers& jit) { I wonder if it ever makes sense to have a normal call API.
Yusuke Suzuki
Comment 4 2016-10-06 21:37:38 PDT
Comment on attachment 290802 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=290802&action=review >> Source/JavaScriptCore/ftl/FTLDOMJITPatchpointParams.cpp:41 >> + params.addLatePath([=] (CCallHelpers& jit) { > > I wonder if it ever makes sense to have a normal call API. Oops, thanks. It's OK. fixed.
Yusuke Suzuki
Comment 5 2016-10-06 21:38:13 PDT
Comment on attachment 290802 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=290802&action=review >> Source/JavaScriptCore/domjit/DOMJITSlowPathCalls.h:32 >> + macro(J_JITOperation_EP, JSValueRegs, GPRReg) \ > > I wonder if it ever makes sense to expose a call API that's more abstract like this: > > class Call { > struct Argument { > Argument(GPRReg); > Argument(JSValueRegs); > Argument(immediate type: int32/int64/pointer); > } > Type m_resultType; > Vector<Arguments> m_arguments; > FunctionPtr m_function; > }; > and then have a function like: > setupCallWithExecState(const Call& call); Looks clean. I filed it in https://bugs.webkit.org/show_bug.cgi?id=163099
Yusuke Suzuki
Comment 6 2016-10-06 21:50:12 PDT
Comment on attachment 290802 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=290802&action=review >>> Source/JavaScriptCore/ftl/FTLDOMJITPatchpointParams.cpp:41 >>> + params.addLatePath([=] (CCallHelpers& jit) { >> >> I wonder if it ever makes sense to have a normal call API. > > Oops, thanks. It's OK. fixed. But, after considering, the above one is still useful. We can emit slow path after the fast path sequence by using addLatePath.
Yusuke Suzuki
Comment 7 2016-10-06 22:09:45 PDT
Note You need to log in before you can comment on or make changes to this bug.