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

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

Issue 2803853005: Inline Array.prototype.forEach in TurboFan (Closed)
Patch Set: Disable new array builtins by default Created 3 years, 6 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
« no previous file with comments | « src/builtins/mips/builtins-mips.cc ('k') | src/builtins/x64/builtins-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // Preserve possible return result from lazy deopt.
1654 __ push(v0);
1655 // Pass the function and deoptimization type to the runtime system.
1656 __ CallRuntime(Runtime::kNotifyStubFailure, false);
1657 __ pop(v0);
1658 }
1659
1660 __ Daddu(sp, sp, Operand(kPointerSize)); // Ignore state
1661 __ Jump(ra); // Jump to the ContinueToBuiltin stub
1662 }
1663
1664 namespace {
1665 void Generate_ContinueToBuiltinHelper(MacroAssembler* masm,
1666 bool java_script_builtin,
1667 bool with_result) {
1668 const RegisterConfiguration* config(RegisterConfiguration::Turbofan());
1669 int allocatable_register_count = config->num_allocatable_general_registers();
1670 if (with_result) {
1671 // Overwrite the hole inserted by the deoptimizer with the return value from
1672 // the LAZY deopt point.
1673 __ Sd(v0,
1674 MemOperand(
1675 sp, config->num_allocatable_general_registers() * kPointerSize +
1676 BuiltinContinuationFrameConstants::kFixedFrameSize));
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(
1686 sp, BuiltinContinuationFrameConstants::kFixedFrameSizeFromFp));
1687 __ Pop(t0);
1688 __ Daddu(sp, sp,
1689 Operand(BuiltinContinuationFrameConstants::kFixedFrameSizeFromFp));
1690 __ Pop(ra);
1691 __ Daddu(t0, t0, Operand(Code::kHeaderSize - kHeapObjectTag));
1692 __ Jump(t0);
1693 }
1694 } // namespace
1695
1696 void Builtins::Generate_ContinueToCodeStubBuiltin(MacroAssembler* masm) {
1697 Generate_ContinueToBuiltinHelper(masm, false, false);
1698 }
1699
1700 void Builtins::Generate_ContinueToCodeStubBuiltinWithResult(
1701 MacroAssembler* masm) {
1702 Generate_ContinueToBuiltinHelper(masm, false, true);
1703 }
1704
1705 void Builtins::Generate_ContinueToJavaScriptBuiltin(MacroAssembler* masm) {
1706 Generate_ContinueToBuiltinHelper(masm, true, false);
1707 }
1708
1709 void Builtins::Generate_ContinueToJavaScriptBuiltinWithResult(
1710 MacroAssembler* masm) {
1711 Generate_ContinueToBuiltinHelper(masm, true, true);
1712 }
1713
1650 static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm, 1714 static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm,
1651 Deoptimizer::BailoutType type) { 1715 Deoptimizer::BailoutType type) {
1652 { 1716 {
1653 FrameScope scope(masm, StackFrame::INTERNAL); 1717 FrameScope scope(masm, StackFrame::INTERNAL);
1654 // Pass the function and deoptimization type to the runtime system. 1718 // Pass the function and deoptimization type to the runtime system.
1655 __ li(a0, Operand(Smi::FromInt(static_cast<int>(type)))); 1719 __ li(a0, Operand(Smi::FromInt(static_cast<int>(type))));
1656 __ push(a0); 1720 __ push(a0);
1657 __ CallRuntime(Runtime::kNotifyDeoptimized); 1721 __ CallRuntime(Runtime::kNotifyDeoptimized);
1658 } 1722 }
1659 1723
(...skipping 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after
3151 __ Daddu(at, v0, Operand(Code::kHeaderSize - kHeapObjectTag)); 3215 __ Daddu(at, v0, Operand(Code::kHeaderSize - kHeapObjectTag));
3152 __ Jump(at); 3216 __ Jump(at);
3153 } 3217 }
3154 3218
3155 #undef __ 3219 #undef __
3156 3220
3157 } // namespace internal 3221 } // namespace internal
3158 } // namespace v8 3222 } // namespace v8
3159 3223
3160 #endif // V8_TARGET_ARCH_MIPS64 3224 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/builtins/mips/builtins-mips.cc ('k') | src/builtins/x64/builtins-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698