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

Unified Diff: src/ppc/code-stubs-ppc.cc

Issue 1412153003: PPC: [runtime] Implement %_ToLength via ToLengthStub. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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 | src/ppc/interface-descriptors-ppc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ppc/code-stubs-ppc.cc
diff --git a/src/ppc/code-stubs-ppc.cc b/src/ppc/code-stubs-ppc.cc
index 02177e2b8c9ce636c78e3391bb2e29acde20cbfe..e98639e372c8d6880846c62548dbdd98ef28694f 100644
--- a/src/ppc/code-stubs-ppc.cc
+++ b/src/ppc/code-stubs-ppc.cc
@@ -3334,6 +3334,28 @@ void ToNumberStub::Generate(MacroAssembler* masm) {
}
+void ToLengthStub::Generate(MacroAssembler* masm) {
+ // The ToLength stub takes one argument in r3.
+ Label not_smi;
+ __ JumpIfNotSmi(r3, &not_smi);
+ STATIC_ASSERT(kSmiTag == 0);
+ __ cmpi(r3, Operand::Zero());
+ if (CpuFeatures::IsSupported(ISELECT)) {
+ __ isel(lt, r3, r0, r3);
+ } else {
+ Label positive;
+ __ bgt(&positive);
+ __ li(r3, Operand::Zero());
+ __ bind(&positive);
+ }
+ __ Ret();
+ __ bind(&not_smi);
+
+ __ push(r3); // Push argument.
+ __ TailCallRuntime(Runtime::kToLength, 1, 1);
+}
+
+
void ToStringStub::Generate(MacroAssembler* masm) {
// The ToString stub takes one argument in r3.
Label is_number;
« no previous file with comments | « no previous file | src/ppc/interface-descriptors-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698