/** * Deletes any nodes created within the scope of this object that have no usages. */ public void deleteUnusedNodes() { if (ivs != null) { for (InductionVariable iv : ivs.getValues()) { iv.deleteUnusedNodes(); } } }
@Override public List<Stub> getStubs() { List<Stub> stubs = new ArrayList<>(); for (HotSpotForeignCallLinkage linkage : foreignCalls.getValues()) { if (linkage.isCompiledStub()) { Stub stub = linkage.getStub(); assert stub != null; stubs.add(stub); } } return stubs; } }
/** * Fills the provided array with the added objects. The array must have the {@link #getLength() * correct length}. */ public T[] encodeAll(T[] allObjects) { assert allObjects.length == getLength(); List<Entry<T>> sortedEntries = new ArrayList<>(allObjects.length); for (Entry<T> value : map.getValues()) { sortedEntries.add(value); } sortedEntries.sort((e1, e2) -> -Integer.compare(e1.frequency, e2.frequency)); int offset = 0; if (containsNull) { allObjects[0] = null; offset = 1; } for (int i = 0; i < sortedEntries.size(); i++) { Entry<T> entry = sortedEntries.get(i); int index = i + offset; entry.index = index; allObjects[index] = entry.object; assert entry.object != null; } return allObjects; } }
@Override protected EconomicMap<LoopExitNode, Double> processLoop(LoopBeginNode loop, Double initialState) { EconomicMap<LoopExitNode, Double> exitStates = ReentrantNodeIterator.processLoop(this, loop, 1D).exitStates; double exitRelativeFrequency = 0.0; for (double d : exitStates.getValues()) { exitRelativeFrequency += d; } exitRelativeFrequency = Math.min(1.0, exitRelativeFrequency); exitRelativeFrequency = Math.max(ControlFlowGraph.MIN_RELATIVE_FREQUENCY, exitRelativeFrequency); double loopFrequency = 1.0 / exitRelativeFrequency; loop.setLoopFrequency(loopFrequency); double adjustmentFactor = initialState * loopFrequency; exitStates.replaceAll((exitNode, frequency) -> multiplyRelativeFrequencies(frequency, adjustmentFactor)); return exitStates; }
hostBackend.completeInitialization(jvmciRuntime, options); for (HotSpotBackend backend : backends.getValues()) { if (backend != hostBackend) { try (InitTimer st = timer(backend.getTarget().arch.getName(), ".completeInitialization")) {
/** * Initializes or updates the relevance computation. If there are no loops within the graph, * most computation happens lazily. */ public void compute() { rootScope = null; if (!graph.hasLoops()) { // fast path for the frequent case of no loops rootScope = new Scope(graph.start(), null); } else { if (nodeRelevances == null) { nodeRelevances = EconomicMap.create(Equivalence.IDENTITY, EXPECTED_MIN_INVOKE_COUNT + InliningUtil.getNodeCount(graph) / EXPECTED_INVOKE_RATIO); } NodeWorkList workList = graph.createNodeWorkList(); EconomicMap<LoopBeginNode, Scope> loops = EconomicMap.create(Equivalence.IDENTITY, EXPECTED_LOOP_COUNT); Scope topScope = new Scope(graph.start(), null); for (LoopBeginNode loopBegin : graph.getNodes(LoopBeginNode.TYPE)) { createLoopScope(loopBegin, loops, topScope); } topScope.process(workList); for (Scope scope : loops.getValues()) { scope.process(workList); } } }
for (TB list : mergeSameTargetsMap.getValues()) { TB tb = list; do {
finishDuplication(); nodes = new NodeBitMap(graph()); nodes.markAll(duplicationMap.getValues()); nodesReady = true; } else {
for (VirtualObject value : virtualObjects.getValues()) { virtualObjectsArray[index++] = value;
for (OpaqueNode opaque : opaqueUnrolledStrides.getValues()) { opaque.remove();