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

Side by Side Diff: src/compiler/arm64/instruction-selector-arm64.cc

Issue 1811283003: [wasm] WIP fix arm64 frame alignment. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 #include "src/compiler/instruction-selector-impl.h" 5 #include "src/compiler/instruction-selector-impl.h"
6 #include "src/compiler/node-matchers.h" 6 #include "src/compiler/node-matchers.h"
7 #include "src/compiler/node-properties.h" 7 #include "src/compiler/node-properties.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 1613 matching lines...) Expand 10 before | Expand all | Expand 10 after
1624 void InstructionSelector::VisitFloat64RoundTiesEven(Node* node) { 1624 void InstructionSelector::VisitFloat64RoundTiesEven(Node* node) {
1625 VisitRR(this, kArm64Float64RoundTiesEven, node); 1625 VisitRR(this, kArm64Float64RoundTiesEven, node);
1626 } 1626 }
1627 1627
1628 1628
1629 void InstructionSelector::EmitPrepareArguments( 1629 void InstructionSelector::EmitPrepareArguments(
1630 ZoneVector<PushParameter>* arguments, const CallDescriptor* descriptor, 1630 ZoneVector<PushParameter>* arguments, const CallDescriptor* descriptor,
1631 Node* node) { 1631 Node* node) {
1632 Arm64OperandGenerator g(this); 1632 Arm64OperandGenerator g(this);
1633 1633
1634 bool from_native_stack = linkage()->GetIncomingDescriptor()->UseNativeStack();
1634 bool to_native_stack = descriptor->UseNativeStack(); 1635 bool to_native_stack = descriptor->UseNativeStack();
1635 1636
1637 bool always_claim = to_native_stack != from_native_stack;
1638
1636 int claim_count = static_cast<int>(arguments->size()); 1639 int claim_count = static_cast<int>(arguments->size());
1637 int slot = claim_count - 1; 1640 int slot = claim_count - 1;
1638 if (to_native_stack) {
1639 // Native stack must always be aligned to 16 (2 words).
1640 claim_count = RoundUp(claim_count, 2);
1641 }
1642 // TODO(titzer): claim and poke probably take small immediates.
1643 // Bump the stack pointer(s). 1641 // Bump the stack pointer(s).
1644 if (claim_count > 0 || to_native_stack) { 1642 if (claim_count > 0 || always_claim) {
1643 // TODO(titzer): claim and poke probably take small immediates.
1645 // TODO(titzer): it would be better to bump the csp here only 1644 // TODO(titzer): it would be better to bump the csp here only
1646 // and emit paired stores with increment for non c frames. 1645 // and emit paired stores with increment for non c frames.
1647 ArchOpcode claim = to_native_stack ? kArm64ClaimCSP : kArm64ClaimJSSP; 1646 ArchOpcode claim = to_native_stack ? kArm64ClaimCSP : kArm64ClaimJSSP;
1648 Emit(claim, g.NoOutput(), g.TempImmediate(claim_count)); 1647 Emit(claim, g.NoOutput(), g.TempImmediate(claim_count));
ahaas 2016/03/29 08:33:58 Could you add a comment here why "claim(0)" isn't
titzer 2016/03/29 09:10:53 Done.
1649 } 1648 }
1650 1649
1651 // Poke the arguments into the stack. 1650 // Poke the arguments into the stack.
1652 ArchOpcode poke = to_native_stack ? kArm64PokeCSP : kArm64PokeJSSP; 1651 ArchOpcode poke = to_native_stack ? kArm64PokeCSP : kArm64PokeJSSP;
1653 while (slot >= 0) { 1652 while (slot >= 0) {
1654 Emit(poke, g.NoOutput(), g.UseRegister((*arguments)[slot].node()), 1653 Emit(poke, g.NoOutput(), g.UseRegister((*arguments)[slot].node()),
1655 g.TempImmediate(slot)); 1654 g.TempImmediate(slot));
1656 slot--; 1655 slot--;
1657 // TODO(ahaas): Poke arguments in pairs if two subsequent arguments have the 1656 // TODO(ahaas): Poke arguments in pairs if two subsequent arguments have the
1658 // same type. 1657 // same type.
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
2263 MachineOperatorBuilder::kWord32ShiftIsSafe | 2262 MachineOperatorBuilder::kWord32ShiftIsSafe |
2264 MachineOperatorBuilder::kInt32DivIsSafe | 2263 MachineOperatorBuilder::kInt32DivIsSafe |
2265 MachineOperatorBuilder::kUint32DivIsSafe | 2264 MachineOperatorBuilder::kUint32DivIsSafe |
2266 MachineOperatorBuilder::kWord32ReverseBits | 2265 MachineOperatorBuilder::kWord32ReverseBits |
2267 MachineOperatorBuilder::kWord64ReverseBits; 2266 MachineOperatorBuilder::kWord64ReverseBits;
2268 } 2267 }
2269 2268
2270 } // namespace compiler 2269 } // namespace compiler
2271 } // namespace internal 2270 } // namespace internal
2272 } // namespace v8 2271 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698