| 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 "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 | 8 |
| 9 #include "vm/bigint_operations.h" | 9 #include "vm/bigint_operations.h" |
| 10 #include "vm/exceptions.h" | 10 #include "vm/exceptions.h" |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 } \ | 164 } \ |
| 165 | 165 |
| 166 | 166 |
| 167 #define TYPED_DATA_NEW_NATIVE(name) \ | 167 #define TYPED_DATA_NEW_NATIVE(name) \ |
| 168 TYPED_DATA_NEW(name) \ | 168 TYPED_DATA_NEW(name) \ |
| 169 EXT_TYPED_DATA_NEW(name) \ | 169 EXT_TYPED_DATA_NEW(name) \ |
| 170 | 170 |
| 171 | 171 |
| 172 CLASS_LIST_TYPED_DATA(TYPED_DATA_NEW_NATIVE) | 172 CLASS_LIST_TYPED_DATA(TYPED_DATA_NEW_NATIVE) |
| 173 | 173 |
| 174 | |
| 175 #define TYPED_DATA_GETTER(getter, object) \ | 174 #define TYPED_DATA_GETTER(getter, object) \ |
| 176 DEFINE_NATIVE_ENTRY(TypedData_##getter, 2) { \ | 175 DEFINE_NATIVE_ENTRY(TypedData_##getter, 2) { \ |
| 177 GET_NON_NULL_NATIVE_ARGUMENT(Instance, instance, arguments->NativeArgAt(0)); \ | 176 GET_NON_NULL_NATIVE_ARGUMENT(Instance, instance, arguments->NativeArgAt(0)); \ |
| 178 GET_NON_NULL_NATIVE_ARGUMENT(Smi, offsetInBytes, arguments->NativeArgAt(1)); \ | 177 GET_NON_NULL_NATIVE_ARGUMENT(Smi, offsetInBytes, arguments->NativeArgAt(1)); \ |
| 179 if (instance.IsTypedData()) { \ | 178 if (instance.IsTypedData()) { \ |
| 180 const TypedData& array = TypedData::Cast(instance); \ | 179 const TypedData& array = TypedData::Cast(instance); \ |
| 181 ASSERT(RangeCheck(offsetInBytes.Value(), array.LengthInBytes())); \ | 180 ASSERT(RangeCheck(offsetInBytes.Value(), array.LengthInBytes())); \ |
| 182 return object::New(array.getter(offsetInBytes.Value())); \ | 181 return object::New(array.getter(offsetInBytes.Value())); \ |
| 183 } \ | 182 } \ |
| 184 if (instance.IsExternalTypedData()) { \ | 183 if (instance.IsExternalTypedData()) { \ |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 TYPED_DATA_NATIVES(Int8Array, GetInt8, SetInt8, Smi, Value) | 298 TYPED_DATA_NATIVES(Int8Array, GetInt8, SetInt8, Smi, Value) |
| 300 TYPED_DATA_NATIVES(Uint8Array, GetUint8, SetUint8, Smi, Value) | 299 TYPED_DATA_NATIVES(Uint8Array, GetUint8, SetUint8, Smi, Value) |
| 301 TYPED_DATA_NATIVES(Int16Array, GetInt16, SetInt16, Smi, Value) | 300 TYPED_DATA_NATIVES(Int16Array, GetInt16, SetInt16, Smi, Value) |
| 302 TYPED_DATA_NATIVES(Uint16Array, GetUint16, SetUint16, Smi, Value) | 301 TYPED_DATA_NATIVES(Uint16Array, GetUint16, SetUint16, Smi, Value) |
| 303 TYPED_DATA_NATIVES(Int32Array, GetInt32, SetInt32, Integer, AsInt64Value) | 302 TYPED_DATA_NATIVES(Int32Array, GetInt32, SetInt32, Integer, AsInt64Value) |
| 304 TYPED_DATA_NATIVES(Uint32Array, GetUint32, SetUint32, Integer, AsInt64Value) | 303 TYPED_DATA_NATIVES(Uint32Array, GetUint32, SetUint32, Integer, AsInt64Value) |
| 305 TYPED_DATA_NATIVES(Int64Array, GetInt64, SetInt64, Integer, AsInt64Value) | 304 TYPED_DATA_NATIVES(Int64Array, GetInt64, SetInt64, Integer, AsInt64Value) |
| 306 TYPED_DATA_UINT64_NATIVES(Uint64Array, GetUint64, SetUint64, Integer) | 305 TYPED_DATA_UINT64_NATIVES(Uint64Array, GetUint64, SetUint64, Integer) |
| 307 TYPED_DATA_NATIVES(Float32Array, GetFloat32, SetFloat32, Double, value) | 306 TYPED_DATA_NATIVES(Float32Array, GetFloat32, SetFloat32, Double, value) |
| 308 TYPED_DATA_NATIVES(Float64Array, GetFloat64, SetFloat64, Double, value) | 307 TYPED_DATA_NATIVES(Float64Array, GetFloat64, SetFloat64, Double, value) |
| 308 TYPED_DATA_NATIVES(Float32x4Array, GetFloat32x4, SetFloat32x4, Float32x4, value) |
| 309 | 309 |
| 310 } // namespace dart | 310 } // namespace dart |
| OLD | NEW |