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

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

Issue 2697013009: Move ArrayBuffer.prototype.slice implementation to C++ (Closed)
Patch Set: merge master Created 3 years, 10 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
« no previous file with comments | « src/runtime/runtime-regexp.cc ('k') | src/v8.gyp » ('j') | 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 bcf5ae402ef5c94795070648d83ed759f47dd863..f4643e0506337e84b37ce2214dc817559e2eb834 100644
--- a/src/runtime/runtime-typedarray.cc
+++ b/src/runtime/runtime-typedarray.cc
@@ -21,39 +21,6 @@ RUNTIME_FUNCTION(Runtime_ArrayBufferGetByteLength) {
}
-RUNTIME_FUNCTION(Runtime_ArrayBufferSliceImpl) {
- HandleScope scope(isolate);
- DCHECK_EQ(4, args.length());
- CONVERT_ARG_HANDLE_CHECKED(JSArrayBuffer, source, 0);
- CONVERT_ARG_HANDLE_CHECKED(JSArrayBuffer, target, 1);
- CONVERT_NUMBER_ARG_HANDLE_CHECKED(first, 2);
- CONVERT_NUMBER_ARG_HANDLE_CHECKED(new_length, 3);
-
- if (source->was_neutered() || target->was_neutered()) {
- THROW_NEW_ERROR_RETURN_FAILURE(
- isolate, NewTypeError(MessageTemplate::kDetachedOperation,
- isolate->factory()->NewStringFromAsciiChecked(
- "ArrayBuffer.prototype.slice")));
- }
-
- CHECK(!source.is_identical_to(target));
- size_t start = 0, target_length = 0;
- CHECK(TryNumberToSize(*first, &start));
- CHECK(TryNumberToSize(*new_length, &target_length));
- CHECK(NumberToSize(target->byte_length()) >= target_length);
-
- if (target_length == 0) return isolate->heap()->undefined_value();
-
- size_t source_byte_length = NumberToSize(source->byte_length());
- CHECK(start <= source_byte_length);
- CHECK(source_byte_length - start >= target_length);
- uint8_t* source_data = reinterpret_cast<uint8_t*>(source->backing_store());
- uint8_t* target_data = reinterpret_cast<uint8_t*>(target->backing_store());
- CopyBytes(target_data, source_data + start, target_length);
- return isolate->heap()->undefined_value();
-}
-
-
RUNTIME_FUNCTION(Runtime_ArrayBufferNeuter) {
HandleScope scope(isolate);
DCHECK_EQ(1, args.length());
« no previous file with comments | « src/runtime/runtime-regexp.cc ('k') | src/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698