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

Side by Side Diff: src/x64/builtins-x64.cc

Issue 1319973007: [runtime] Add %ToString and %_ToString and remove the TO_STRING builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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/runtime/runtime-object.cc ('k') | src/x64/code-stubs-x64.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_X64 5 #if V8_TARGET_ARCH_X64
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/codegen.h" 8 #include "src/codegen.h"
9 #include "src/deoptimizer.h" 9 #include "src/deoptimizer.h"
10 #include "src/full-codegen/full-codegen.h" 10 #include "src/full-codegen/full-codegen.h"
(...skipping 1566 matching lines...) Expand 10 before | Expand all | Expand 10 after
1577 __ movp(rbx, rax); 1577 __ movp(rbx, rax);
1578 __ IncrementCounter(counters->string_ctor_string_value(), 1); 1578 __ IncrementCounter(counters->string_ctor_string_value(), 1);
1579 __ jmp(&argument_is_string); 1579 __ jmp(&argument_is_string);
1580 1580
1581 // Invoke the conversion builtin and put the result into rbx. 1581 // Invoke the conversion builtin and put the result into rbx.
1582 __ bind(&convert_argument); 1582 __ bind(&convert_argument);
1583 __ IncrementCounter(counters->string_ctor_conversions(), 1); 1583 __ IncrementCounter(counters->string_ctor_conversions(), 1);
1584 { 1584 {
1585 FrameScope scope(masm, StackFrame::INTERNAL); 1585 FrameScope scope(masm, StackFrame::INTERNAL);
1586 __ Push(rdi); // Preserve the function. 1586 __ Push(rdi); // Preserve the function.
1587 __ Push(rax); 1587 ToStringStub stub(masm->isolate());
1588 __ InvokeBuiltin(Context::TO_STRING_BUILTIN_INDEX, CALL_FUNCTION); 1588 __ CallStub(&stub);
1589 __ Pop(rdi); 1589 __ Pop(rdi);
1590 } 1590 }
1591 __ movp(rbx, rax); 1591 __ movp(rbx, rax);
1592 __ jmp(&argument_is_string); 1592 __ jmp(&argument_is_string);
1593 1593
1594 // Load the empty string into rbx, remove the receiver from the 1594 // Load the empty string into rbx, remove the receiver from the
1595 // stack, and jump back to the case where the argument is a string. 1595 // stack, and jump back to the case where the argument is a string.
1596 __ bind(&no_arguments); 1596 __ bind(&no_arguments);
1597 __ LoadRoot(rbx, Heap::kempty_stringRootIndex); 1597 __ LoadRoot(rbx, Heap::kempty_stringRootIndex);
1598 __ PopReturnAddressTo(rcx); 1598 __ PopReturnAddressTo(rcx);
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
1857 __ ret(0); 1857 __ ret(0);
1858 } 1858 }
1859 1859
1860 1860
1861 #undef __ 1861 #undef __
1862 1862
1863 } // namespace internal 1863 } // namespace internal
1864 } // namespace v8 1864 } // namespace v8
1865 1865
1866 #endif // V8_TARGET_ARCH_X64 1866 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/runtime/runtime-object.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698