Home | History | Annotate | Download | only in compiler

Lines Matching refs:Node

8 #include "src/compiler/node-properties.h"
18 int NodeProperties::PastValueIndex(Node* node) {
19 return FirstValueIndex(node) + node->op()->ValueInputCount();
24 int NodeProperties::PastContextIndex(Node* node) {
25 return FirstContextIndex(node) +
26 OperatorProperties::GetContextInputCount(node->op());
31 int NodeProperties::PastFrameStateIndex(Node* node) {
32 return FirstFrameStateIndex(node) +
33 OperatorProperties::GetFrameStateInputCount(node->op());
38 int NodeProperties::PastEffectIndex(Node* node) {
39 return FirstEffectIndex(node) + node->op()->EffectInputCount();
44 int NodeProperties::PastControlIndex(Node* node) {
45 return FirstControlIndex(node) + node->op()->ControlInputCount();
50 Node* NodeProperties::GetValueInput(Node* node, int index) {
51 DCHECK(0 <= index && index < node->op()->ValueInputCount());
52 return node->InputAt(FirstValueIndex(node) + index);
57 Node* NodeProperties::GetContextInput(Node* node) {
58 DCHECK(OperatorProperties::HasContextInput(node->op()));
59 return node->InputAt(FirstContextIndex(node));
64 Node* NodeProperties::GetFrameStateInput(Node* node, int index) {
65 DCHECK_LT(index, OperatorProperties::GetFrameStateInputCount(node->op()));
66 return node->InputAt(FirstFrameStateIndex(node) + index);
71 Node* NodeProperties::GetEffectInput(Node* node, int index) {
72 DCHECK(0 <= index && index < node->op()->EffectInputCount());
73 return node->InputAt(FirstEffectIndex(node) + index);
78 Node* NodeProperties::GetControlInput(Node* node, int index) {
79 DCHECK(0 <= index && index < node->op()->ControlInputCount());
80 return node->InputAt(FirstControlIndex(node) + index);
86 Node* const node = edge.from();
87 return IsInputRange(edge, FirstValueIndex(node),
88 node->op()->ValueInputCount());
94 Node* const node = edge.from();
95 return IsInputRange(edge, FirstContextIndex(node),
96 OperatorProperties::GetContextInputCount(node->op()));
102 Node* const node = edge.from();
103 return IsInputRange(edge, FirstFrameStateIndex(node),
104 OperatorProperties::GetFrameStateInputCount(node->op()));
110 Node* const node = edge.from();
111 return IsInputRange(edge, FirstEffectIndex(node),
112 node->op()->EffectInputCount());
118 Node* const node = edge.from();
119 return IsInputRange(edge, FirstControlIndex(node),
120 node->op()->ControlInputCount());
125 bool NodeProperties::IsExceptionalCall(Node* node) {
126 for (Edge const edge : node->use_edges()) {
135 void NodeProperties::ReplaceValueInput(Node* node, Node* value, int index) {
136 DCHECK(index < node->op()->ValueInputCount());
137 node->ReplaceInput(FirstValueIndex(node) + index, value);
142 void NodeProperties::ReplaceValueInputs(Node* node, Node* value) {
143 int value_input_count = node->op()->ValueInputCount();
145 node->ReplaceInput(0, value);
147 node->RemoveInput(value_input_count);
153 void NodeProperties::ReplaceContextInput(Node* node, Node* context) {
154 node->ReplaceInput(FirstContextIndex(node), context);
159 void NodeProperties::ReplaceControlInput(Node* node, Node* control) {
160 node->ReplaceInput(FirstControlIndex(node), control);
165 void NodeProperties::ReplaceEffectInput(Node* node, Node* effect, int index) {
166 DCHECK(index < node->op()->EffectInputCount());
167 return node->ReplaceInput(FirstEffectIndex(node) + index, effect);
172 void NodeProperties::ReplaceFrameStateInput(Node* node, int index,
173 Node* frame_state) {
174 DCHECK_LT(index, OperatorProperties::GetFrameStateInputCount(node->op()));
175 node->ReplaceInput(FirstFrameStateIndex(node) + index, frame_state);
180 void NodeProperties::RemoveFrameStateInput(Node* node, int index) {
181 DCHECK_LT(index, OperatorProperties::GetFrameStateInputCount(node->op()));
182 node->RemoveInput(FirstFrameStateIndex(node) + index);
187 void NodeProperties::RemoveNonValueInputs(Node* node) {
188 node->TrimInputCount(node->op()->ValueInputCount());
193 void NodeProperties::RemoveValueInputs(Node* node) {
194 int value_input_count = node->op()->ValueInputCount();
196 node->RemoveInput(value_input_count);
203 Node* node) {
204 graph->end()->AppendInput(graph->zone(), node);
210 void NodeProperties::ReplaceUses(Node* node, Node* value, Node* effect,
211 Node* success, Node* exception) {
213 for (Edge edge : node->use_edges()) {
236 void NodeProperties::ChangeOp(Node* node, const Operator* new_op) {
237 node->set_op(new_op);
238 Verifier::VerifyNode(node);
243 Node* NodeProperties::FindProjection(Node* node, size_t projection_index) {
244 for (auto use : node->uses()) {
255 void NodeProperties::CollectControlProjections(Node* node, Node** projections,
258 DCHECK_LE(static_cast<int>(projection_count), node->UseCount());
262 for (Edge const edge : node->use_edges()) {
264 Node* use = edge.from();
268 DCHECK_EQ(IrOpcode::kBranch, node->opcode());
272 DCHECK_EQ(IrOpcode::kBranch, node->opcode());
276 DCHECK(!node->op()->HasProperty(Operator::kNoThrow));
280 DCHECK(!node->op()->HasProperty(Operator::kNoThrow));
284 DCHECK_EQ(IrOpcode::kSwitch, node->opcode());
288 DCHECK_EQ(IrOpcode::kSwitch, node->opcode());
309 Node* node, MaybeHandle<Context> context) {
310 switch (node->opcode()) {
312 return Handle<Context>::cast(OpParameter<Handle<HeapObject>>(node));
314 Node* const start = NodeProperties::GetValueInput(node, 0);
316 int const index = ParameterIndexOf(node->op());
334 Node* node, MaybeHandle<Context> native_context) {
336 switch (node->opcode()) {
345 node = NodeProperties::GetContextInput(node);
351 Handle<Context>::cast(OpParameter<Handle<HeapObject>>(node));
355 int const index = OpParameter<int>(node);
362 Node* const start = NodeProperties::GetValueInput(node, 0);
364 int const index = ParameterIndexOf(node->op());
382 Node* node, MaybeHandle<Context> native_context) {
384 if (GetSpecializationNativeContext(node, native_context).ToHandle(&context)) {
392 Type* NodeProperties::GetTypeOrAny(Node* node) {
393 return IsTyped(node) ? node->type() : Type::Any();
398 bool NodeProperties::AllValueInputsAreTyped(Node* node) {
399 int input_count = node->op()->ValueInputCount();
401 if (!IsTyped(GetValueInput(node, index))) return false;