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

Side by Side Diff: src/arm64/code-stubs-arm64.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/arm/code-stubs-arm.cc ('k') | src/builtins/arm/builtins-arm.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_ARM64 5 #if V8_TARGET_ARCH_ARM64
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/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 2655 matching lines...) Expand 10 before | Expand all | Expand 10 after
2666 // Compute the entry point of the rewritten stub. 2666 // Compute the entry point of the rewritten stub.
2667 __ Add(stub_entry, x0, Code::kHeaderSize - kHeapObjectTag); 2667 __ Add(stub_entry, x0, Code::kHeaderSize - kHeapObjectTag);
2668 // Restore caller-saved registers. 2668 // Restore caller-saved registers.
2669 __ Pop(lr, x0, x1); 2669 __ Pop(lr, x0, x1);
2670 } 2670 }
2671 2671
2672 // Tail-call to the new stub. 2672 // Tail-call to the new stub.
2673 __ Jump(stub_entry); 2673 __ Jump(stub_entry);
2674 } 2674 }
2675 2675
2676 void ToStringStub::Generate(MacroAssembler* masm) {
2677 // The ToString stub takes one argument in x0.
2678 Label is_number;
2679 __ JumpIfSmi(x0, &is_number);
2680
2681 Label not_string;
2682 __ JumpIfObjectType(x0, x1, x1, FIRST_NONSTRING_TYPE, &not_string, hs);
2683 // x0: receiver
2684 // x1: receiver instance type
2685 __ Ret();
2686 __ Bind(&not_string);
2687
2688 Label not_heap_number;
2689 __ Cmp(x1, HEAP_NUMBER_TYPE);
2690 __ B(ne, &not_heap_number);
2691 __ Bind(&is_number);
2692 NumberToStringStub stub(isolate());
2693 __ TailCallStub(&stub);
2694 __ Bind(&not_heap_number);
2695
2696 Label not_oddball;
2697 __ Cmp(x1, ODDBALL_TYPE);
2698 __ B(ne, &not_oddball);
2699 __ Ldr(x0, FieldMemOperand(x0, Oddball::kToStringOffset));
2700 __ Ret();
2701 __ Bind(&not_oddball);
2702
2703 __ Push(x0); // Push argument.
2704 __ TailCallRuntime(Runtime::kToString);
2705 }
2706
2707 2676
2708 void StringHelper::GenerateFlatOneByteStringEquals( 2677 void StringHelper::GenerateFlatOneByteStringEquals(
2709 MacroAssembler* masm, Register left, Register right, Register scratch1, 2678 MacroAssembler* masm, Register left, Register right, Register scratch1,
2710 Register scratch2, Register scratch3) { 2679 Register scratch2, Register scratch3) {
2711 DCHECK(!AreAliased(left, right, scratch1, scratch2, scratch3)); 2680 DCHECK(!AreAliased(left, right, scratch1, scratch2, scratch3));
2712 Register result = x0; 2681 Register result = x0;
2713 Register left_length = scratch1; 2682 Register left_length = scratch1;
2714 Register right_length = scratch2; 2683 Register right_length = scratch2;
2715 2684
2716 // Compare lengths. If lengths differ, strings can't be equal. Lengths are 2685 // Compare lengths. If lengths differ, strings can't be equal. Lengths are
(...skipping 2557 matching lines...) Expand 10 before | Expand all | Expand 10 after
5274 kStackUnwindSpace, NULL, spill_offset, 5243 kStackUnwindSpace, NULL, spill_offset,
5275 return_value_operand, NULL); 5244 return_value_operand, NULL);
5276 } 5245 }
5277 5246
5278 #undef __ 5247 #undef __
5279 5248
5280 } // namespace internal 5249 } // namespace internal
5281 } // namespace v8 5250 } // namespace v8
5282 5251
5283 #endif // V8_TARGET_ARCH_ARM64 5252 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/builtins/arm/builtins-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698