Reviewers: titzer,
Description:
Remove ambiguous getter for operator value counts.
[email protected]
Please review this at https://codereview.chromium.org/735583003/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+12, -20 lines):
M src/compiler/graph.cc
M src/compiler/graph-builder.cc
M src/compiler/graph-replay.cc
M src/compiler/instruction-selector.cc
M src/compiler/js-inlining.cc
M src/compiler/operator.h
M test/cctest/compiler/simplified-graph-builder.cc
M test/cctest/compiler/test-control-reducer.cc
M test/cctest/compiler/test-js-typed-lowering.cc
Index: src/compiler/graph-builder.cc
diff --git a/src/compiler/graph-builder.cc b/src/compiler/graph-builder.cc
index
65ce345023a64851f98f9d8998ecdcb4ecee4772..3c90f4b634254218b5dbd919400f9f9abf7c400a
100644
--- a/src/compiler/graph-builder.cc
+++ b/src/compiler/graph-builder.cc
@@ -45,7 +45,7 @@ Node** StructuredGraphBuilder::EnsureInputBufferSize(int
size) {
Node* StructuredGraphBuilder::MakeNode(const Operator* op,
int value_input_count,
Node** value_inputs, bool
incomplete) {
- DCHECK(op->InputCount() == value_input_count);
+ DCHECK(op->ValueInputCount() == value_input_count);
bool has_context = OperatorProperties::HasContextInput(op);
bool has_framestate = OperatorProperties::HasFrameStateInput(op);
Index: src/compiler/graph-replay.cc
diff --git a/src/compiler/graph-replay.cc b/src/compiler/graph-replay.cc
index
296ffe4c941b36523559553717bc32bf3609f5c2..25a62f36c77106ffca03129b2a4e3523196d719a
100644
--- a/src/compiler/graph-replay.cc
+++ b/src/compiler/graph-replay.cc
@@ -59,7 +59,7 @@ void GraphReplayPrinter::PrintReplayOpCreator(const
Operator* op) {
PrintF("unique_constant");
break;
case IrOpcode::kPhi:
- PrintF("%d", op->InputCount());
+ PrintF("%d", op->ValueInputCount());
break;
case IrOpcode::kEffectPhi:
PrintF("%d", op->EffectInputCount());
Index: src/compiler/graph.cc
diff --git a/src/compiler/graph.cc b/src/compiler/graph.cc
index
1de712efccd8d84c24a8af27be83e70834f6ee66..7e320fe220c452e1e1b8ddfc12539b6f8f8c0661
100644
--- a/src/compiler/graph.cc
+++ b/src/compiler/graph.cc
@@ -32,7 +32,7 @@ void Graph::Decorate(Node* node) {
Node* Graph::NewNode(const Operator* op, int input_count, Node** inputs,
bool incomplete) {
- DCHECK_LE(op->InputCount(), input_count);
+ DCHECK_LE(op->ValueInputCount(), input_count);
Node* result = Node::New(this, input_count, inputs, incomplete);
result->Initialize(op);
if (!incomplete) {
Index: src/compiler/instruction-selector.cc
diff --git a/src/compiler/instruction-selector.cc
b/src/compiler/instruction-selector.cc
index
e601b2c092f70209bf7014ebc66df435bf4a2f9b..567b1c920f00ff86273dec94e4e4fb6ea5356330
100644
--- a/src/compiler/instruction-selector.cc
+++ b/src/compiler/instruction-selector.cc
@@ -295,7 +295,7 @@ void InstructionSelector::InitializeCallBuffer(Node*
call, CallBuffer* buffer,
bool call_code_immediate,
bool
call_address_immediate) {
OperandGenerator g(this);
- DCHECK_EQ(call->op()->OutputCount(),
+ DCHECK_EQ(call->op()->ValueOutputCount(),
static_cast<int>(buffer->descriptor->ReturnCount()));
DCHECK_EQ(
call->op()->ValueInputCount(),
@@ -929,7 +929,7 @@ void InstructionSelector::VisitPhi(Node* node) {
PhiInstruction* phi = new (instruction_zone())
PhiInstruction(instruction_zone(), GetVirtualRegister(node));
sequence()->InstructionBlockAt(current_block_->GetRpoNumber())->AddPhi(phi);
- const int input_count = node->op()->InputCount();
+ const int input_count = node->op()->ValueInputCount();
phi->operands().reserve(static_cast<size_t>(input_count));
for (int i = 0; i < input_count; ++i) {
Node* const input = node->InputAt(i);
Index: src/compiler/js-inlining.cc
diff --git a/src/compiler/js-inlining.cc b/src/compiler/js-inlining.cc
index
110cec521d27c5407799482952b105fde5c0dab4..86463179486bcf326bed9a26842b2d48e95dc3d6
100644
--- a/src/compiler/js-inlining.cc
+++ b/src/compiler/js-inlining.cc
@@ -87,7 +87,7 @@ class Inlinee {
}
// Counts JSFunction, Receiver, arguments, context but not effect,
control.
- size_t total_parameters() { return start_->op()->OutputCount(); }
+ size_t total_parameters() { return start_->op()->ValueOutputCount(); }
// Counts only formal parameters.
size_t formal_parameters() {
Index: src/compiler/operator.h
diff --git a/src/compiler/operator.h b/src/compiler/operator.h
index
74b714b3d65e5d5aec001f860059497948ecf401..810851b626a02e0a9a3e5510d716bfff3a5f11cc
100644
--- a/src/compiler/operator.h
+++ b/src/compiler/operator.h
@@ -82,14 +82,6 @@ class Operator : public ZoneObject {
return (properties() & property) == property;
}
- // Number of data inputs to the operator, for verifying graph structure.
- // TODO(titzer): convert callers to ValueInputCount();
- int InputCount() const { return ValueInputCount(); }
-
- // Number of data outputs from the operator, for verifying graph
structure.
- // TODO(titzer): convert callers to ValueOutputCount();
- int OutputCount() const { return ValueOutputCount(); }
-
Properties properties() const { return properties_; }
// TODO(titzer): convert return values here to size_t.
Index: test/cctest/compiler/simplified-graph-builder.cc
diff --git a/test/cctest/compiler/simplified-graph-builder.cc
b/test/cctest/compiler/simplified-graph-builder.cc
index
8d6844f28e9dcb96b63c0ad2cc04e209af16031a..4e8a5e3546a0fb84f6c6f9cca85ea9707087c622
100644
--- a/test/cctest/compiler/simplified-graph-builder.cc
+++ b/test/cctest/compiler/simplified-graph-builder.cc
@@ -46,7 +46,7 @@ void SimplifiedGraphBuilder::End() {
Node* SimplifiedGraphBuilder::MakeNode(const Operator* op,
int value_input_count,
Node** value_inputs, bool
incomplete) {
- DCHECK(op->InputCount() == value_input_count);
+ DCHECK(op->ValueInputCount() == value_input_count);
DCHECK(!OperatorProperties::HasContextInput(op));
DCHECK(!OperatorProperties::HasFrameStateInput(op));
Index: test/cctest/compiler/test-control-reducer.cc
diff --git a/test/cctest/compiler/test-control-reducer.cc
b/test/cctest/compiler/test-control-reducer.cc
index
67fdb6840b94a840b85256d2e08cdaa1ebb203cc..d0103f5644009aaf28f1b99a198efa54512f7a73
100644
--- a/test/cctest/compiler/test-control-reducer.cc
+++ b/test/cctest/compiler/test-control-reducer.cc
@@ -772,7 +772,7 @@ TEST(CMergeReduce_edit_phi1) {
R.leaf[1], R.leaf[2], merge);
R.ReduceMerge(merge, merge);
CHECK_EQ(IrOpcode::kPhi, phi->opcode());
- CHECK_EQ(2, phi->op()->InputCount());
+ CHECK_EQ(2, phi->op()->ValueInputCount());
CHECK_EQ(3, phi->InputCount());
CHECK_EQ(R.leaf[i < 1 ? 1 : 0], phi->InputAt(0));
CHECK_EQ(R.leaf[i < 2 ? 2 : 1], phi->InputAt(1));
@@ -791,7 +791,7 @@ TEST(CMergeReduce_edit_effect_phi1) {
R.leaf[2], merge);
R.ReduceMerge(merge, merge);
CHECK_EQ(IrOpcode::kEffectPhi, phi->opcode());
- CHECK_EQ(0, phi->op()->InputCount());
+ CHECK_EQ(0, phi->op()->ValueInputCount());
CHECK_EQ(2, phi->op()->EffectInputCount());
CHECK_EQ(3, phi->InputCount());
CHECK_EQ(R.leaf[i < 1 ? 1 : 0], phi->InputAt(0));
@@ -883,7 +883,7 @@ TEST(CMergeReduce_exhaustive_4) {
selector.CheckNode(ephi, IrOpcode::kEffectPhi, effects, merge);
CHECK_EQ(phi, phi_use->InputAt(0));
CHECK_EQ(ephi, ephi_use->InputAt(0));
- CHECK_EQ(count, phi->op()->InputCount());
+ CHECK_EQ(count, phi->op()->ValueInputCount());
CHECK_EQ(count + 1, phi->InputCount());
CHECK_EQ(count, ephi->op()->EffectInputCount());
CHECK_EQ(count + 1, ephi->InputCount());
@@ -909,7 +909,7 @@ TEST(CMergeReduce_edit_many_phis1) {
for (int j = 0; j < kPhiCount; j++) {
Node* phi = phis[j];
CHECK_EQ(IrOpcode::kPhi, phi->opcode());
- CHECK_EQ(2, phi->op()->InputCount());
+ CHECK_EQ(2, phi->op()->ValueInputCount());
CHECK_EQ(3, phi->InputCount());
CHECK_EQ(R.leaf[i < 1 ? 1 : 0], phi->InputAt(0));
CHECK_EQ(R.leaf[i < 2 ? 2 : 1], phi->InputAt(1));
Index: test/cctest/compiler/test-js-typed-lowering.cc
diff --git a/test/cctest/compiler/test-js-typed-lowering.cc
b/test/cctest/compiler/test-js-typed-lowering.cc
index
1a0551442c1e4d98ae38e5f39cfad23701e471c2..4d53ef363df6bd7d7abd676e3cb9bc8209593fb2
100644
--- a/test/cctest/compiler/test-js-typed-lowering.cc
+++ b/test/cctest/compiler/test-js-typed-lowering.cc
@@ -820,7 +820,7 @@ TEST(RemoveToNumberEffects) {
if (effect_use != NULL) {
R.CheckEffectInput(R.start(), effect_use);
// Check that value uses of ToNumber() do not go to start().
- for (int i = 0; i < effect_use->op()->InputCount(); i++) {
+ for (int i = 0; i < effect_use->op()->ValueInputCount(); i++) {
CHECK_NE(R.start(), effect_use->InputAt(i));
}
}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.