[builtin] Adapt NewArgumentsElements with new arguments stack order

Change-Id: Ifadaffdd7e846f51accc51cc14898ddf05c98f88
Bug: v8:10201
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2214836
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68011}
This commit is contained in:
Victor Gomes 2020-05-27 15:11:37 +02:00 committed by Commit Bot
parent c0e877f1ac
commit ec9401aa16

View File

@ -72,7 +72,7 @@ TF_BUILTIN(GrowFastSmiOrObjectElements, CodeStubAssembler) {
}
TF_BUILTIN(NewArgumentsElements, CodeStubAssembler) {
TNode<IntPtrT> frame = UncheckedCast<IntPtrT>(Parameter(Descriptor::kFrame));
TNode<RawPtrT> frame = UncheckedCast<RawPtrT>(Parameter(Descriptor::kFrame));
TNode<IntPtrT> length = SmiToIntPtr(Parameter(Descriptor::kLength));
TNode<IntPtrT> mapped_count =
SmiToIntPtr(Parameter(Descriptor::kMappedCount));
@ -127,10 +127,8 @@ TF_BUILTIN(NewArgumentsElements, CodeStubAssembler) {
}
BIND(&done_loop1);
// Compute the effective {offset} into the {frame}.
TNode<IntPtrT> offset = IntPtrAdd(length, IntPtrConstant(1));
// Copy the parameters from {frame} (starting at {offset}) to {result}.
CodeStubArguments args(this, length, frame);
Label loop2(this, &var_index), done_loop2(this);
Goto(&loop2);
BIND(&loop2);
@ -142,9 +140,7 @@ TF_BUILTIN(NewArgumentsElements, CodeStubAssembler) {
GotoIf(IntPtrEqual(index, length), &done_loop2);
// Load the parameter at the given {index}.
TNode<Object> value = BitcastWordToTagged(
Load(MachineType::Pointer(), frame,
TimesSystemPointerSize(IntPtrSub(offset, index))));
TNode<Object> value = args.AtIndex(index);
// Store the {value} into the {result}.
StoreFixedArrayElement(result, index, value, SKIP_WRITE_BARRIER);