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

Side by Side Diff: src/arm/code-stubs-arm.cc

Issue 2380973002: [stubs] replaced ToString MacroAssembler Stub with CodeStubAssembler builtin (Closed)
Patch Set: Merge branch 'master' of https://chromium.googlesource.com/v8/v8 into ToStringTFStub Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/arm64/code-stubs-arm64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_ARM 5 #if V8_TARGET_ARCH_ARM
6 6
7 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/api-arguments.h" 8 #include "src/api-arguments.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 2106 matching lines...) Expand 10 before | Expand all | Expand 10 after
2117 __ bind(&loop); 2117 __ bind(&loop);
2118 __ ldrb(scratch, MemOperand(src, 1, PostIndex), lt); 2118 __ ldrb(scratch, MemOperand(src, 1, PostIndex), lt);
2119 __ strb(scratch, MemOperand(dest, 1, PostIndex)); 2119 __ strb(scratch, MemOperand(dest, 1, PostIndex));
2120 __ bind(&loop_entry); 2120 __ bind(&loop_entry);
2121 __ cmp(dest, Operand(limit)); 2121 __ cmp(dest, Operand(limit));
2122 __ b(lt, &loop); 2122 __ b(lt, &loop);
2123 2123
2124 __ bind(&done); 2124 __ bind(&done);
2125 } 2125 }
2126 2126
2127 void ToStringStub::Generate(MacroAssembler* masm) {
2128 // The ToString stub takes one argument in r0.
2129 Label is_number;
2130 __ JumpIfSmi(r0, &is_number);
2131
2132 __ CompareObjectType(r0, r1, r1, FIRST_NONSTRING_TYPE);
2133 // r0: receiver
2134 // r1: receiver instance type
2135 __ Ret(lo);
2136
2137 Label not_heap_number;
2138 __ cmp(r1, Operand(HEAP_NUMBER_TYPE));
2139 __ b(ne, &not_heap_number);
2140 __ bind(&is_number);
2141 NumberToStringStub stub(isolate());
2142 __ TailCallStub(&stub);
2143 __ bind(&not_heap_number);
2144
2145 Label not_oddball;
2146 __ cmp(r1, Operand(ODDBALL_TYPE));
2147 __ b(ne, &not_oddball);
2148 __ ldr(r0, FieldMemOperand(r0, Oddball::kToStringOffset));
2149 __ Ret();
2150 __ bind(&not_oddball);
2151
2152 __ push(r0); // Push argument.
2153 __ TailCallRuntime(Runtime::kToString);
2154 }
2155
2156 2127
2157 void StringHelper::GenerateFlatOneByteStringEquals( 2128 void StringHelper::GenerateFlatOneByteStringEquals(
2158 MacroAssembler* masm, Register left, Register right, Register scratch1, 2129 MacroAssembler* masm, Register left, Register right, Register scratch1,
2159 Register scratch2, Register scratch3) { 2130 Register scratch2, Register scratch3) {
2160 Register length = scratch1; 2131 Register length = scratch1;
2161 2132
2162 // Compare lengths. 2133 // Compare lengths.
2163 Label strings_not_equal, check_zero_length; 2134 Label strings_not_equal, check_zero_length;
2164 __ ldr(length, FieldMemOperand(left, String::kLengthOffset)); 2135 __ ldr(length, FieldMemOperand(left, String::kLengthOffset));
2165 __ ldr(scratch2, FieldMemOperand(right, String::kLengthOffset)); 2136 __ ldr(scratch2, FieldMemOperand(right, String::kLengthOffset));
(...skipping 2776 matching lines...) Expand 10 before | Expand all | Expand 10 after
4942 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, 4913 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref,
4943 kStackUnwindSpace, NULL, return_value_operand, NULL); 4914 kStackUnwindSpace, NULL, return_value_operand, NULL);
4944 } 4915 }
4945 4916
4946 #undef __ 4917 #undef __
4947 4918
4948 } // namespace internal 4919 } // namespace internal
4949 } // namespace v8 4920 } // namespace v8
4950 4921
4951 #endif // V8_TARGET_ARCH_ARM 4922 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm64/code-stubs-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698