OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_S390 | 5 #if V8_TARGET_ARCH_S390 |
6 | 6 |
7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
(...skipping 1676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1687 } | 1687 } |
1688 | 1688 |
1689 void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) { | 1689 void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) { |
1690 Generate_NotifyStubFailureHelper(masm, kDontSaveFPRegs); | 1690 Generate_NotifyStubFailureHelper(masm, kDontSaveFPRegs); |
1691 } | 1691 } |
1692 | 1692 |
1693 void Builtins::Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm) { | 1693 void Builtins::Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm) { |
1694 Generate_NotifyStubFailureHelper(masm, kSaveFPRegs); | 1694 Generate_NotifyStubFailureHelper(masm, kSaveFPRegs); |
1695 } | 1695 } |
1696 | 1696 |
| 1697 void Builtins::Generate_NotifyBuiltinContinuation(MacroAssembler* masm) { |
| 1698 { |
| 1699 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); |
| 1700 // Preserve possible return result from lazy deopt. |
| 1701 __ push(r2); |
| 1702 // Pass the function and deoptimization type to the runtime system. |
| 1703 __ CallRuntime(Runtime::kNotifyStubFailure, false); |
| 1704 __ pop(r2); |
| 1705 } |
| 1706 |
| 1707 __ AddP(sp, sp, Operand(kPointerSize)); // Ignore state |
| 1708 __ Ret(); // Jump to ContinueToBuiltin stub |
| 1709 } |
| 1710 |
| 1711 namespace { |
| 1712 void Generate_ContinueToBuiltinHelper(MacroAssembler* masm, |
| 1713 bool java_script_builtin, |
| 1714 bool with_result) { |
| 1715 const RegisterConfiguration* config(RegisterConfiguration::Turbofan()); |
| 1716 int allocatable_register_count = config->num_allocatable_general_registers(); |
| 1717 if (with_result) { |
| 1718 // Overwrite the hole inserted by the deoptimizer with the return value from |
| 1719 // the LAZY deopt point. |
| 1720 __ StoreP( |
| 1721 r2, MemOperand( |
| 1722 sp, config->num_allocatable_general_registers() * kPointerSize + |
| 1723 BuiltinContinuationFrameConstants::kFixedFrameSize)); |
| 1724 } |
| 1725 for (int i = allocatable_register_count - 1; i >= 0; --i) { |
| 1726 int code = config->GetAllocatableGeneralCode(i); |
| 1727 __ Pop(Register::from_code(code)); |
| 1728 if (java_script_builtin && code == kJavaScriptCallArgCountRegister.code()) { |
| 1729 __ SmiUntag(Register::from_code(code)); |
| 1730 } |
| 1731 } |
| 1732 __ LoadP( |
| 1733 fp, |
| 1734 MemOperand(sp, BuiltinContinuationFrameConstants::kFixedFrameSizeFromFp)); |
| 1735 __ Pop(ip); |
| 1736 __ AddP(sp, sp, |
| 1737 Operand(BuiltinContinuationFrameConstants::kFixedFrameSizeFromFp)); |
| 1738 __ Pop(r0); |
| 1739 __ LoadRR(r14, r0); |
| 1740 __ AddP(ip, ip, Operand(Code::kHeaderSize - kHeapObjectTag)); |
| 1741 __ Jump(ip); |
| 1742 } |
| 1743 } // namespace |
| 1744 |
| 1745 void Builtins::Generate_ContinueToCodeStubBuiltin(MacroAssembler* masm) { |
| 1746 Generate_ContinueToBuiltinHelper(masm, false, false); |
| 1747 } |
| 1748 |
| 1749 void Builtins::Generate_ContinueToCodeStubBuiltinWithResult( |
| 1750 MacroAssembler* masm) { |
| 1751 Generate_ContinueToBuiltinHelper(masm, false, true); |
| 1752 } |
| 1753 |
| 1754 void Builtins::Generate_ContinueToJavaScriptBuiltin(MacroAssembler* masm) { |
| 1755 Generate_ContinueToBuiltinHelper(masm, true, false); |
| 1756 } |
| 1757 |
| 1758 void Builtins::Generate_ContinueToJavaScriptBuiltinWithResult( |
| 1759 MacroAssembler* masm) { |
| 1760 Generate_ContinueToBuiltinHelper(masm, true, true); |
| 1761 } |
| 1762 |
1697 static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm, | 1763 static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm, |
1698 Deoptimizer::BailoutType type) { | 1764 Deoptimizer::BailoutType type) { |
1699 { | 1765 { |
1700 FrameScope scope(masm, StackFrame::INTERNAL); | 1766 FrameScope scope(masm, StackFrame::INTERNAL); |
1701 // Pass the function and deoptimization type to the runtime system. | 1767 // Pass the function and deoptimization type to the runtime system. |
1702 __ LoadSmiLiteral(r2, Smi::FromInt(static_cast<int>(type))); | 1768 __ LoadSmiLiteral(r2, Smi::FromInt(static_cast<int>(type))); |
1703 __ push(r2); | 1769 __ push(r2); |
1704 __ CallRuntime(Runtime::kNotifyDeoptimized); | 1770 __ CallRuntime(Runtime::kNotifyDeoptimized); |
1705 } | 1771 } |
1706 | 1772 |
(...skipping 1473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3180 // Now jump to the instructions of the returned code object. | 3246 // Now jump to the instructions of the returned code object. |
3181 __ Jump(ip); | 3247 __ Jump(ip); |
3182 } | 3248 } |
3183 | 3249 |
3184 #undef __ | 3250 #undef __ |
3185 | 3251 |
3186 } // namespace internal | 3252 } // namespace internal |
3187 } // namespace v8 | 3253 } // namespace v8 |
3188 | 3254 |
3189 #endif // V8_TARGET_ARCH_S390 | 3255 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |