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

Side by Side Diff: src/crankshaft/hydrogen-instructions.cc

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 | « src/crankshaft/hydrogen-instructions.h ('k') | src/factory.h » ('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 #include "src/crankshaft/hydrogen-instructions.h" 5 #include "src/crankshaft/hydrogen-instructions.h"
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/base/ieee754.h" 8 #include "src/base/ieee754.h"
9 #include "src/base/safe_math.h" 9 #include "src/base/safe_math.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 2159 matching lines...) Expand 10 before | Expand all | Expand 10 after
2170 2170
2171 2171
2172 HConstant::HConstant(Special special) 2172 HConstant::HConstant(Special special)
2173 : HTemplateInstruction<0>(HType::TaggedNumber()), 2173 : HTemplateInstruction<0>(HType::TaggedNumber()),
2174 object_(Handle<Object>::null()), 2174 object_(Handle<Object>::null()),
2175 object_map_(Handle<Map>::null()), 2175 object_map_(Handle<Map>::null()),
2176 bit_field_(HasDoubleValueField::encode(true) | 2176 bit_field_(HasDoubleValueField::encode(true) |
2177 InstanceTypeField::encode(kUnknownInstanceType)), 2177 InstanceTypeField::encode(kUnknownInstanceType)),
2178 int32_value_(0) { 2178 int32_value_(0) {
2179 DCHECK_EQ(kHoleNaN, special); 2179 DCHECK_EQ(kHoleNaN, special);
2180 // Manipulating the signaling NaN used for the hole in C++, e.g. with bit_cast
2181 // will change its value on ia32 (the x87 stack is used to return values
2182 // and stores to the stack silently clear the signalling bit).
2183 // Therefore we have to use memcpy for initializing |double_value_| with
2184 // kHoleNanInt64 here.
2180 std::memcpy(&double_value_, &kHoleNanInt64, sizeof(double_value_)); 2185 std::memcpy(&double_value_, &kHoleNanInt64, sizeof(double_value_));
2181 Initialize(Representation::Double()); 2186 Initialize(Representation::Double());
2182 } 2187 }
2183 2188
2184 2189
2185 HConstant::HConstant(Handle<Object> object, Representation r) 2190 HConstant::HConstant(Handle<Object> object, Representation r)
2186 : HTemplateInstruction<0>(HType::FromValue(object)), 2191 : HTemplateInstruction<0>(HType::FromValue(object)),
2187 object_(Unique<Object>::CreateUninitialized(object)), 2192 object_(Unique<Object>::CreateUninitialized(object)),
2188 object_map_(Handle<Map>::null()), 2193 object_map_(Handle<Map>::null()),
2189 bit_field_( 2194 bit_field_(
(...skipping 1859 matching lines...) Expand 10 before | Expand all | Expand 10 after
4049 case HObjectAccess::kExternalMemory: 4054 case HObjectAccess::kExternalMemory:
4050 os << "[external-memory]"; 4055 os << "[external-memory]";
4051 break; 4056 break;
4052 } 4057 }
4053 4058
4054 return os << "@" << access.offset(); 4059 return os << "@" << access.offset();
4055 } 4060 }
4056 4061
4057 } // namespace internal 4062 } // namespace internal
4058 } // namespace v8 4063 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/hydrogen-instructions.h ('k') | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698