Commit 02a5ddff authored by Franziska Hinkelmann's avatar Franziska Hinkelmann Committed by Commit Bot

Revert "[runtime] Port TypedArraySetFormArrayLike to C++"

This reverts commit a50b6751.

Reason for revert: Regression

Original change's description:
> [runtime] Port TypedArraySetFormArrayLike to C++
> 
> Bug: v8:6704
> Change-Id: I316f085801f4fb6a792124f9a6f80a16e6d43162
> Reviewed-on: https://chromium-review.googlesource.com/616721
> Commit-Queue: Franziska Hinkelmann <franzih@chromium.org>
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#47369}

TBR=franzih@chromium.org,bmeurer@chromium.org

Change-Id: Ibafeae41c85b6d7848b26dac7468057e1cea4769
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:6704
Reviewed-on: https://chromium-review.googlesource.com/617480Reviewed-by: 's avatarFranziska Hinkelmann <franzih@chromium.org>
Commit-Queue: Franziska Hinkelmann <franzih@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47383}
parent 983eec89
......@@ -250,7 +250,21 @@ TYPED_ARRAYS(TYPED_ARRAY_SUBARRAY_CASE)
%SetForceInlineFlag(GlobalTypedArray.prototype.subarray);
function TypedArraySetFromOverlappingTypedArray(target, source, offset) {
function TypedArraySetFromArrayLike(target, source, sourceLength, offset) {
if (offset > 0) {
for (var i = 0; i < sourceLength; i++) {
target[offset + i] = source[i];
}
}
else {
for (var i = 0; i < sourceLength; i++) {
target[i] = source[i];
}
}
}
function TypedArraySetFromOverlappingTypedArray(target, source, offset) {
var sourceElementSize = source.BYTES_PER_ELEMENT;
var targetElementSize = target.BYTES_PER_ELEMENT;
var sourceLength = %_TypedArrayGetLength(source);
......@@ -325,7 +339,7 @@ DEFINE_METHOD_LEN(
if (intOffset === 0) {
%TypedArrayCopyElements(this, obj, %_TypedArrayGetLength(obj));
} else {
%_TypedArraySetFromArrayLike(
TypedArraySetFromArrayLike(
this, obj, %_TypedArrayGetLength(obj), intOffset);
}
return;
......@@ -345,7 +359,7 @@ DEFINE_METHOD_LEN(
if (intOffset + l > %_TypedArrayGetLength(this)) {
throw %make_range_error(kTypedArraySetSourceTooLarge);
}
%_TypedArraySetFromArrayLike(this, obj, l, intOffset);
TypedArraySetFromArrayLike(this, obj, l, intOffset);
return;
}
},
......
......@@ -110,32 +110,6 @@ enum TypedArraySetResultCodes {
TYPED_ARRAY_SET_NON_TYPED_ARRAY = 3
};
// TypedArraySetFromArrayLike(target, source, source_length, offset);
RUNTIME_FUNCTION(Runtime_TypedArraySetFromArrayLike) {
HandleScope scope(isolate);
DCHECK_EQ(4, args.length());
CONVERT_ARG_HANDLE_CHECKED(JSTypedArray, target, 0);
CONVERT_ARG_HANDLE_CHECKED(Object, source, 1);
CONVERT_INT32_ARG_CHECKED(source_length, 2);
DCHECK_GE(source_length, 0);
CONVERT_INT32_ARG_CHECKED(offset, 3);
DCHECK_GE(offset, 0);
for (int i = 0; i < source_length; i++) {
Handle<Object> value;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, value,
Object::GetElement(isolate, source, i));
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, value,
Object::SetElement(isolate, target, offset + i, value,
LanguageMode::STRICT));
}
return *target;
}
RUNTIME_FUNCTION(Runtime_TypedArraySetFastCases) {
HandleScope scope(isolate);
......
......@@ -620,7 +620,6 @@ namespace internal {
F(ArrayBufferViewWasNeutered, 1, 1) \
F(TypedArrayGetLength, 1, 1) \
F(TypedArrayGetBuffer, 1, 1) \
F(TypedArraySetFromArrayLike, 4, 1) \
F(TypedArraySetFastCases, 3, 1) \
F(TypedArraySortFast, 1, 1) \
F(TypedArrayMaxSizeInHeap, 0, 1) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment