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

Unified Diff: src/runtime/runtime-typedarray.cc

Issue 2814683002: [builtins] Implement %TypedArray%.prototype.map in the CSA (Closed)
Patch Set: switched to BIND macro Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« src/objects-inl.h ('K') | « src/runtime/runtime.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-typedarray.cc
diff --git a/src/runtime/runtime-typedarray.cc b/src/runtime/runtime-typedarray.cc
index eeaa40e5ea648df51d7f5583df55ce5ea63d8ebe..afebda25a520f544709f9c6fc5e02120ca6d1554 100644
--- a/src/runtime/runtime-typedarray.cc
+++ b/src/runtime/runtime-typedarray.cc
@@ -177,9 +177,8 @@ RUNTIME_FUNCTION(Runtime_TypedArraySortFast) {
CONVERT_ARG_HANDLE_CHECKED(Object, target_obj, 0);
Handle<JSTypedArray> array;
- const char* method = "%TypedArray%.prototype.sort";
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, array, JSTypedArray::Validate(isolate, target_obj, method));
+ isolate, array, JSTypedArray::Validate(isolate, target_obj));
// This line can be removed when JSTypedArray::Validate throws
// if array.[[ViewedArrayBuffer]] is neutered(v8:4648)
@@ -260,5 +259,20 @@ RUNTIME_FUNCTION(Runtime_IsSharedInteger32TypedArray) {
obj->type() == kExternalInt32Array);
}
+RUNTIME_FUNCTION(Runtime_TypedArraySpeciesCreateByLength) {
+ HandleScope scope(isolate);
+ DCHECK(args.length() == 2);
+ Handle<JSTypedArray> exemplar = args.at<JSTypedArray>(1);
+ Handle<Object> length = args.at(2);
+ int argc = 1;
+ ScopedVector<Handle<Object>> argv(argc);
+ argv[0] = length;
+ Handle<JSTypedArray> result_array;
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
+ isolate, result_array,
+ JSTypedArray::SpeciesCreate(isolate, exemplar, argc, argv.start()));
+ return *result_array;
+}
+
} // namespace internal
} // namespace v8
« src/objects-inl.h ('K') | « src/runtime/runtime.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698