| Index: src/compiler/x64/instruction-selector-x64.cc
|
| diff --git a/src/compiler/x64/instruction-selector-x64.cc b/src/compiler/x64/instruction-selector-x64.cc
|
| index f19225f1ec9ff97dabdb6400ae2dc24ebf6d9512..1722b43ae3b819552d319de78b3d6cfe31c08f13 100644
|
| --- a/src/compiler/x64/instruction-selector-x64.cc
|
| +++ b/src/compiler/x64/instruction-selector-x64.cc
|
| @@ -31,7 +31,7 @@ class X64OperandGenerator FINAL : public OperandGenerator {
|
|
|
| AddressingMode GenerateMemoryOperandInputs(Node* index, int scale_exponent,
|
| Node* base, Node* displacement,
|
| - InstructionOperand* inputs[],
|
| + InstructionOperand inputs[],
|
| size_t* input_count) {
|
| AddressingMode mode = kMode_MRI;
|
| if (base != NULL) {
|
| @@ -80,7 +80,7 @@ class X64OperandGenerator FINAL : public OperandGenerator {
|
| }
|
|
|
| AddressingMode GetEffectiveAddressMemoryOperand(Node* operand,
|
| - InstructionOperand* inputs[],
|
| + InstructionOperand inputs[],
|
| size_t* input_count) {
|
| BaseWithIndexAndDisplacement64Matcher m(operand, true);
|
| DCHECK(m.matches());
|
| @@ -132,9 +132,9 @@ void InstructionSelector::VisitLoad(Node* node) {
|
| return;
|
| }
|
|
|
| - InstructionOperand* outputs[1];
|
| + InstructionOperand outputs[1];
|
| outputs[0] = g.DefineAsRegister(node);
|
| - InstructionOperand* inputs[3];
|
| + InstructionOperand inputs[3];
|
| size_t input_count = 0;
|
| AddressingMode mode =
|
| g.GetEffectiveAddressMemoryOperand(node, inputs, &input_count);
|
| @@ -156,8 +156,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(rcx), g.TempRegister(rdx)};
|
| - Emit(kX64StoreWriteBarrier, NULL, g.UseFixed(base, rbx),
|
| + InstructionOperand temps[] = {g.TempRegister(rcx), g.TempRegister(rdx)};
|
| + Emit(kX64StoreWriteBarrier, g.NoOutput(), g.UseFixed(base, rbx),
|
| g.UseFixed(index, rcx), g.UseFixed(value, rdx), arraysize(temps),
|
| temps);
|
| return;
|
| @@ -189,15 +189,15 @@ void InstructionSelector::VisitStore(Node* node) {
|
| UNREACHABLE();
|
| return;
|
| }
|
| - InstructionOperand* inputs[4];
|
| + InstructionOperand inputs[4];
|
| size_t input_count = 0;
|
| AddressingMode mode =
|
| g.GetEffectiveAddressMemoryOperand(node, inputs, &input_count);
|
| InstructionCode code = opcode | AddressingModeField::encode(mode);
|
| - InstructionOperand* value_operand =
|
| + InstructionOperand value_operand =
|
| g.CanBeImmediate(value) ? g.UseImmediate(value) : g.UseRegister(value);
|
| inputs[input_count++] = value_operand;
|
| - Emit(code, 0, static_cast<InstructionOperand**>(NULL), input_count, inputs);
|
| + Emit(code, 0, static_cast<InstructionOperand*>(NULL), input_count, inputs);
|
| }
|
|
|
|
|
| @@ -241,7 +241,7 @@ void InstructionSelector::VisitCheckedLoad(Node* node) {
|
| return;
|
| }
|
| }
|
| - InstructionOperand* length_operand =
|
| + InstructionOperand length_operand =
|
| g.CanBeImmediate(length) ? g.UseImmediate(length) : g.UseRegister(length);
|
| Emit(opcode, g.DefineAsRegister(node), g.UseRegister(buffer),
|
| g.UseRegister(offset), g.TempImmediate(0), length_operand);
|
| @@ -276,7 +276,7 @@ void InstructionSelector::VisitCheckedStore(Node* node) {
|
| UNREACHABLE();
|
| return;
|
| }
|
| - InstructionOperand* value_operand =
|
| + InstructionOperand value_operand =
|
| g.CanBeImmediate(value) ? g.UseImmediate(value) : g.UseRegister(value);
|
| if (offset->opcode() == IrOpcode::kInt32Add && CanCover(node, offset)) {
|
| Int32Matcher mlength(length);
|
| @@ -284,16 +284,16 @@ void InstructionSelector::VisitCheckedStore(Node* node) {
|
| if (mlength.HasValue() && moffset.right().HasValue() &&
|
| moffset.right().Value() >= 0 &&
|
| mlength.Value() >= moffset.right().Value()) {
|
| - Emit(opcode, nullptr, g.UseRegister(buffer),
|
| + Emit(opcode, g.NoOutput(), g.UseRegister(buffer),
|
| g.UseRegister(moffset.left().node()),
|
| g.UseImmediate(moffset.right().node()), g.UseImmediate(length),
|
| value_operand);
|
| return;
|
| }
|
| }
|
| - InstructionOperand* length_operand =
|
| + InstructionOperand length_operand =
|
| g.CanBeImmediate(length) ? g.UseImmediate(length) : g.UseRegister(length);
|
| - Emit(opcode, nullptr, g.UseRegister(buffer), g.UseRegister(offset),
|
| + Emit(opcode, g.NoOutput(), g.UseRegister(buffer), g.UseRegister(offset),
|
| g.TempImmediate(0), length_operand, value_operand);
|
| }
|
|
|
| @@ -305,9 +305,9 @@ static void VisitBinop(InstructionSelector* selector, Node* node,
|
| Int32BinopMatcher m(node);
|
| Node* left = m.left().node();
|
| Node* right = m.right().node();
|
| - InstructionOperand* inputs[4];
|
| + InstructionOperand inputs[4];
|
| size_t input_count = 0;
|
| - InstructionOperand* outputs[2];
|
| + InstructionOperand outputs[2];
|
| size_t output_count = 0;
|
|
|
| // TODO(turbofan): match complex addressing modes.
|
| @@ -319,7 +319,7 @@ static void VisitBinop(InstructionSelector* selector, Node* node,
|
| // mov rax, [rbp-0x10]
|
| // add rax, [rbp-0x10]
|
| // jo label
|
| - InstructionOperand* const input = g.UseRegister(left);
|
| + InstructionOperand const input = g.UseRegister(left);
|
| inputs[input_count++] = input;
|
| inputs[input_count++] = input;
|
| } else if (g.CanBeImmediate(right)) {
|
| @@ -456,7 +456,7 @@ void EmitLea(InstructionSelector* selector, InstructionCode opcode,
|
| Node* displacement) {
|
| X64OperandGenerator g(selector);
|
|
|
| - InstructionOperand* inputs[4];
|
| + InstructionOperand inputs[4];
|
| size_t input_count = 0;
|
| AddressingMode mode = g.GenerateMemoryOperandInputs(
|
| index, scale, base, displacement, inputs, &input_count);
|
| @@ -464,7 +464,7 @@ void EmitLea(InstructionSelector* selector, InstructionCode opcode,
|
| DCHECK_NE(0, static_cast<int>(input_count));
|
| DCHECK_GE(arraysize(inputs), input_count);
|
|
|
| - InstructionOperand* outputs[1];
|
| + InstructionOperand outputs[1];
|
| outputs[0] = g.DefineAsRegister(result);
|
|
|
| opcode = AddressingModeField::encode(mode) | opcode;
|
| @@ -634,7 +634,7 @@ void VisitMulHigh(InstructionSelector* selector, Node* node,
|
|
|
| void VisitDiv(InstructionSelector* selector, Node* node, ArchOpcode opcode) {
|
| X64OperandGenerator g(selector);
|
| - InstructionOperand* temps[] = {g.TempRegister(rdx)};
|
| + InstructionOperand temps[] = {g.TempRegister(rdx)};
|
| selector->Emit(
|
| opcode, g.DefineAsFixed(node, rax), g.UseFixed(node->InputAt(0), rax),
|
| g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps);
|
| @@ -870,7 +870,7 @@ void InstructionSelector::VisitFloat64Div(Node* node) {
|
|
|
| void InstructionSelector::VisitFloat64Mod(Node* node) {
|
| X64OperandGenerator g(this);
|
| - InstructionOperand* temps[] = {g.TempRegister(rax)};
|
| + InstructionOperand temps[] = {g.TempRegister(rax)};
|
| Emit(kSSEFloat64Mod, g.DefineSameAsFirst(node),
|
| g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)), 1,
|
| temps);
|
| @@ -937,11 +937,11 @@ void InstructionSelector::VisitCall(Node* node) {
|
| for (auto i = buffer.pushed_nodes.rbegin(); i != buffer.pushed_nodes.rend();
|
| ++i) {
|
| // TODO(titzer): handle pushing double parameters.
|
| - InstructionOperand* value =
|
| + InstructionOperand value =
|
| g.CanBeImmediate(*i) ? g.UseImmediate(*i) : IsSupported(ATOM)
|
| ? g.UseRegister(*i)
|
| : g.Use(*i);
|
| - Emit(kX64Push, nullptr, value);
|
| + Emit(kX64Push, g.NoOutput(), value);
|
| }
|
|
|
| // Select the appropriate opcode based on the call type.
|
| @@ -961,7 +961,7 @@ void InstructionSelector::VisitCall(Node* node) {
|
| opcode |= MiscField::encode(descriptor->flags());
|
|
|
| // Emit the call instruction.
|
| - InstructionOperand** first_output =
|
| + InstructionOperand* first_output =
|
| buffer.outputs.size() > 0 ? &buffer.outputs.front() : NULL;
|
| Instruction* call_instr =
|
| Emit(opcode, buffer.outputs.size(), first_output,
|
| @@ -972,12 +972,13 @@ void InstructionSelector::VisitCall(Node* node) {
|
|
|
| // Shared routine for multiple compare operations.
|
| static void VisitCompare(InstructionSelector* selector, InstructionCode opcode,
|
| - InstructionOperand* left, InstructionOperand* right,
|
| + InstructionOperand left, InstructionOperand right,
|
| FlagsContinuation* cont) {
|
| X64OperandGenerator 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());
|
|
|