OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 "vm/exceptions.h" | 7 #include "vm/exceptions.h" |
8 #include "vm/native_entry.h" | 8 #include "vm/native_entry.h" |
9 #include "vm/object.h" | 9 #include "vm/object.h" |
10 #include "vm/symbols.h" | 10 #include "vm/symbols.h" |
11 | 11 |
12 namespace dart { | 12 namespace dart { |
13 | 13 |
14 static void ThrowMaskRangeException(int64_t m) { | 14 static void ThrowMaskRangeException(int64_t m) { |
15 if ((m < 0) || (m > 255)) { | 15 if ((m < 0) || (m > 255)) { |
16 Exceptions::ThrowRangeError( | 16 Exceptions::ThrowRangeError( |
17 "mask", Integer::Handle(Integer::New(m)), 0, 256); | 17 "mask", Integer::Handle(Integer::New(m)), 0, 255); |
18 } | 18 } |
19 } | 19 } |
20 | 20 |
21 | 21 |
22 DEFINE_NATIVE_ENTRY(Float32x4_fromDoubles, 5) { | 22 DEFINE_NATIVE_ENTRY(Float32x4_fromDoubles, 5) { |
23 ASSERT(TypeArguments::CheckedHandle(arguments->NativeArgAt(0)).IsNull()); | 23 ASSERT(TypeArguments::CheckedHandle(arguments->NativeArgAt(0)).IsNull()); |
24 GET_NON_NULL_NATIVE_ARGUMENT(Double, x, arguments->NativeArgAt(1)); | 24 GET_NON_NULL_NATIVE_ARGUMENT(Double, x, arguments->NativeArgAt(1)); |
25 GET_NON_NULL_NATIVE_ARGUMENT(Double, y, arguments->NativeArgAt(2)); | 25 GET_NON_NULL_NATIVE_ARGUMENT(Double, y, arguments->NativeArgAt(2)); |
26 GET_NON_NULL_NATIVE_ARGUMENT(Double, z, arguments->NativeArgAt(3)); | 26 GET_NON_NULL_NATIVE_ARGUMENT(Double, z, arguments->NativeArgAt(3)); |
27 GET_NON_NULL_NATIVE_ARGUMENT(Double, w, arguments->NativeArgAt(4)); | 27 GET_NON_NULL_NATIVE_ARGUMENT(Double, w, arguments->NativeArgAt(4)); |
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
873 | 873 |
874 | 874 |
875 DEFINE_NATIVE_ENTRY(Float64x2_sqrt, 1) { | 875 DEFINE_NATIVE_ENTRY(Float64x2_sqrt, 1) { |
876 GET_NON_NULL_NATIVE_ARGUMENT(Float64x2, self, arguments->NativeArgAt(0)); | 876 GET_NON_NULL_NATIVE_ARGUMENT(Float64x2, self, arguments->NativeArgAt(0)); |
877 double _x = sqrt(self.x()); | 877 double _x = sqrt(self.x()); |
878 double _y = sqrt(self.y()); | 878 double _y = sqrt(self.y()); |
879 return Float64x2::New(_x, _y); | 879 return Float64x2::New(_x, _y); |
880 } | 880 } |
881 | 881 |
882 } // namespace dart | 882 } // namespace dart |
OLD | NEW |