RESOLVED FIXED 179389
Introduce a default RegisterSet constructor so that we can use { } notation.
https://bugs.webkit.org/show_bug.cgi?id=179389
Summary Introduce a default RegisterSet constructor so that we can use { } notation.
Mark Lam
Reported 2017-11-07 13:09:59 PST
Refactor code that are obviously able to pass RegisterSet by value to do so instead of passing a reference.
Attachments
proposed patch. (29.74 KB, patch)
2017-11-07 13:23 PST, Mark Lam
fpizlo: review-
proposed patch. (8.85 KB, patch)
2017-11-07 14:02 PST, Mark Lam
saam: review+
Mark Lam
Comment 1 2017-11-07 13:23:40 PST
Created attachment 326251 [details] proposed patch.
Filip Pizlo
Comment 2 2017-11-07 13:30:31 PST
Comment on attachment 326251 [details] 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.
Mark Lam
Comment 3 2017-11-07 13:33:49 PST
(In reply to Filip Pizlo from comment #2) > It turns out that even for primitive values that can/should be passed by > value, doing const T& is essentially doing just that. OK. I should have known compilers are smart enough for that.
Mark Lam
Comment 4 2017-11-07 14:02:53 PST
Created attachment 326257 [details] proposed patch.
Mark Lam
Comment 5 2017-11-07 14:53:25 PST
Thanks for the review. Landed in r224550: <http://trac.webkit.org/r224550>.
Radar WebKit Bug Importer
Comment 6 2017-11-15 12:09:45 PST
Note You need to log in before you can comment on or make changes to this bug.