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

Side by Side Diff: src/builtins/mips64/builtins-mips64.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
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 1629 matching lines...) Expand 10 before | Expand all | Expand 10 after
1640 } 1640 }
1641 1641
1642 void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) { 1642 void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) {
1643 Generate_NotifyStubFailureHelper(masm, kDontSaveFPRegs); 1643 Generate_NotifyStubFailureHelper(masm, kDontSaveFPRegs);
1644 } 1644 }
1645 1645
1646 void Builtins::Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm) { 1646 void Builtins::Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm) {
1647 Generate_NotifyStubFailureHelper(masm, kSaveFPRegs); 1647 Generate_NotifyStubFailureHelper(masm, kSaveFPRegs);
1648 } 1648 }
1649 1649
1650 void Builtins::Generate_NotifyBuiltinContinuation(MacroAssembler* masm) {
1651 {
1652 FrameScope scope(masm, StackFrame::INTERNAL);
1653
1654 // Preserve registers across notification, this is important for compiled
1655 // stubs that tail call the runtime on deopts passing their parameters in
1656 // registers.
1657 __ MultiPush(kJSCallerSaved | kCalleeSaved);
1658 // Pass the function and deoptimization type to the runtime system.
1659 __ CallRuntime(Runtime::kNotifyStubFailure, false);
1660 __ MultiPop(kJSCallerSaved | kCalleeSaved);
1661 }
1662
1663 __ Daddu(sp, sp, Operand(kPointerSize)); // Ignore state
1664 __ Jump(ra); // Jump to miss handler
1665 }
1666
1667 namespace {
1668 void Generate_ContinueToBuiltinHelper(MacroAssembler* masm,
1669 bool java_script_builtin,
1670 bool with_result) {
1671 const RegisterConfiguration* config(RegisterConfiguration::Turbofan());
1672 int allocatable_register_count = config->num_allocatable_general_registers();
1673 if (with_result) {
1674 __ Sd(v0, MemOperand(sp, config->num_allocatable_general_registers() *
1675 kPointerSize +
1676 TYPED_FRAME_SIZE(1)));
1677 }
1678 for (int i = allocatable_register_count - 1; i >= 0; --i) {
1679 int code = config->GetAllocatableGeneralCode(i);
1680 __ Pop(Register::from_code(code));
1681 if (java_script_builtin && code == kJavaScriptCallArgCountRegister.code()) {
1682 __ SmiUntag(Register::from_code(code));
1683 }
1684 }
1685 __ Ld(fp, MemOperand(sp, 2 * kPointerSize));
1686 __ Pop(t0);
1687 __ Daddu(sp, sp, Operand(2 * kPointerSize));
1688 __ Pop(ra);
1689 __ Daddu(t0, t0, Operand(Code::kHeaderSize - kHeapObjectTag));
1690 __ Jump(t0);
1691 }
1692 } // namespace
1693
1694 void Builtins::Generate_ContinueToCodeStubBuiltin(MacroAssembler* masm) {
1695 Generate_ContinueToBuiltinHelper(masm, false, false);
1696 }
1697
1698 void Builtins::Generate_ContinueToCodeStubBuiltinWithResult(
1699 MacroAssembler* masm) {
1700 Generate_ContinueToBuiltinHelper(masm, false, true);
1701 }
1702
1703 void Builtins::Generate_ContinueToJavaScriptBuiltin(MacroAssembler* masm) {
1704 Generate_ContinueToBuiltinHelper(masm, true, false);
1705 }
1706
1707 void Builtins::Generate_ContinueToJavaScriptBuiltinWithResult(
1708 MacroAssembler* masm) {
1709 Generate_ContinueToBuiltinHelper(masm, true, true);
1710 }
1711
1650 static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm, 1712 static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm,
1651 Deoptimizer::BailoutType type) { 1713 Deoptimizer::BailoutType type) {
1652 { 1714 {
1653 FrameScope scope(masm, StackFrame::INTERNAL); 1715 FrameScope scope(masm, StackFrame::INTERNAL);
1654 // Pass the function and deoptimization type to the runtime system. 1716 // Pass the function and deoptimization type to the runtime system.
1655 __ li(a0, Operand(Smi::FromInt(static_cast<int>(type)))); 1717 __ li(a0, Operand(Smi::FromInt(static_cast<int>(type))));
1656 __ push(a0); 1718 __ push(a0);
1657 __ CallRuntime(Runtime::kNotifyDeoptimized); 1719 __ CallRuntime(Runtime::kNotifyDeoptimized);
1658 } 1720 }
1659 1721
(...skipping 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after
3151 __ Daddu(at, v0, Operand(Code::kHeaderSize - kHeapObjectTag)); 3213 __ Daddu(at, v0, Operand(Code::kHeaderSize - kHeapObjectTag));
3152 __ Jump(at); 3214 __ Jump(at);
3153 } 3215 }
3154 3216
3155 #undef __ 3217 #undef __
3156 3218
3157 } // namespace internal 3219 } // namespace internal
3158 } // namespace v8 3220 } // namespace v8
3159 3221
3160 #endif // V8_TARGET_ARCH_MIPS64 3222 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698