On Tue, Jul 30, 2019 at 1:05 PM Nathan Froyd <nfr...@mozilla.com> wrote: > One grotty low-level question about the new exception proposal. Your > post states: > > "it was observed that since we need to revise the calling convention > as part of this proposal anyways, perhaps we could take the > opportunity to make other improvements to it as well, such as allowing > small objects to be passed in registers, the lack of which is a pretty > unfortunate performance problem today (certainly one we’ve run into at > Mozilla multiple times). That seems intriguing." > > How is revising the calling convention a C++ standards committee > issue? Doesn't that properly belong to the underlying platform (CPU > and/or OS)?
"We" was a poor word choice :) What I meant was, to support lightweight exceptions, ABI specs (lilke Itanium) will need a revised calling convention, so perhaps they might take the opportunity to make other improvements at the same time. On Tue, Jul 30, 2019 at 11:56 PM Joshua Cranmer 🐧 <pidgeo...@gmail.com> wrote: > On 7/30/2019 4:40 PM, Mike Hommey wrote: > > ... and aren't small objects already passed via registers already? > > I wasn't at the meeting, so I can't say for sure, but I imagine the > issue being talked about is the fact that structs/classes need to have a > *this parameter (most notably for non-trivial constructors and > destructors), which precludes being able to stick them in registers when > those kick in. Watch what happens if you return a std::tuple for > example: https://gcc.godbolt.org/z/CfbGvq (I would love to have real > multiple return values in C++, but std::tuple still causes stack > allocation for the return value). I believe that's right. The specific example that came up was unique_ptr, which unlike a raw pointer cannot be passed in a register today [1]. Cheers, Botond [1] https://stackoverflow.com/questions/54225864/does-passing-a-unique-ptr-by-value-have-a-performance-penalty-compared-to-a-pl _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform