V8 Project
v8::internal::compiler::OperatorProperties Class Reference

#include <operator-properties.h>

+ Collaboration diagram for v8::internal::compiler::OperatorProperties:

Static Public Member Functions

static bool HasValueInput (const Operator *op)
 
static bool HasContextInput (const Operator *op)
 
static bool HasEffectInput (const Operator *op)
 
static bool HasControlInput (const Operator *op)
 
static bool HasFrameStateInput (const Operator *op)
 
static int GetValueInputCount (const Operator *op)
 
static int GetContextInputCount (const Operator *op)
 
static int GetEffectInputCount (const Operator *op)
 
static int GetControlInputCount (const Operator *op)
 
static int GetFrameStateInputCount (const Operator *op)
 
static int GetTotalInputCount (const Operator *op)
 
static bool HasValueOutput (const Operator *op)
 
static bool HasEffectOutput (const Operator *op)
 
static bool HasControlOutput (const Operator *op)
 
static int GetValueOutputCount (const Operator *op)
 
static int GetEffectOutputCount (const Operator *op)
 
static int GetControlOutputCount (const Operator *op)
 
static bool IsBasicBlockBegin (const Operator *op)
 

Detailed Description

Definition at line 14 of file operator-properties.h.

Member Function Documentation

◆ GetContextInputCount()

int v8::internal::compiler::OperatorProperties::GetContextInputCount ( const Operator op)
inlinestatic

Definition at line 91 of file operator-properties-inl.h.

91  {
92  return OperatorProperties::HasContextInput(op) ? 1 : 0;
93 }
static bool HasContextInput(const Operator *op)

References HasContextInput().

Referenced by v8::internal::compiler::GraphVisualizer::AnnotateNode(), GetTotalInputCount(), v8::internal::compiler::NodeProperties::IsContextEdge(), v8::internal::compiler::NodeProperties::PastContextIndex(), v8::internal::compiler::Verifier::Visitor::Pre(), and v8::internal::compiler::RepresentationSelector::VisitInputs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetControlInputCount()

int v8::internal::compiler::OperatorProperties::GetControlInputCount ( const Operator op)
inlinestatic

Definition at line 109 of file operator-properties-inl.h.

109  {
110  switch (op->opcode()) {
111  case IrOpcode::kPhi:
112  case IrOpcode::kEffectPhi:
113  case IrOpcode::kControlEffect:
114  return 1;
115 #define OPCODE_CASE(x) case IrOpcode::k##x:
117 #undef OPCODE_CASE
118  // Control operators are Operator1<int>.
119  return OpParameter<int>(op);
120  default:
121  // Operators that have write effects must have a control
122  // dependency. Effect dependencies only ensure the correct order of
123  // write/read operations without consideration of control flow. Without an
124  // explicit control dependency writes can be float in the schedule too
125  // early along a path that shouldn't generate a side-effect.
126  return op->HasProperty(Operator::kNoWrite) ? 0 : 1;
127  }
128  return 0;
129 }
#define CONTROL_OP_LIST(V)
Definition: opcodes.h:19
#define OPCODE_CASE(x)

References CONTROL_OP_LIST, v8::internal::compiler::Operator::HasProperty(), v8::internal::compiler::Operator::kNoWrite, v8::internal::compiler::Operator::opcode(), and OPCODE_CASE.

Referenced by v8::internal::compiler::GraphVisualizer::AnnotateNode(), v8::internal::compiler::JSBinopReduction::ChangeToPureOperator(), v8::internal::compiler::GetControlCluster(), v8::internal::compiler::NodeProperties::GetControlInput(), GetTotalInputCount(), HasControlInput(), v8::internal::compiler::NodeProperties::IsControlEdge(), v8::internal::compiler::StructuredGraphBuilder::MakeNode(), v8::internal::compiler::StructuredGraphBuilder::MergeControl(), v8::internal::compiler::StructuredGraphBuilder::MergeEffect(), v8::internal::compiler::StructuredGraphBuilder::MergeValue(), v8::internal::compiler::NodeProperties::PastControlIndex(), v8::internal::compiler::Verifier::Visitor::Pre(), v8::internal::compiler::GraphVisualizer::PrintEdge(), v8::internal::compiler::TEST_P(), v8::internal::compiler::Inlinee::UnifyReturn(), and v8::internal::compiler::RepresentationSelector::VisitInputs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetControlOutputCount()

