/* * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package org.graalvm.compiler.phases.common.inlining.walker; import java.util.BitSet; import java.util.LinkedList; import java.util.function.ToDoubleFunction; import jdk.internal.vm.compiler.collections.EconomicSet; import jdk.internal.vm.compiler.collections.Equivalence; import org.graalvm.compiler.nodes.FixedNode; import org.graalvm.compiler.nodes.Invoke; import org.graalvm.compiler.nodes.ParameterNode; import org.graalvm.compiler.nodes.StructuredGraph; import org.graalvm.compiler.nodes.ValueNode; import org.graalvm.compiler.phases.common.inlining.policy.AbstractInliningPolicy; import org.graalvm.compiler.phases.graph.FixedNodeRelativeFrequencyCache; import jdk.vm.ci.meta.ResolvedJavaMethod; /** *
* A {@link CallsiteHolder} whose graph has been copied already and thus can be modified without * affecting the original (usually cached) version. *
* ** An instance of this class is derived from an * {@link org.graalvm.compiler.phases.common.inlining.info.elem.InlineableGraph InlineableGraph} and * contains a subset of the information there: just the {@link Invoke} nodes from it. Such nodes are * candidates for depth-first search of further inlining opportunities (thus the adjective * "explorable" given to this class) *
* * @see InliningData#moveForward() */ public final class CallsiteHolderExplorable extends CallsiteHolder { /** * Graph in which inlining may be performed at one or more of the callsites containined in * {@link #remainingInvokes}. */ private final StructuredGraph graph; private final LinkedList* Parameters for which the callsite targeting {@link #graph()} provides "fixed" arguments. That * callsite isn't referenced by this instance. Instead, it belongs to the graph of the caller of * this {@link CallsiteHolderExplorable} *
* ** Constant arguments don't contribute to fixed-params: those params have been removed already, * see {@link org.graalvm.compiler.phases.common.inlining.info.elem.InlineableGraph}. *
* ** Instead, fixed-params are those receiving freshly instantiated arguments (possibly * instantiated several levels up in the call-hierarchy) *
*/ public EconomicSet