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

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

Issue 583723002: Implement .forEach() on typed arrays (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Even more tests Created 6 years, 2 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 | « src/runtime/runtime.h ('k') | test/mjsunit/harmony/typedarrays-foreach.js » ('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/runtime/runtime.h" 8 #include "src/runtime/runtime.h"
9 #include "src/runtime/runtime-utils.h" 9 #include "src/runtime/runtime-utils.h"
10 10
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 493
494 494
495 RUNTIME_FUNCTION(Runtime_TypedArrayMaxSizeInHeap) { 495 RUNTIME_FUNCTION(Runtime_TypedArrayMaxSizeInHeap) {
496 DCHECK(args.length() == 0); 496 DCHECK(args.length() == 0);
497 DCHECK_OBJECT_SIZE(FLAG_typed_array_max_size_in_heap + 497 DCHECK_OBJECT_SIZE(FLAG_typed_array_max_size_in_heap +
498 FixedTypedArrayBase::kDataOffset); 498 FixedTypedArrayBase::kDataOffset);
499 return Smi::FromInt(FLAG_typed_array_max_size_in_heap); 499 return Smi::FromInt(FLAG_typed_array_max_size_in_heap);
500 } 500 }
501 501
502 502
503 RUNTIME_FUNCTION(Runtime_IsTypedArray) {
504 HandleScope scope(isolate);
505 DCHECK(args.length() == 1);
506 return isolate->heap()->ToBoolean(args[0]->IsJSTypedArray());
507 }
508
509
503 RUNTIME_FUNCTION(Runtime_DataViewInitialize) { 510 RUNTIME_FUNCTION(Runtime_DataViewInitialize) {
504 HandleScope scope(isolate); 511 HandleScope scope(isolate);
505 DCHECK(args.length() == 4); 512 DCHECK(args.length() == 4);
506 CONVERT_ARG_HANDLE_CHECKED(JSDataView, holder, 0); 513 CONVERT_ARG_HANDLE_CHECKED(JSDataView, holder, 0);
507 CONVERT_ARG_HANDLE_CHECKED(JSArrayBuffer, buffer, 1); 514 CONVERT_ARG_HANDLE_CHECKED(JSArrayBuffer, buffer, 1);
508 CONVERT_NUMBER_ARG_HANDLE_CHECKED(byte_offset, 2); 515 CONVERT_NUMBER_ARG_HANDLE_CHECKED(byte_offset, 2);
509 CONVERT_NUMBER_ARG_HANDLE_CHECKED(byte_length, 3); 516 CONVERT_NUMBER_ARG_HANDLE_CHECKED(byte_length, 3);
510 517
511 DCHECK(holder->GetInternalFieldCount() == 518 DCHECK(holder->GetInternalFieldCount() ==
512 v8::ArrayBufferView::kInternalFieldCount); 519 v8::ArrayBufferView::kInternalFieldCount);
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 DATA_VIEW_SETTER(Uint16, uint16_t) 758 DATA_VIEW_SETTER(Uint16, uint16_t)
752 DATA_VIEW_SETTER(Int16, int16_t) 759 DATA_VIEW_SETTER(Int16, int16_t)
753 DATA_VIEW_SETTER(Uint32, uint32_t) 760 DATA_VIEW_SETTER(Uint32, uint32_t)
754 DATA_VIEW_SETTER(Int32, int32_t) 761 DATA_VIEW_SETTER(Int32, int32_t)
755 DATA_VIEW_SETTER(Float32, float) 762 DATA_VIEW_SETTER(Float32, float)
756 DATA_VIEW_SETTER(Float64, double) 763 DATA_VIEW_SETTER(Float64, double)
757 764
758 #undef DATA_VIEW_SETTER 765 #undef DATA_VIEW_SETTER
759 } 766 }
760 } // namespace v8::internal 767 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | test/mjsunit/harmony/typedarrays-foreach.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698