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 1892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1903 // Both expected and actual are in (different) registers. This | 1903 // Both expected and actual are in (different) registers. This |
1904 // is the case when we invoke functions using call and apply. | 1904 // is the case when we invoke functions using call and apply. |
1905 cmpq(expected.reg(), actual.reg()); | 1905 cmpq(expected.reg(), actual.reg()); |
1906 j(equal, &invoke); | 1906 j(equal, &invoke); |
1907 ASSERT(actual.reg().is(rax)); | 1907 ASSERT(actual.reg().is(rax)); |
1908 ASSERT(expected.reg().is(rbx)); | 1908 ASSERT(expected.reg().is(rbx)); |
1909 } | 1909 } |
1910 } | 1910 } |
1911 | 1911 |
1912 if (!definitely_matches) { | 1912 if (!definitely_matches) { |
1913 Handle<Code> adaptor = | 1913 Handle<Code> adaptor = isolate()->builtins()->ArgumentsAdaptorTrampoline(); |
1914 Handle<Code>(Isolate::Current()->builtins()->builtin( | |
1915 Builtins::ArgumentsAdaptorTrampoline)); | |
1916 if (!code_constant.is_null()) { | 1914 if (!code_constant.is_null()) { |
1917 movq(rdx, code_constant, RelocInfo::EMBEDDED_OBJECT); | 1915 movq(rdx, code_constant, RelocInfo::EMBEDDED_OBJECT); |
1918 addq(rdx, Immediate(Code::kHeaderSize - kHeapObjectTag)); | 1916 addq(rdx, Immediate(Code::kHeaderSize - kHeapObjectTag)); |
1919 } else if (!code_register.is(rdx)) { | 1917 } else if (!code_register.is(rdx)) { |
1920 movq(rdx, code_register); | 1918 movq(rdx, code_register); |
1921 } | 1919 } |
1922 | 1920 |
1923 if (flag == CALL_FUNCTION) { | 1921 if (flag == CALL_FUNCTION) { |
1924 if (call_wrapper != NULL) call_wrapper->BeforeCall(CallSize(adaptor)); | 1922 if (call_wrapper != NULL) call_wrapper->BeforeCall(CallSize(adaptor)); |
1925 Call(adaptor, RelocInfo::CODE_TARGET); | 1923 Call(adaptor, RelocInfo::CODE_TARGET); |
1926 if (call_wrapper != NULL) call_wrapper->AfterCall(); | 1924 if (call_wrapper != NULL) call_wrapper->AfterCall(); |
1927 jmp(done); | 1925 jmp(done); |
1928 } else { | 1926 } else { |
1929 Jump(adaptor, RelocInfo::CODE_TARGET); | 1927 Jump(adaptor, RelocInfo::CODE_TARGET); |
1930 } | 1928 } |
1931 bind(&invoke); | 1929 bind(&invoke); |
1932 } | 1930 } |
1933 } | 1931 } |
1934 | 1932 |
1935 | 1933 |
1936 } } // namespace v8::internal | 1934 } } // namespace v8::internal |
1937 | 1935 |
1938 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 1936 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
OLD | NEW |