| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 1758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1769 | 1769 |
| 1770 | 1770 |
| 1771 void MacroAssembler::InvokeFunction(JSFunction* function, | 1771 void MacroAssembler::InvokeFunction(JSFunction* function, |
| 1772 const ParameterCount& actual, | 1772 const ParameterCount& actual, |
| 1773 InvokeFlag flag) { | 1773 InvokeFlag flag) { |
| 1774 ASSERT(function->is_compiled()); | 1774 ASSERT(function->is_compiled()); |
| 1775 // Get the function and setup the context. | 1775 // Get the function and setup the context. |
| 1776 Move(rdi, Handle<JSFunction>(function)); | 1776 Move(rdi, Handle<JSFunction>(function)); |
| 1777 movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset)); | 1777 movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset)); |
| 1778 | 1778 |
| 1779 // Invoke the cached code. | 1779 if (V8::UseCrankshaft()) { |
| 1780 Handle<Code> code(function->code()); | 1780 // Since Crankshaft can recompile a function, we need to load |
| 1781 ParameterCount expected(function->shared()->formal_parameter_count()); | 1781 // the Code object every time we call the function. |
| 1782 InvokeCode(code, expected, actual, RelocInfo::CODE_TARGET, flag); | 1782 movq(rdx, FieldOperand(rdi, JSFunction::kCodeEntryOffset)); |
| 1783 ParameterCount expected(function->shared()->formal_parameter_count()); |
| 1784 InvokeCode(rdx, expected, actual, flag); |
| 1785 } else { |
| 1786 // Invoke the cached code. |
| 1787 Handle<Code> code(function->code()); |
| 1788 ParameterCount expected(function->shared()->formal_parameter_count()); |
| 1789 InvokeCode(code, expected, actual, RelocInfo::CODE_TARGET, flag); |
| 1790 } |
| 1783 } | 1791 } |
| 1784 | 1792 |
| 1785 | 1793 |
| 1786 void MacroAssembler::EnterFrame(StackFrame::Type type) { | 1794 void MacroAssembler::EnterFrame(StackFrame::Type type) { |
| 1787 push(rbp); | 1795 push(rbp); |
| 1788 movq(rbp, rsp); | 1796 movq(rbp, rsp); |
| 1789 push(rsi); // Context. | 1797 push(rsi); // Context. |
| 1790 Push(Smi::FromInt(type)); | 1798 Push(Smi::FromInt(type)); |
| 1791 movq(kScratchRegister, CodeObject(), RelocInfo::EMBEDDED_OBJECT); | 1799 movq(kScratchRegister, CodeObject(), RelocInfo::EMBEDDED_OBJECT); |
| 1792 push(kScratchRegister); | 1800 push(kScratchRegister); |
| (...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2497 CPU::FlushICache(address_, size_); | 2505 CPU::FlushICache(address_, size_); |
| 2498 | 2506 |
| 2499 // Check that the code was patched as expected. | 2507 // Check that the code was patched as expected. |
| 2500 ASSERT(masm_.pc_ == address_ + size_); | 2508 ASSERT(masm_.pc_ == address_ + size_); |
| 2501 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 2509 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
| 2502 } | 2510 } |
| 2503 | 2511 |
| 2504 } } // namespace v8::internal | 2512 } } // namespace v8::internal |
| 2505 | 2513 |
| 2506 #endif // V8_TARGET_ARCH_X64 | 2514 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |