[webkit-reviews] review denied: [Bug 179389] Refactoring: RegisterSet is meant to be passed by value. : [Attachment 326251] proposed patch.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Nov 7 13:30:31 PST 2017


Filip Pizlo <fpizlo at apple.com> has denied Mark Lam <mark.lam at apple.com>'s
request for review:
Bug 179389: Refactoring: RegisterSet is meant to be passed by value.
https://bugs.webkit.org/show_bug.cgi?id=179389

Attachment 326251: proposed patch.

https://bugs.webkit.org/attachment.cgi?id=326251&action=review




--- Comment #2 from Filip Pizlo <fpizlo at apple.com> ---
Comment on attachment 326251
  --> https://bugs.webkit.org/attachment.cgi?id=326251
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=326251&action=review

> Source/JavaScriptCore/ChangeLog:9
> +	   Refactored code that are obviously able to pass RegisterSet by value
to do so
> +	   instead of passing a reference.

It turns out that even for primitive values that can/should be passed by value,
doing const T& is essentially doing just that.	For example,

const int& foo() const { return m_foo; }

means that the actual load of the int will happen if the caller to foo()
actually needs the value, and then it happens at the moment that the value is
really needed.

So, I don't think that your patch's change is consistent with what you're
saying you're doing - RegisterSet is already being "passed by value" under the
loose C++ definition of that.


More information about the webkit-reviews mailing list