Index: src/compiler/mips64/instruction-selector-mips64.cc |
diff --git a/src/compiler/mips64/instruction-selector-mips64.cc b/src/compiler/mips64/instruction-selector-mips64.cc |
index 027276fe5c59da40b7cc91d522c4b6fdaae46290..9f97d68697f204c282e17118dfd3bad7aa8b5e5d 100644 |
--- a/src/compiler/mips64/instruction-selector-mips64.cc |
+++ b/src/compiler/mips64/instruction-selector-mips64.cc |
@@ -23,7 +23,7 @@ class Mips64OperandGenerator FINAL : public OperandGenerator { |
explicit Mips64OperandGenerator(InstructionSelector* selector) |
: OperandGenerator(selector) {} |
- InstructionOperand* UseOperand(Node* node, InstructionCode opcode) { |
+ InstructionOperand UseOperand(Node* node, InstructionCode opcode) { |
if (CanBeImmediate(node, opcode)) { |
return UseImmediate(node); |
} |
@@ -124,9 +124,9 @@ static void VisitBinop(InstructionSelector* selector, Node* node, |
InstructionCode opcode, FlagsContinuation* cont) { |
Mips64OperandGenerator g(selector); |
Int32BinopMatcher m(node); |
- InstructionOperand* inputs[4]; |
+ InstructionOperand inputs[4]; |
size_t input_count = 0; |
- InstructionOperand* outputs[2]; |
+ InstructionOperand outputs[2]; |
size_t output_count = 0; |
inputs[input_count++] = g.UseRegister(m.left().node()); |
@@ -198,7 +198,7 @@ void InstructionSelector::VisitLoad(Node* node) { |
Emit(opcode | AddressingModeField::encode(kMode_MRI), |
g.DefineAsRegister(node), g.UseRegister(base), g.UseImmediate(index)); |
} else { |
- InstructionOperand* addr_reg = g.TempRegister(); |
+ InstructionOperand addr_reg = g.TempRegister(); |
Emit(kMips64Dadd | AddressingModeField::encode(kMode_None), addr_reg, |
g.UseRegister(index), g.UseRegister(base)); |
// Emit desired load opcode, using temp addr_reg. |
@@ -221,8 +221,8 @@ void InstructionSelector::VisitStore(Node* node) { |
// TODO(dcarney): refactor RecordWrite function to take temp registers |
// and pass them here instead of using fixed regs |
// TODO(dcarney): handle immediate indices. |
- InstructionOperand* temps[] = {g.TempRegister(t1), g.TempRegister(t2)}; |
- Emit(kMips64StoreWriteBarrier, NULL, g.UseFixed(base, t0), |
+ InstructionOperand temps[] = {g.TempRegister(t1), g.TempRegister(t2)}; |
+ Emit(kMips64StoreWriteBarrier, g.NoOutput(), g.UseFixed(base, t0), |
g.UseFixed(index, t1), g.UseFixed(value, t2), arraysize(temps), temps); |
return; |
} |
@@ -256,15 +256,15 @@ void InstructionSelector::VisitStore(Node* node) { |
} |
if (g.CanBeImmediate(index, opcode)) { |
- Emit(opcode | AddressingModeField::encode(kMode_MRI), NULL, |
+ Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(), |
g.UseRegister(base), g.UseImmediate(index), g.UseRegister(value)); |
} else { |
- InstructionOperand* addr_reg = g.TempRegister(); |
+ InstructionOperand addr_reg = g.TempRegister(); |
Emit(kMips64Dadd | AddressingModeField::encode(kMode_None), addr_reg, |
g.UseRegister(index), g.UseRegister(base)); |
// Emit desired store opcode, using temp addr_reg. |
- Emit(opcode | AddressingModeField::encode(kMode_MRI), NULL, addr_reg, |
- g.TempImmediate(0), g.UseRegister(value)); |
+ Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(), |
+ addr_reg, g.TempImmediate(0), g.UseRegister(value)); |
} |
} |
@@ -375,7 +375,7 @@ void InstructionSelector::VisitInt32Mul(Node* node) { |
return; |
} |
if (base::bits::IsPowerOfTwo32(value - 1)) { |
- InstructionOperand* temp = g.TempRegister(); |
+ InstructionOperand temp = g.TempRegister(); |
Emit(kMips64Shl | AddressingModeField::encode(kMode_None), temp, |
g.UseRegister(m.left().node()), |
g.TempImmediate(WhichPowerOf2(value - 1))); |
@@ -384,7 +384,7 @@ void InstructionSelector::VisitInt32Mul(Node* node) { |
return; |
} |
if (base::bits::IsPowerOfTwo32(value + 1)) { |
- InstructionOperand* temp = g.TempRegister(); |
+ InstructionOperand temp = g.TempRegister(); |
Emit(kMips64Shl | AddressingModeField::encode(kMode_None), temp, |
g.UseRegister(m.left().node()), |
g.TempImmediate(WhichPowerOf2(value + 1))); |
@@ -407,7 +407,7 @@ void InstructionSelector::VisitInt32MulHigh(Node* node) { |
void InstructionSelector::VisitUint32MulHigh(Node* node) { |
Mips64OperandGenerator g(this); |
- InstructionOperand* const dmul_operand = g.TempRegister(); |
+ InstructionOperand const dmul_operand = g.TempRegister(); |
Emit(kMips64MulHighU, dmul_operand, g.UseRegister(node->InputAt(0)), |
g.UseRegister(node->InputAt(1))); |
Emit(kMips64Ext, g.DefineAsRegister(node), dmul_operand, g.TempImmediate(0), |
@@ -428,7 +428,7 @@ void InstructionSelector::VisitInt64Mul(Node* node) { |
return; |
} |
if (base::bits::IsPowerOfTwo32(value - 1)) { |
- InstructionOperand* temp = g.TempRegister(); |
+ InstructionOperand temp = g.TempRegister(); |
Emit(kMips64Dshl | AddressingModeField::encode(kMode_None), temp, |
g.UseRegister(m.left().node()), |
g.TempImmediate(WhichPowerOf2(value - 1))); |
@@ -437,7 +437,7 @@ void InstructionSelector::VisitInt64Mul(Node* node) { |
return; |
} |
if (base::bits::IsPowerOfTwo32(value + 1)) { |
- InstructionOperand* temp = g.TempRegister(); |
+ InstructionOperand temp = g.TempRegister(); |
Emit(kMips64Dshl | AddressingModeField::encode(kMode_None), temp, |
g.UseRegister(m.left().node()), |
g.TempImmediate(WhichPowerOf2(value + 1))); |
@@ -646,12 +646,12 @@ void InstructionSelector::VisitCall(Node* node) { |
int push_count = buffer.pushed_nodes.size(); |
if (push_count > 0) { |
- Emit(kMips64StackClaim | MiscField::encode(push_count), NULL); |
+ Emit(kMips64StackClaim | MiscField::encode(push_count), g.NoOutput()); |
} |
int slot = buffer.pushed_nodes.size() - 1; |
for (auto i = buffer.pushed_nodes.rbegin(); i != buffer.pushed_nodes.rend(); |
++i) { |
- Emit(kMips64StoreToStackSlot | MiscField::encode(slot), nullptr, |
+ Emit(kMips64StoreToStackSlot | MiscField::encode(slot), g.NoOutput(), |
g.UseRegister(*i)); |
slot--; |
} |
@@ -709,15 +709,15 @@ void InstructionSelector::VisitCheckedLoad(Node* node) { |
UNREACHABLE(); |
return; |
} |
- InstructionOperand* offset_operand = g.CanBeImmediate(offset, opcode) |
- ? g.UseImmediate(offset) |
- : g.UseRegister(offset); |
+ InstructionOperand offset_operand = g.CanBeImmediate(offset, opcode) |
+ ? g.UseImmediate(offset) |
+ : g.UseRegister(offset); |
- InstructionOperand* length_operand = |
- (!g.CanBeImmediate(offset, opcode)) ? g.CanBeImmediate(length, opcode) |
- ? g.UseImmediate(length) |
- : g.UseRegister(length) |
- : g.UseRegister(length); |
+ InstructionOperand length_operand = (!g.CanBeImmediate(offset, opcode)) |
+ ? g.CanBeImmediate(length, opcode) |
+ ? g.UseImmediate(length) |
+ : g.UseRegister(length) |
+ : g.UseRegister(length); |
Emit(opcode | AddressingModeField::encode(kMode_MRI), |
g.DefineAsRegister(node), offset_operand, length_operand, |
@@ -753,18 +753,19 @@ void InstructionSelector::VisitCheckedStore(Node* node) { |
UNREACHABLE(); |
return; |
} |
- InstructionOperand* offset_operand = g.CanBeImmediate(offset, opcode) |
- ? g.UseImmediate(offset) |
- : g.UseRegister(offset); |
- |
- InstructionOperand* length_operand = |
- (!g.CanBeImmediate(offset, opcode)) ? g.CanBeImmediate(length, opcode) |
- ? g.UseImmediate(length) |
- : g.UseRegister(length) |
- : g.UseRegister(length); |
- |
- Emit(opcode | AddressingModeField::encode(kMode_MRI), nullptr, offset_operand, |
- length_operand, g.UseRegister(value), g.UseRegister(buffer)); |
+ InstructionOperand offset_operand = g.CanBeImmediate(offset, opcode) |
+ ? g.UseImmediate(offset) |
+ : g.UseRegister(offset); |
+ |
+ InstructionOperand length_operand = (!g.CanBeImmediate(offset, opcode)) |
+ ? g.CanBeImmediate(length, opcode) |
+ ? g.UseImmediate(length) |
+ : g.UseRegister(length) |
+ : g.UseRegister(length); |
+ |
+ Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(), |
+ offset_operand, length_operand, g.UseRegister(value), |
+ g.UseRegister(buffer)); |
} |
@@ -772,12 +773,13 @@ namespace { |
// Shared routine for multiple compare operations. |
static void VisitCompare(InstructionSelector* selector, InstructionCode opcode, |
- InstructionOperand* left, InstructionOperand* right, |
+ InstructionOperand left, InstructionOperand right, |
FlagsContinuation* cont) { |
Mips64OperandGenerator g(selector); |
opcode = cont->Encode(opcode); |
if (cont->IsBranch()) { |
- selector->Emit(opcode, NULL, left, right, g.Label(cont->true_block()), |
+ selector->Emit(opcode, g.NoOutput(), left, right, |
+ g.Label(cont->true_block()), |
g.Label(cont->false_block()))->MarkAsControl(); |
} else { |
DCHECK(cont->IsSet()); |
@@ -838,9 +840,9 @@ void EmitWordCompareZero(InstructionSelector* selector, InstructionCode opcode, |
Node* value, FlagsContinuation* cont) { |
Mips64OperandGenerator g(selector); |
opcode = cont->Encode(opcode); |
- InstructionOperand* const value_operand = g.UseRegister(value); |
+ InstructionOperand const value_operand = g.UseRegister(value); |
if (cont->IsBranch()) { |
- selector->Emit(opcode, nullptr, value_operand, g.TempImmediate(0), |
+ selector->Emit(opcode, g.NoOutput(), value_operand, g.TempImmediate(0), |
g.Label(cont->true_block()), |
g.Label(cont->false_block()))->MarkAsControl(); |
} else { |