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

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

Issue 2816743003: [turbofan] Add alignment parameter to StackSlot operator (Closed)
Patch Set: Small fixes in test 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 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/base/adapters.h" 5 #include "src/base/adapters.h"
6 #include "src/base/bits.h" 6 #include "src/base/bits.h"
7 #include "src/compiler/instruction-selector-impl.h" 7 #include "src/compiler/instruction-selector-impl.h"
8 #include "src/compiler/node-matchers.h" 8 #include "src/compiler/node-matchers.h"
9 #include "src/compiler/node-properties.h" 9 #include "src/compiler/node-properties.h"
10 10
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 static void VisitBinop(InstructionSelector* selector, Node* node, 345 static void VisitBinop(InstructionSelector* selector, Node* node,
346 InstructionCode opcode, FlagsContinuation* cont) { 346 InstructionCode opcode, FlagsContinuation* cont) {
347 VisitBinop(selector, node, opcode, false, kArchNop, cont); 347 VisitBinop(selector, node, opcode, false, kArchNop, cont);
348 } 348 }
349 349
350 static void VisitBinop(InstructionSelector* selector, Node* node, 350 static void VisitBinop(InstructionSelector* selector, Node* node,
351 InstructionCode opcode) { 351 InstructionCode opcode) {
352 VisitBinop(selector, node, opcode, false, kArchNop); 352 VisitBinop(selector, node, opcode, false, kArchNop);
353 } 353 }
354 354
355 void InstructionSelector::VisitStackSlot(Node* node) {
356 StackSlotRepresentation rep = StackSlotRepresentationOf(node->op());
357 int alignment = rep.alignment();
358 int slot = frame_->AllocateSpillSlot(rep.size(), alignment);
359 OperandGenerator g(this);
360
361 Emit(kArchStackSlot, g.DefineAsRegister(node),
362 sequence()->AddImmediate(Constant(slot)),
363 sequence()->AddImmediate(Constant(alignment)), 0, nullptr);
364 }
365
355 void EmitLoad(InstructionSelector* selector, Node* node, InstructionCode opcode, 366 void EmitLoad(InstructionSelector* selector, Node* node, InstructionCode opcode,
356 Node* output = nullptr) { 367 Node* output = nullptr) {
357 Mips64OperandGenerator g(selector); 368 Mips64OperandGenerator g(selector);
358 Node* base = node->InputAt(0); 369 Node* base = node->InputAt(0);
359 Node* index = node->InputAt(1); 370 Node* index = node->InputAt(1);
360 371
361 if (g.CanBeImmediate(index, opcode)) { 372 if (g.CanBeImmediate(index, opcode)) {
362 selector->Emit(opcode | AddressingModeField::encode(kMode_MRI), 373 selector->Emit(opcode | AddressingModeField::encode(kMode_MRI),
363 g.DefineAsRegister(output == nullptr ? node : output), 374 g.DefineAsRegister(output == nullptr ? node : output),
364 g.UseRegister(base), g.UseImmediate(index)); 375 g.UseRegister(base), g.UseImmediate(index));
(...skipping 2577 matching lines...) Expand 10 before | Expand all | Expand 10 after
2942 } else { 2953 } else {
2943 DCHECK(kArchVariant == kMips64r2); 2954 DCHECK(kArchVariant == kMips64r2);
2944 return MachineOperatorBuilder::AlignmentRequirements:: 2955 return MachineOperatorBuilder::AlignmentRequirements::
2945 NoUnalignedAccessSupport(); 2956 NoUnalignedAccessSupport();
2946 } 2957 }
2947 } 2958 }
2948 2959
2949 } // namespace compiler 2960 } // namespace compiler
2950 } // namespace internal 2961 } // namespace internal
2951 } // namespace v8 2962 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/mips64/code-generator-mips64.cc ('k') | src/compiler/ppc/instruction-selector-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698