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

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

Issue 1663133002: PPC: Minor improvements to MathMaxMin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ppc/builtins-ppc.cc
diff --git a/src/ppc/builtins-ppc.cc b/src/ppc/builtins-ppc.cc
index 855dcda632a970d7a66aeab61736d9df5ae85e28..60e1cb9183b259c2e41f887121a3b5afb9805316 100644
--- a/src/ppc/builtins-ppc.cc
+++ b/src/ppc/builtins-ppc.cc
@@ -156,10 +156,10 @@ void Builtins::Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind) {
// Setup state for loop
// r5: address of arg[0] + kPointerSize
- // r6: number of arguments
+ // r6: number of slots to drop at exit (arguments + receiver)
__ ShiftLeftImm(r5, r3, Operand(kPointerSizeLog2));
__ add(r5, sp, r5);
- __ mr(r6, r3);
+ __ addi(r6, r3, Operand(1));
Label done_loop, loop;
__ bind(&loop);
@@ -189,12 +189,10 @@ void Builtins::Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind) {
__ SmiUntag(r6);
{
// Restore the double accumulator value (d1).
- Label restore_smi, done_restore;
- __ JumpIfSmi(r4, &restore_smi);
- __ lfd(d1, FieldMemOperand(r4, HeapNumber::kValueOffset));
- __ b(&done_restore);
- __ bind(&restore_smi);
+ Label done_restore;
__ SmiToDouble(d1, r4);
+ __ JumpIfSmi(r4, &done_restore);
+ __ lfd(d1, FieldMemOperand(r4, HeapNumber::kValueOffset));
__ bind(&done_restore);
}
}
@@ -235,7 +233,7 @@ void Builtins::Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind) {
__ bind(&done_loop);
__ mr(r3, r4);
__ Drop(r6);
- __ Ret(1);
+ __ Ret();
}
// static
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698