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 1622493002: [stubs] Introduce ToNameStub to implement %_ToName. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix BuildNumberToString type in Crankshaft. 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 | src/arm/interface-descriptors-arm.cc » ('j') | no next file with comments »
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 0dd399ea2c6b6430b325f70e648c07cd5ae66aee..42f6d658c7169b2ad8f44b3ec553fe8bc8d5be71 100644
--- a/src/arm/code-stubs-arm.cc
+++ b/src/arm/code-stubs-arm.cc
@@ -3119,6 +3119,37 @@ void ToStringStub::Generate(MacroAssembler* masm) {
}
+void ToNameStub::Generate(MacroAssembler* masm) {
+ // The ToName stub takes one argument in r0.
+ Label is_number;
+ __ JumpIfSmi(r0, &is_number);
+
+ STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE);
+ __ CompareObjectType(r0, r1, r1, LAST_NAME_TYPE);
+ // r0: receiver
+ // r1: receiver instance type
+ __ Ret(ls);
+
+ Label not_heap_number;
+ __ cmp(r1, Operand(HEAP_NUMBER_TYPE));
+ __ b(ne, &not_heap_number);
+ __ bind(&is_number);
+ NumberToStringStub stub(isolate());
+ __ TailCallStub(&stub);
+ __ bind(&not_heap_number);
+
+ Label not_oddball;
+ __ cmp(r1, Operand(ODDBALL_TYPE));
+ __ b(ne, &not_oddball);
+ __ ldr(r0, FieldMemOperand(r0, Oddball::kToStringOffset));
+ __ Ret();
+ __ bind(&not_oddball);
+
+ __ push(r0); // Push argument.
+ __ TailCallRuntime(Runtime::kToName);
+}
+
+
void StringHelper::GenerateFlatOneByteStringEquals(
MacroAssembler* masm, Register left, Register right, Register scratch1,
Register scratch2, Register scratch3) {
« no previous file with comments | « no previous file | src/arm/interface-descriptors-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698