Lines Matching defs:node

5 #include "src/compiler/node-properties.h"
12 #include "src/compiler/node-matchers.h"
27 Node* const node = edge.from();
28 return IsInputRange(edge, FirstValueIndex(node),
29 node->op()->ValueInputCount());
35 Node* const node = edge.from();
36 return IsInputRange(edge, FirstContextIndex(node),
37 OperatorProperties::GetContextInputCount(node->op()));
43 Node* const node = edge.from();
44 return IsInputRange(edge, FirstFrameStateIndex(node),
45 OperatorProperties::GetFrameStateInputCount(node->op()));
51 Node* const node = edge.from();
52 return IsInputRange(edge, FirstEffectIndex(node),
53 node->op()->EffectInputCount());
59 Node* const node = edge.from();
60 return IsInputRange(edge, FirstControlIndex(node),
61 node->op()->ControlInputCount());
66 bool NodeProperties::IsExceptionalCall(Node* node, Node** out_exception) {
67 if (node->op()->HasProperty(Operator::kNoThrow)) return false;
68 for (Edge const edge : node->use_edges()) {
79 Node* NodeProperties::FindSuccessfulControlProjection(Node* node) {
80 CHECK_GT(node->op()->ControlOutputCount(), 0);
81 if (node->op()->HasProperty(Operator::kNoThrow)) return node;
82 for (Edge const edge : node->use_edges()) {
88 return node;
92 void NodeProperties::ReplaceValueInput(Node* node, Node* value, int index) {
94 CHECK_LT(index, node->op()->ValueInputCount());
95 node->ReplaceInput(FirstValueIndex(node) + index, value);
100 void NodeProperties::ReplaceValueInputs(Node* node, Node* value) {
101 int value_input_count = node->op()->ValueInputCount();
103 node->ReplaceInput(0, value);
105 node->RemoveInput(value_input_count);
111 void NodeProperties::ReplaceContextInput(Node* node, Node* context) {
112 CHECK(OperatorProperties::HasContextInput(node->op()));
113 node->ReplaceInput(FirstContextIndex(node), context);
118 void NodeProperties::ReplaceControlInput(Node* node, Node* control, int index) {
120 CHECK_LT(index, node->op()->ControlInputCount());
121 node->ReplaceInput(FirstControlIndex(node) + index, control);
126 void NodeProperties::ReplaceEffectInput(Node* node, Node* effect, int index) {
128 CHECK_LT(index, node->op()->EffectInputCount());
129 return node->ReplaceInput(FirstEffectIndex(node) + index, effect);
134 void NodeProperties::ReplaceFrameStateInput(Node* node, Node* frame_state) {
135 CHECK(OperatorProperties::HasFrameStateInput(node->op()));
136 node->ReplaceInput(FirstFrameStateIndex(node), frame_state);
140 void NodeProperties::RemoveNonValueInputs(Node* node) {
141 node->TrimInputCount(node->op()->ValueInputCount());
146 void NodeProperties::RemoveValueInputs(Node* node) {
147 int value_input_count = node->op()->ValueInputCount();
149 node->RemoveInput(value_input_count);
156 Node* node) {
157 graph->end()->AppendInput(graph->zone(), node);
163 Node* node) {
167 if (graph->end()->InputAt(index) == node) {
178 void NodeProperties::ReplaceUses(Node* node, Node* value, Node* effect,
181 for (Edge edge : node->use_edges()) {
205 void NodeProperties::ChangeOp(Node* node, const Operator* new_op) {
206 node->set_op(new_op);
207 Verifier::VerifyNode(node);
212 Node* NodeProperties::FindFrameStateBefore(Node* node,
214 Node* effect = NodeProperties::GetEffectInput(node);
229 Node* NodeProperties::FindProjection(Node* node, size_t projection_index) {
230 for (auto use : node->uses()) {
241 void NodeProperties::CollectValueProjections(Node* node, Node** projections,
248 for (Edge const edge : node->use_edges()) {
258 void NodeProperties::CollectControlProjections(Node* node, Node** projections,
261 DCHECK_LE(static_cast<int>(projection_count), node->UseCount());
265 for (Edge const edge : node->use_edges()) {
271 DCHECK_EQ(IrOpcode::kBranch, node->opcode());
275 DCHECK_EQ(IrOpcode::kBranch, node->opcode());
279 DCHECK(!node->op()->HasProperty(Operator::kNoThrow));
283 DCHECK(!node->op()->HasProperty(Operator::kNoThrow));
287 DCHECK_EQ(IrOpcode::kSwitch, node->opcode());
291 DCHECK_EQ(IrOpcode::kSwitch, node->opcode());
488 // Didn't find any appropriate CheckMaps node.
580 Node* NodeProperties::GetOuterContext(Node* node, size_t* depth) {
581 Node* context = NodeProperties::GetContextInput(node);
591 Type NodeProperties::GetTypeOrAny(const Node* node) {
592 return IsTyped(node) ? node->type() : Type::Any();
596 bool NodeProperties::AllValueInputsAreTyped(Node* node) {
597 int input_count = node->op()->ValueInputCount();
599 if (!IsTyped(GetValueInput(node, index))) return false;
605 bool NodeProperties::IsFreshObject(Node* node) {
606 if (node->opcode() == IrOpcode::kAllocate ||
607 node->opcode() == IrOpcode::kAllocateRaw)
610 if (node->opcode() == IrOpcode::kCall) {
614 if (CallDescriptorOf(node->op())->kind() !=
618 NumberMatcher matcher(node->InputAt(0));
643 size_t NodeProperties::HashCode(Node* node) {
644 size_t h = base::hash_combine(node->op()->HashCode(), node->InputCount());
645 for (Node* input : node->inputs()) {