/** * Shallow copy of the descriptor. Re-uses the existing slots in new descriptor. As a result, if * you {@link FrameSlot#setKind(FrameSlotKind) change kind} of one of the slots it is changed in * the original as well as in the shallow copy. * * @return new instance of a descriptor with copies of values from this one * @since 0.8 or earlier */ public FrameDescriptor shallowCopy() { FrameDescriptor clonedFrameDescriptor = new FrameDescriptor(this.defaultValue); clonedFrameDescriptor.slots.addAll(slots); clonedFrameDescriptor.identifierToSlotMap.putAll(identifierToSlotMap); return clonedFrameDescriptor; }
public OptionValues(OptionValues initialValues, UnmodifiableEconomicMap<OptionKey<?>, Object> extraPairs) { EconomicMap<OptionKey<?>, Object> map = newOptionMap(); if (initialValues != null) { map.putAll(initialValues.getMap()); } initMap(map, extraPairs); this.values = map; }
EconomicMap<String, List<Binding>> res = EconomicMap.create(Equivalence.DEFAULT); if (parent != null && includeParents) { res.putAll(parent.getBindings(true, flushDeferrables));
@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; }