16Node* TryGetConstant(JSGraph*
jsgraph, Node* node, JSHeapBroker*
broker) {
21 }
else if (type.Is(Type::Null())) {
23 }
else if (type.Is(Type::Undefined())) {
25 }
else if (type.Is(Type::MinusZero())) {
27 }
else if (type.Is(Type::NaN())) {
29 }
else if (type.IsHeapConstant()) {
31 }
else if (type.Is(Type::PlainNumber()) && type.Min() == type.Max()) {
53 node->opcode() != IrOpcode::kFinishRegion &&
54 node->opcode() != IrOpcode::kTypeGuard) {
56 if (constant !=
nullptr) {
58 DCHECK_EQ(node->op()->ControlOutputCount(), 0);
59 ReplaceWithValue(node, constant);
60 return Replace(constant);
ConstantFoldingReducer(Editor *editor, JSGraph *jsgraph, JSHeapBroker *broker)
Reduction Reduce(Node *node) final
JSGraph * jsgraph() const
JSHeapBroker * broker() const
~ConstantFoldingReducer() final
Node * ConstantNoHole(ObjectRef ref, JSHeapBroker *broker)
static Type GetType(const Node *node)
static bool IsTyped(const Node *node)
static bool IsConstant(Node *node)
JSHeapBroker *const broker_
ZoneVector< RpoNumber > & result
#define DCHECK_IMPLIES(v1, v2)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)