OLD | NEW |
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 Loading... |
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 | |
366 void EmitLoad(InstructionSelector* selector, Node* node, InstructionCode opcode, | 355 void EmitLoad(InstructionSelector* selector, Node* node, InstructionCode opcode, |
367 Node* output = nullptr) { | 356 Node* output = nullptr) { |
368 Mips64OperandGenerator g(selector); | 357 Mips64OperandGenerator g(selector); |
369 Node* base = node->InputAt(0); | 358 Node* base = node->InputAt(0); |
370 Node* index = node->InputAt(1); | 359 Node* index = node->InputAt(1); |
371 | 360 |
372 if (g.CanBeImmediate(index, opcode)) { | 361 if (g.CanBeImmediate(index, opcode)) { |
373 selector->Emit(opcode | AddressingModeField::encode(kMode_MRI), | 362 selector->Emit(opcode | AddressingModeField::encode(kMode_MRI), |
374 g.DefineAsRegister(output == nullptr ? node : output), | 363 g.DefineAsRegister(output == nullptr ? node : output), |
375 g.UseRegister(base), g.UseImmediate(index)); | 364 g.UseRegister(base), g.UseImmediate(index)); |
(...skipping 2577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2953 } else { | 2942 } else { |
2954 DCHECK(kArchVariant == kMips64r2); | 2943 DCHECK(kArchVariant == kMips64r2); |
2955 return MachineOperatorBuilder::AlignmentRequirements:: | 2944 return MachineOperatorBuilder::AlignmentRequirements:: |
2956 NoUnalignedAccessSupport(); | 2945 NoUnalignedAccessSupport(); |
2957 } | 2946 } |
2958 } | 2947 } |
2959 | 2948 |
2960 } // namespace compiler | 2949 } // namespace compiler |
2961 } // namespace internal | 2950 } // namespace internal |
2962 } // namespace v8 | 2951 } // namespace v8 |
OLD | NEW |