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

Side by Side Diff: src/builtins/mips/builtins-mips.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_MIPS 5 #if V8_TARGET_ARCH_MIPS
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 1628 matching lines...) Expand 10 before | Expand all | Expand 10 after
1639 } 1639 }
1640 1640
1641 void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) { 1641 void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) {
1642 Generate_NotifyStubFailureHelper(masm, kDontSaveFPRegs); 1642 Generate_NotifyStubFailureHelper(masm, kDontSaveFPRegs);
1643 } 1643 }
1644 1644
1645 void Builtins::Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm) { 1645 void Builtins::Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm) {
1646 Generate_NotifyStubFailureHelper(masm, kSaveFPRegs); 1646 Generate_NotifyStubFailureHelper(masm, kSaveFPRegs);
1647 } 1647 }
1648 1648
1649 void Builtins::Generate_NotifyBuiltinContinuation(MacroAssembler* masm) {
1650 {
1651 FrameScope scope(masm, StackFrame::INTERNAL);
1652
1653 // Preserve registers across notification, this is important for compiled
1654 // stubs that tail call the runtime on deopts passing their parameters in
1655 // registers.
1656 __ MultiPush(kJSCallerSaved | kCalleeSaved);
1657 // Pass the function and deoptimization type to the runtime system.
1658 __ CallRuntime(Runtime::kNotifyStubFailure, false);
1659 __ MultiPop(kJSCallerSaved | kCalleeSaved);
1660 }
1661
1662 __ Addu(sp, sp, Operand(kPointerSize)); // Ignore state
1663 __ Jump(ra); // Jump to miss handler
1664 }
1665
1666 namespace {
1667 void Generate_ContinueToBuiltinHelper(MacroAssembler* masm,
1668 bool java_script_builtin,
1669 bool with_result) {
1670 const RegisterConfiguration* config(RegisterConfiguration::Turbofan());
1671 int allocatable_register_count = config->num_allocatable_general_registers();
1672 if (with_result) {
1673 __ sw(v0, MemOperand(sp, config->num_allocatable_general_registers() *
1674 kPointerSize +
1675 TYPED_FRAME_SIZE(1)));
1676 }
1677 for (int i = allocatable_register_count - 1; i >= 0; --i) {
1678 int code = config->GetAllocatableGeneralCode(i);
1679 __ Pop(Register::from_code(code));
1680 if (java_script_builtin && code == kJavaScriptCallArgCountRegister.code()) {
1681 __ SmiUntag(Register::from_code(code));
1682 }
1683 }
1684 __ lw(fp, MemOperand(sp, 2 * kPointerSize));
1685 __ Pop(t0);
1686 __ Addu(sp, sp, Operand(2 * kPointerSize));
1687 __ Pop(ra);
1688 __ Addu(t0, t0, Operand(Code::kHeaderSize - kHeapObjectTag));
1689 __ Jump(t0);
1690 }
1691 } // namespace
1692
1693 void Builtins::Generate_ContinueToCodeStubBuiltin(MacroAssembler* masm) {
1694 Generate_ContinueToBuiltinHelper(masm, false, false);
1695 }
1696
1697 void Builtins::Generate_ContinueToCodeStubBuiltinWithResult(
1698 MacroAssembler* masm) {
1699 Generate_ContinueToBuiltinHelper(masm, false, true);
1700 }
1701
1702 void Builtins::Generate_ContinueToJavaScriptBuiltin(MacroAssembler* masm) {
1703 Generate_ContinueToBuiltinHelper(masm, true, false);
1704 }
1705
1706 void Builtins::Generate_ContinueToJavaScriptBuiltinWithResult(
1707 MacroAssembler* masm) {
1708 Generate_ContinueToBuiltinHelper(masm, true, true);
1709 }
1710
1649 static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm, 1711 static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm,
1650 Deoptimizer::BailoutType type) { 1712 Deoptimizer::BailoutType type) {
1651 { 1713 {
1652 FrameScope scope(masm, StackFrame::INTERNAL); 1714 FrameScope scope(masm, StackFrame::INTERNAL);
1653 // Pass the function and deoptimization type to the runtime system. 1715 // Pass the function and deoptimization type to the runtime system.
1654 __ li(a0, Operand(Smi::FromInt(static_cast<int>(type)))); 1716 __ li(a0, Operand(Smi::FromInt(static_cast<int>(type))));
1655 __ push(a0); 1717 __ push(a0);
1656 __ CallRuntime(Runtime::kNotifyDeoptimized); 1718 __ CallRuntime(Runtime::kNotifyDeoptimized);
1657 } 1719 }
1658 1720
(...skipping 1453 matching lines...) Expand 10 before | Expand all | Expand 10 after
3112 // Now jump to the instructions of the returned code object. 3174 // Now jump to the instructions of the returned code object.
3113 __ Jump(at, v0, Code::kHeaderSize - kHeapObjectTag); 3175 __ Jump(at, v0, Code::kHeaderSize - kHeapObjectTag);
3114 } 3176 }
3115 3177
3116 #undef __ 3178 #undef __
3117 3179
3118 } // namespace internal 3180 } // namespace internal
3119 } // namespace v8 3181 } // namespace v8
3120 3182
3121 #endif // V8_TARGET_ARCH_MIPS 3183 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698