Commit ec9401aa authored by Victor Gomes's avatar Victor Gomes Committed by Commit Bot

[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: 's avatarIgor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68011}
parent c0e877f1
...@@ -72,7 +72,7 @@ TF_BUILTIN(GrowFastSmiOrObjectElements, CodeStubAssembler) { ...@@ -72,7 +72,7 @@ TF_BUILTIN(GrowFastSmiOrObjectElements, CodeStubAssembler) {
} }
TF_BUILTIN(NewArgumentsElements, 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> length = SmiToIntPtr(Parameter(Descriptor::kLength));
TNode<IntPtrT> mapped_count = TNode<IntPtrT> mapped_count =
SmiToIntPtr(Parameter(Descriptor::kMappedCount)); SmiToIntPtr(Parameter(Descriptor::kMappedCount));
...@@ -127,10 +127,8 @@ TF_BUILTIN(NewArgumentsElements, CodeStubAssembler) { ...@@ -127,10 +127,8 @@ TF_BUILTIN(NewArgumentsElements, CodeStubAssembler) {
} }
BIND(&done_loop1); 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}. // Copy the parameters from {frame} (starting at {offset}) to {result}.
CodeStubArguments args(this, length, frame);
Label loop2(this, &var_index), done_loop2(this); Label loop2(this, &var_index), done_loop2(this);
Goto(&loop2); Goto(&loop2);
BIND(&loop2); BIND(&loop2);
...@@ -142,9 +140,7 @@ TF_BUILTIN(NewArgumentsElements, CodeStubAssembler) { ...@@ -142,9 +140,7 @@ TF_BUILTIN(NewArgumentsElements, CodeStubAssembler) {
GotoIf(IntPtrEqual(index, length), &done_loop2); GotoIf(IntPtrEqual(index, length), &done_loop2);
// Load the parameter at the given {index}. // Load the parameter at the given {index}.
TNode<Object> value = BitcastWordToTagged( TNode<Object> value = args.AtIndex(index);
Load(MachineType::Pointer(), frame,
TimesSystemPointerSize(IntPtrSub(offset, index))));
// Store the {value} into the {result}. // Store the {value} into the {result}.
StoreFixedArrayElement(result, index, value, SKIP_WRITE_BARRIER); StoreFixedArrayElement(result, index, value, SKIP_WRITE_BARRIER);
......
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