int v8::internal::compiler::OperatorProperties::GetControlOutputCount ( const Operator op)
inlinestatic

Definition at line 165 of file operator-properties-inl.h.

165  {
166  return node->opcode() == IrOpcode::kBranch ? 2 : HasControlOutput(node) ? 1
167  : 0;
168 }
static bool HasControlOutput(const Operator *op)

References HasControlOutput(), and v8::internal::compiler::Operator::opcode().

Referenced by v8::internal::compiler::TEST_F(), and v8::internal::compiler::TEST_P().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetEffectInputCount()

int v8::internal::compiler::OperatorProperties::GetEffectInputCount ( const Operator op)
inlinestatic

Definition at line 99 of file operator-properties-inl.h.

99  {
100  if (op->opcode() == IrOpcode::kEffectPhi ||
101  op->opcode() == IrOpcode::kFinish) {
102  return OpParameter<int>(op);
103  }
104  if (op->HasProperty(Operator::kNoRead) && op->HasProperty(Operator::kNoWrite))
105  return 0; // no effects.
106  return 1;
107 }

References v8::internal::compiler::Operator::HasProperty(), v8::internal::compiler::Operator::kNoRead, v8::internal::compiler::Operator::kNoWrite, and v8::internal::compiler::Operator::opcode().

Referenced by v8::internal::compiler::GraphVisualizer::AnnotateNode(), v8::internal::compiler::JSBinopReduction::ChangeToPureOperator(), v8::internal::compiler::NodeProperties::GetEffectInput(), GetTotalInputCount(), HasEffectInput(), HasEffectOutput(), v8::internal::compiler::NodeProperties::IsEffectEdge(), v8::internal::compiler::StructuredGraphBuilder::MakeNode(), v8::internal::compiler::NodeProperties::PastEffectIndex(), v8::internal::compiler::Verifier::Visitor::Pre(), v8::internal::compiler::NodeProperties::ReplaceEffectInput(), v8::internal::compiler::TEST_F(), v8::internal::compiler::TEST_P(), and v8::internal::compiler::RepresentationSelector::VisitInputs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetEffectOutputCount()

int v8::internal::compiler::OperatorProperties::GetEffectOutputCount ( const Operator op)
inlinestatic

Definition at line 161 of file operator-properties-inl.h.

161  {
162  return HasEffectOutput(op) ? 1 : 0;
163 }
static bool HasEffectOutput(const Operator *op)

References HasEffectOutput().

Referenced by v8::internal::compiler::TEST_F(), and v8::internal::compiler::TEST_P().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetFrameStateInputCount()

int v8::internal::compiler::OperatorProperties::GetFrameStateInputCount ( const Operator op)
inlinestatic

Definition at line 95 of file operator-properties-inl.h.

95  {
96  return OperatorProperties::HasFrameStateInput(op) ? 1 : 0;
97 }
static bool HasFrameStateInput(const Operator *op)

References HasFrameStateInput().

Referenced by v8::internal::compiler::GraphVisualizer::AnnotateNode(), GetTotalInputCount(), v8::internal::compiler::NodeProperties::PastFrameStateIndex(), and v8::internal::compiler::Verifier::Visitor::Pre().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetTotalInputCount()

int v8::internal::compiler::OperatorProperties::GetTotalInputCount ( const Operator op)
inlinestatic

Definition at line 131 of file operator-properties-inl.h.

131  {
132  return GetValueInputCount(op) + GetContextInputCount(op) +
135 }
static int GetEffectInputCount(const Operator *op)
static int GetFrameStateInputCount(const Operator *op)
static int GetContextInputCount(const Operator *op)
static int GetValueInputCount(const Operator *op)
static int GetControlInputCount(const Operator *op)

References GetContextInputCount(), GetControlInputCount(), GetEffectInputCount(), GetFrameStateInputCount(), and GetValueInputCount().

Referenced by v8::internal::compiler::TEST_F(), and v8::internal::compiler::TEST_P().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetValueInputCount()

