| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 885 | 885 |
| 886 // Tail call a code stub (jump) and return the code object called. Try to | 886 // Tail call a code stub (jump) and return the code object called. Try to |
| 887 // generate the code if necessary. Do not perform a GC but instead return | 887 // generate the code if necessary. Do not perform a GC but instead return |
| 888 // a retry after GC failure. | 888 // a retry after GC failure. |
| 889 MUST_USE_RESULT MaybeObject* TryTailCallStub(CodeStub* stub); | 889 MUST_USE_RESULT MaybeObject* TryTailCallStub(CodeStub* stub); |
| 890 | 890 |
| 891 // Return from a code stub after popping its arguments. | 891 // Return from a code stub after popping its arguments. |
| 892 void StubReturn(int argc); | 892 void StubReturn(int argc); |
| 893 | 893 |
| 894 // Call a runtime routine. | 894 // Call a runtime routine. |
| 895 void CallRuntime(Runtime::Function* f, int num_arguments); | 895 void CallRuntime(const Runtime::Function* f, int num_arguments); |
| 896 | 896 |
| 897 // Call a runtime function and save the value of XMM registers. | 897 // Call a runtime function and save the value of XMM registers. |
| 898 void CallRuntimeSaveDoubles(Runtime::FunctionId id); | 898 void CallRuntimeSaveDoubles(Runtime::FunctionId id); |
| 899 | 899 |
| 900 // Call a runtime function, returning the CodeStub object called. | 900 // Call a runtime function, returning the CodeStub object called. |
| 901 // Try to generate the stub code if necessary. Do not perform a GC | 901 // Try to generate the stub code if necessary. Do not perform a GC |
| 902 // but instead return a retry after GC failure. | 902 // but instead return a retry after GC failure. |
| 903 MUST_USE_RESULT MaybeObject* TryCallRuntime(Runtime::Function* f, | 903 MUST_USE_RESULT MaybeObject* TryCallRuntime(const Runtime::Function* f, |
| 904 int num_arguments); | 904 int num_arguments); |
| 905 | 905 |
| 906 // Convenience function: Same as above, but takes the fid instead. | 906 // Convenience function: Same as above, but takes the fid instead. |
| 907 void CallRuntime(Runtime::FunctionId id, int num_arguments); | 907 void CallRuntime(Runtime::FunctionId id, int num_arguments); |
| 908 | 908 |
| 909 // Convenience function: Same as above, but takes the fid instead. | 909 // Convenience function: Same as above, but takes the fid instead. |
| 910 MUST_USE_RESULT MaybeObject* TryCallRuntime(Runtime::FunctionId id, | 910 MUST_USE_RESULT MaybeObject* TryCallRuntime(Runtime::FunctionId id, |
| 911 int num_arguments); | 911 int num_arguments); |
| 912 | 912 |
| 913 // Convenience function: call an external reference. | 913 // Convenience function: call an external reference. |
| (...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1804 movq(kScratchRegister, ExternalReference::new_space_mask()); | 1804 movq(kScratchRegister, ExternalReference::new_space_mask()); |
| 1805 and_(scratch, kScratchRegister); | 1805 and_(scratch, kScratchRegister); |
| 1806 } else { | 1806 } else { |
| 1807 movq(scratch, ExternalReference::new_space_mask()); | 1807 movq(scratch, ExternalReference::new_space_mask()); |
| 1808 and_(scratch, object); | 1808 and_(scratch, object); |
| 1809 } | 1809 } |
| 1810 movq(kScratchRegister, ExternalReference::new_space_start()); | 1810 movq(kScratchRegister, ExternalReference::new_space_start()); |
| 1811 cmpq(scratch, kScratchRegister); | 1811 cmpq(scratch, kScratchRegister); |
| 1812 j(cc, branch); | 1812 j(cc, branch); |
| 1813 } else { | 1813 } else { |
| 1814 ASSERT(is_int32(static_cast<int64_t>(Heap::NewSpaceMask()))); | 1814 ASSERT(is_int32(static_cast<int64_t>(HEAP->NewSpaceMask()))); |
| 1815 intptr_t new_space_start = | 1815 intptr_t new_space_start = |
| 1816 reinterpret_cast<intptr_t>(Heap::NewSpaceStart()); | 1816 reinterpret_cast<intptr_t>(HEAP->NewSpaceStart()); |
| 1817 movq(kScratchRegister, -new_space_start, RelocInfo::NONE); | 1817 movq(kScratchRegister, -new_space_start, RelocInfo::NONE); |
| 1818 if (scratch.is(object)) { | 1818 if (scratch.is(object)) { |
| 1819 addq(scratch, kScratchRegister); | 1819 addq(scratch, kScratchRegister); |
| 1820 } else { | 1820 } else { |
| 1821 lea(scratch, Operand(object, kScratchRegister, times_1, 0)); | 1821 lea(scratch, Operand(object, kScratchRegister, times_1, 0)); |
| 1822 } | 1822 } |
| 1823 and_(scratch, Immediate(static_cast<int32_t>(Heap::NewSpaceMask()))); | 1823 and_(scratch, Immediate(static_cast<int32_t>(HEAP->NewSpaceMask()))); |
| 1824 j(cc, branch); | 1824 j(cc, branch); |
| 1825 } | 1825 } |
| 1826 } | 1826 } |
| 1827 | 1827 |
| 1828 | 1828 |
| 1829 template <typename LabelType> | 1829 template <typename LabelType> |
| 1830 void MacroAssembler::InvokePrologue(const ParameterCount& expected, | 1830 void MacroAssembler::InvokePrologue(const ParameterCount& expected, |
| 1831 const ParameterCount& actual, | 1831 const ParameterCount& actual, |
| 1832 Handle<Code> code_constant, | 1832 Handle<Code> code_constant, |
| 1833 Register code_register, | 1833 Register code_register, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1867 // is the case when we invoke functions using call and apply. | 1867 // is the case when we invoke functions using call and apply. |
| 1868 cmpq(expected.reg(), actual.reg()); | 1868 cmpq(expected.reg(), actual.reg()); |
| 1869 j(equal, &invoke); | 1869 j(equal, &invoke); |
| 1870 ASSERT(actual.reg().is(rax)); | 1870 ASSERT(actual.reg().is(rax)); |
| 1871 ASSERT(expected.reg().is(rbx)); | 1871 ASSERT(expected.reg().is(rbx)); |
| 1872 } | 1872 } |
| 1873 } | 1873 } |
| 1874 | 1874 |
| 1875 if (!definitely_matches) { | 1875 if (!definitely_matches) { |
| 1876 Handle<Code> adaptor = | 1876 Handle<Code> adaptor = |
| 1877 Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)); | 1877 Handle<Code>(Isolate::Current()->builtins()->builtin( |
| 1878 Builtins::ArgumentsAdaptorTrampoline)); |
| 1878 if (!code_constant.is_null()) { | 1879 if (!code_constant.is_null()) { |
| 1879 movq(rdx, code_constant, RelocInfo::EMBEDDED_OBJECT); | 1880 movq(rdx, code_constant, RelocInfo::EMBEDDED_OBJECT); |
| 1880 addq(rdx, Immediate(Code::kHeaderSize - kHeapObjectTag)); | 1881 addq(rdx, Immediate(Code::kHeaderSize - kHeapObjectTag)); |
| 1881 } else if (!code_register.is(rdx)) { | 1882 } else if (!code_register.is(rdx)) { |
| 1882 movq(rdx, code_register); | 1883 movq(rdx, code_register); |
| 1883 } | 1884 } |
| 1884 | 1885 |
| 1885 if (flag == CALL_FUNCTION) { | 1886 if (flag == CALL_FUNCTION) { |
| 1886 if (call_wrapper != NULL) call_wrapper->BeforeCall(CallSize(adaptor)); | 1887 if (call_wrapper != NULL) call_wrapper->BeforeCall(CallSize(adaptor)); |
| 1887 Call(adaptor, RelocInfo::CODE_TARGET); | 1888 Call(adaptor, RelocInfo::CODE_TARGET); |
| 1888 if (call_wrapper != NULL) call_wrapper->AfterCall(); | 1889 if (call_wrapper != NULL) call_wrapper->AfterCall(); |
| 1889 jmp(done); | 1890 jmp(done); |
| 1890 } else { | 1891 } else { |
| 1891 Jump(adaptor, RelocInfo::CODE_TARGET); | 1892 Jump(adaptor, RelocInfo::CODE_TARGET); |
| 1892 } | 1893 } |
| 1893 bind(&invoke); | 1894 bind(&invoke); |
| 1894 } | 1895 } |
| 1895 } | 1896 } |
| 1896 | 1897 |
| 1897 | 1898 |
| 1898 } } // namespace v8::internal | 1899 } } // namespace v8::internal |
| 1899 | 1900 |
| 1900 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 1901 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
| OLD | NEW |