Home | History | Annotate | Download | only in compiler

Lines Matching refs:node

9 #include "src/compiler/node-properties.h"
19 int NodeProperties::PastValueIndex(Node* node) {
20 return FirstValueIndex(node) + node->op()->ValueInputCount();
25 int NodeProperties::PastContextIndex(Node* node) {
26 return FirstContextIndex(node) +
27 OperatorProperties::GetContextInputCount(node->op());
32 int NodeProperties::PastFrameStateIndex(Node* node) {
33 return FirstFrameStateIndex(node) +
34 OperatorProperties::GetFrameStateInputCount(node->op());
39 int NodeProperties::PastEffectIndex(Node* node) {
40 return FirstEffectIndex(node) + node->op()->EffectInputCount();
45 int NodeProperties::PastControlIndex(Node* node) {
46 return FirstControlIndex(node) + node->op()->ControlInputCount();
51 Node* NodeProperties::GetValueInput(Node* node, int index) {
52 DCHECK(0 <= index && index < node->op()->ValueInputCount());
53 return node->InputAt(FirstValueIndex(node) + index);
58 Node* NodeProperties::GetContextInput(Node* node) {
59 DCHECK(OperatorProperties::HasContextInput(node->op()));
60 return node->InputAt(FirstContextIndex(node));
65 Node* NodeProperties::GetFrameStateInput(Node* node, int index) {
66 DCHECK_LT(index, OperatorProperties::GetFrameStateInputCount(node->op()));
67 return node->InputAt(FirstFrameStateIndex(node) + index);
72 Node* NodeProperties::GetEffectInput(Node* node, int index) {
73 DCHECK(0 <= index && index < node->op()->EffectInputCount());
74 return node->InputAt(FirstEffectIndex(node) + index);
79 Node* NodeProperties::GetControlInput(Node* node, int index) {
80 DCHECK(0 <= index && index < node->op()->ControlInputCount());
81 return node->InputAt(FirstControlIndex(node) + index);
87 Node* const node = edge.from();
88 return IsInputRange(edge, FirstValueIndex(node),
89 node->op()->ValueInputCount());
95 Node* const node = edge.from();
96 return IsInputRange(edge, FirstContextIndex(node),
97 OperatorProperties::GetContextInputCount(node->op()));
103 Node* const node = edge.from();
104 return IsInputRange(edge, FirstFrameStateIndex(node),
105 OperatorProperties::GetFrameStateInputCount(node->op()));
111 Node* const node = edge.from();
112 return IsInputRange(edge, FirstEffectIndex(node),
113 node->op()->EffectInputCount());
119 Node* const node = edge.from();
120 return IsInputRange(edge, FirstControlIndex(node),
121 node->op()->ControlInputCount());
126 bool NodeProperties::IsExceptionalCall(Node* node) {
127 if (node->op()->HasProperty(Operator::kNoThrow)) return false;
128 for (Edge const edge : node->use_edges()) {
137 void NodeProperties::ReplaceValueInput(Node* node, Node* value, int index) {
138 DCHECK(index < node->op()->ValueInputCount());
139 node->ReplaceInput(FirstValueIndex(node) + index, value);
144 void NodeProperties::ReplaceValueInputs(Node* node, Node* value) {
145 int value_input_count = node->op()->ValueInputCount();
147 node->ReplaceInput(0, value);
149 node->RemoveInput(value_input_count);
155 void NodeProperties::ReplaceContextInput(Node* node, Node* context) {
156 node->ReplaceInput(FirstContextIndex(node), context);
161 void NodeProperties::ReplaceControlInput(Node* node, Node* control, int index) {
162 DCHECK(index < node->op()->ControlInputCount());
163 node->ReplaceInput(FirstControlIndex(node) + index, control);
168 void NodeProperties::ReplaceEffectInput(Node* node, Node* effect, int index) {
169 DCHECK(index < node->op()->EffectInputCount());
170 return node->ReplaceInput(FirstEffectIndex(node) + index, effect);
175 void NodeProperties::ReplaceFrameStateInput(Node* node, int index,
176 Node* frame_state) {
177 DCHECK_LT(index, OperatorProperties::GetFrameStateInputCount(node->op()));
178 node->ReplaceInput(FirstFrameStateIndex(node) + index, frame_state);
183 void NodeProperties::RemoveNonValueInputs(Node* node) {
184 node->TrimInputCount(node->op()->ValueInputCount());
189 void NodeProperties::RemoveValueInputs(Node* node) {
190 int value_input_count = node->op()->ValueInputCount();
192 node->RemoveInput(value_input_count);
199 Node* node) {
200 graph->end()->AppendInput(graph->zone(), node);
206 void NodeProperties::ReplaceUses(Node* node, Node* value, Node* effect,
207 Node* success, Node* exception) {
209 for (Edge edge : node->use_edges()) {
233 void NodeProperties::ChangeOp(Node* node, const Operator* new_op) {
234 node->set_op(new_op);
235 Verifier::VerifyNode(node);
240 Node* NodeProperties::FindFrameStateBefore(Node* node) {
241 Node* effect = NodeProperties::GetEffectInput(node);
247 Node* frame_state = GetFrameStateInput(effect, 0);
252 Node* NodeProperties::FindProjection(Node* node, size_t projection_index) {
253 for (auto use : node->uses()) {
264 void NodeProperties::CollectControlProjections(Node* node, Node** projections,
267 DCHECK_LE(static_cast<int>(projection_count), node->UseCount());
271 for (Edge const edge : node->use_edges()) {
273 Node* use = edge.from();
277 DCHECK_EQ(IrOpcode::kBranch, node->opcode());
281 DCHECK_EQ(IrOpcode::kBranch, node->opcode());
285 DCHECK(!node->op()->HasProperty(Operator::kNoThrow));
289 DCHECK(!node->op()->HasProperty(Operator::kNoThrow));
293 DCHECK_EQ(IrOpcode::kSwitch, node->opcode());
297 DCHECK_EQ(IrOpcode::kSwitch, node->opcode());
318 Node* node, MaybeHandle<Context> context) {
319 switch (node->opcode()) {
321 return Handle<Context>::cast(OpParameter<Handle<HeapObject>>(node));
323 Node* const start = NodeProperties::GetValueInput(node, 0);
325 int const index = ParameterIndexOf(node->op());
343 Node* node, MaybeHandle<Context> native_context) {
345 switch (node->opcode()) {
347 ContextAccess const& access = ContextAccessOf(node->op());
353 node = NodeProperties::GetContextInput(node);
364 node = NodeProperties::GetContextInput(node);
370 Handle<Context>::cast(OpParameter<Handle<HeapObject>>(node));
374 int const index = OpParameter<int>(node);
381 Node* const start = NodeProperties::GetValueInput(node, 0);
383 int const index = ParameterIndexOf(node->op());
401 Node* node, MaybeHandle<Context> native_context) {
403 if (GetSpecializationNativeContext(node, native_context).ToHandle(&context)) {
411 Type* NodeProperties::GetTypeOrAny(Node* node) {
412 return IsTyped(node) ? node->type() : Type::Any();
417 bool NodeProperties::AllValueInputsAreTyped(Node* node) {
418 int input_count = node->op()->ValueInputCount();
420 if (!IsTyped(GetValueInput(node, index))) return false;