Commit 1e850705 authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

Revert "[compiler] Add a StartNode wrapper class"

This reverts commit 453cf219.

Reason for revert: Multiple compile errors, e.g. https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20-%20debug%20builder/45301

Original change's description:
> [compiler] Add a StartNode wrapper class
> 
> .. to make implicit semantics of output nodes explicit.
> 
> Bug: v8:8888
> Change-Id: I2ea5f5fa02f3d1f51196ea1e1e46b526dd9dc7d6
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2388117
> Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#69681}

TBR=jgruber@chromium.org,tebbi@chromium.org

Change-Id: Ic81321960da36e8ddcdc8e0072b2e9cd41206478
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:8888
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2390646Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69682}
parent 453cf219
......@@ -1141,8 +1141,7 @@ void BytecodeGraphBuilder::CreateGraph() {
// Set up the basic structure of the graph. Outputs for {Start} are the formal
// parameters (including the receiver) plus new target, number of arguments,
// context and closure.
int actual_parameter_count = StartNode::OutputArityForFormalParameterCount(
bytecode_array().parameter_count());
int actual_parameter_count = bytecode_array().parameter_count() + 4;
graph()->SetStart(graph()->NewNode(common()->Start(actual_parameter_count)));
Environment env(this, bytecode_array().register_count(),
......
......@@ -12,8 +12,6 @@
#include "src/common/globals.h"
#include "src/compiler/feedback-source.h"
#include "src/compiler/frame-states.h"
#include "src/compiler/linkage.h"
#include "src/compiler/node-properties.h"
#include "src/deoptimizer/deoptimize-reason.h"
#include "src/zone/zone-containers.h"
#include "src/zone/zone-handle-set.h"
......@@ -567,77 +565,6 @@ class V8_EXPORT_PRIVATE CommonOperatorBuilder final
DISALLOW_COPY_AND_ASSIGN(CommonOperatorBuilder);
};
// Node wrappers.
class CommonNodeWrapperBase : public NodeWrapper {
public:
explicit constexpr CommonNodeWrapperBase(Node* node) : NodeWrapper(node) {}
// Valid iff this node has exactly one effect input.
Effect effect() const {
DCHECK_EQ(node()->op()->EffectInputCount(), 1);
return Effect{NodeProperties::GetEffectInput(node())};
}
// Valid iff this node has exactly one control input.
Control control() const {
DCHECK_EQ(node()->op()->ControlInputCount(), 1);
return Control{NodeProperties::GetControlInput(node())};
}
};
#define DEFINE_INPUT_ACCESSORS(Name, name, TheIndex, Type) \
static constexpr int Name##Index() { return TheIndex; } \
TNode<Type> name() const { \
return TNode<Type>::UncheckedCast( \
NodeProperties::GetValueInput(node(), TheIndex)); \
}
class StartNode final : public CommonNodeWrapperBase {
public:
explicit constexpr StartNode(Node* node) : CommonNodeWrapperBase(node) {
CONSTEXPR_DCHECK(node->opcode() == IrOpcode::kStart);
}
// The receiver is counted as part of formal parameters.
static constexpr int kReceiverOutputCount = 1;
// These outputs are in addition to formal parameters.
static constexpr int kExtraOutputCount = 4;
// Takes the formal parameter count of the current function (including
// receiver) and returns the number of value outputs of the start node.
static constexpr int OutputArityForFormalParameterCount(int argc) {
constexpr int kClosure = 1;
constexpr int kNewTarget = 1;
constexpr int kArgCount = 1;
constexpr int kContext = 1;
STATIC_ASSERT(kClosure + kNewTarget + kArgCount + kContext ==
kExtraOutputCount);
// Checking related linkage methods here since they rely on Start node
// layout.
CONSTEXPR_DCHECK(Linkage::kJSCallClosureParamIndex == -1);
CONSTEXPR_DCHECK(Linkage::GetJSCallNewTargetParamIndex(argc) == argc + 0);
CONSTEXPR_DCHECK(Linkage::GetJSCallArgCountParamIndex(argc) == argc + 1);
CONSTEXPR_DCHECK(Linkage::GetJSCallContextParamIndex(argc) == argc + 2);
return argc + kClosure + kNewTarget + kArgCount + kContext;
}
int FormalParameterCount() const {
DCHECK_GE(node()->op()->ValueOutputCount(),
kExtraOutputCount + kReceiverOutputCount);
return node()->op()->ValueOutputCount() - kExtraOutputCount;
}
int FormalParameterCountWithoutReceiver() const {
DCHECK_GE(node()->op()->ValueOutputCount(),
kExtraOutputCount + kReceiverOutputCount);
return node()->op()->ValueOutputCount() - kExtraOutputCount -
kReceiverOutputCount;
}
};
#undef DEFINE_INPUT_ACCESSORS
} // namespace compiler
} // namespace internal
} // namespace v8
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment