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

Unified Diff: src/compiler/instruction-selector.cc

Issue 1645653002: [turbofan] Add the StackSlot operator to turbofan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Forgot to initialize frame in testing code. Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: src/compiler/instruction-selector.cc
diff --git a/src/compiler/instruction-selector.cc b/src/compiler/instruction-selector.cc
index 32ffc634e01efcb20cec6338e5ef9241bb8b400f..6a79ddccb093c7d7e022b343250ac031bf636ac0 100644
--- a/src/compiler/instruction-selector.cc
+++ b/src/compiler/instruction-selector.cc
@@ -21,7 +21,7 @@ namespace compiler {
InstructionSelector::InstructionSelector(
Zone* zone, size_t node_count, Linkage* linkage,
InstructionSequence* sequence, Schedule* schedule,
- SourcePositionTable* source_positions,
+ SourcePositionTable* source_positions, Frame* frame,
SourcePositionMode source_position_mode, Features features)
: zone_(zone),
linkage_(linkage),
@@ -36,7 +36,8 @@ InstructionSelector::InstructionSelector(
used_(node_count, false, zone),
virtual_registers_(node_count,
InstructionOperand::kInvalidVirtualRegister, zone),
- scheduler_(nullptr) {
+ scheduler_(nullptr),
+ frame_(frame) {
instructions_.reserve(node_count);
}
@@ -1066,6 +1067,8 @@ void InstructionSelector::VisitNode(Node* node) {
return MarkAsFloat64(node), VisitFloat64InsertLowWord32(node);
case IrOpcode::kFloat64InsertHighWord32:
return MarkAsFloat64(node), VisitFloat64InsertHighWord32(node);
+ case IrOpcode::kStackSlot:
+ return VisitStackSlot(node);
case IrOpcode::kLoadStackPointer:
return VisitLoadStackPointer(node);
case IrOpcode::kLoadFramePointer:
@@ -1133,6 +1136,22 @@ void InstructionSelector::EmitLookupSwitch(const SwitchInfo& sw,
Emit(kArchLookupSwitch, 0, nullptr, input_count, inputs, 0, nullptr);
}
+void InstructionSelector::VisitStackSlot(Node* node) {
+ MachineRepresentation rep = StackSlotRepresentationOf(node->op());
titzer 2016/01/28 09:02:18 You should probably use ElemSizeLog2Of(MachineRepr
ahaas 2016/01/28 14:55:44 Done.
+ int size;
+ if (rep == MachineRepresentation::kFloat64) {
+ size = kDoubleSize;
+ } else if (rep == MachineRepresentation::kWord64) {
+ size = kInt64Size;
+ } else {
+ size = kPointerSize;
+ }
+ int slot = frame_->AllocateSpillSlot(size);
+ OperandGenerator g(this);
+
+ Emit(kArchStackSlot, g.DefineAsRegister(node),
+ sequence()->AddImmediate(Constant(slot)), 0, nullptr);
+}
// 32 bit targets do not implement the following instructions.
#if V8_TARGET_ARCH_32_BIT

Powered by Google App Engine
This is Rietveld 408576698