Commit 546b549d authored by Hai Dang's avatar Hai Dang Committed by Commit Bot

Cleanup unnecessary use of CopyFixedArrayElements.

This removes the check for holeyness when using CopyFixedArrayElements,
because the function does not use that information.

Change-Id: I6033495bf00947ded083ebc24695f6c8bf4569d0
Reviewed-on: https://chromium-review.googlesource.com/c/1280763
Commit-Queue: Hai Dang <dhai@google.com>
Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56646}
parent cc8c92a9
......@@ -267,8 +267,6 @@ void CallOrConstructBuiltinsAssembler::CallOrConstructDoubleVarargs(
TNode<Object> target, SloppyTNode<Object> new_target,
TNode<FixedDoubleArray> elements, TNode<Int32T> length,
TNode<Int32T> args_count, TNode<Context> context, TNode<Int32T> kind) {
Label if_done(this);
const ElementsKind new_kind = PACKED_ELEMENTS;
const WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER;
TNode<IntPtrT> intptr_length = ChangeInt32ToIntPtr(length);
......@@ -277,31 +275,18 @@ void CallOrConstructBuiltinsAssembler::CallOrConstructDoubleVarargs(
// Allocate a new FixedArray of Objects.
TNode<FixedArray> new_elements = CAST(AllocateFixedArray(
new_kind, intptr_length, CodeStubAssembler::kAllowLargeObjectAllocation));
Branch(Word32Equal(kind, Int32Constant(HOLEY_DOUBLE_ELEMENTS)),
[&] {
// Fill the FixedArray with pointers to HeapObjects.
CopyFixedArrayElements(HOLEY_DOUBLE_ELEMENTS, elements, new_kind,
new_elements, intptr_length, intptr_length,
barrier_mode);
Goto(&if_done);
},
[&] {
CopyFixedArrayElements(PACKED_DOUBLE_ELEMENTS, elements, new_kind,
new_elements, intptr_length, intptr_length,
barrier_mode);
Goto(&if_done);
});
BIND(&if_done);
{
if (new_target == nullptr) {
Callable callable = CodeFactory::CallVarargs(isolate());
TailCallStub(callable, context, target, args_count, length, new_elements);
} else {
Callable callable = CodeFactory::ConstructVarargs(isolate());
TailCallStub(callable, context, target, new_target, args_count, length,
new_elements);
}
// CopyFixedArrayElements does not distinguish between holey and packed for
// its first argument, so we don't need to dispatch on {kind} here.
CopyFixedArrayElements(PACKED_DOUBLE_ELEMENTS, elements, new_kind,
new_elements, intptr_length, intptr_length,
barrier_mode);
if (new_target == nullptr) {
Callable callable = CodeFactory::CallVarargs(isolate());
TailCallStub(callable, context, target, args_count, length, new_elements);
} else {
Callable callable = CodeFactory::ConstructVarargs(isolate());
TailCallStub(callable, context, target, new_target, args_count, length,
new_elements);
}
}
......
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