Commit 1bcac785 authored by Victor Gomes's avatar Victor Gomes Committed by Commit Bot

[builtins][ia32] Reverse JS arguments for ia32

Change-Id: Ic5f703f29525ce7680249666454cf146c1f088dd
Bug: v8:10201
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2116198Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67443}
parent 79855db4
This diff is collapsed.
......@@ -135,6 +135,31 @@ void MacroAssembler::JumpIfIsInRange(Register value, unsigned lower_limit,
j(below_equal, on_in_range, near_jump);
}
void TurboAssembler::PushArray(Register array, Register size, Register scratch,
PushArrayOrder order) {
DCHECK(!AreAliased(array, size, scratch));
Register counter = scratch;
Label loop, entry;
if (order == PushArrayOrder::kReverse) {
mov(counter, 0);
jmp(&entry);
bind(&loop);
Push(Operand(array, counter, times_system_pointer_size, 0));
inc(counter);
bind(&entry);
cmp(counter, size);
j(less, &loop, Label::kNear);
} else {
mov(counter, size);
jmp(&entry);
bind(&loop);
Push(Operand(array, counter, times_system_pointer_size, 0));
bind(&entry);
dec(counter);
j(greater_equal, &loop, Label::kNear);
}
}
Operand TurboAssembler::ExternalReferenceAsOperand(ExternalReference reference,
Register scratch) {
// TODO(jgruber): Add support for enable_root_array_delta_access.
......
......@@ -224,6 +224,12 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
void PushPC();
enum class PushArrayOrder { kNormal, kReverse };
// `array` points to the first element (the lowest address).
// `array` and `size` are not modified.
void PushArray(Register array, Register size, Register scratch,
PushArrayOrder order = PushArrayOrder::kNormal);
// Operand pointing to an external reference.
// May emit code to set up the scratch register. The operand is
// only guaranteed to be correct as long as the scratch register
......
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