DescriptionFix move.h's to use a concrete RValue carrier object rather than hacking a RValue&.
For move semantics, we need to create a private "RValue" type that is used to
create move constructors and move operators. Previously, we emulated Boost's
idea of making the RValue type a subclass of the move-only type that doesn't add
any new member fields. We then just reinterpret_cast "this" into a RValue&
depending on the fact that RValue is just a type pun for the move-only type.
This ends up being undefined behavior though (C++98 5.2.10.7).
This change makes use a concrete RValue class that contains a pointer to the
move-only type. With -O2 on clang version 3.2 (trunk 163674), this yields
identical assembly code to the previous implementation. With -O0, we generate
2 more instructions to allocate and initialize the temporary RValue struct's
object field when calling Pass().
This should be acceptable. The snowman says so ☃.
BUG=155436
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=161945
Patch Set 1 #Patch Set 2 : comment fixes #Patch Set 3 : fix #Patch Set 4 : adding ☃. #
Total comments: 2
Patch Set 5 : fix error. #
Messages
Total messages: 10 (0 generated)
|