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

Side by Side Diff: src/builtins/arm/builtins-arm.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
« no previous file with comments | « no previous file | src/builtins/arm64/builtins-arm64.cc » ('j') | src/builtins/builtins.h » ('J')
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_ARM 5 #if V8_TARGET_ARCH_ARM
6 6
7 #include "src/assembler-inl.h" 7 #include "src/assembler-inl.h"
8 #include "src/codegen.h" 8 #include "src/codegen.h"
9 #include "src/counters.h" 9 #include "src/counters.h"
10 #include "src/debug/debug.h" 10 #include "src/debug/debug.h"
(...skipping 1627 matching lines...) Expand 10 before | Expand all | Expand 10 after
1638 } 1638 }
1639 1639
1640 void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) { 1640 void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) {
1641 Generate_NotifyStubFailureHelper(masm, kDontSaveFPRegs); 1641 Generate_NotifyStubFailureHelper(masm, kDontSaveFPRegs);
1642 } 1642 }
1643 1643
1644 void Builtins::Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm) { 1644 void Builtins::Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm) {
1645 Generate_NotifyStubFailureHelper(masm, kSaveFPRegs); 1645 Generate_NotifyStubFailureHelper(masm, kSaveFPRegs);
1646 } 1646 }
1647 1647
1648 void Builtins::Generate_NotifyBuiltinContinuation(MacroAssembler* masm) {
1649 {
1650 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
1651
1652 // Preserve registers across notification, this is important for compiled
1653 // stubs that tail call the runtime on deopts passing their parameters in
1654 // registers.
1655 __ stm(db_w, sp, kJSCallerSaved | kCalleeSaved);
1656 // Pass the function and deoptimization type to the runtime system.
1657 __ CallRuntime(Runtime::kNotifyStubFailure, false);
1658 __ ldm(ia_w, sp, kJSCallerSaved | kCalleeSaved);
1659 }
1660
1661 __ add(sp, sp, Operand(kPointerSize)); // Ignore state
1662 __ mov(pc, lr); // Jump to miss handler
1663 }
1664
1665 namespace {
1666 void Generate_ContinueToBuiltinHelper(MacroAssembler* masm,
1667 bool java_script_builtin,
1668 bool with_result) {
1669 const RegisterConfiguration* config(RegisterConfiguration::Turbofan());
1670 int allocatable_register_count = config->num_allocatable_general_registers();
1671 if (with_result) {
1672 __ str(r0, MemOperand(sp, config->num_allocatable_general_registers() *
1673 kPointerSize +
1674 TYPED_FRAME_SIZE(1)));
1675 }
1676 for (int i = allocatable_register_count - 1; i >= 0; --i) {
1677 int code = config->GetAllocatableGeneralCode(i);
1678 __ Pop(Register::from_code(code));
1679 if (java_script_builtin && code == kJavaScriptCallArgCountRegister.code()) {
1680 __ SmiUntag(Register::from_code(code));
1681 }
1682 }
1683 __ ldr(fp, MemOperand(sp, 2 * kPointerSize));
1684 __ Pop(ip);
1685 __ add(sp, sp, Operand(2 * kPointerSize));
1686 __ Pop(lr);
1687 __ add(pc, ip, Operand(Code::kHeaderSize - kHeapObjectTag));
1688 }
1689 } // namespace
1690
1691 void Builtins::Generate_ContinueToCodeStubBuiltin(MacroAssembler* masm) {
1692 Generate_ContinueToBuiltinHelper(masm, false, false);
1693 }
1694
1695 void Builtins::Generate_ContinueToCodeStubBuiltinWithResult(
1696 MacroAssembler* masm) {
1697 Generate_ContinueToBuiltinHelper(masm, false, true);
1698 }
1699
1700 void Builtins::Generate_ContinueToJavaScriptBuiltin(MacroAssembler* masm) {
1701 Generate_ContinueToBuiltinHelper(masm, true, false);
1702 }
1703
1704 void Builtins::Generate_ContinueToJavaScriptBuiltinWithResult(
1705 MacroAssembler* masm) {
1706 Generate_ContinueToBuiltinHelper(masm, true, true);
1707 }
1708
1648 static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm, 1709 static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm,
1649 Deoptimizer::BailoutType type) { 1710 Deoptimizer::BailoutType type) {
1650 { 1711 {
1651 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); 1712 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
1652 // Pass the function and deoptimization type to the runtime system. 1713 // Pass the function and deoptimization type to the runtime system.
1653 __ mov(r0, Operand(Smi::FromInt(static_cast<int>(type)))); 1714 __ mov(r0, Operand(Smi::FromInt(static_cast<int>(type))));
1654 __ push(r0); 1715 __ push(r0);
1655 __ CallRuntime(Runtime::kNotifyDeoptimized); 1716 __ CallRuntime(Runtime::kNotifyDeoptimized);
1656 } 1717 }
1657 1718
(...skipping 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after
3053 } 3114 }
3054 // Now jump to the instructions of the returned code object. 3115 // Now jump to the instructions of the returned code object.
3055 __ Jump(r8); 3116 __ Jump(r8);
3056 } 3117 }
3057 #undef __ 3118 #undef __
3058 3119
3059 } // namespace internal 3120 } // namespace internal
3060 } // namespace v8 3121 } // namespace v8
3061 3122
3062 #endif // V8_TARGET_ARCH_ARM 3123 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/builtins/arm64/builtins-arm64.cc » ('j') | src/builtins/builtins.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698