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

Side by Side Diff: runtime/lib/double.cc

Issue 1166523005: Fix fix (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: f Created 5 years, 6 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/bootstrap_natives.h" 5 #include "vm/bootstrap_natives.h"
6 6
7 #include "platform/math.h" 7 #include "platform/math.h"
8 8
9 #include "vm/code_generator.h" // DartModulo. 9 #include "vm/code_generator.h" // DartModulo.
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 const Double& arg = Double::CheckedHandle(arguments->NativeArgAt(0)); 297 const Double& arg = Double::CheckedHandle(arguments->NativeArgAt(0));
298 // Include negative zero, infinity. 298 // Include negative zero, infinity.
299 double dval = arg.value(); 299 double dval = arg.value();
300 return Bool::Get(signbit(dval) && !isnan(dval)).raw(); 300 return Bool::Get(signbit(dval) && !isnan(dval)).raw();
301 } 301 }
302 302
303 303
304 DEFINE_NATIVE_ENTRY(Double_flipSignBit, 1) { 304 DEFINE_NATIVE_ENTRY(Double_flipSignBit, 1) {
305 const Double& arg = Double::CheckedHandle(arguments->NativeArgAt(0)); 305 const Double& arg = Double::CheckedHandle(arguments->NativeArgAt(0));
306 const double in_val = arg.value(); 306 const double in_val = arg.value();
307 // TODO(srdjan): Fix this compilation error. 307 const int64_t bits = bit_cast<int64_t, double>(in_val) ^ kSignBitDouble;
308 // const int64_t bits = 308 return Double::New(bit_cast<double, int64_t>(bits));
309 // *(reinterpret_cast<const int64_t*>(&in_val)) ^ kSignBitDouble;
310 // const double out_val = *(reinterpret_cast<const double*>(&bits));
311 // return Double::New(out_val);
312 return Double::New(-in_val);
313 } 309 }
314 310
315 // Add here only functions using/referring to old-style casts. 311 // Add here only functions using/referring to old-style casts.
316 312
317 } // namespace dart 313 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698