OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
8 #include "vm/exceptions.h" | 8 #include "vm/exceptions.h" |
9 #include "vm/native_entry.h" | 9 #include "vm/native_entry.h" |
10 #include "vm/object.h" | 10 #include "vm/object.h" |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 uint8_t* bytes = OS::AllocateAlignedArray<uint8_t>( | 360 uint8_t* bytes = OS::AllocateAlignedArray<uint8_t>( |
361 len, | 361 len, |
362 ExternalByteArrayData<uint8_t>::kAlignment); | 362 ExternalByteArrayData<uint8_t>::kAlignment); |
363 return ExternalUint8ClampedArray::New(bytes, | 363 return ExternalUint8ClampedArray::New(bytes, |
364 len, | 364 len, |
365 bytes, | 365 bytes, |
366 OS::AlignedFree); | 366 OS::AlignedFree); |
367 } | 367 } |
368 | 368 |
369 | 369 |
| 370 DEFINE_NATIVE_ENTRY(Uint8ClampedArray_getIndexed, 2) { |
| 371 GETTER(Uint8ClampedArray, Smi, uint8_t); |
| 372 } |
| 373 |
| 374 |
| 375 DEFINE_NATIVE_ENTRY(Uint8ClampedArray_setIndexed, 3) { |
| 376 SETTER(Uint8ClampedArray, Smi, Value, uint8_t); |
| 377 } |
| 378 |
| 379 |
370 // Int16Array | 380 // Int16Array |
371 | 381 |
372 DEFINE_NATIVE_ENTRY(Int16Array_new, 1) { | 382 DEFINE_NATIVE_ENTRY(Int16Array_new, 1) { |
373 GET_NATIVE_ARGUMENT(Smi, length, arguments->NativeArgAt(0)); | 383 GET_NATIVE_ARGUMENT(Smi, length, arguments->NativeArgAt(0)); |
374 intptr_t len = length.Value(); | 384 intptr_t len = length.Value(); |
375 LengthCheck(len, Int16Array::kMaxElements); | 385 LengthCheck(len, Int16Array::kMaxElements); |
376 return Int16Array::New(len); | 386 return Int16Array::New(len); |
377 } | 387 } |
378 | 388 |
379 | 389 |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 DEFINE_NATIVE_ENTRY(ExternalFloat64Array_getIndexed, 2) { | 762 DEFINE_NATIVE_ENTRY(ExternalFloat64Array_getIndexed, 2) { |
753 GETTER(ExternalFloat64Array, Double, double); | 763 GETTER(ExternalFloat64Array, Double, double); |
754 } | 764 } |
755 | 765 |
756 | 766 |
757 DEFINE_NATIVE_ENTRY(ExternalFloat64Array_setIndexed, 3) { | 767 DEFINE_NATIVE_ENTRY(ExternalFloat64Array_setIndexed, 3) { |
758 SETTER(ExternalFloat64Array, Double, value, double); | 768 SETTER(ExternalFloat64Array, Double, value, double); |
759 } | 769 } |
760 | 770 |
761 } // namespace dart | 771 } // namespace dart |
OLD | NEW |