/** * The lifecycle that single-pass node iterators go through is described in {@link #apply()} * * <p> * When overriding this method don't forget to invoke this implementation, otherwise the * assertions will be skipped. * </p> */ protected void finished() { assert nodeQueue.isEmpty(); assert nodeStates.isEmpty(); }
/** * Formats the inlining log as a hierarchical tree. * * @param nullIfEmpty specifies whether null should be returned if there are no inlining * decisions * @return the tree representation of the inlining log */ public String formatAsTree(boolean nullIfEmpty) { assert root.decisions.isEmpty(); assert !root.children.isEmpty() || leaves.isEmpty(); if (nullIfEmpty && root.children.isEmpty()) { return null; } StringBuilder builder = new StringBuilder(512); formatAsTree(root, "", builder); return builder.toString(); }
/** * Determines if this object currently contains any plugins (in any state of registration). If * this object has any {@link #defer(Runnable) deferred registrations}, it is assumed that * executing them will result in at least one plugin being registered. */ public boolean isEmpty() { if (parent != null && !parent.isEmpty()) { return false; } UnmodifiableEconomicMap<ResolvedJavaMethod, InvocationPlugin> resolvedRegs = resolvedRegistrations; if (resolvedRegs != null) { if (!resolvedRegs.isEmpty()) { return false; } } List<Runnable> deferred = deferredRegistrations; if (deferred != null) { if (!deferred.isEmpty()) { return false; } } for (LateClassPlugins late = lateRegistrations; late != null; late = late.next) { if (!late.bindings.isEmpty()) { return false; } } return registrations.size() == 0; }
if (!values.isEmpty()) { RuntimeOptionValues.singleton().update(values);
/** * Parses a map representing assignments of values to options. * * @param optionSettings option settings (i.e., assignments of values to options) * @param values the object in which to store the parsed values * @param loader source of the available {@link OptionDescriptors} * @throws IllegalArgumentException if there's a problem parsing {@code option} */ public static void parseOptions(EconomicMap<String, String> optionSettings, EconomicMap<OptionKey<?>, Object> values, Iterable<OptionDescriptors> loader) { if (optionSettings != null && !optionSettings.isEmpty()) { MapCursor<String, String> cursor = optionSettings.getEntries(); while (cursor.advance()) { parseOption(cursor.getKey(), cursor.getValue(), values, loader); } } }
/** * Removes the plugins from {@code other} in this object that were added by * {@link #addTestPlugins}. */ public synchronized void removeTestPlugins(InvocationPlugins other) { assert resolvedRegistrations == null : "registration is closed"; if (testExtensions != null) { MapCursor<String, List<Binding>> c = other.getBindings(false).getEntries(); while (c.advance()) { String declaringClass = c.getKey(); List<Binding> bindings = testExtensions.get(declaringClass); if (bindings != null) { for (Binding b : c.getValue()) { int index = findBinding(bindings, b); if (index != -1) { bindings.remove(index); } } if (bindings.isEmpty()) { testExtensions.removeKey(declaringClass); } } } if (testExtensions.isEmpty()) { testExtensions = null; } } }
/** * Completely replace the current log with the copy of the specified log. * * The precondition is that the current inlining log is completely empty. This is usually called * when copying the entire graph. * * @see InliningLog#addDecision */ public void replaceLog(UnmodifiableEconomicMap<Node, Node> replacements, InliningLog replacementLog) { assert root.decisions.isEmpty(); assert root.children.isEmpty(); assert leaves.isEmpty(); EconomicMap<Callsite, Callsite> mapping = EconomicMap.create(Equivalence.IDENTITY_WITH_SYSTEM_HASHCODE); copyTree(root, replacementLog.root, replacements, mapping); MapCursor<Invokable, Callsite> replacementEntries = replacementLog.leaves.getEntries(); while (replacementEntries.advance()) { Invokable replacementInvoke = replacementEntries.getKey(); Callsite replacementSite = replacementEntries.getValue(); if (replacementInvoke.isAlive()) { Invokable invoke = (Invokable) replacements.get((Node) replacementInvoke); Callsite site = mapping.get(replacementSite); leaves.put(invoke, site); } } }
assert resolvedRegistrations == null : "registration is closed"; EconomicMap<String, List<Binding>> otherBindings = other.getBindings(true, false); if (otherBindings.isEmpty()) { return;
if (duplicateInThreads.isEmpty()) { duplicateInThreads = null; singleThreadSession = true;
public CompilationTask(HotSpotJVMCIRuntime jvmciRuntime, HotSpotGraalCompiler compiler, HotSpotCompilationRequest request, boolean useProfilingInfo, boolean installAsDefault, OptionValues options) { this.jvmciRuntime = jvmciRuntime; this.compiler = compiler; this.compilationId = new HotSpotCompilationIdentifier(request); this.useProfilingInfo = useProfilingInfo; this.installAsDefault = installAsDefault; /* * Disable inlining if HotSpot has it disabled unless it's been explicitly set in Graal. */ HotSpotGraalRuntimeProvider graalRuntime = compiler.getGraalRuntime(); GraalHotSpotVMConfig config = graalRuntime.getVMConfig(); OptionValues newOptions = options; if (!config.inline) { EconomicMap<OptionKey<?>, Object> m = OptionValues.newOptionMap(); if (Inline.getValue(options) && !Inline.hasBeenSet(options)) { m.put(Inline, false); } if (InlineDuringParsing.getValue(options) && !InlineDuringParsing.hasBeenSet(options)) { m.put(InlineDuringParsing, false); } if (!m.isEmpty()) { newOptions = new OptionValues(options, m); } } this.options = newOptions; }
super.processInitialLoopState(loop, initialState); if (!initialState.getReadCache().isEmpty()) { EconomicMap<ValueNode, Pair<ValueNode, Object>> firstValueSet = null; for (PhiNode phi : ((LoopBeginNode) loop.getHeader().getBeginNode()).phis()) {
if (currentEndMap == null || !currentEndMap.isEmpty()) {
if (!trueGuards.isEmpty()) { for (GuardNode guard : node.falseSuccessor().guards().snapshot()) { GuardNode otherGuard = trueGuards.get(guard.getCondition());