OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/messages.h" | |
9 #include "src/runtime/runtime.h" | 8 #include "src/runtime/runtime.h" |
10 #include "src/runtime/runtime-utils.h" | 9 #include "src/runtime/runtime-utils.h" |
11 | 10 |
12 | 11 |
13 namespace v8 { | 12 namespace v8 { |
14 namespace internal { | 13 namespace internal { |
15 | 14 |
16 void Runtime::SetupArrayBuffer(Isolate* isolate, | 15 void Runtime::SetupArrayBuffer(Isolate* isolate, |
17 Handle<JSArrayBuffer> array_buffer, | 16 Handle<JSArrayBuffer> array_buffer, |
18 bool is_external, void* data, | 17 bool is_external, void* data, |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 // Set from non-typed array. | 392 // Set from non-typed array. |
394 TYPED_ARRAY_SET_NON_TYPED_ARRAY = 3 | 393 TYPED_ARRAY_SET_NON_TYPED_ARRAY = 3 |
395 }; | 394 }; |
396 | 395 |
397 | 396 |
398 RUNTIME_FUNCTION(Runtime_TypedArraySetFastCases) { | 397 RUNTIME_FUNCTION(Runtime_TypedArraySetFastCases) { |
399 HandleScope scope(isolate); | 398 HandleScope scope(isolate); |
400 DCHECK(args.length() == 3); | 399 DCHECK(args.length() == 3); |
401 if (!args[0]->IsJSTypedArray()) { | 400 if (!args[0]->IsJSTypedArray()) { |
402 THROW_NEW_ERROR_RETURN_FAILURE( | 401 THROW_NEW_ERROR_RETURN_FAILURE( |
403 isolate, NewTypeError(MessageTemplate::kNotTypedArray)); | 402 isolate, |
| 403 NewTypeError("not_typed_array", HandleVector<Object>(NULL, 0))); |
404 } | 404 } |
405 | 405 |
406 if (!args[1]->IsJSTypedArray()) | 406 if (!args[1]->IsJSTypedArray()) |
407 return Smi::FromInt(TYPED_ARRAY_SET_NON_TYPED_ARRAY); | 407 return Smi::FromInt(TYPED_ARRAY_SET_NON_TYPED_ARRAY); |
408 | 408 |
409 CONVERT_ARG_HANDLE_CHECKED(JSTypedArray, target_obj, 0); | 409 CONVERT_ARG_HANDLE_CHECKED(JSTypedArray, target_obj, 0); |
410 CONVERT_ARG_HANDLE_CHECKED(JSTypedArray, source_obj, 1); | 410 CONVERT_ARG_HANDLE_CHECKED(JSTypedArray, source_obj, 1); |
411 CONVERT_NUMBER_ARG_HANDLE_CHECKED(offset_obj, 2); | 411 CONVERT_NUMBER_ARG_HANDLE_CHECKED(offset_obj, 2); |
412 | 412 |
413 Handle<JSTypedArray> target(JSTypedArray::cast(*target_obj)); | 413 Handle<JSTypedArray> target(JSTypedArray::cast(*target_obj)); |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 DATA_VIEW_SETTER(Uint16, uint16_t) | 719 DATA_VIEW_SETTER(Uint16, uint16_t) |
720 DATA_VIEW_SETTER(Int16, int16_t) | 720 DATA_VIEW_SETTER(Int16, int16_t) |
721 DATA_VIEW_SETTER(Uint32, uint32_t) | 721 DATA_VIEW_SETTER(Uint32, uint32_t) |
722 DATA_VIEW_SETTER(Int32, int32_t) | 722 DATA_VIEW_SETTER(Int32, int32_t) |
723 DATA_VIEW_SETTER(Float32, float) | 723 DATA_VIEW_SETTER(Float32, float) |
724 DATA_VIEW_SETTER(Float64, double) | 724 DATA_VIEW_SETTER(Float64, double) |
725 | 725 |
726 #undef DATA_VIEW_SETTER | 726 #undef DATA_VIEW_SETTER |
727 } | 727 } |
728 } // namespace v8::internal | 728 } // namespace v8::internal |
OLD | NEW |