Commit c35eee3b authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

[cleanup] Remove more OpParameter

Bug: v8:7570, v8:7517
Change-Id: Ia62a9afeec0d0df1596198deec6165a3f02edeaa
Reviewed-on: https://chromium-review.googlesource.com/973606Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52120}
parent cbbdc6cb
......@@ -69,8 +69,9 @@ inline bool operator==(const BranchOperatorInfo& a,
}
V8_EXPORT_PRIVATE const BranchOperatorInfo& BranchOperatorInfoOf(
const Operator* const);
V8_EXPORT_PRIVATE BranchHint BranchHintOf(const Operator* const);
const Operator* const) WARN_UNUSED_RESULT;
V8_EXPORT_PRIVATE BranchHint BranchHintOf(const Operator* const)
WARN_UNUSED_RESULT;
// Helper function for return nodes, because returns have a hidden value input.
int ValueInputCountOfReturn(Operator const* const op);
......@@ -105,9 +106,10 @@ size_t hast_value(DeoptimizeParameters p);
std::ostream& operator<<(std::ostream&, DeoptimizeParameters p);
DeoptimizeParameters const& DeoptimizeParametersOf(Operator const* const);
DeoptimizeParameters const& DeoptimizeParametersOf(Operator const* const)
WARN_UNUSED_RESULT;
IsSafetyCheck IsSafetyCheckOf(const Operator* op);
IsSafetyCheck IsSafetyCheckOf(const Operator* op) WARN_UNUSED_RESULT;
class SelectParameters final {
public:
......@@ -131,14 +133,16 @@ size_t hash_value(SelectParameters const& p);
std::ostream& operator<<(std::ostream&, SelectParameters const& p);
V8_EXPORT_PRIVATE SelectParameters const& SelectParametersOf(
const Operator* const);
const Operator* const) WARN_UNUSED_RESULT;
V8_EXPORT_PRIVATE CallDescriptor const* CallDescriptorOf(const Operator* const);
V8_EXPORT_PRIVATE CallDescriptor const* CallDescriptorOf(const Operator* const)
WARN_UNUSED_RESULT;
V8_EXPORT_PRIVATE size_t ProjectionIndexOf(const Operator* const);
V8_EXPORT_PRIVATE size_t ProjectionIndexOf(const Operator* const)
WARN_UNUSED_RESULT;
V8_EXPORT_PRIVATE MachineRepresentation
PhiRepresentationOf(const Operator* const);
PhiRepresentationOf(const Operator* const) WARN_UNUSED_RESULT;
// The {IrOpcode::kParameter} opcode represents an incoming parameter to the
// function. This class bundles the index and a debug name for such operators.
......@@ -157,8 +161,9 @@ class ParameterInfo final {
std::ostream& operator<<(std::ostream&, ParameterInfo const&);
V8_EXPORT_PRIVATE int ParameterIndexOf(const Operator* const);
const ParameterInfo& ParameterInfoOf(const Operator* const);
V8_EXPORT_PRIVATE int ParameterIndexOf(const Operator* const)
WARN_UNUSED_RESULT;
const ParameterInfo& ParameterInfoOf(const Operator* const) WARN_UNUSED_RESULT;
struct ObjectStateInfo final : std::pair<uint32_t, int> {
ObjectStateInfo(uint32_t object_id, int size)
......@@ -342,9 +347,9 @@ std::ostream& operator<<(std::ostream& os,
Type* TypeGuardTypeOf(Operator const*) WARN_UNUSED_RESULT;
int OsrValueIndexOf(Operator const*);
int OsrValueIndexOf(Operator const*) WARN_UNUSED_RESULT;
SparseInputMask SparseInputMaskOf(Operator const*);
SparseInputMask SparseInputMaskOf(Operator const*) WARN_UNUSED_RESULT;
ZoneVector<MachineType> const* MachineTypesOf(Operator const*)
WARN_UNUSED_RESULT;
......@@ -374,7 +379,8 @@ ArgumentsStateType ArgumentsStateTypeOf(Operator const*) WARN_UNUSED_RESULT;
uint32_t ObjectIdOf(Operator const*);
MachineRepresentation DeadValueRepresentationOf(Operator const*);
MachineRepresentation DeadValueRepresentationOf(Operator const*)
WARN_UNUSED_RESULT;
class IfValueParameters final {
public:
......
......@@ -260,7 +260,7 @@ size_t hash_value(ContextAccess const&);
V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, ContextAccess const&);
ContextAccess const& ContextAccessOf(Operator const*);
V8_EXPORT_PRIVATE ContextAccess const& ContextAccessOf(Operator const*);
// Defines the name and ScopeInfo for a new catch context. This is used as a
// parameter by the JSCreateCatchContext operator.
......
......@@ -45,7 +45,8 @@ class OptionalOperator final {
// A Load needs a MachineType.
typedef MachineType LoadRepresentation;
LoadRepresentation LoadRepresentationOf(Operator const*);
V8_EXPORT_PRIVATE LoadRepresentation LoadRepresentationOf(Operator const*)
WARN_UNUSED_RESULT;
// A Store needs a MachineType and a WriteBarrierKind in order to emit the
// correct write barrier.
......@@ -71,13 +72,14 @@ size_t hash_value(StoreRepresentation);
V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, StoreRepresentation);
StoreRepresentation const& StoreRepresentationOf(Operator const*);
V8_EXPORT_PRIVATE StoreRepresentation const& StoreRepresentationOf(
Operator const*) WARN_UNUSED_RESULT;
// An UnalignedStore needs a MachineType.
typedef MachineRepresentation UnalignedStoreRepresentation;
UnalignedStoreRepresentation const& UnalignedStoreRepresentationOf(
Operator const*);
Operator const*) WARN_UNUSED_RESULT;
class StackSlotRepresentation final {
public:
......@@ -101,11 +103,13 @@ size_t hash_value(StackSlotRepresentation);
V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&,
StackSlotRepresentation);
StackSlotRepresentation const& StackSlotRepresentationOf(Operator const* op);
V8_EXPORT_PRIVATE StackSlotRepresentation const& StackSlotRepresentationOf(
Operator const* op) WARN_UNUSED_RESULT;
MachineRepresentation AtomicStoreRepresentationOf(Operator const* op);
MachineRepresentation AtomicStoreRepresentationOf(Operator const* op)
WARN_UNUSED_RESULT;
MachineType AtomicOpRepresentationOf(Operator const* op);
MachineType AtomicOpRepresentationOf(Operator const* op) WARN_UNUSED_RESULT;
// Interface for building machine-level operators. These operators are
// machine-level but machine-independent and thus define a language suitable
......
......@@ -76,7 +76,8 @@ size_t hash_value(FieldAccess const&);
V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, FieldAccess const&);
FieldAccess const& FieldAccessOf(const Operator* op) WARN_UNUSED_RESULT;
V8_EXPORT_PRIVATE FieldAccess const& FieldAccessOf(const Operator* op)
WARN_UNUSED_RESULT;
template <>
void Operator1<FieldAccess>::PrintParameter(std::ostream& os,
......@@ -123,7 +124,8 @@ V8_EXPORT_PRIVATE ElementAccess const& ElementAccessOf(const Operator* op)
ExternalArrayType ExternalArrayTypeOf(const Operator* op) WARN_UNUSED_RESULT;
// The ConvertReceiverMode is used as parameter by ConvertReceiver operators.
ConvertReceiverMode ConvertReceiverModeOf(Operator const* op);
ConvertReceiverMode ConvertReceiverModeOf(Operator const* op)
WARN_UNUSED_RESULT;
// A the parameters for several Check nodes. The {feedback} parameter is
// optional. If {feedback} references a valid CallIC slot and this MapCheck
......@@ -362,11 +364,11 @@ ElementsTransition const& ElementsTransitionOf(const Operator* op)
// Parameters for TransitionAndStoreElement, or
// TransitionAndStoreNonNumberElement, or
// TransitionAndStoreNumberElement.
Handle<Map> DoubleMapParameterOf(const Operator* op);
Handle<Map> FastMapParameterOf(const Operator* op);
Handle<Map> DoubleMapParameterOf(const Operator* op) WARN_UNUSED_RESULT;
Handle<Map> FastMapParameterOf(const Operator* op) WARN_UNUSED_RESULT;
// Parameters for TransitionAndStoreNonNumberElement.
Type* ValueTypeParameterOf(const Operator* op);
Type* ValueTypeParameterOf(const Operator* op) WARN_UNUSED_RESULT;
// A hint for speculative number operations.
enum class NumberOperationHint : uint8_t {
......@@ -381,7 +383,7 @@ size_t hash_value(NumberOperationHint);
V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, NumberOperationHint);
NumberOperationHint NumberOperationHintOf(const Operator* op)
V8_EXPORT_PRIVATE NumberOperationHint NumberOperationHintOf(const Operator* op)
WARN_UNUSED_RESULT;
class NumberOperationParameters {
......
......@@ -256,7 +256,7 @@ UnobservablesSet RedundantStoreFinder::RecomputeSet(Node* node,
switch (node->op()->opcode()) {
case IrOpcode::kStoreField: {
Node* stored_to = node->InputAt(0);
FieldAccess access = OpParameter<FieldAccess>(node->op());
const FieldAccess& access = FieldAccessOf(node->op());
StoreOffset offset = ToOffset(access);
UnobservableStore observation = {stored_to->id(), offset};
......@@ -297,7 +297,7 @@ UnobservablesSet RedundantStoreFinder::RecomputeSet(Node* node,
}
case IrOpcode::kLoadField: {
Node* loaded_from = node->InputAt(0);
FieldAccess access = OpParameter<FieldAccess>(node->op());
const FieldAccess& access = FieldAccessOf(node->op());
StoreOffset offset = ToOffset(access);
TRACE(
......
......@@ -70,7 +70,7 @@ void ContextSpecializationTester::CheckChangesToValue(
void ContextSpecializationTester::CheckContextInputAndDepthChanges(
Node* node, Handle<Context> expected_new_context_object,
size_t expected_new_depth) {
ContextAccess access = OpParameter<ContextAccess>(node->op());
ContextAccess access = ContextAccessOf(node->op());
Reduction r = spec()->Reduce(node);
CHECK(r.Changed());
......@@ -79,7 +79,7 @@ void ContextSpecializationTester::CheckContextInputAndDepthChanges(
HeapObjectMatcher match(new_context);
CHECK_EQ(*match.Value(), *expected_new_context_object);
ContextAccess new_access = OpParameter<ContextAccess>(r.replacement()->op());
ContextAccess new_access = ContextAccessOf(r.replacement()->op());
CHECK_EQ(new_access.depth(), expected_new_depth);
CHECK_EQ(new_access.index(), access.index());
CHECK_EQ(new_access.immutable(), access.immutable());
......@@ -87,14 +87,14 @@ void ContextSpecializationTester::CheckContextInputAndDepthChanges(
void ContextSpecializationTester::CheckContextInputAndDepthChanges(
Node* node, Node* expected_new_context, size_t expected_new_depth) {
ContextAccess access = OpParameter<ContextAccess>(node->op());
ContextAccess access = ContextAccessOf(node->op());
Reduction r = spec()->Reduce(node);
CHECK(r.Changed());
Node* new_context = NodeProperties::GetContextInput(r.replacement());
CHECK_EQ(new_context, expected_new_context);
ContextAccess new_access = OpParameter<ContextAccess>(r.replacement()->op());
ContextAccess new_access = ContextAccessOf(r.replacement()->op());
CHECK_EQ(new_access.depth(), expected_new_depth);
CHECK_EQ(new_access.index(), access.index());
CHECK_EQ(new_access.immutable(), access.immutable());
......@@ -149,7 +149,7 @@ TEST(ReduceJSLoadContext0) {
CHECK_EQ(IrOpcode::kHeapConstant, new_context_input->opcode());
HeapObjectMatcher match(new_context_input);
CHECK_EQ(*native, *match.Value());
ContextAccess access = OpParameter<ContextAccess>(r.replacement()->op());
ContextAccess access = ContextAccessOf(r.replacement()->op());
CHECK_EQ(Context::GLOBAL_EVAL_FUN_INDEX, static_cast<int>(access.index()));
CHECK_EQ(0, static_cast<int>(access.depth()));
CHECK_EQ(false, access.immutable());
......@@ -453,7 +453,7 @@ TEST(ReduceJSStoreContext0) {
CHECK_EQ(IrOpcode::kHeapConstant, new_context_input->opcode());
HeapObjectMatcher match(new_context_input);
CHECK_EQ(*native, *match.Value());
ContextAccess access = OpParameter<ContextAccess>(r.replacement()->op());
ContextAccess access = ContextAccessOf(r.replacement()->op());
CHECK_EQ(Context::GLOBAL_EVAL_FUN_INDEX, static_cast<int>(access.index()));
CHECK_EQ(0, static_cast<int>(access.depth()));
CHECK_EQ(false, access.immutable());
......
......@@ -355,7 +355,7 @@ TEST_F(Int64LoweringTest, CallI64Return) {
start(), start()));
CompareCallDescriptors(
OpParameter<const CallDescriptor*>(
CallDescriptorOf(
graph()->end()->InputAt(1)->InputAt(1)->InputAt(0)->op()),
compiler::GetI32WasmCallDescriptor(zone(), call_descriptor));
}
......@@ -391,8 +391,7 @@ TEST_F(Int64LoweringTest, CallI64Parameter) {
start(), start()));
CompareCallDescriptors(
OpParameter<const CallDescriptor*>(
graph()->end()->InputAt(1)->InputAt(1)->op()),
CallDescriptorOf(graph()->end()->InputAt(1)->InputAt(1)->op()),
compiler::GetI32WasmCallDescriptor(zone(), call_descriptor));
}
......
......@@ -88,8 +88,7 @@ TEST_P(MachineLoadOperatorTest, OpcodeIsCorrect) {
TEST_P(MachineLoadOperatorTest, ParameterIsCorrect) {
MachineOperatorBuilder machine(zone(), representation());
EXPECT_EQ(GetParam(),
OpParameter<LoadRepresentation>(machine.Load(GetParam())));
EXPECT_EQ(GetParam(), LoadRepresentationOf(machine.Load(GetParam())));
}
......@@ -149,8 +148,7 @@ TEST_P(MachineStoreOperatorTest, OpcodeIsCorrect) {
TEST_P(MachineStoreOperatorTest, ParameterIsCorrect) {
MachineOperatorBuilder machine(zone(), representation());
EXPECT_EQ(GetParam(),
OpParameter<StoreRepresentation>(machine.Store(GetParam())));
EXPECT_EQ(GetParam(), StoreRepresentationOf(machine.Store(GetParam())));
}
......
This diff is collapsed.
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