Bug 183746

Summary: FunctionPtr should be passed by value.
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, fpizlo, jfbastien, keith_miller, msaboff, rmorisset, saam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
proposed patch.
jfbastien: review+, mark.lam: commit-queue-
patch for landing. none

Mark Lam
Reported 2018-03-19 10:52:53 PDT
It's meant to be an encapsulation of a C/C++ function pointer. There's no need to pass it by reference.
Attachments
proposed patch. (11.03 KB, patch)
2018-03-19 11:02 PDT, Mark Lam
jfbastien: review+
mark.lam: commit-queue-
patch for landing. (11.09 KB, patch)
2018-03-19 12:45 PDT, Mark Lam
no flags
Radar WebKit Bug Importer
Comment 1 2018-03-19 10:53:25 PDT
Mark Lam
Comment 2 2018-03-19 11:02:04 PDT
Created attachment 336056 [details] proposed patch.
JF Bastien
Comment 3 2018-03-19 11:06:38 PDT
Comment on attachment 336056 [details] proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=336056&action=review r=me with suggested assert. > Source/JavaScriptCore/assembler/MacroAssemblerCodeRef.h:129 > +static_assert(sizeof(FunctionPtr) == sizeof(void*), ""); You probably also want std::is_trivially_copyable<FunctionPtr>::value so that passing it by values is just a register thing.
Mark Lam
Comment 4 2018-03-19 12:45:01 PDT
Created attachment 336069 [details] patch for landing.
WebKit Commit Bot
Comment 5 2018-03-19 13:22:35 PDT
Comment on attachment 336069 [details] patch for landing. Clearing flags on attachment: 336069 Committed r229709: <https://trac.webkit.org/changeset/229709>
WebKit Commit Bot
Comment 6 2018-03-19 13:22:36 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.