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

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

Issue 2814683002: [builtins] Implement %TypedArray%.prototype.map in the CSA (Closed)
Patch Set: added todo Created 3 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.h ('k') | no next file » | 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/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/elements.h" 8 #include "src/elements.h"
9 #include "src/factory.h" 9 #include "src/factory.h"
10 #include "src/messages.h" 10 #include "src/messages.h"
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 DCHECK_EQ(1, args.length()); 274 DCHECK_EQ(1, args.length());
275 if (!args[0]->IsJSTypedArray()) { 275 if (!args[0]->IsJSTypedArray()) {
276 return isolate->heap()->false_value(); 276 return isolate->heap()->false_value();
277 } 277 }
278 278
279 Handle<JSTypedArray> obj(JSTypedArray::cast(args[0])); 279 Handle<JSTypedArray> obj(JSTypedArray::cast(args[0]));
280 return isolate->heap()->ToBoolean(obj->GetBuffer()->is_shared() && 280 return isolate->heap()->ToBoolean(obj->GetBuffer()->is_shared() &&
281 obj->type() == kExternalInt32Array); 281 obj->type() == kExternalInt32Array);
282 } 282 }
283 283
284 RUNTIME_FUNCTION(Runtime_TypedArraySpeciesCreateByLength) {
285 HandleScope scope(isolate);
286 DCHECK(args.length() == 2);
287 Handle<JSTypedArray> exemplar = args.at<JSTypedArray>(1);
288 Handle<Object> length = args.at(2);
289 int argc = 1;
290 ScopedVector<Handle<Object>> argv(argc);
291 argv[0] = length;
292 Handle<JSTypedArray> result_array;
293 // TODO(tebbi): Pass correct method name.
294 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
295 isolate, result_array,
296 JSTypedArray::SpeciesCreate(isolate, exemplar, argc, argv.start(), ""));
297 return *result_array;
298 }
299
284 } // namespace internal 300 } // namespace internal
285 } // namespace v8 301 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698