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

Side by Side Diff: src/runtime/runtime-typedarray.cc

Issue 1124813005: WIP Atomics (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix AtomicsLoad type in typer.cc Created 5 years, 7 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
« no previous file with comments | « src/runtime/runtime-atomics.cc ('k') | src/runtime/runtime-utils.h » ('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 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" 8 #include "src/messages.h"
9 #include "src/runtime/runtime.h" 9 #include "src/runtime/runtime.h"
10 #include "src/runtime/runtime-utils.h" 10 #include "src/runtime/runtime-utils.h"
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 } 468 }
469 469
470 470
471 RUNTIME_FUNCTION(Runtime_IsTypedArray) { 471 RUNTIME_FUNCTION(Runtime_IsTypedArray) {
472 HandleScope scope(isolate); 472 HandleScope scope(isolate);
473 DCHECK(args.length() == 1); 473 DCHECK(args.length() == 1);
474 return isolate->heap()->ToBoolean(args[0]->IsJSTypedArray()); 474 return isolate->heap()->ToBoolean(args[0]->IsJSTypedArray());
475 } 475 }
476 476
477 477
478 RUNTIME_FUNCTION(Runtime_IsSharedTypedArray) {
479 HandleScope scope(isolate);
480 DCHECK(args.length() == 1);
481 return isolate->heap()->ToBoolean(args[0]->IsJSTypedArray() &&
482 JSTypedArray::cast(args[0])->is_shared());
483 }
484
485
486 RUNTIME_FUNCTION(Runtime_IsSharedIntegerTypedArray) {
487 HandleScope scope(isolate);
488 DCHECK(args.length() == 1);
489 if (!args[0]->IsJSTypedArray()) {
490 return isolate->heap()->false_value();
491 }
492
493 Handle<JSTypedArray> obj(JSTypedArray::cast(args[0]));
494 return isolate->heap()->ToBoolean(obj->is_shared() &&
495 obj->type() != kExternalFloat32Array &&
496 obj->type() != kExternalFloat64Array);
497 }
498
499
478 RUNTIME_FUNCTION(Runtime_DataViewInitialize) { 500 RUNTIME_FUNCTION(Runtime_DataViewInitialize) {
479 HandleScope scope(isolate); 501 HandleScope scope(isolate);
480 DCHECK(args.length() == 4); 502 DCHECK(args.length() == 4);
481 CONVERT_ARG_HANDLE_CHECKED(JSDataView, holder, 0); 503 CONVERT_ARG_HANDLE_CHECKED(JSDataView, holder, 0);
482 CONVERT_ARG_HANDLE_CHECKED(JSArrayBuffer, buffer, 1); 504 CONVERT_ARG_HANDLE_CHECKED(JSArrayBuffer, buffer, 1);
483 CONVERT_NUMBER_ARG_HANDLE_CHECKED(byte_offset, 2); 505 CONVERT_NUMBER_ARG_HANDLE_CHECKED(byte_offset, 2);
484 CONVERT_NUMBER_ARG_HANDLE_CHECKED(byte_length, 3); 506 CONVERT_NUMBER_ARG_HANDLE_CHECKED(byte_length, 3);
485 507
486 DCHECK(holder->GetInternalFieldCount() == 508 DCHECK(holder->GetInternalFieldCount() ==
487 v8::ArrayBufferView::kInternalFieldCount); 509 v8::ArrayBufferView::kInternalFieldCount);
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 DATA_VIEW_SETTER(Uint16, uint16_t) 745 DATA_VIEW_SETTER(Uint16, uint16_t)
724 DATA_VIEW_SETTER(Int16, int16_t) 746 DATA_VIEW_SETTER(Int16, int16_t)
725 DATA_VIEW_SETTER(Uint32, uint32_t) 747 DATA_VIEW_SETTER(Uint32, uint32_t)
726 DATA_VIEW_SETTER(Int32, int32_t) 748 DATA_VIEW_SETTER(Int32, int32_t)
727 DATA_VIEW_SETTER(Float32, float) 749 DATA_VIEW_SETTER(Float32, float)
728 DATA_VIEW_SETTER(Float64, double) 750 DATA_VIEW_SETTER(Float64, double)
729 751
730 #undef DATA_VIEW_SETTER 752 #undef DATA_VIEW_SETTER
731 } 753 }
732 } // namespace v8::internal 754 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime/runtime-atomics.cc ('k') | src/runtime/runtime-utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698