| 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/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
| 6 | 6 |
| 7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
| 8 #include "src/factory.h" | 8 #include "src/factory.h" |
| 9 #include "src/messages.h" | 9 #include "src/messages.h" |
| 10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 return isolate->heap()->false_value(); | 426 return isolate->heap()->false_value(); |
| 427 } | 427 } |
| 428 | 428 |
| 429 Handle<JSTypedArray> obj(JSTypedArray::cast(args[0])); | 429 Handle<JSTypedArray> obj(JSTypedArray::cast(args[0])); |
| 430 return isolate->heap()->ToBoolean(obj->GetBuffer()->is_shared() && | 430 return isolate->heap()->ToBoolean(obj->GetBuffer()->is_shared() && |
| 431 obj->type() != kExternalFloat32Array && | 431 obj->type() != kExternalFloat32Array && |
| 432 obj->type() != kExternalFloat64Array); | 432 obj->type() != kExternalFloat64Array); |
| 433 } | 433 } |
| 434 | 434 |
| 435 | 435 |
| 436 RUNTIME_FUNCTION(Runtime_IsSharedInteger32TypedArray) { |
| 437 HandleScope scope(isolate); |
| 438 DCHECK(args.length() == 1); |
| 439 if (!args[0]->IsJSTypedArray()) { |
| 440 return isolate->heap()->false_value(); |
| 441 } |
| 442 |
| 443 Handle<JSTypedArray> obj(JSTypedArray::cast(args[0])); |
| 444 return isolate->heap()->ToBoolean(obj->GetBuffer()->is_shared() && |
| 445 obj->type() == kExternalInt32Array); |
| 446 } |
| 447 |
| 448 |
| 436 RUNTIME_FUNCTION(Runtime_DataViewInitialize) { | 449 RUNTIME_FUNCTION(Runtime_DataViewInitialize) { |
| 437 HandleScope scope(isolate); | 450 HandleScope scope(isolate); |
| 438 DCHECK(args.length() == 4); | 451 DCHECK(args.length() == 4); |
| 439 CONVERT_ARG_HANDLE_CHECKED(JSDataView, holder, 0); | 452 CONVERT_ARG_HANDLE_CHECKED(JSDataView, holder, 0); |
| 440 CONVERT_ARG_HANDLE_CHECKED(JSArrayBuffer, buffer, 1); | 453 CONVERT_ARG_HANDLE_CHECKED(JSArrayBuffer, buffer, 1); |
| 441 CONVERT_NUMBER_ARG_HANDLE_CHECKED(byte_offset, 2); | 454 CONVERT_NUMBER_ARG_HANDLE_CHECKED(byte_offset, 2); |
| 442 CONVERT_NUMBER_ARG_HANDLE_CHECKED(byte_length, 3); | 455 CONVERT_NUMBER_ARG_HANDLE_CHECKED(byte_length, 3); |
| 443 | 456 |
| 444 DCHECK_EQ(v8::ArrayBufferView::kInternalFieldCount, | 457 DCHECK_EQ(v8::ArrayBufferView::kInternalFieldCount, |
| 445 holder->GetInternalFieldCount()); | 458 holder->GetInternalFieldCount()); |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 DATA_VIEW_SETTER(Uint16, uint16_t) | 694 DATA_VIEW_SETTER(Uint16, uint16_t) |
| 682 DATA_VIEW_SETTER(Int16, int16_t) | 695 DATA_VIEW_SETTER(Int16, int16_t) |
| 683 DATA_VIEW_SETTER(Uint32, uint32_t) | 696 DATA_VIEW_SETTER(Uint32, uint32_t) |
| 684 DATA_VIEW_SETTER(Int32, int32_t) | 697 DATA_VIEW_SETTER(Int32, int32_t) |
| 685 DATA_VIEW_SETTER(Float32, float) | 698 DATA_VIEW_SETTER(Float32, float) |
| 686 DATA_VIEW_SETTER(Float64, double) | 699 DATA_VIEW_SETTER(Float64, double) |
| 687 | 700 |
| 688 #undef DATA_VIEW_SETTER | 701 #undef DATA_VIEW_SETTER |
| 689 } // namespace internal | 702 } // namespace internal |
| 690 } // namespace v8 | 703 } // namespace v8 |
| OLD | NEW |