/** * Adds all of the elements in {@code values} to this set if they're not already present. * * @since 1.0 */ default void addAll(Iterable<E> values) { addAll(values.iterator()); }
/** * Adds all of the elements in {@code values} to this set if they're not already present. * * @since 1.0 */ default void addAll(Iterable<E> values) { addAll(values.iterator()); }
@Override protected EconomicSet<FloatingReadNode> cloneState(EconomicSet<FloatingReadNode> oldState) { EconomicSet<FloatingReadNode> result = EconomicSet.create(Equivalence.IDENTITY); if (oldState != null) { result.addAll(oldState); } return result; }
/** * Adds all of the elements in {@code other} to this set if they're not already present. * * @since 1.0 */ default void addAll(EconomicSet<E> other) { addAll(other.iterator()); }
/** * Adds all of the elements in {@code other} to this set if they're not already present. * * @since 1.0 */ default void addAll(EconomicSet<E> other) { addAll(other.iterator()); }
private static EconomicSet<String> parseUnscopedMetricSpec(String spec, boolean unconditional, boolean accumulatedKey) { EconomicSet<String> res; if (spec == null) { if (!unconditional) { res = null; } else { res = EconomicSet.create(); } } else { res = EconomicSet.create(); if (!spec.isEmpty()) { if (!accumulatedKey) { res.addAll(Arrays.asList(spec.split(","))); } else { for (String n : spec.split(",")) { res.add(n + AccumulatedKey.ACCUMULATED_KEY_SUFFIX); res.add(n + AccumulatedKey.FLAT_KEY_SUFFIX); } } } } return res; }
/** * Updates the {@linkplain #getFields() fields} of this graph with the accessed fields of * another graph. */ public void updateFields(StructuredGraph other) { assert this != other; assert GraalOptions.GeneratePIC.getValue(getOptions()); if (other.fields != null) { if (this.fields == null) { this.fields = createFieldSet(null); } this.fields.addAll(other.fields); } }
@CompilerDirectives.TruffleBoundary static String[] findUniquePublicMemberNames(Class<?> clazz, boolean onlyStatic, boolean includeInternal) throws SecurityException { HostClassDesc classDesc = HostClassDesc.forClass(clazz); EconomicSet<String> names = EconomicSet.create(); names.addAll(classDesc.getFieldNames(onlyStatic)); names.addAll(classDesc.getMethodNames(onlyStatic, includeInternal)); if (onlyStatic) { names.add("class"); if (!TruffleOptions.AOT) { // GR-13208: SVM does not support Class.getClasses() yet if (Modifier.isPublic(clazz.getModifiers())) { // no support for non-static member types now for (Class<?> t : clazz.getClasses()) { if (!isStaticTypeOrInterface(t)) { continue; } names.add(t.getSimpleName()); } } } } return names.toArray(new String[names.size()]); }
@CompilerDirectives.TruffleBoundary static String[] findUniquePublicMemberNames(Class<?> clazz, boolean onlyStatic, boolean includeInternal) throws SecurityException { JavaClassDesc classDesc = JavaClassDesc.forClass(clazz); EconomicSet<String> names = EconomicSet.create(); names.addAll(classDesc.getFieldNames(onlyStatic)); names.addAll(classDesc.getMethodNames(onlyStatic, includeInternal)); if (onlyStatic) { names.add("class"); if (Modifier.isPublic(clazz.getModifiers())) { // no support for non-static member types now for (Class<?> t : clazz.getClasses()) { if (!isStaticTypeOrInterface(t)) { continue; } names.add(t.getSimpleName()); } } } return names.toArray(new String[names.size()]); }
try (DebugContext.Scope scope = debug.scope("doInline", callerGraph)) { EconomicSet<Node> canonicalizedNodes = EconomicSet.create(Equivalence.IDENTITY); canonicalizedNodes.addAll(calleeInfo.invoke().asNode().usages()); EconomicSet<Node> parameterUsages = calleeInfo.inline(new Providers(context), reason); canonicalizedNodes.addAll(parameterUsages); counterInliningRuns.increment(debug); debug.dump(DebugContext.DETAILED_LEVEL, callerGraph, "after %s", calleeInfo);
private EconomicSet<LocationIdentity> processLoop(HIRLoop loop, EconomicMap<LoopBeginNode, EconomicSet<LocationIdentity>> modifiedInLoops) { LoopBeginNode loopBegin = (LoopBeginNode) loop.getHeader().getBeginNode(); EconomicSet<LocationIdentity> result = modifiedInLoops.get(loopBegin); if (result != null) { return result; } result = EconomicSet.create(Equivalence.DEFAULT); for (Loop<Block> inner : loop.getChildren()) { result.addAll(processLoop((HIRLoop) inner, modifiedInLoops)); } for (Block b : loop.getBlocks()) { if (b.getLoop() == loop) { processBlock(b, result); } } modifiedInLoops.put(loopBegin, result); return result; }
keys.addAll(other.getLocations());
@Override protected EconomicMap<LoopExitNode, MemoryMapImpl> processLoop(LoopBeginNode loop, MemoryMapImpl initialState) { EconomicSet<LocationIdentity> modifiedLocations = modifiedInLoops.get(loop); EconomicMap<LocationIdentity, MemoryPhiNode> phis = EconomicMap.create(Equivalence.DEFAULT); if (modifiedLocations.contains(LocationIdentity.any())) { // create phis for all locations if ANY is modified in the loop modifiedLocations = EconomicSet.create(Equivalence.DEFAULT, modifiedLocations); modifiedLocations.addAll(initialState.lastMemorySnapshot.getKeys()); } for (LocationIdentity location : modifiedLocations) { createMemoryPhi(loop, initialState, phis, location); } initialState.lastMemorySnapshot.putAll(phis); LoopInfo<MemoryMapImpl> loopInfo = ReentrantNodeIterator.processLoop(this, loop, initialState); UnmodifiableMapCursor<LoopEndNode, MemoryMapImpl> endStateCursor = loopInfo.endStates.getEntries(); while (endStateCursor.advance()) { int endIndex = loop.phiPredecessorIndex(endStateCursor.getKey()); UnmodifiableMapCursor<LocationIdentity, MemoryPhiNode> phiCursor = phis.getEntries(); while (phiCursor.advance()) { LocationIdentity key = phiCursor.getKey(); PhiNode phi = phiCursor.getValue(); phi.initializeValueAt(endIndex, ValueNodeUtil.asNode(endStateCursor.getValue().getLastLocationAccess(key))); } } return loopInfo.exitStates; }
kills.addAll(memoryMap.getLocations());
newNodes.addAll(invokeGraph.getNewNodes(mark)); EconomicMap<NodeSourcePosition, NodeSourcePosition> posMap = EconomicMap.create(Equivalence.DEFAULT); UnmodifiableMapCursor<Node, Node> cursor = duplicates.getEntries();
canonicalizeNodes.addAll(doInline(i, invokeForInlining, reason));