Lines Matching refs:node
16 Node* TryGetConstant(JSGraph* jsgraph, Node* node) {
17 Type type = NodeProperties::GetType(node);
44 bool IsAlreadyBeingFolded(Node* node) {
46 if (node->opcode() == IrOpcode::kFoldConstant) return true;
47 for (Edge edge : node->use_edges()) {
50 // Note: {node} may have gained new value uses since the time it was
66 Reduction ConstantFoldingReducer::Reduce(Node* node) {
67 if (!NodeProperties::IsConstant(node) && NodeProperties::IsTyped(node) &&
68 node->op()->HasProperty(Operator::kEliminatable) &&
69 node->opcode() != IrOpcode::kFinishRegion) {
70 Node* constant = TryGetConstant(jsgraph(), node);
74 DCHECK_EQ(node->op()->ControlOutputCount(), 0);
75 ReplaceWithValue(node, constant);
77 } else if (!IsAlreadyBeingFolded(node)) {
81 jsgraph()->common()->FoldConstant(), node, constant);
83 ReplaceWithValue(node, fold_constant, node, node);
84 fold_constant->ReplaceInput(0, node);
85 DCHECK(IsAlreadyBeingFolded(node));
87 return Changed(node);