OLD | NEW |
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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1756 __ ret(0); | 1756 __ ret(0); |
1757 } | 1757 } |
1758 __ bind(&runtime_call); | 1758 __ bind(&runtime_call); |
1759 | 1759 |
1760 // Push arguments below the return address to prepare jump to builtin. | 1760 // Push arguments below the return address to prepare jump to builtin. |
1761 __ PopReturnAddressTo(rcx); | 1761 __ PopReturnAddressTo(rcx); |
1762 __ Push(rdx); | 1762 __ Push(rdx); |
1763 __ Push(rax); | 1763 __ Push(rax); |
1764 | 1764 |
1765 // Figure out which native to call and setup the arguments. | 1765 // Figure out which native to call and setup the arguments. |
1766 Builtins::JavaScript builtin; | 1766 if (cc == equal && strict()) { |
1767 if (cc == equal) { | 1767 __ PushReturnAddressFrom(rcx); |
1768 builtin = strict() ? Builtins::STRICT_EQUALS : Builtins::EQUALS; | 1768 __ TailCallRuntime(Runtime::kStrictEquals, 2, 1); |
1769 } else { | 1769 } else { |
1770 builtin = | 1770 Builtins::JavaScript builtin; |
1771 is_strong(strength()) ? Builtins::COMPARE_STRONG : Builtins::COMPARE; | 1771 if (cc == equal) { |
1772 __ Push(Smi::FromInt(NegativeComparisonResult(cc))); | 1772 builtin = Builtins::EQUALS; |
| 1773 } else { |
| 1774 builtin = |
| 1775 is_strong(strength()) ? Builtins::COMPARE_STRONG : Builtins::COMPARE; |
| 1776 __ Push(Smi::FromInt(NegativeComparisonResult(cc))); |
| 1777 } |
| 1778 |
| 1779 __ PushReturnAddressFrom(rcx); |
| 1780 |
| 1781 // Call the native; it returns -1 (less), 0 (equal), or 1 (greater) |
| 1782 // tagged as a small integer. |
| 1783 __ InvokeBuiltin(builtin, JUMP_FUNCTION); |
1773 } | 1784 } |
1774 | 1785 |
1775 __ PushReturnAddressFrom(rcx); | |
1776 | |
1777 // Call the native; it returns -1 (less), 0 (equal), or 1 (greater) | |
1778 // tagged as a small integer. | |
1779 __ InvokeBuiltin(builtin, JUMP_FUNCTION); | |
1780 | |
1781 __ bind(&miss); | 1786 __ bind(&miss); |
1782 GenerateMiss(masm); | 1787 GenerateMiss(masm); |
1783 } | 1788 } |
1784 | 1789 |
1785 | 1790 |
1786 static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub, | 1791 static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub, |
1787 bool is_super) { | 1792 bool is_super) { |
1788 // rax : number of arguments to the construct function | 1793 // rax : number of arguments to the construct function |
1789 // rbx : feedback vector | 1794 // rbx : feedback vector |
1790 // rcx : original constructor (for IsSuperConstructorCall) | 1795 // rcx : original constructor (for IsSuperConstructorCall) |
(...skipping 3792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5583 kStackSpace, nullptr, return_value_operand, NULL); | 5588 kStackSpace, nullptr, return_value_operand, NULL); |
5584 } | 5589 } |
5585 | 5590 |
5586 | 5591 |
5587 #undef __ | 5592 #undef __ |
5588 | 5593 |
5589 } // namespace internal | 5594 } // namespace internal |
5590 } // namespace v8 | 5595 } // namespace v8 |
5591 | 5596 |
5592 #endif // V8_TARGET_ARCH_X64 | 5597 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |