@SuppressWarnings("unchecked") @Override public boolean contains(Object o) { return map.containsKey((K) o); }
@SuppressWarnings("unchecked") @Override public boolean contains(Object o) { return map.containsKey((K) o); }
/** * Return true if the descriptor has already been registered. */ public boolean isRegistered(ForeignCallDescriptor descriptor) { return foreignCalls.containsKey(descriptor); }
@Override public boolean hasBeenSet(OptionKey<?> optionKey) { return values.containsKey(optionKey); }
public boolean containsLeafCallsite(Invokable invokable) { return leaves.containsKey(invokable); }
private void keepForLater(FixedNode x, T s) { assert !nodeStates.containsKey(x); assert (x instanceof LoopBeginNode) || (x instanceof LoopEndNode) || (x instanceof EndNode); assert s != null; nodeStates.put(x, s); }
@Override public boolean isReexecutable(ForeignCallDescriptor descriptor) { assert foreignCalls.containsKey(descriptor) : "unknown foreign call: " + descriptor; return foreignCalls.get(descriptor).isReexecutable(); }
@Override public LocationIdentity[] getKilledLocations(ForeignCallDescriptor descriptor) { assert foreignCalls.containsKey(descriptor) : "unknown foreign call: " + descriptor; return foreignCalls.get(descriptor).getKilledLocations(); }
public void checkInvariants(StructuredGraph graph) { for (Invoke invoke : graph.getInvokes()) { assert leaves.containsKey(invoke) : "Invoke " + invoke + " not contained in the leaves."; } assert root.parent == null; checkTreeInvariants(root); }
@Override public boolean canDeoptimize(ForeignCallDescriptor descriptor) { assert foreignCalls.containsKey(descriptor) : "unknown foreign call: " + descriptor; return foreignCalls.get(descriptor).needsDebugInfo(); }
@Override public boolean isGuaranteedSafepoint(ForeignCallDescriptor descriptor) { assert foreignCalls.containsKey(descriptor) : "unknown foreign call: " + descriptor; return foreignCalls.get(descriptor).isGuaranteedSafepoint(); }
private static <StateT> boolean allEndsVisited(EconomicMap<FixedNode, StateT> states, Block current, AbstractMergeNode merge) { for (AbstractEndNode forwardEnd : merge.forwardEnds()) { if (forwardEnd != current.getEndNode() && !states.containsKey(forwardEnd)) { return false; } } return true; }
/** * Ensures a given metric key is registered. * * @return the globally unique id for {@code value} */ static synchronized int register(AbstractKey key) { String name = key.getName(); if (!keyMap.containsKey(name)) { keyMap.put(name, keys.size()); keys.add(key); } return keyMap.get(name); }
/** * Sets the value of this option in a given map if it doesn't already have a value. The * {@link #onValueUpdate(EconomicMap, Object, Object)} method is called once the value is set. * * @param values map of option values * @param v the value to set for this key in {@code map} */ @SuppressWarnings("unchecked") public void putIfAbsent(EconomicMap<OptionKey<?>, Object> values, Object v) { if (!values.containsKey(this)) { T oldValue = (T) values.put(this, v); onValueUpdate(values, oldValue, (T) v); } }
public void trackNewCallsite(Invokable invoke) { assert !leaves.containsKey(invoke); Callsite currentRoot = findCurrentRoot(); Callsite callsite = new Callsite(currentRoot, invoke); currentRoot.children.add(callsite); leaves.put(invoke, callsite); }
private static <StateT> ArrayList<StateT> mergeStates(EconomicMap<FixedNode, StateT> states, StateT state, Block current, Block successor, AbstractMergeNode merge) { ArrayList<StateT> mergedStates = new ArrayList<>(merge.forwardEndCount()); for (Block predecessor : successor.getPredecessors()) { assert predecessor == current || states.containsKey(predecessor.getEndNode()); StateT endState = predecessor == current ? state : states.removeKey(predecessor.getEndNode()); mergedStates.add(endState); } return mergedStates; }
/** * Registers the linkage for a foreign call. */ public HotSpotForeignCallLinkage register(HotSpotForeignCallLinkage linkage) { assert !foreignCalls.containsKey(linkage.getDescriptor()) : "already registered linkage for " + linkage.getDescriptor(); foreignCalls.put(linkage.getDescriptor(), linkage); return linkage; }
public static <StateT> LoopInfo<StateT> processLoop(NodeIteratorClosure<StateT> closure, LoopBeginNode loop, StateT initialState) { EconomicMap<FixedNode, StateT> blockEndStates = apply(closure, loop, initialState, loop); LoopInfo<StateT> info = new LoopInfo<>(loop.loopEnds().count(), loop.loopExits().count()); for (LoopEndNode end : loop.loopEnds()) { if (blockEndStates.containsKey(end)) { info.endStates.put(end, blockEndStates.get(end)); } } for (LoopExitNode exit : loop.loopExits()) { if (blockEndStates.containsKey(exit)) { info.exitStates.put(exit, blockEndStates.get(exit)); } } return info; }
/** * Gets the set of registers that can be used by the register allocator for a value of a * particular kind. */ public AllocatableRegisters getAllocatableRegisters(PlatformKind kind) { PlatformKind.Key key = kind.getKey(); if (categorized.containsKey(key)) { AllocatableRegisters val = categorized.get(key); return val; } AllocatableRegisters ret = createAllocatableRegisters(registerConfig.filterAllocatableRegisters(kind, getAllocatableRegisters())); categorized.put(key, ret); return ret; }
public GroupBoundaries createGroupBoundaries(CompilationFinalBitSet updateIndices, CompilationFinalBitSet clearIndices) { if (updateIndices.isEmpty() && clearIndices.isEmpty()) { return GroupBoundaries.getEmptyInstance(); } GroupBoundaries lookup = new GroupBoundaries(updateIndices, clearIndices); if (groupBoundariesDeduplicationMap.containsKey(lookup)) { return groupBoundariesDeduplicationMap.get(lookup); } else { GroupBoundaries gb = new GroupBoundaries(updateIndices.copy(), clearIndices.copy()); groupBoundariesDeduplicationMap.put(gb, gb); return gb; } }