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

Side by Side Diff: src/ppc/code-stubs-ppc.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 | « src/mips64/code-stubs-mips64.cc ('k') | src/s390/code-stubs-s390.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_PPC 5 #if V8_TARGET_ARCH_PPC
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 2189 matching lines...) Expand 10 before | Expand all | Expand 10 after
2200 __ bind(&byte_loop); 2200 __ bind(&byte_loop);
2201 __ lbz(scratch, MemOperand(src)); 2201 __ lbz(scratch, MemOperand(src));
2202 __ addi(src, src, Operand(1)); 2202 __ addi(src, src, Operand(1));
2203 __ stb(scratch, MemOperand(dest)); 2203 __ stb(scratch, MemOperand(dest));
2204 __ addi(dest, dest, Operand(1)); 2204 __ addi(dest, dest, Operand(1));
2205 __ bdnz(&byte_loop); 2205 __ bdnz(&byte_loop);
2206 2206
2207 __ bind(&done); 2207 __ bind(&done);
2208 } 2208 }
2209 2209
2210 void ToStringStub::Generate(MacroAssembler* masm) {
2211 // The ToString stub takes one argument in r3.
2212 Label is_number;
2213 __ JumpIfSmi(r3, &is_number);
2214
2215 __ CompareObjectType(r3, r4, r4, FIRST_NONSTRING_TYPE);
2216 // r3: receiver
2217 // r4: receiver instance type
2218 __ Ret(lt);
2219
2220 Label not_heap_number;
2221 __ cmpi(r4, Operand(HEAP_NUMBER_TYPE));
2222 __ bne(&not_heap_number);
2223 __ bind(&is_number);
2224 NumberToStringStub stub(isolate());
2225 __ TailCallStub(&stub);
2226 __ bind(&not_heap_number);
2227
2228 Label not_oddball;
2229 __ cmpi(r4, Operand(ODDBALL_TYPE));
2230 __ bne(&not_oddball);
2231 __ LoadP(r3, FieldMemOperand(r3, Oddball::kToStringOffset));
2232 __ Ret();
2233 __ bind(&not_oddball);
2234
2235 __ push(r3); // Push argument.
2236 __ TailCallRuntime(Runtime::kToString);
2237 }
2238
2239 2210
2240 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, 2211 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm,
2241 Register left, 2212 Register left,
2242 Register right, 2213 Register right,
2243 Register scratch1, 2214 Register scratch1,
2244 Register scratch2) { 2215 Register scratch2) {
2245 Register length = scratch1; 2216 Register length = scratch1;
2246 2217
2247 // Compare lengths. 2218 // Compare lengths.
2248 Label strings_not_equal, check_zero_length; 2219 Label strings_not_equal, check_zero_length;
(...skipping 2965 matching lines...) Expand 10 before | Expand all | Expand 10 after
5214 fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize); 5185 fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize);
5215 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, 5186 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref,
5216 kStackUnwindSpace, NULL, return_value_operand, NULL); 5187 kStackUnwindSpace, NULL, return_value_operand, NULL);
5217 } 5188 }
5218 5189
5219 #undef __ 5190 #undef __
5220 } // namespace internal 5191 } // namespace internal
5221 } // namespace v8 5192 } // namespace v8
5222 5193
5223 #endif // V8_TARGET_ARCH_PPC 5194 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « src/mips64/code-stubs-mips64.cc ('k') | src/s390/code-stubs-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698