Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Unified Diff: src/s390/builtins-s390.cc

Issue 2125913004: PPC/s390: [builtins] Fix MathMaxMin on arm and arm64 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ppc/builtins-ppc.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/s390/builtins-s390.cc
diff --git a/src/s390/builtins-s390.cc b/src/s390/builtins-s390.cc
index c315f9d48bd3923cdbaad5b52f882943b1244e10..9a7c3d205a6866c4a58ee36759a24d7eaf5230c9 100644
--- a/src/s390/builtins-s390.cc
+++ b/src/s390/builtins-s390.cc
@@ -119,12 +119,12 @@ void Builtins::Generate_ArrayCode(MacroAssembler* masm) {
// static
void Builtins::Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind) {
// ----------- S t a t e -------------
- // -- r2 : number of arguments
- // -- r3 : function
- // -- cp : context
- // -- lr : return address
- // -- sp[(argc - n) * 8] : arg[n] (zero-based)
- // -- sp[(argc + 1) * 8] : receiver
+ // -- r2 : number of arguments
+ // -- r3 : function
+ // -- cp : context
+ // -- lr : return address
+ // -- sp[(argc - n - 1) * 4] : arg[n] (zero based)
+ // -- sp[argc * 4] : receiver
// -----------------------------------
Condition const cond_done = (kind == MathMaxMinKind::kMin) ? lt : gt;
Heap::RootListIndex const root_index =
@@ -143,14 +143,15 @@ void Builtins::Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind) {
__ AddP(r6, r2, Operand(1));
Label done_loop, loop;
+ __ LoadRR(r6, r2);
__ bind(&loop);
{
// Check if all parameters done.
- __ SubP(r2, Operand(1));
+ __ SubP(r6, Operand(1));
__ blt(&done_loop);
// Load the next parameter tagged value into r2.
- __ ShiftLeftP(r1, r2, Operand(kPointerSizeLog2));
+ __ ShiftLeftP(r1, r6, Operand(kPointerSizeLog2));
__ LoadP(r4, MemOperand(sp, r1));
// Load the double value of the parameter into d2, maybe converting the
@@ -219,8 +220,10 @@ void Builtins::Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind) {
}
__ bind(&done_loop);
+ // Drop all slots, including the receiver.
+ __ AddP(r2, Operand(1));
+ __ Drop(r2);
__ LoadRR(r2, r7);
- __ Drop(r6);
__ Ret();
}
« no previous file with comments | « src/ppc/builtins-ppc.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698