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

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

Issue 12534006: Port SIMD types from dart:scalarlist to dart:typeddata. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/lib/typeddata.dart » ('j') | runtime/lib/typeddata.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 } \ 98 } \
99 99
100 100
101 #define TYPED_DATA_NEW_NATIVE(name) \ 101 #define TYPED_DATA_NEW_NATIVE(name) \
102 TYPED_DATA_NEW(name) \ 102 TYPED_DATA_NEW(name) \
103 EXT_TYPED_DATA_NEW(name) \ 103 EXT_TYPED_DATA_NEW(name) \
104 104
105 105
106 CLASS_LIST_TYPED_DATA(TYPED_DATA_NEW_NATIVE) 106 CLASS_LIST_TYPED_DATA(TYPED_DATA_NEW_NATIVE)
107 107
108
109 #define TYPED_DATA_GETTER(getter, object) \ 108 #define TYPED_DATA_GETTER(getter, object) \
110 DEFINE_NATIVE_ENTRY(TypedData_##getter, 2) { \ 109 DEFINE_NATIVE_ENTRY(TypedData_##getter, 2) { \
111 GET_NON_NULL_NATIVE_ARGUMENT(Instance, instance, arguments->NativeArgAt(0)); \ 110 GET_NON_NULL_NATIVE_ARGUMENT(Instance, instance, arguments->NativeArgAt(0)); \
112 GET_NON_NULL_NATIVE_ARGUMENT(Smi, index, arguments->NativeArgAt(1)); \ 111 GET_NON_NULL_NATIVE_ARGUMENT(Smi, index, arguments->NativeArgAt(1)); \
113 if (instance.IsTypedData()) { \ 112 if (instance.IsTypedData()) { \
114 const TypedData& array = TypedData::Cast(instance); \ 113 const TypedData& array = TypedData::Cast(instance); \
115 intptr_t offsetInBytes = index.Value() * array.ElementSizeInBytes(); \ 114 intptr_t offsetInBytes = index.Value() * array.ElementSizeInBytes(); \
116 ASSERT(RangeCheck(offsetInBytes, array.LengthInBytes())); \ 115 ASSERT(RangeCheck(offsetInBytes, array.LengthInBytes())); \
117 return object::New(array.getter(offsetInBytes)); \ 116 return object::New(array.getter(offsetInBytes)); \
118 } \ 117 } \
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 TYPED_DATA_NATIVES(Int8Array, GetInt8, SetInt8, Smi, Value) 240 TYPED_DATA_NATIVES(Int8Array, GetInt8, SetInt8, Smi, Value)
242 TYPED_DATA_NATIVES(Uint8Array, GetUint8, SetUint8, Smi, Value) 241 TYPED_DATA_NATIVES(Uint8Array, GetUint8, SetUint8, Smi, Value)
243 TYPED_DATA_NATIVES(Int16Array, GetInt16, SetInt16, Smi, Value) 242 TYPED_DATA_NATIVES(Int16Array, GetInt16, SetInt16, Smi, Value)
244 TYPED_DATA_NATIVES(Uint16Array, GetUint16, SetUint16, Smi, Value) 243 TYPED_DATA_NATIVES(Uint16Array, GetUint16, SetUint16, Smi, Value)
245 TYPED_DATA_NATIVES(Int32Array, GetInt32, SetInt32, Integer, AsInt64Value) 244 TYPED_DATA_NATIVES(Int32Array, GetInt32, SetInt32, Integer, AsInt64Value)
246 TYPED_DATA_NATIVES(Uint32Array, GetUint32, SetUint32, Integer, AsInt64Value) 245 TYPED_DATA_NATIVES(Uint32Array, GetUint32, SetUint32, Integer, AsInt64Value)
247 TYPED_DATA_NATIVES(Int64Array, GetInt64, SetInt64, Integer, AsInt64Value) 246 TYPED_DATA_NATIVES(Int64Array, GetInt64, SetInt64, Integer, AsInt64Value)
248 TYPED_DATA_UINT64_NATIVES(Uint64Array, GetUint64, SetUint64, Integer) 247 TYPED_DATA_UINT64_NATIVES(Uint64Array, GetUint64, SetUint64, Integer)
249 TYPED_DATA_NATIVES(Float32Array, GetFloat32, SetFloat32, Double, value) 248 TYPED_DATA_NATIVES(Float32Array, GetFloat32, SetFloat32, Double, value)
250 TYPED_DATA_NATIVES(Float64Array, GetFloat64, SetFloat64, Double, value) 249 TYPED_DATA_NATIVES(Float64Array, GetFloat64, SetFloat64, Double, value)
250 TYPED_DATA_NATIVES(Float32x4Array, GetFloat32x4, SetFloat32x4, Float32x4, value)
251 251
252 } // namespace dart 252 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/lib/typeddata.dart » ('j') | runtime/lib/typeddata.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698