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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/crankshaft/hydrogen-instructions.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ 5 #ifndef V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_
6 #define V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ 6 #define V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_
7 7
8 #include <cstring> 8 #include <cstring>
9 #include <iosfwd> 9 #include <iosfwd>
10 10
(...skipping 3070 matching lines...) Expand 10 before | Expand all | Expand 10 after
3081 } 3081 }
3082 bool HasSmiValue() const { return HasSmiValueField::decode(bit_field_); } 3082 bool HasSmiValue() const { return HasSmiValueField::decode(bit_field_); }
3083 bool HasDoubleValue() const { 3083 bool HasDoubleValue() const {
3084 return HasDoubleValueField::decode(bit_field_); 3084 return HasDoubleValueField::decode(bit_field_);
3085 } 3085 }
3086 double DoubleValue() const { 3086 double DoubleValue() const {
3087 DCHECK(HasDoubleValue()); 3087 DCHECK(HasDoubleValue());
3088 return double_value_; 3088 return double_value_;
3089 } 3089 }
3090 uint64_t DoubleValueAsBits() const { 3090 uint64_t DoubleValueAsBits() const {
3091 uint64_t bits;
3092 DCHECK(HasDoubleValue()); 3091 DCHECK(HasDoubleValue());
3093 STATIC_ASSERT(sizeof(bits) == sizeof(double_value_)); 3092 return bit_cast<uint64_t>(double_value_);
3094 std::memcpy(&bits, &double_value_, sizeof(bits));
3095 return bits;
3096 } 3093 }
3097 bool IsTheHole() const { 3094 bool IsTheHole() const {
3098 if (HasDoubleValue() && DoubleValueAsBits() == kHoleNanInt64) { 3095 if (HasDoubleValue() && DoubleValueAsBits() == kHoleNanInt64) {
3099 return true; 3096 return true;
3100 } 3097 }
3101 return object_.IsInitialized() && 3098 return object_.IsInitialized() &&
3102 object_.IsKnownGlobal(isolate()->heap()->the_hole_value()); 3099 object_.IsKnownGlobal(isolate()->heap()->the_hole_value());
3103 } 3100 }
3104 bool HasNumberValue() const { return HasDoubleValue(); } 3101 bool HasNumberValue() const { return HasDoubleValue(); }
3105 int32_t NumberValueAsInteger32() const { 3102 int32_t NumberValueAsInteger32() const {
(...skipping 3653 matching lines...) Expand 10 before | Expand all | Expand 10 after
6759 bool IsDeletable() const override { return true; } 6756 bool IsDeletable() const override { return true; }
6760 }; 6757 };
6761 6758
6762 #undef DECLARE_INSTRUCTION 6759 #undef DECLARE_INSTRUCTION
6763 #undef DECLARE_CONCRETE_INSTRUCTION 6760 #undef DECLARE_CONCRETE_INSTRUCTION
6764 6761
6765 } // namespace internal 6762 } // namespace internal
6766 } // namespace v8 6763 } // namespace v8
6767 6764
6768 #endif // V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ 6765 #endif // V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« 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