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

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

Issue 1412963002: [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/arm/interface-descriptors-arm.cc » ('j') | src/full-codegen/arm/full-codegen-arm.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/code-stubs-arm.cc
diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc
index 35928107f2b78551156c05c6cfa3a6190d8a06ce..d85ebdb114c76ba4a3f9a9796d2154814e678ab8 100644
--- a/src/arm/code-stubs-arm.cc
+++ b/src/arm/code-stubs-arm.cc
@@ -3168,6 +3168,21 @@ void ToNumberStub::Generate(MacroAssembler* masm) {
}
+void ToLengthStub::Generate(MacroAssembler* masm) {
+ // The ToLength stub takes one argument in r0.
+ Label not_smi;
+ __ JumpIfNotSmi(r0, &not_smi);
+ STATIC_ASSERT(kSmiTag == 0);
+ __ tst(r0, r0);
+ __ mov(r0, Operand(0), LeaveCC, lt);
+ __ Ret();
+ __ bind(&not_smi);
+
+ __ push(r0); // Push argument.
+ __ TailCallRuntime(Runtime::kToLength, 1, 1);
+}
+
+
void ToStringStub::Generate(MacroAssembler* masm) {
// The ToString stub takes one argument in r0.
Label is_number;
« no previous file with comments | « no previous file | src/arm/interface-descriptors-arm.cc » ('j') | src/full-codegen/arm/full-codegen-arm.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698