int v8::internal::compiler::OperatorProperties::GetValueInputCount ( const Operator op)
inlinestatic

◆ GetValueOutputCount()

int v8::internal::compiler::OperatorProperties::GetValueOutputCount ( const Operator op)
inlinestatic

Definition at line 157 of file operator-properties-inl.h.

157  {
158  return op->OutputCount();
159 }

References v8::internal::compiler::Operator::OutputCount().

Referenced by HasValueOutput(), v8::internal::compiler::Verifier::Visitor::Pre(), v8::internal::compiler::TEST_F(), and v8::internal::compiler::TEST_P().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HasContextInput()

bool v8::internal::compiler::OperatorProperties::HasContextInput ( const Operator op)
inlinestatic

Definition at line 21 of file operator-properties-inl.h.

21  {
22  IrOpcode::Value opcode = static_cast<IrOpcode::Value>(op->opcode());
23  return IrOpcode::IsJsOpcode(opcode);
24 }
static bool IsJsOpcode(Value val)
Definition: opcodes.h:268

References v8::internal::compiler::IrOpcode::IsJsOpcode(), and v8::internal::compiler::Operator::opcode().

Referenced by v8::internal::compiler::JSBinopReduction::ChangeToPureOperator(), v8::internal::compiler::NodeProperties::GetContextInput(), GetContextInputCount(), and v8::internal::compiler::StructuredGraphBuilder::MakeNode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HasControlInput()

bool v8::internal::compiler::OperatorProperties::HasControlInput ( const Operator op)
inlinestatic

Definition at line 30 of file operator-properties-inl.h.

30  {
32 }

References GetControlInputCount().

+ Here is the call graph for this function:

◆ HasControlOutput()

bool v8::internal::compiler::OperatorProperties::HasControlOutput ( const Operator op)
inlinestatic

Definition at line 151 of file operator-properties-inl.h.

151  {
152  IrOpcode::Value opcode = static_cast<IrOpcode::Value>(op->opcode());
153  return (opcode != IrOpcode::kEnd && IrOpcode::IsControlOpcode(opcode));
154 }
static bool IsControlOpcode(Value val)
Definition: opcodes.h:280

References v8::internal::compiler::IrOpcode::IsControlOpcode(), and v8::internal::compiler::Operator::opcode().

Referenced by GetControlOutputCount(), v8::internal::compiler::StructuredGraphBuilder::MakeNode(), v8::internal::compiler::Verifier::Visitor::Pre(), and v8::internal::compiler::NodeProperties::ReplaceWithValue().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HasEffectInput()

bool v8::internal::compiler::OperatorProperties::HasEffectInput ( const Operator op)
inlinestatic

Definition at line 26 of file operator-properties-inl.h.

26  {
28 }

References GetEffectInputCount().

Referenced by v8::internal::compiler::NodeProperties::ReplaceWithValue().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HasEffectOutput()

bool v8::internal::compiler::OperatorProperties::HasEffectOutput ( const Operator op)
inlinestatic

Definition at line 144 of file operator-properties-inl.h.

144  {
145  return op->opcode() == IrOpcode::kStart ||
146  op->opcode() == IrOpcode::kControlEffect ||
147  op->opcode() == IrOpcode::kValueEffect ||
148  (op->opcode() != IrOpcode::kFinish && GetEffectInputCount(op) > 0);
149 }

References GetEffectInputCount(), and v8::internal::compiler::Operator::opcode().

Referenced by GetEffectOutputCount(), and v8::internal::compiler::Verifier::Visitor::Pre().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HasFrameStateInput()

bool v8::internal::compiler::OperatorProperties::HasFrameStateInput ( const Operator op)
inlinestatic

Definition at line 34 of file operator-properties-inl.h.

