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

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

Issue 13093005: Revert 12534006 (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') | 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) 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
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
174 #define TYPED_DATA_GETTER(getter, object) \ 175 #define TYPED_DATA_GETTER(getter, object) \
175 DEFINE_NATIVE_ENTRY(TypedData_##getter, 2) { \ 176 DEFINE_NATIVE_ENTRY(TypedData_##getter, 2) { \
176 GET_NON_NULL_NATIVE_ARGUMENT(Instance, instance, arguments->NativeArgAt(0)); \ 177 GET_NON_NULL_NATIVE_ARGUMENT(Instance, instance, arguments->NativeArgAt(0)); \
177 GET_NON_NULL_NATIVE_ARGUMENT(Smi, offsetInBytes, arguments->NativeArgAt(1)); \ 178 GET_NON_NULL_NATIVE_ARGUMENT(Smi, offsetInBytes, arguments->NativeArgAt(1)); \
178 if (instance.IsTypedData()) { \ 179 if (instance.IsTypedData()) { \
179 const TypedData& array = TypedData::Cast(instance); \ 180 const TypedData& array = TypedData::Cast(instance); \
180 ASSERT(RangeCheck(offsetInBytes.Value(), array.LengthInBytes())); \ 181 ASSERT(RangeCheck(offsetInBytes.Value(), array.LengthInBytes())); \
181 return object::New(array.getter(offsetInBytes.Value())); \ 182 return object::New(array.getter(offsetInBytes.Value())); \
182 } \ 183 } \
183 if (instance.IsExternalTypedData()) { \ 184 if (instance.IsExternalTypedData()) { \
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 TYPED_DATA_NATIVES(Int8Array, GetInt8, SetInt8, Smi, Value) 299 TYPED_DATA_NATIVES(Int8Array, GetInt8, SetInt8, Smi, Value)
299 TYPED_DATA_NATIVES(Uint8Array, GetUint8, SetUint8, Smi, Value) 300 TYPED_DATA_NATIVES(Uint8Array, GetUint8, SetUint8, Smi, Value)
300 TYPED_DATA_NATIVES(Int16Array, GetInt16, SetInt16, Smi, Value) 301 TYPED_DATA_NATIVES(Int16Array, GetInt16, SetInt16, Smi, Value)
301 TYPED_DATA_NATIVES(Uint16Array, GetUint16, SetUint16, Smi, Value) 302 TYPED_DATA_NATIVES(Uint16Array, GetUint16, SetUint16, Smi, Value)
302 TYPED_DATA_NATIVES(Int32Array, GetInt32, SetInt32, Integer, AsInt64Value) 303 TYPED_DATA_NATIVES(Int32Array, GetInt32, SetInt32, Integer, AsInt64Value)
303 TYPED_DATA_NATIVES(Uint32Array, GetUint32, SetUint32, Integer, AsInt64Value) 304 TYPED_DATA_NATIVES(Uint32Array, GetUint32, SetUint32, Integer, AsInt64Value)
304 TYPED_DATA_NATIVES(Int64Array, GetInt64, SetInt64, Integer, AsInt64Value) 305 TYPED_DATA_NATIVES(Int64Array, GetInt64, SetInt64, Integer, AsInt64Value)
305 TYPED_DATA_UINT64_NATIVES(Uint64Array, GetUint64, SetUint64, Integer) 306 TYPED_DATA_UINT64_NATIVES(Uint64Array, GetUint64, SetUint64, Integer)
306 TYPED_DATA_NATIVES(Float32Array, GetFloat32, SetFloat32, Double, value) 307 TYPED_DATA_NATIVES(Float32Array, GetFloat32, SetFloat32, Double, value)
307 TYPED_DATA_NATIVES(Float64Array, GetFloat64, SetFloat64, Double, value) 308 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
OLDNEW
« no previous file with comments | « no previous file | runtime/lib/typeddata.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698