WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
152557
Stop moving local objects in return statements
https://bugs.webkit.org/show_bug.cgi?id=152557
Summary
Stop moving local objects in return statements
Andy Estes
Reported
2015-12-25 01:19:58 PST
Stop moving local objects in return statements
Attachments
Patch
(52.00 KB, patch)
2015-12-25 01:42 PST
,
Andy Estes
no flags
Details
Formatted Diff
Diff
Patch
(54.05 KB, patch)
2015-12-25 04:37 PST
,
Andy Estes
beidson
: review+
beidson
: commit-queue-
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Andy Estes
Comment 1
2015-12-25 01:42:59 PST
Created
attachment 267915
[details]
Patch
Andy Estes
Comment 2
2015-12-25 04:37:19 PST
Created
attachment 267920
[details]
Patch
Brady Eidson
Comment 3
2015-12-25 08:09:04 PST
Comment on
attachment 267920
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=267920&action=review
Can you resubmit for the commit queue to see if mac-debug clears up?
> Source/JavaScriptCore/ChangeLog:11 > + I found these issues by temporarily replacing WTF::move with WTF::move and recompiling.
"WTF::move" and "WTF::move" are the same string, so I suspect there's a typo in your ChangeLog.
Andy Estes
Comment 4
2015-12-25 09:13:42 PST
(In reply to
comment #3
)
> Comment on
attachment 267920
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=267920&action=review
> > Can you resubmit for the commit queue to see if mac-debug clears up?
Sure, I'll try.
> > > Source/JavaScriptCore/ChangeLog:11 > > + I found these issues by temporarily replacing WTF::move with WTF::move and recompiling. > > "WTF::move" and "WTF::move" are the same string, so I suspect there's a typo > in your ChangeLog.
Hah, this ChangeLog is in the JSC Xcode project for some reason, so this got swept up in my global replace of std::move back to WTF::move.
Alexey Proskuryakov
Comment 5
2015-12-25 09:27:50 PST
There is no need to re-submit for EWS, it keeps trying. You can learn what's going on by hovering the bubble, or by clicking on it. Someone probably landed a bad patch while no one was watching.
Alexey Proskuryakov
Comment 6
2015-12-25 09:56:27 PST
Hmm, in fact it's because bot ews113 went crazy, and somehow, each attempt ran on the same bot. Something is wrong here, but for now, I just rebooted it.
Brady Eidson
Comment 7
2015-12-25 15:18:01 PST
OH OH OH! This hasn't landed yet, good! Because I thought of a super obvious improvement: Make check-webkit-style warn for "return WTF::move("
Andy Estes
Comment 8
2015-12-25 16:35:22 PST
(In reply to
comment #7
)
> OH OH OH! > > This hasn't landed yet, good! > > Because I thought of a super obvious improvement: Make check-webkit-style > warn for "return WTF::move("
There's at least one case where (I believe) we have to move a return value: class Base { }; class Derived : public Base { }; std::unique_ptr<Base> create() { auto derived { std::make_unique<Derived>() }; return WTF::move(derived); } Since the type of create()'s return value differs from the type of the local, this function is not eligible for the RVO, and since std::unique_ptr<> is a move-only type, it can't be copied into the return value. There's also one more case where it's acceptable (although not mandatory) to move a return value, and that's a member function that releases a member variable to the caller (although I'd prefer we use std::exchange() for those cases).
Andy Estes
Comment 9
2015-12-28 08:26:45 PST
Committed
r194428
: <
http://trac.webkit.org/changeset/194428
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug