Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: src/builtins/arm64/builtins-arm64.cc

Issue 2803853005: Inline Array.prototype.forEach in TurboFan (Closed)
Patch Set: fix v8heapconst.py Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_ARM64 5 #if V8_TARGET_ARCH_ARM64
6 6
7 #include "src/arm64/frames-arm64.h" 7 #include "src/arm64/frames-arm64.h"
8 #include "src/arm64/macro-assembler-arm64-inl.h" 8 #include "src/arm64/macro-assembler-arm64-inl.h"
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/counters.h" 10 #include "src/counters.h"
(...skipping 1672 matching lines...) Expand 10 before | Expand all | Expand 10 after
1683 } 1683 }
1684 1684
1685 void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) { 1685 void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) {
1686 Generate_NotifyStubFailureHelper(masm, kDontSaveFPRegs); 1686 Generate_NotifyStubFailureHelper(masm, kDontSaveFPRegs);
1687 } 1687 }
1688 1688
1689 void Builtins::Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm) { 1689 void Builtins::Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm) {
1690 Generate_NotifyStubFailureHelper(masm, kSaveFPRegs); 1690 Generate_NotifyStubFailureHelper(masm, kSaveFPRegs);
1691 } 1691 }
1692 1692
1693 void Builtins::Generate_NotifyBuiltinContinuation(MacroAssembler* masm) {
1694 {
1695 FrameScope scope(masm, StackFrame::INTERNAL);
1696
1697 // Preserve registers across notification, this is important for compiled
1698 // stubs that tail call the runtime on deopts passing their parameters in
1699 // registers.
1700 // TODO(jbramley): Is it correct (and appropriate) to use safepoint
1701 // registers here? According to the comment above, we should only need to
1702 // preserve the registers with parameters.
1703 __ PushXRegList(kSafepointSavedRegisters);
1704 // Pass the function and deoptimization type to the runtime system.
1705 __ CallRuntime(Runtime::kNotifyStubFailure, false);
1706 __ PopXRegList(kSafepointSavedRegisters);
1707 }
1708
1709 // Ignore state (pushed by Deoptimizer::EntryGenerator::Generate).
1710 __ Drop(1);
1711
1712 // Jump to the miss handler. Deoptimizer::EntryGenerator::Generate loads this
1713 // into lr before it jumps here.
1714 __ Br(lr);
1715 }
1716
1717 namespace {
1718 void Generate_ContinueToBuiltinHelper(MacroAssembler* masm,
1719 bool java_script_builtin,
1720 bool with_result) {
1721 const RegisterConfiguration* config(RegisterConfiguration::Turbofan());
1722 int allocatable_register_count = config->num_allocatable_general_registers();
1723 if (with_result) {
1724 __ Str(x0, MemOperand(jssp, config->num_allocatable_general_registers() *
1725 kPointerSize +
1726 TYPED_FRAME_SIZE(1)));
1727 }
1728 for (int i = allocatable_register_count - 1; i >= 0; --i) {
1729 int code = config->GetAllocatableGeneralCode(i);
1730 __ Pop(Register::from_code(code));
1731 if (java_script_builtin && code == kJavaScriptCallArgCountRegister.code()) {
1732 __ SmiUntag(Register::from_code(code));
1733 }
1734 }
1735 __ ldr(fp, MemOperand(jssp, 2 * kPointerSize));
1736 __ Pop(ip0);
1737 __ Add(jssp, jssp, Operand(2 * kPointerSize));
1738 __ Pop(lr);
1739 __ Add(ip0, ip0, Operand(Code::kHeaderSize - kHeapObjectTag));
1740 __ Br(ip0);
1741 }
1742 } // namespace
1743
1744 void Builtins::Generate_ContinueToCodeStubBuiltin(MacroAssembler* masm) {
1745 Generate_ContinueToBuiltinHelper(masm, false, false);
1746 }
1747
1748 void Builtins::Generate_ContinueToCodeStubBuiltinWithResult(
1749 MacroAssembler* masm) {
1750 Generate_ContinueToBuiltinHelper(masm, false, true);
1751 }
1752
1753 void Builtins::Generate_ContinueToJavaScriptBuiltin(MacroAssembler* masm) {
1754 Generate_ContinueToBuiltinHelper(masm, true, false);
1755 }
1756
1757 void Builtins::Generate_ContinueToJavaScriptBuiltinWithResult(
1758 MacroAssembler* masm) {
1759 Generate_ContinueToBuiltinHelper(masm, true, true);
1760 }
1761
1693 static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm, 1762 static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm,
1694 Deoptimizer::BailoutType type) { 1763 Deoptimizer::BailoutType type) {
1695 { 1764 {
1696 FrameScope scope(masm, StackFrame::INTERNAL); 1765 FrameScope scope(masm, StackFrame::INTERNAL);
1697 // Pass the deoptimization type to the runtime system. 1766 // Pass the deoptimization type to the runtime system.
1698 __ Mov(x0, Smi::FromInt(static_cast<int>(type))); 1767 __ Mov(x0, Smi::FromInt(static_cast<int>(type)));
1699 __ Push(x0); 1768 __ Push(x0);
1700 __ CallRuntime(Runtime::kNotifyDeoptimized); 1769 __ CallRuntime(Runtime::kNotifyDeoptimized);
1701 } 1770 }
1702 1771
(...skipping 1511 matching lines...) Expand 10 before | Expand all | Expand 10 after
3214 // Now jump to the instructions of the returned code object. 3283 // Now jump to the instructions of the returned code object.
3215 __ Jump(x8); 3284 __ Jump(x8);
3216 } 3285 }
3217 3286
3218 #undef __ 3287 #undef __
3219 3288
3220 } // namespace internal 3289 } // namespace internal
3221 } // namespace v8 3290 } // namespace v8
3222 3291
3223 #endif // V8_TARGET_ARCH_ARM 3292 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698