src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileNode.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileNode.java

Print this page




   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 package org.graalvm.compiler.hotspot.nodes.profiling;
  24 
  25 import jdk.vm.ci.meta.ResolvedJavaMethod;
  26 
  27 import org.graalvm.compiler.core.common.type.StampFactory;
  28 import org.graalvm.compiler.graph.NodeClass;
  29 import org.graalvm.compiler.graph.iterators.NodeIterable;
  30 import org.graalvm.compiler.nodeinfo.NodeInfo;
  31 import org.graalvm.compiler.nodes.DeoptimizingFixedWithNextNode;
  32 import org.graalvm.compiler.nodes.StructuredGraph;
  33 import org.graalvm.compiler.nodes.ValueNode;
  34 import org.graalvm.compiler.nodes.spi.Lowerable;
  35 import org.graalvm.compiler.nodes.spi.LoweringTool;
  36 import org.graalvm.compiler.options.Option;

  37 import org.graalvm.compiler.options.OptionType;
  38 import org.graalvm.compiler.options.OptionValue;

  39 
  40 @NodeInfo
  41 public class ProfileNode extends DeoptimizingFixedWithNextNode implements Lowerable {
  42     public static class Options {
  43         @Option(help = "Control probabilistic profiling on AMD64", type = OptionType.Expert)//
  44         public static final OptionValue<Boolean> ProbabilisticProfiling = new OptionValue<>(true);
  45     }
  46 
  47     public static final NodeClass<ProfileNode> TYPE = NodeClass.create(ProfileNode.class);
  48 
  49     protected ResolvedJavaMethod method;
  50 
  51     // Only used if ProbabilisticProfiling == true and may be ignored by lowerer.
  52     @OptionalInput protected ValueNode random;
  53 
  54     // logarithm base 2 of the profile probability
  55     protected int probabilityLog;
  56 
  57     protected ProfileNode(NodeClass<? extends DeoptimizingFixedWithNextNode> c, ResolvedJavaMethod method, int probabilityLog) {
  58         super(c, StampFactory.forVoid());
  59         this.method = method;
  60         this.probabilityLog = probabilityLog;
  61     }
  62 
  63     public ProfileNode(ResolvedJavaMethod method, int probabilityLog) {
  64         super(TYPE, StampFactory.forVoid());




   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 package org.graalvm.compiler.hotspot.nodes.profiling;
  24 


  25 import org.graalvm.compiler.core.common.type.StampFactory;
  26 import org.graalvm.compiler.graph.NodeClass;
  27 import org.graalvm.compiler.graph.iterators.NodeIterable;
  28 import org.graalvm.compiler.nodeinfo.NodeInfo;
  29 import org.graalvm.compiler.nodes.DeoptimizingFixedWithNextNode;
  30 import org.graalvm.compiler.nodes.StructuredGraph;
  31 import org.graalvm.compiler.nodes.ValueNode;
  32 import org.graalvm.compiler.nodes.spi.Lowerable;
  33 import org.graalvm.compiler.nodes.spi.LoweringTool;
  34 import org.graalvm.compiler.options.Option;
  35 import org.graalvm.compiler.options.OptionKey;
  36 import org.graalvm.compiler.options.OptionType;
  37 
  38 import jdk.vm.ci.meta.ResolvedJavaMethod;
  39 
  40 @NodeInfo
  41 public class ProfileNode extends DeoptimizingFixedWithNextNode implements Lowerable {
  42     public static class Options {
  43         @Option(help = "Control probabilistic profiling on AMD64", type = OptionType.Expert)//
  44         public static final OptionKey<Boolean> ProbabilisticProfiling = new OptionKey<>(true);
  45     }
  46 
  47     public static final NodeClass<ProfileNode> TYPE = NodeClass.create(ProfileNode.class);
  48 
  49     protected ResolvedJavaMethod method;
  50 
  51     // Only used if ProbabilisticProfiling == true and may be ignored by lowerer.
  52     @OptionalInput protected ValueNode random;
  53 
  54     // logarithm base 2 of the profile probability
  55     protected int probabilityLog;
  56 
  57     protected ProfileNode(NodeClass<? extends DeoptimizingFixedWithNextNode> c, ResolvedJavaMethod method, int probabilityLog) {
  58         super(c, StampFactory.forVoid());
  59         this.method = method;
  60         this.probabilityLog = probabilityLog;
  61     }
  62 
  63     public ProfileNode(ResolvedJavaMethod method, int probabilityLog) {
  64         super(TYPE, StampFactory.forVoid());


src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileNode.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File