Index: src/compiler/x87/instruction-selector-x87.cc |
diff --git a/src/compiler/x87/instruction-selector-x87.cc b/src/compiler/x87/instruction-selector-x87.cc |
index 1fa883f821ace1007e61f4c96b7050c6bf6dce5d..cff4aafb278d8c3d5de8a82fcf2dea54f5f45035 100644 |
--- a/src/compiler/x87/instruction-selector-x87.cc |
+++ b/src/compiler/x87/instruction-selector-x87.cc |
@@ -54,18 +54,18 @@ class X87OperandGenerator final : public OperandGenerator { |
InstructionOperand inputs[], |
size_t* input_count) { |
AddressingMode mode = kMode_MRI; |
- int32_t displacement = (displacement_node == NULL) |
+ int32_t displacement = (displacement_node == nullptr) |
? 0 |
: OpParameter<int32_t>(displacement_node); |
- if (base != NULL) { |
+ if (base != nullptr) { |
if (base->opcode() == IrOpcode::kInt32Constant) { |
displacement += OpParameter<int32_t>(base); |
- base = NULL; |
+ base = nullptr; |
} |
} |
- if (base != NULL) { |
+ if (base != nullptr) { |
inputs[(*input_count)++] = UseRegister(base); |
- if (index != NULL) { |
+ if (index != nullptr) { |
DCHECK(scale >= 0 && scale <= 3); |
inputs[(*input_count)++] = UseRegister(index); |
if (displacement != 0) { |
@@ -88,7 +88,7 @@ class X87OperandGenerator final : public OperandGenerator { |
} |
} else { |
DCHECK(scale >= 0 && scale <= 3); |
- if (index != NULL) { |
+ if (index != nullptr) { |
inputs[(*input_count)++] = UseRegister(index); |
if (displacement != 0) { |
inputs[(*input_count)++] = TempImmediate(displacement); |
@@ -113,7 +113,7 @@ class X87OperandGenerator final : public OperandGenerator { |
size_t* input_count) { |
BaseWithIndexAndDisplacement32Matcher m(node, true); |
DCHECK(m.matches()); |
- if ((m.displacement() == NULL || CanBeImmediate(m.displacement()))) { |
+ if ((m.displacement() == nullptr || CanBeImmediate(m.displacement()))) { |
return GenerateMemoryOperandInputs(m.index(), m.scale(), m.base(), |
m.displacement(), inputs, input_count); |
} else { |
@@ -259,7 +259,8 @@ void InstructionSelector::VisitStore(Node* node) { |
InstructionCode code = |
opcode | AddressingModeField::encode(addressing_mode); |
inputs[input_count++] = val; |
- Emit(code, 0, static_cast<InstructionOperand*>(NULL), input_count, inputs); |
+ Emit(code, 0, static_cast<InstructionOperand*>(nullptr), input_count, |
+ inputs); |
} |
} |
@@ -516,8 +517,8 @@ void InstructionSelector::VisitWord32Shl(Node* node) { |
Int32ScaleMatcher m(node, true); |
if (m.matches()) { |
Node* index = node->InputAt(0); |
- Node* base = m.power_of_two_plus_one() ? index : NULL; |
- EmitLea(this, node, index, m.scale(), base, NULL); |
+ Node* base = m.power_of_two_plus_one() ? index : nullptr; |
+ EmitLea(this, node, index, m.scale(), base, nullptr); |
return; |
} |
VisitShift(this, node, kX87Shl); |
@@ -560,7 +561,7 @@ void InstructionSelector::VisitInt32Add(Node* node) { |
// Try to match the Add to a lea pattern |
BaseWithIndexAndDisplacement32Matcher m(node); |
if (m.matches() && |
- (m.displacement() == NULL || g.CanBeImmediate(m.displacement()))) { |
+ (m.displacement() == nullptr || g.CanBeImmediate(m.displacement()))) { |
InstructionOperand inputs[4]; |
size_t input_count = 0; |
AddressingMode mode = g.GenerateMemoryOperandInputs( |
@@ -597,8 +598,8 @@ void InstructionSelector::VisitInt32Mul(Node* node) { |
Int32ScaleMatcher m(node, true); |
if (m.matches()) { |
Node* index = node->InputAt(0); |
- Node* base = m.power_of_two_plus_one() ? index : NULL; |
- EmitLea(this, node, index, m.scale(), base, NULL); |
+ Node* base = m.power_of_two_plus_one() ? index : nullptr; |
+ EmitLea(this, node, index, m.scale(), base, nullptr); |
return; |
} |
X87OperandGenerator g(this); |
@@ -707,7 +708,7 @@ void InstructionSelector::VisitTruncateFloat64ToInt32(Node* node) { |
void InstructionSelector::VisitBitcastFloat32ToInt32(Node* node) { |
X87OperandGenerator g(this); |
Emit(kX87PushFloat32, g.NoOutput(), g.Use(node->InputAt(0))); |
- Emit(kX87BitcastFI, g.DefineAsRegister(node), 0, NULL); |
+ Emit(kX87BitcastFI, g.DefineAsRegister(node), 0, nullptr); |
} |
@@ -721,7 +722,7 @@ void InstructionSelector::VisitFloat32Add(Node* node) { |
X87OperandGenerator g(this); |
Emit(kX87PushFloat32, g.NoOutput(), g.Use(node->InputAt(0))); |
Emit(kX87PushFloat32, g.NoOutput(), g.Use(node->InputAt(1))); |
- Emit(kX87Float32Add, g.DefineAsFixed(node, stX_0), 0, NULL); |
+ Emit(kX87Float32Add, g.DefineAsFixed(node, stX_0), 0, nullptr); |
} |
@@ -729,7 +730,7 @@ void InstructionSelector::VisitFloat64Add(Node* node) { |
X87OperandGenerator g(this); |
Emit(kX87PushFloat64, g.NoOutput(), g.Use(node->InputAt(0))); |
Emit(kX87PushFloat64, g.NoOutput(), g.Use(node->InputAt(1))); |
- Emit(kX87Float64Add, g.DefineAsFixed(node, stX_0), 0, NULL); |
+ Emit(kX87Float64Add, g.DefineAsFixed(node, stX_0), 0, nullptr); |
} |
@@ -737,7 +738,7 @@ void InstructionSelector::VisitFloat32Sub(Node* node) { |
X87OperandGenerator g(this); |
Emit(kX87PushFloat32, g.NoOutput(), g.Use(node->InputAt(0))); |
Emit(kX87PushFloat32, g.NoOutput(), g.Use(node->InputAt(1))); |
- Emit(kX87Float32Sub, g.DefineAsFixed(node, stX_0), 0, NULL); |
+ Emit(kX87Float32Sub, g.DefineAsFixed(node, stX_0), 0, nullptr); |
} |
@@ -745,7 +746,7 @@ void InstructionSelector::VisitFloat64Sub(Node* node) { |
X87OperandGenerator g(this); |
Emit(kX87PushFloat64, g.NoOutput(), g.Use(node->InputAt(0))); |
Emit(kX87PushFloat64, g.NoOutput(), g.Use(node->InputAt(1))); |
- Emit(kX87Float64Sub, g.DefineAsFixed(node, stX_0), 0, NULL); |
+ Emit(kX87Float64Sub, g.DefineAsFixed(node, stX_0), 0, nullptr); |
} |
@@ -753,7 +754,7 @@ void InstructionSelector::VisitFloat32Mul(Node* node) { |
X87OperandGenerator g(this); |
Emit(kX87PushFloat32, g.NoOutput(), g.Use(node->InputAt(0))); |
Emit(kX87PushFloat32, g.NoOutput(), g.Use(node->InputAt(1))); |
- Emit(kX87Float32Mul, g.DefineAsFixed(node, stX_0), 0, NULL); |
+ Emit(kX87Float32Mul, g.DefineAsFixed(node, stX_0), 0, nullptr); |
} |
@@ -761,7 +762,7 @@ void InstructionSelector::VisitFloat64Mul(Node* node) { |
X87OperandGenerator g(this); |
Emit(kX87PushFloat64, g.NoOutput(), g.Use(node->InputAt(0))); |
Emit(kX87PushFloat64, g.NoOutput(), g.Use(node->InputAt(1))); |
- Emit(kX87Float64Mul, g.DefineAsFixed(node, stX_0), 0, NULL); |
+ Emit(kX87Float64Mul, g.DefineAsFixed(node, stX_0), 0, nullptr); |
} |
@@ -769,7 +770,7 @@ void InstructionSelector::VisitFloat32Div(Node* node) { |
X87OperandGenerator g(this); |
Emit(kX87PushFloat32, g.NoOutput(), g.Use(node->InputAt(0))); |
Emit(kX87PushFloat32, g.NoOutput(), g.Use(node->InputAt(1))); |
- Emit(kX87Float32Div, g.DefineAsFixed(node, stX_0), 0, NULL); |
+ Emit(kX87Float32Div, g.DefineAsFixed(node, stX_0), 0, nullptr); |
} |
@@ -777,7 +778,7 @@ void InstructionSelector::VisitFloat64Div(Node* node) { |
X87OperandGenerator g(this); |
Emit(kX87PushFloat64, g.NoOutput(), g.Use(node->InputAt(0))); |
Emit(kX87PushFloat64, g.NoOutput(), g.Use(node->InputAt(1))); |
- Emit(kX87Float64Div, g.DefineAsFixed(node, stX_0), 0, NULL); |
+ Emit(kX87Float64Div, g.DefineAsFixed(node, stX_0), 0, nullptr); |
} |
@@ -794,7 +795,7 @@ void InstructionSelector::VisitFloat32Max(Node* node) { |
X87OperandGenerator g(this); |
Emit(kX87PushFloat32, g.NoOutput(), g.Use(node->InputAt(0))); |
Emit(kX87PushFloat32, g.NoOutput(), g.Use(node->InputAt(1))); |
- Emit(kX87Float32Max, g.DefineAsFixed(node, stX_0), 0, NULL); |
+ Emit(kX87Float32Max, g.DefineAsFixed(node, stX_0), 0, nullptr); |
} |
@@ -802,7 +803,7 @@ void InstructionSelector::VisitFloat64Max(Node* node) { |
X87OperandGenerator g(this); |
Emit(kX87PushFloat64, g.NoOutput(), g.Use(node->InputAt(0))); |
Emit(kX87PushFloat64, g.NoOutput(), g.Use(node->InputAt(1))); |
- Emit(kX87Float64Max, g.DefineAsFixed(node, stX_0), 0, NULL); |
+ Emit(kX87Float64Max, g.DefineAsFixed(node, stX_0), 0, nullptr); |
} |
@@ -810,7 +811,7 @@ void InstructionSelector::VisitFloat32Min(Node* node) { |
X87OperandGenerator g(this); |
Emit(kX87PushFloat32, g.NoOutput(), g.Use(node->InputAt(0))); |
Emit(kX87PushFloat32, g.NoOutput(), g.Use(node->InputAt(1))); |
- Emit(kX87Float32Min, g.DefineAsFixed(node, stX_0), 0, NULL); |
+ Emit(kX87Float32Min, g.DefineAsFixed(node, stX_0), 0, nullptr); |
} |
@@ -818,35 +819,35 @@ void InstructionSelector::VisitFloat64Min(Node* node) { |
X87OperandGenerator g(this); |
Emit(kX87PushFloat64, g.NoOutput(), g.Use(node->InputAt(0))); |
Emit(kX87PushFloat64, g.NoOutput(), g.Use(node->InputAt(1))); |
- Emit(kX87Float64Min, g.DefineAsFixed(node, stX_0), 0, NULL); |
+ Emit(kX87Float64Min, g.DefineAsFixed(node, stX_0), 0, nullptr); |
} |
void InstructionSelector::VisitFloat32Abs(Node* node) { |
X87OperandGenerator g(this); |
Emit(kX87PushFloat32, g.NoOutput(), g.Use(node->InputAt(0))); |
- Emit(kX87Float32Abs, g.DefineAsFixed(node, stX_0), 0, NULL); |
+ Emit(kX87Float32Abs, g.DefineAsFixed(node, stX_0), 0, nullptr); |
} |
void InstructionSelector::VisitFloat64Abs(Node* node) { |
X87OperandGenerator g(this); |
Emit(kX87PushFloat64, g.NoOutput(), g.Use(node->InputAt(0))); |
- Emit(kX87Float64Abs, g.DefineAsFixed(node, stX_0), 0, NULL); |
+ Emit(kX87Float64Abs, g.DefineAsFixed(node, stX_0), 0, nullptr); |
} |
void InstructionSelector::VisitFloat32Sqrt(Node* node) { |
X87OperandGenerator g(this); |
Emit(kX87PushFloat32, g.NoOutput(), g.Use(node->InputAt(0))); |
- Emit(kX87Float32Sqrt, g.DefineAsFixed(node, stX_0), 0, NULL); |
+ Emit(kX87Float32Sqrt, g.DefineAsFixed(node, stX_0), 0, nullptr); |
} |
void InstructionSelector::VisitFloat64Sqrt(Node* node) { |
X87OperandGenerator g(this); |
Emit(kX87PushFloat64, g.NoOutput(), g.Use(node->InputAt(0))); |
- Emit(kX87Float64Sqrt, g.DefineAsFixed(node, stX_0), 0, NULL); |
+ Emit(kX87Float64Sqrt, g.DefineAsFixed(node, stX_0), 0, nullptr); |
} |
@@ -1121,12 +1122,12 @@ void VisitWordCompareZero(InstructionSelector* selector, Node* user, |
if (ProjectionIndexOf(value->op()) == 1u) { |
// We cannot combine the <Operation>WithOverflow with this branch |
// unless the 0th projection (the use of the actual value of the |
- // <Operation> is either NULL, which means there's no use of the |
+ // <Operation> is either nullptr, which means there's no use of the |
// actual value, or was already defined, which means it is scheduled |
// *AFTER* this branch). |
Node* const node = value->InputAt(0); |
Node* const result = NodeProperties::FindProjection(node, 0); |
- if (result == NULL || selector->IsDefined(result)) { |
+ if (result == nullptr || selector->IsDefined(result)) { |
switch (node->opcode()) { |
case IrOpcode::kInt32AddWithOverflow: |
cont->OverwriteAndNegateIfEqual(kOverflow); |