34  {
35  if (!FLAG_turbo_deoptimization) {
36  return false;
37  }
38 
39  switch (op->opcode()) {
40  case IrOpcode::kFrameState:
41  return true;
42  case IrOpcode::kJSCallRuntime: {
43  Runtime::FunctionId function = OpParameter<Runtime::FunctionId>(op);
44  return Linkage::NeedsFrameState(function);
45  }
46 
47  // Strict equality cannot lazily deoptimize.
48  case IrOpcode::kJSStrictEqual:
49  case IrOpcode::kJSStrictNotEqual:
50  return false;
51 
52  // Calls
53  case IrOpcode::kJSCallFunction:
54  case IrOpcode::kJSCallConstruct:
55 
56  // Compare operations
57  case IrOpcode::kJSEqual:
58  case IrOpcode::kJSNotEqual:
59  case IrOpcode::kJSLessThan:
60  case IrOpcode::kJSGreaterThan:
61  case IrOpcode::kJSLessThanOrEqual:
62  case IrOpcode::kJSGreaterThanOrEqual:
63 
64  // Binary operations
65  case IrOpcode::kJSBitwiseOr:
66  case IrOpcode::kJSBitwiseXor:
67  case IrOpcode::kJSBitwiseAnd:
68  case IrOpcode::kJSShiftLeft:
69  case IrOpcode::kJSShiftRight:
70  case IrOpcode::kJSShiftRightLogical:
71  case IrOpcode::kJSAdd:
72  case IrOpcode::kJSSubtract:
73  case IrOpcode::kJSMultiply:
74  case IrOpcode::kJSDivide:
75  case IrOpcode::kJSModulus:
76  case IrOpcode::kJSLoadProperty:
77  case IrOpcode::kJSStoreProperty:
78  case IrOpcode::kJSLoadNamed:
79  case IrOpcode::kJSStoreNamed:
80  return true;
81 
82  default:
83  return false;
84  }
85 }
static bool NeedsFrameState(Runtime::FunctionId function)
Definition: linkage.cc:112

References v8::internal::compiler::Linkage::NeedsFrameState(), and v8::internal::compiler::Operator::opcode().

Referenced by v8::internal::compiler::FlagsForNode(), v8::internal::compiler::NodeProperties::GetFrameStateIndex(), v8::internal::compiler::NodeProperties::GetFrameStateInput(), GetFrameStateInputCount(), v8::internal::compiler::StructuredGraphBuilder::MakeNode(), v8::internal::compiler::Verifier::Visitor::Pre(), v8::internal::compiler::AstGraphBuilder::PrepareFrameState(), v8::internal::compiler::NodeProperties::ReplaceFrameStateInput(), and v8::internal::compiler::JSGenericLowering::ReplaceWithCompareIC().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HasValueInput()

bool v8::internal::compiler::OperatorProperties::HasValueInput ( const Operator op)
inlinestatic

Definition at line 17 of file operator-properties-inl.h.

17  {
19 }

References GetValueInputCount().

+ Here is the call graph for this function:

◆ HasValueOutput()

bool v8::internal::compiler::OperatorProperties::HasValueOutput ( const Operator op)
inlinestatic

Definition at line 140 of file operator-properties-inl.h.

140  {
141  return GetValueOutputCount(op) > 0;
142 }
static int GetValueOutputCount(const Operator *op)

References GetValueOutputCount().

Referenced by v8::internal::compiler::Typer::Init(), v8::internal::compiler::Typer::RunVisitor::Post(), v8::internal::compiler::Typer::NarrowVisitor::Pre(), v8::internal::compiler::Typer::WidenVisitor::Pre(), and v8::internal::compiler::Verifier::Visitor::Pre().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsBasicBlockBegin()

bool v8::internal::compiler::OperatorProperties::IsBasicBlockBegin ( const Operator op)
inlinestatic

Definition at line 171 of file operator-properties-inl.h.

171  {
172  uint8_t opcode = op->opcode();
173  return opcode == IrOpcode::kStart || opcode == IrOpcode::kEnd ||
174  opcode == IrOpcode::kDead || opcode == IrOpcode::kLoop ||
175  opcode == IrOpcode::kMerge || opcode == IrOpcode::kIfTrue ||
176  opcode == IrOpcode::kIfFalse;
177 }

References v8::internal::compiler::Operator::opcode().

Referenced by v8::internal::compiler::GraphVisualizer::AnnotateNode(), v8::internal::compiler::FindInsertionPoint(), v8::internal::compiler::GetControlCluster(), and v8::internal::compiler::GraphVisualizer::PrintEdge().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: