@Override public void virtualize(VirtualizerTool tool) { ValueNode alias = tool.getAlias(getValue()); TriState fold = tryFold(alias.stamp(NodeView.DEFAULT)); if (fold != TriState.UNKNOWN) { tool.replaceWithValue(LogicConstantNode.forBoolean(fold.isTrue(), graph())); } }
@Override public void lower(FloatingNode node, LoweringTool tool) { InstanceOfNode instanceOfNode = (InstanceOfNode) node; if (tool.getLoweringStage() == LoweringTool.StandardLoweringStage.HIGH_TIER) { if (instanceOfNode.allowsNull()) { StructuredGraph graph = instanceOfNode.graph(); ValueNode object = instanceOfNode.getValue(); LogicNode newTypeCheck = graph.addOrUniqueWithInputs(InstanceOfNode.create(instanceOfNode.type(), object, instanceOfNode.profile(), instanceOfNode.getAnchor())); LogicNode newNode = LogicNode.or(graph.unique(IsNullNode.create(object)), newTypeCheck, GraalDirectives.UNLIKELY_PROBABILITY); instanceOfNode.replaceAndDelete(newNode); } return; } VMError.guarantee(!instanceOfNode.allowsNull(), "must be lowered before"); super.lower(node, tool); }
Arguments args = new Arguments(typeEqualityTest, node.graph().getGuardsStage(), tool.getLoweringStage()); args.add("object", node.getValue()); args.add("trueValue", replacer.trueValue); Arguments args = new Arguments(instanceOfDynamic, node.graph().getGuardsStage(), tool.getLoweringStage()); args.add("type", type.getHub()); args.add("object", node.getValue()); Arguments args = new Arguments(instanceOf, node.graph().getGuardsStage(), tool.getLoweringStage()); args.add("object", node.getValue()); args.add("trueValue", replacer.trueValue); Arguments args = new Arguments(instanceOfBitTest, node.graph().getGuardsStage(), tool.getLoweringStage()); args.add("object", node.getValue()); args.add("trueValue", replacer.trueValue);
InstanceOfNode instanceOf = (InstanceOfNode) replacer.instanceOf; ValueNode object = instanceOf.getValue(); Assumptions assumptions = instanceOf.graph().getAssumptions(); TypeCheckMaxHints.getValue(localOptions)); final HotSpotResolvedObjectType type = (HotSpotResolvedObjectType) instanceOf.type().getType(); ConstantNode hub = ConstantNode.forConstant(KlassPointerStamp.klassNonNull(), type.klass(), providers.getMetaAccess(), instanceOf.graph()); StructuredGraph graph = instanceOf.graph(); if (hintInfo.hintHitProbability >= 1.0 && hintInfo.exact == null) { Hints hints = createHints(hintInfo, providers.getMetaAccess(), false, graph);