public InfoElement get(EndNode end) { if (infoElements == null) { return null; } return infoElements.get(end); } }
@Override public Node replacement(Node original) { Node replacement = map.get(original); return replacement != null ? replacement : original; }
/** * Gets the comment attached to a {@link LIRInstruction}. */ public final String getComment(LIRInstruction op) { if (comments == null) { return null; } return comments.get(op); }
/** * Returns the index of an object in the array. The object must have been * {@link #addObject(Object) added} before. */ public int getIndex(T object) { if (object == null) { assert containsNull; return 0; } Entry<T> entry = map.get(object); assert entry != null && entry.index >= 0; return entry.index; }
@Override public <T extends SnippetTemplateCache> T getSnippetTemplateCache(Class<T> templatesClass) { SnippetTemplateCache ret = snippetTemplateCache.get(templatesClass.getName()); return templatesClass.cast(ret); } }
@SuppressWarnings("unchecked") public <New extends Node, Old extends New> New getDuplicatedNode(Old n) { assert isDuplicate(); return (New) duplicationMap.get(n); }
@Override public void registerSnippetTemplateCache(SnippetTemplateCache templates) { assert snippetTemplateCache.get(templates.getClass().getName()) == null; snippetTemplateCache.put(templates.getClass().getName(), templates); }
/** * Finds an existing slot. This is a slow operation. * * @param identifier the key of the slot to search for * @return the slot or <code>null</code> * @since 0.8 or earlier */ public FrameSlot findFrameSlot(Object identifier) { CompilerAsserts.neverPartOfCompilation(NEVER_PART_OF_COMPILATION_MESSAGE); synchronized (lock) { return identifierToSlotMap.get(identifier); } }
static boolean containsBinding(InvocationPlugins p, Type declaringType, Binding key) { String internalName = MetaUtil.toInternalName(declaringType.getTypeName()); ClassPlugins classPlugins = p.registrations.get(internalName); return classPlugins != null && classPlugins.lookup(key) != null; }
@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 trackDuplicatedCallsite(Invokable sibling, Invokable newInvoke) { Callsite siblingCallsite = leaves.get(sibling); Callsite parentCallsite = siblingCallsite.parent; Callsite callsite = parentCallsite.addChild(newInvoke); leaves.put(newInvoke, callsite); }
public Data createDataItem(Constant constant) { Data data = dataCache.get(constant); if (data == null) { data = dataBuilder.createDataItem(constant); dataCache.put(constant, data); } return data; }
@Override protected EncodedGraph lookupEncodedGraph(ResolvedJavaMethod method, ResolvedJavaMethod originalMethod, BytecodeProvider intrinsicBytecodeProvider, boolean isSubstitution, boolean trackNodeSourcePosition) { EncodedGraph result = graphCache.get(method); if (result == null && method.hasBytecodes()) { result = createGraph(method, originalMethod, intrinsicBytecodeProvider, isSubstitution); } return result; } }
protected LabelHint requestHint(SPARCMacroAssembler masm, Label label) { LabelHint hint = labelHints.get(label); if (hint == null) { hint = masm.requestLabelHint(label); labelHints.put(label, hint); } return hint; }
private void invalidateNotInFrameAssumption(Object identifier) { if (identifierToNotInFrameAssumptionMap != null) { Assumption assumption = identifierToNotInFrameAssumptionMap.get(identifier); if (assumption != null) { assumption.invalidate(); identifierToNotInFrameAssumptionMap.removeKey(identifier); } } }
@Override public boolean canDeoptimize(ForeignCallDescriptor descriptor) { assert foreignCalls.containsKey(descriptor) : "unknown foreign call: " + descriptor; return foreignCalls.get(descriptor).needsDebugInfo(); }
/** * Gets the fields cache for {@code type}. * * Synchronized since the cache is lazily created. */ private synchronized FieldsCache getFields(ResolvedJavaType type) { FieldsCache fieldsCache = fields.get(type); if (fieldsCache == null) { fieldsCache = new FieldsCache(); fields.put(type, fieldsCache); } return fieldsCache; }
Node findNodeInCache(Node node) { int leafId = node.getNodeClass().getLeafId(); if (cachedLeafNodes == null || cachedLeafNodes.length <= leafId || cachedLeafNodes[leafId] == null) { return null; } Node result = cachedLeafNodes[leafId].get(node); assert result == null || result.isAlive() : result; return result; }
@SuppressWarnings("unchecked") static <T> T getValue(OptionValues polyglotValues, OptionKey<T> key) { if (polyglotValues != null && polyglotValues.hasBeenSet(key)) { return polyglotValues.get(key); } else { OptionKey<?> truffleKey = POLYGLOT_TO_TRUFFLE.get(key); if (truffleKey != null) { return (T) TruffleRuntimeOptions.getValue(truffleKey); } } return key.getDefaultValue(); }