| OLD | NEW |
| 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 <math.h> | 5 #include <math.h> |
| 6 | 6 |
| 7 #include "vm/bootstrap_natives.h" | 7 #include "vm/bootstrap_natives.h" |
| 8 | 8 |
| 9 #include "vm/bigint_operations.h" | 9 #include "vm/bigint_operations.h" |
| 10 #include "vm/code_generator.h" // DartModulo. | 10 #include "vm/code_generator.h" // DartModulo. |
| 11 #include "vm/double_conversion.h" | 11 #include "vm/double_conversion.h" |
| 12 #include "vm/exceptions.h" | 12 #include "vm/exceptions.h" |
| 13 #include "vm/native_entry.h" | 13 #include "vm/native_entry.h" |
| 14 #include "vm/object.h" | 14 #include "vm/object.h" |
| 15 #include "vm/symbols.h" | 15 #include "vm/symbols.h" |
| 16 | 16 |
| 17 namespace dart { | 17 namespace dart { |
| 18 | 18 |
| 19 DECLARE_FLAG(bool, trace_intrinsified_natives); | 19 DECLARE_FLAG(bool, trace_intrinsified_natives); |
| 20 | 20 |
| 21 DEFINE_NATIVE_ENTRY(Double_doubleFromInteger, 2) { | 21 DEFINE_NATIVE_ENTRY(Double_doubleFromInteger, 2) { |
| 22 ASSERT(AbstractTypeArguments::CheckedHandle( | 22 ASSERT(TypeArguments::CheckedHandle(arguments->NativeArgAt(0)).IsNull()); |
| 23 arguments->NativeArgAt(0)).IsNull()); | |
| 24 const Integer& value = Integer::CheckedHandle(arguments->NativeArgAt(1)); | 23 const Integer& value = Integer::CheckedHandle(arguments->NativeArgAt(1)); |
| 25 if (FLAG_trace_intrinsified_natives) { | 24 if (FLAG_trace_intrinsified_natives) { |
| 26 OS::Print("Double_doubleFromInteger %s\n", value.ToCString()); | 25 OS::Print("Double_doubleFromInteger %s\n", value.ToCString()); |
| 27 } | 26 } |
| 28 return Double::New(value.AsDoubleValue()); | 27 return Double::New(value.AsDoubleValue()); |
| 29 } | 28 } |
| 30 | 29 |
| 31 | 30 |
| 32 DEFINE_NATIVE_ENTRY(Double_add, 2) { | 31 DEFINE_NATIVE_ENTRY(Double_add, 2) { |
| 33 double left = Double::CheckedHandle(arguments->NativeArgAt(0)).value(); | 32 double left = Double::CheckedHandle(arguments->NativeArgAt(0)).value(); |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 | 270 |
| 272 DEFINE_NATIVE_ENTRY(Double_getIsNegative, 1) { | 271 DEFINE_NATIVE_ENTRY(Double_getIsNegative, 1) { |
| 273 const Double& arg = Double::CheckedHandle(arguments->NativeArgAt(0)); | 272 const Double& arg = Double::CheckedHandle(arguments->NativeArgAt(0)); |
| 274 // Include negative zero, infinity. | 273 // Include negative zero, infinity. |
| 275 return Bool::Get(signbit(arg.value()) && !isnan(arg.value())).raw(); | 274 return Bool::Get(signbit(arg.value()) && !isnan(arg.value())).raw(); |
| 276 } | 275 } |
| 277 | 276 |
| 278 // Add here only functions using/referring to old-style casts. | 277 // Add here only functions using/referring to old-style casts. |
| 279 | 278 |
| 280 } // namespace dart | 279 } // namespace dart |
| OLD | NEW |