private static void resetGlobalStateInGraal() { withGlobalStaticField("org.graalvm.compiler.nodes.NamedLocationIdentity$DB", "map", f -> ((EconomicSet<?>) f.get(null)).clear()); withGlobalStaticField("org.graalvm.compiler.debug.DebugContext$Immutable", "CACHE", f -> { Object[] cache = (Object[]) f.get(null); for (int i = 0; i < cache.length; i++) { cache[i] = null; } }); }
usedRegs.clear(); for (i = 0; i < mappingTo.size(); i++) { Interval interval = mappingTo.get(i);
contexts.clear(); for (PolyglotInstrument instrumentImpl : idToInstrument.values()) { try {
@Override @SuppressWarnings("try") protected void run(StructuredGraph graph, PhaseContext context) { EconomicSetNodeEventListener listener = new EconomicSetNodeEventListener().exclude(NODE_ADDED); int count = 0; while (true) { try (NodeEventScope nes = graph.trackNodeEvents(listener)) { new ConditionalEliminationPhase(fullSchedule).apply(graph, context); } if (listener.getNodes().isEmpty()) { break; } for (Node node : graph.getNodes()) { if (node instanceof Simplifiable) { listener.getNodes().add(node); } } canonicalizer.applyIncremental(graph, context, listener.getNodes()); listener.getNodes().clear(); if (++count > MAX_ITERATIONS) { throw new RetryableBailoutException("Number of iterations in ConditionalEliminationPhase phase exceeds %d", MAX_ITERATIONS); } } }
listener.getNodes().clear();