Closed
Bug 921561
Opened 11 years ago
Closed 11 years ago
JS_DECLARE_NEW_METHODS should use "perfect" forwarding
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla28
People
(Reporter: Waldo, Assigned: Waldo)
References
Details
(Whiteboard: [qa-])
Attachments
(2 files)
10.67 KB,
patch
|
luke
:
review+
|
Details | Diff | Splinter Review |
11.85 KB,
patch
|
Details | Diff | Splinter Review |
No description provided.
Attachment #811252 -
Flags: review?(luke)
Comment 1•11 years ago
|
||
Comment on attachment 811252 [details] [diff] [review]
forward.diff
Why is the uint32_t cast needed? I demand perfection!
Attachment #811252 -
Flags: review?(luke) → review+
Assignee | ||
Comment 2•11 years ago
|
||
I think I mentioned this once on IRC, but you can't perfectly forward bit-field lvalues, because you can't form a reference to a bit-field. Good times. (This is in the commit message, I think.)
Assignee | ||
Comment 3•11 years ago
|
||
So, this (or a slightly-tweaked version) busted on MSVC only. I don't have the try link at hand for this any more. :-\ My recollection is that MSVC seemed to be treating an rvalue as an lvalue, or vice versa, and that it might have been due to the extension note on <http://msdn.microsoft.com/en-us/library/bkbs2cds.aspx>. But I'd have to page this all into memory to double-check, exactly. Soon, but not now.
Assignee | ||
Comment 4•11 years ago
|
||
Another try, that seems to work with MSVC10 locally, pending which I'll push this:
https://tbpl.mozilla.org/?tree=Try&rev=22fe07ab0c4b
Assignee | ||
Comment 5•11 years ago
|
||
Once more, with feeling!
https://tbpl.mozilla.org/?tree=Try&rev=bd4e5eeb0b49
Comment 6•11 years ago
|
||
(In reply to Jeff Walden [:Waldo] (remove +bmo to email) from comment #2)
> I think I mentioned this once on IRC, but you can't perfectly forward
> bit-field lvalues, because you can't form a reference to a bit-field. Good
> times. (This is in the commit message, I think.)
This belongs in a comment in the code, not in the commit message. ("Why this temporary variable??")
Could we land the new_ forwarding bit separately? It's blocking bug 896100.
Comment 7•11 years ago
|
||
This is the prequisite patch for bug 896100, extracted from one of Waldo's try pushes. I'm attaching it here so that I can link to it; the try push changeset will be cleaned up eventually, so a link to that would go dead.
Assignee | ||
Comment 8•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/474be320001f
Didn't see comment 6 before pushing, but given every compiler -- not just MSVC, or clang, or gcc, all of them -- will error instantly if you pass a bit field directly, it doesn't seem worth commenting on.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Updated•11 years ago
|
Whiteboard: [qa-]
You need to log in
before you can comment on or make changes to this bug.
Description
•