OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 } | 636 } |
637 | 637 |
638 | 638 |
639 void Builtins::Generate_NotifyLazyDeoptimized(MacroAssembler* masm) { | 639 void Builtins::Generate_NotifyLazyDeoptimized(MacroAssembler* masm) { |
640 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::LAZY); | 640 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::LAZY); |
641 } | 641 } |
642 | 642 |
643 | 643 |
644 void Builtins::Generate_NotifyOSR(MacroAssembler* masm) { | 644 void Builtins::Generate_NotifyOSR(MacroAssembler* masm) { |
645 // TODO(kasperl): Do we need to save/restore the XMM registers too? | 645 // TODO(kasperl): Do we need to save/restore the XMM registers too? |
| 646 // TODO(mvstanton): We should save these regs, do this in a future |
| 647 // checkin. |
646 | 648 |
647 // For now, we are relying on the fact that Runtime::NotifyOSR | 649 // For now, we are relying on the fact that Runtime::NotifyOSR |
648 // doesn't do any garbage collection which allows us to save/restore | 650 // doesn't do any garbage collection which allows us to save/restore |
649 // the registers without worrying about which of them contain | 651 // the registers without worrying about which of them contain |
650 // pointers. This seems a bit fragile. | 652 // pointers. This seems a bit fragile. |
651 __ pushad(); | 653 __ pushad(); |
652 { | 654 { |
653 FrameScope scope(masm, StackFrame::INTERNAL); | 655 FrameScope scope(masm, StackFrame::INTERNAL); |
654 __ CallRuntime(Runtime::kNotifyOSR, 0); | 656 __ CallRuntime(Runtime::kNotifyOSR, 0); |
655 } | 657 } |
(...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1785 | 1787 |
1786 // ------------------------------------------- | 1788 // ------------------------------------------- |
1787 // Dont adapt arguments. | 1789 // Dont adapt arguments. |
1788 // ------------------------------------------- | 1790 // ------------------------------------------- |
1789 __ bind(&dont_adapt_arguments); | 1791 __ bind(&dont_adapt_arguments); |
1790 __ jmp(edx); | 1792 __ jmp(edx); |
1791 } | 1793 } |
1792 | 1794 |
1793 | 1795 |
1794 void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) { | 1796 void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) { |
1795 CpuFeatures::TryForceFeatureScope scope(SSE2); | |
1796 if (!CpuFeatures::IsSupported(SSE2) && FLAG_debug_code) { | |
1797 __ Abort("Unreachable code: Cannot optimize without SSE2 support."); | |
1798 return; | |
1799 } | |
1800 | |
1801 // Get the loop depth of the stack guard check. This is recorded in | 1797 // Get the loop depth of the stack guard check. This is recorded in |
1802 // a test(eax, depth) instruction right after the call. | 1798 // a test(eax, depth) instruction right after the call. |
1803 Label stack_check; | 1799 Label stack_check; |
1804 __ mov(ebx, Operand(esp, 0)); // return address | 1800 __ mov(ebx, Operand(esp, 0)); // return address |
1805 if (FLAG_debug_code) { | 1801 if (FLAG_debug_code) { |
1806 __ cmpb(Operand(ebx, 0), Assembler::kTestAlByte); | 1802 __ cmpb(Operand(ebx, 0), Assembler::kTestAlByte); |
1807 __ Assert(equal, "test eax instruction not found after loop stack check"); | 1803 __ Assert(equal, "test eax instruction not found after loop stack check"); |
1808 } | 1804 } |
1809 __ movzx_b(ebx, Operand(ebx, 1)); // depth | 1805 __ movzx_b(ebx, Operand(ebx, 1)); // depth |
1810 | 1806 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1860 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); | 1856 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); |
1861 generator.Generate(); | 1857 generator.Generate(); |
1862 } | 1858 } |
1863 | 1859 |
1864 | 1860 |
1865 #undef __ | 1861 #undef __ |
1866 } | 1862 } |
1867 } // namespace v8::internal | 1863 } // namespace v8::internal |
1868 | 1864 |
1869 #endif // V8_TARGET_ARCH_IA32 | 1865 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |