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 1752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1763 | 1763 |
1764 | 1764 |
1765 void MacroAssembler::InvokeFunction(JSFunction* function, | 1765 void MacroAssembler::InvokeFunction(JSFunction* function, |
1766 const ParameterCount& actual, | 1766 const ParameterCount& actual, |
1767 InvokeFlag flag) { | 1767 InvokeFlag flag) { |
1768 ASSERT(function->is_compiled()); | 1768 ASSERT(function->is_compiled()); |
1769 // Get the function and setup the context. | 1769 // Get the function and setup the context. |
1770 Move(rdi, Handle<JSFunction>(function)); | 1770 Move(rdi, Handle<JSFunction>(function)); |
1771 movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset)); | 1771 movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset)); |
1772 | 1772 |
1773 // Invoke the cached code. | 1773 if (V8::UseCrankshaft()) { |
Rico
2011/01/27 11:52:41
Maybe add the comment from ia32 stating why we nee
Lasse Reichstein
2011/01/27 11:57:33
A comment has been added (without the TODO and "fo
| |
1774 Handle<Code> code(function->code()); | 1774 movq(rdx, FieldOperand(rdi, JSFunction::kCodeEntryOffset)); |
1775 ParameterCount expected(function->shared()->formal_parameter_count()); | 1775 ParameterCount expected(function->shared()->formal_parameter_count()); |
1776 InvokeCode(code, expected, actual, RelocInfo::CODE_TARGET, flag); | 1776 InvokeCode(rdx, expected, actual, flag); |
1777 } else { | |
1778 // Invoke the cached code. | |
1779 Handle<Code> code(function->code()); | |
1780 ParameterCount expected(function->shared()->formal_parameter_count()); | |
1781 InvokeCode(code, expected, actual, RelocInfo::CODE_TARGET, flag); | |
1782 } | |
1777 } | 1783 } |
1778 | 1784 |
1779 | 1785 |
1780 void MacroAssembler::EnterFrame(StackFrame::Type type) { | 1786 void MacroAssembler::EnterFrame(StackFrame::Type type) { |
1781 push(rbp); | 1787 push(rbp); |
1782 movq(rbp, rsp); | 1788 movq(rbp, rsp); |
1783 push(rsi); // Context. | 1789 push(rsi); // Context. |
1784 Push(Smi::FromInt(type)); | 1790 Push(Smi::FromInt(type)); |
1785 movq(kScratchRegister, CodeObject(), RelocInfo::EMBEDDED_OBJECT); | 1791 movq(kScratchRegister, CodeObject(), RelocInfo::EMBEDDED_OBJECT); |
1786 push(kScratchRegister); | 1792 push(kScratchRegister); |
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2462 CPU::FlushICache(address_, size_); | 2468 CPU::FlushICache(address_, size_); |
2463 | 2469 |
2464 // Check that the code was patched as expected. | 2470 // Check that the code was patched as expected. |
2465 ASSERT(masm_.pc_ == address_ + size_); | 2471 ASSERT(masm_.pc_ == address_ + size_); |
2466 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 2472 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
2467 } | 2473 } |
2468 | 2474 |
2469 } } // namespace v8::internal | 2475 } } // namespace v8::internal |
2470 | 2476 |
2471 #endif // V8_TARGET_ARCH_X64 | 2477 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |