Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Unified Diff: src/crankshaft/hydrogen-instructions.h

Issue 2652553003: Access double fields in C++ as uint64_t fields to preserve signaling bit of a NaN. (Closed)
Patch Set: More fixes Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/crankshaft/hydrogen-instructions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/hydrogen-instructions.h
diff --git a/src/crankshaft/hydrogen-instructions.h b/src/crankshaft/hydrogen-instructions.h
index 7ffb2a3a7ba10f1d03f6aa3021986cc58dd5c0c7..b2cbdab5fe108f8f6157edb241a51612b32912ca 100644
--- a/src/crankshaft/hydrogen-instructions.h
+++ b/src/crankshaft/hydrogen-instructions.h
@@ -3088,11 +3088,8 @@ class HConstant final : public HTemplateInstruction<0> {
return double_value_;
}
uint64_t DoubleValueAsBits() const {
- uint64_t bits;
DCHECK(HasDoubleValue());
- STATIC_ASSERT(sizeof(bits) == sizeof(double_value_));
- std::memcpy(&bits, &double_value_, sizeof(bits));
- return bits;
+ return bit_cast<uint64_t>(double_value_);
}
bool IsTheHole() const {
if (HasDoubleValue() && DoubleValueAsBits() == kHoleNanInt64) {
« no previous file with comments | « no previous file | src/crankshaft/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698