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

Side by Side Diff: src/x64/code-stubs-x64.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/s390/code-stubs-s390.cc ('k') | src/x87/code-stubs-x87.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_X64 5 #if V8_TARGET_ARCH_X64
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 1993 matching lines...) Expand 10 before | Expand all | Expand 10 after
2004 __ movb(kScratchRegister, Operand(src, 0)); 2004 __ movb(kScratchRegister, Operand(src, 0));
2005 __ movb(Operand(dest, 0), kScratchRegister); 2005 __ movb(Operand(dest, 0), kScratchRegister);
2006 __ incp(src); 2006 __ incp(src);
2007 __ incp(dest); 2007 __ incp(dest);
2008 __ decl(count); 2008 __ decl(count);
2009 __ j(not_zero, &loop); 2009 __ j(not_zero, &loop);
2010 2010
2011 __ bind(&done); 2011 __ bind(&done);
2012 } 2012 }
2013 2013
2014 void ToStringStub::Generate(MacroAssembler* masm) {
2015 // The ToString stub takes one argument in rax.
2016 Label is_number;
2017 __ JumpIfSmi(rax, &is_number, Label::kNear);
2018
2019 Label not_string;
2020 __ CmpObjectType(rax, FIRST_NONSTRING_TYPE, rdi);
2021 // rax: receiver
2022 // rdi: receiver map
2023 __ j(above_equal, &not_string, Label::kNear);
2024 __ Ret();
2025 __ bind(&not_string);
2026
2027 Label not_heap_number;
2028 __ CompareRoot(rdi, Heap::kHeapNumberMapRootIndex);
2029 __ j(not_equal, &not_heap_number, Label::kNear);
2030 __ bind(&is_number);
2031 NumberToStringStub stub(isolate());
2032 __ TailCallStub(&stub);
2033 __ bind(&not_heap_number);
2034
2035 Label not_oddball;
2036 __ CmpInstanceType(rdi, ODDBALL_TYPE);
2037 __ j(not_equal, &not_oddball, Label::kNear);
2038 __ movp(rax, FieldOperand(rax, Oddball::kToStringOffset));
2039 __ Ret();
2040 __ bind(&not_oddball);
2041
2042 __ PopReturnAddressTo(rcx); // Pop return address.
2043 __ Push(rax); // Push argument.
2044 __ PushReturnAddressFrom(rcx); // Push return address.
2045 __ TailCallRuntime(Runtime::kToString);
2046 }
2047
2048 2014
2049 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, 2015 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm,
2050 Register left, 2016 Register left,
2051 Register right, 2017 Register right,
2052 Register scratch1, 2018 Register scratch1,
2053 Register scratch2) { 2019 Register scratch2) {
2054 Register length = scratch1; 2020 Register length = scratch1;
2055 2021
2056 // Compare lengths. 2022 // Compare lengths.
2057 Label check_zero_length; 2023 Label check_zero_length;
(...skipping 2871 matching lines...) Expand 10 before | Expand all | Expand 10 after
4929 kStackUnwindSpace, nullptr, return_value_operand, 4895 kStackUnwindSpace, nullptr, return_value_operand,
4930 NULL); 4896 NULL);
4931 } 4897 }
4932 4898
4933 #undef __ 4899 #undef __
4934 4900
4935 } // namespace internal 4901 } // namespace internal
4936 } // namespace v8 4902 } // namespace v8
4937 4903
4938 #endif // V8_TARGET_ARCH_X64 4904 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/s390/code-stubs-s390.cc ('k') | src/x87/code-stubs-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698