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

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

Issue 888613002: Initial switch to Chromium-style CHECK_* and DCHECK_* macros. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix slow dchecks. Created 5 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 da586988350894660b6d668cf37f9b0a3fdc4fe9..d53287a354f9047ab8d62c850752d49a3a5606b2 100644
--- a/src/compiler/instruction-selector.cc
+++ b/src/compiler/instruction-selector.cc
@@ -40,7 +40,7 @@ void InstructionSelector::SelectInstructions() {
BasicBlockVector* blocks = schedule()->rpo_order();
for (auto const block : *blocks) {
if (!block->IsLoopHeader()) continue;
- DCHECK_LE(2, block->PredecessorCount());
+ DCHECK_LE(2u, block->PredecessorCount());
for (Node* const phi : *block) {
if (phi->opcode() != IrOpcode::kPhi) continue;
@@ -178,7 +178,7 @@ bool InstructionSelector::CanCover(Node* user, Node* node) const {
int InstructionSelector::GetVirtualRegister(const Node* node) {
- DCHECK_NOT_NULL(node);
+ DCHECK(node);
size_t const id = node->id();
DCHECK_LT(id, virtual_registers_.size());
int virtual_register = virtual_registers_[id];
@@ -204,7 +204,7 @@ const std::map<NodeId, int> InstructionSelector::GetVirtualRegistersForTesting()
bool InstructionSelector::IsDefined(Node* node) const {
- DCHECK_NOT_NULL(node);
+ DCHECK(node);
size_t const id = node->id();
DCHECK_LT(id, defined_.size());
return defined_[id];
@@ -212,7 +212,7 @@ bool InstructionSelector::IsDefined(Node* node) const {
void InstructionSelector::MarkAsDefined(Node* node) {
- DCHECK_NOT_NULL(node);
+ DCHECK(node);
size_t const id = node->id();
DCHECK_LT(id, defined_.size());
defined_[id] = true;
@@ -220,7 +220,7 @@ void InstructionSelector::MarkAsDefined(Node* node) {
bool InstructionSelector::IsUsed(Node* node) const {
- DCHECK_NOT_NULL(node);
+ DCHECK(node);
if (!node->op()->HasProperty(Operator::kEliminatable)) return true;
size_t const id = node->id();
DCHECK_LT(id, used_.size());
@@ -229,7 +229,7 @@ bool InstructionSelector::IsUsed(Node* node) const {
void InstructionSelector::MarkAsUsed(Node* node) {
- DCHECK_NOT_NULL(node);
+ DCHECK(node);
size_t const id = node->id();
DCHECK_LT(id, used_.size());
used_[id] = true;
@@ -237,7 +237,7 @@ void InstructionSelector::MarkAsUsed(Node* node) {
bool InstructionSelector::IsDouble(const Node* node) const {
- DCHECK_NOT_NULL(node);
+ DCHECK(node);
int const virtual_register = virtual_registers_[node->id()];
if (virtual_register == UnallocatedOperand::kInvalidVirtualRegister) {
return false;
@@ -247,14 +247,14 @@ bool InstructionSelector::IsDouble(const Node* node) const {
void InstructionSelector::MarkAsDouble(Node* node) {
- DCHECK_NOT_NULL(node);
+ DCHECK(node);
DCHECK(!IsReference(node));
sequence()->MarkAsDouble(GetVirtualRegister(node));
}
bool InstructionSelector::IsReference(const Node* node) const {
- DCHECK_NOT_NULL(node);
+ DCHECK(node);
int const virtual_register = virtual_registers_[node->id()];
if (virtual_register == UnallocatedOperand::kInvalidVirtualRegister) {
return false;
@@ -264,7 +264,7 @@ bool InstructionSelector::IsReference(const Node* node) const {
void InstructionSelector::MarkAsReference(Node* node) {
- DCHECK_NOT_NULL(node);
+ DCHECK(node);
DCHECK(!IsDouble(node));
sequence()->MarkAsReference(GetVirtualRegister(node));
}
@@ -288,7 +288,7 @@ void InstructionSelector::MarkAsRepresentation(MachineType rep,
void InstructionSelector::MarkAsRepresentation(MachineType rep, Node* node) {
- DCHECK_NOT_NULL(node);
+ DCHECK(node);
switch (RepresentationOf(rep)) {
case kRepFloat32:
case kRepFloat64:
@@ -342,7 +342,7 @@ void InstructionSelector::InitializeCallBuffer(Node* call, CallBuffer* buffer,
if (use->opcode() != IrOpcode::kProjection) continue;
size_t const index = ProjectionIndexOf(use->op());
DCHECK_LT(index, buffer->output_nodes.size());
- DCHECK_EQ(nullptr, buffer->output_nodes[index]);
+ DCHECK(!buffer->output_nodes[index]);
buffer->output_nodes[index] = use;
}
}
@@ -435,7 +435,7 @@ void InstructionSelector::InitializeCallBuffer(Node* call, CallBuffer* buffer,
if (static_cast<size_t>(stack_index) >= buffer->pushed_nodes.size()) {
buffer->pushed_nodes.resize(stack_index + 1, NULL);
}
- DCHECK_EQ(NULL, buffer->pushed_nodes[stack_index]);
+ DCHECK(!buffer->pushed_nodes[stack_index]);
buffer->pushed_nodes[stack_index] = *iter;
pushed_count++;
} else {
@@ -450,7 +450,7 @@ void InstructionSelector::InitializeCallBuffer(Node* call, CallBuffer* buffer,
void InstructionSelector::VisitBlock(BasicBlock* block) {
- DCHECK_EQ(NULL, current_block_);
+ DCHECK(!current_block_);
current_block_ = block;
int current_block_end = static_cast<int>(instructions_.size());
@@ -535,7 +535,7 @@ void InstructionSelector::VisitControl(BasicBlock* block) {
MachineType InstructionSelector::GetMachineType(Node* node) {
- DCHECK_NOT_NULL(schedule()->block(node)); // should only use scheduled nodes.
+ DCHECK(schedule()->block(node)); // should only use scheduled nodes.
switch (node->opcode()) {
case IrOpcode::kStart:
case IrOpcode::kLoop:
@@ -666,7 +666,7 @@ MachineType InstructionSelector::GetMachineType(Node* node) {
void InstructionSelector::VisitNode(Node* node) {
- DCHECK_NOT_NULL(schedule()->block(node)); // should only use scheduled nodes.
+ DCHECK(schedule()->block(node)); // should only use scheduled nodes.
SourcePosition source_position = source_positions_->GetSourcePosition(node);
if (!source_position.IsUnknown()) {
DCHECK(!source_position.IsInvalid());

Powered by Google App Engine
This is Rietveld 408576698