Mercurial > hg > truffle
changeset 11510:231958c9ddf9
Merge.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 02 Sep 2013 20:44:49 +0200 |
parents | dcaf879d4a7e (current diff) be283d587cfc (diff) |
children | 3110bea9a6b0 189baa5ea5f0 |
files | |
diffstat | 7 files changed, 46 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/IfCanonicalizerTest.java Mon Sep 02 16:47:29 2013 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/IfCanonicalizerTest.java Mon Sep 02 20:44:49 2013 +0200 @@ -145,6 +145,9 @@ } Debug.dump(graph, "Graph"); new CanonicalizerPhase.Instance(runtime(), new Assumptions(false), true).apply(graph); + for (FrameState fs : local.usages().filter(FrameState.class).snapshot()) { + fs.replaceFirstInput(local, null); + } StructuredGraph referenceGraph = parse(REFERENCE_SNIPPET); assertEquals(referenceGraph, graph); }
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Mon Sep 02 16:47:29 2013 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Mon Sep 02 20:44:49 2013 +0200 @@ -22,6 +22,7 @@ */ package com.oracle.graal.compiler; +import static com.oracle.graal.compiler.GraalCompiler.Options.*; import static com.oracle.graal.compiler.MethodFilter.*; import static com.oracle.graal.phases.GraalOptions.*; @@ -42,6 +43,7 @@ import com.oracle.graal.nodes.cfg.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.util.*; +import com.oracle.graal.options.*; import com.oracle.graal.phases.*; import com.oracle.graal.phases.PhasePlan.PhasePosition; import com.oracle.graal.phases.common.*; @@ -57,17 +59,47 @@ private static final DebugTimer FrontEnd = Debug.timer("FrontEnd"); private static final DebugTimer BackEnd = Debug.timer("BackEnd"); + /** + * The set of positive filters specified by the {@code -G:IntrinsificationsEnabled} option. To + * enable a fast path in {@link #shouldIntrinsify(JavaMethod)}, this field is {@code null} when + * no enabling/disabling filters are specified. + */ private static final MethodFilter[] positiveIntrinsificationFilter; + + /** + * The set of negative filters specified by the {@code -G:IntrinsificationsDisabled} option. + */ private static final MethodFilter[] negativeIntrinsificationFilter; + + static class Options { + + // @formatter:off + /** + * @see MethodFilter + */ + @Option(help = "Pattern for method(s) to which intrinsification (if available) will be applied. " + + "By default, all available intrinsifications are applied except for methods matched " + + "by IntrinsificationsDisabled. See MethodFilter class for pattern syntax.") + public static final OptionValue<String> IntrinsificationsEnabled = new OptionValue<>(null); + /** + * @see MethodFilter + */ + @Option(help = "Pattern for method(s) to which intrinsification will not be applied. " + + "See MethodFilter class for pattern syntax.") + public static final OptionValue<String> IntrinsificationsDisabled = new OptionValue<>("Object.clone"); + // @formatter:on + + } + static { - if (GraalDebugConfig.IntrinsificationsDisabled.getValue() != null) { - negativeIntrinsificationFilter = parse(GraalDebugConfig.IntrinsificationsDisabled.getValue()); + if (IntrinsificationsDisabled.getValue() != null) { + negativeIntrinsificationFilter = parse(IntrinsificationsDisabled.getValue()); } else { negativeIntrinsificationFilter = null; } - if (GraalDebugConfig.IntrinsificationsEnabled.getValue() != null) { - positiveIntrinsificationFilter = parse(GraalDebugConfig.IntrinsificationsEnabled.getValue()); + if (Options.IntrinsificationsEnabled.getValue() != null) { + positiveIntrinsificationFilter = parse(IntrinsificationsEnabled.getValue()); } else if (negativeIntrinsificationFilter != null) { positiveIntrinsificationFilter = new MethodFilter[0]; } else { @@ -77,8 +109,7 @@ /** * Determines if a given method should be intrinsified based on the values of - * {@link GraalDebugConfig#IntrinsificationsEnabled} and - * {@link GraalDebugConfig#IntrinsificationsDisabled}. + * {@link Options#IntrinsificationsEnabled} and {@link Options#IntrinsificationsDisabled}. */ public static boolean shouldIntrinsify(JavaMethod method) { if (positiveIntrinsificationFilter == null) {
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalDebugConfig.java Mon Sep 02 16:47:29 2013 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalDebugConfig.java Mon Sep 02 20:44:49 2013 +0200 @@ -66,19 +66,6 @@ return enabled; } }; - /** - * @see MethodFilter - */ - @Option(help = "Pattern for method(s) to which intrinsification (if available) will be applied. " + - "By default, all available intrinsifications are applied except for methods matched " + - "by IntrinsificationsDisabled. See MethodFilter class for pattern syntax.") - public static final OptionValue<String> IntrinsificationsEnabled = new OptionValue<>(null); - /** - * @see MethodFilter - */ - @Option(help = "Pattern for method(s) to which intrinsification will not be applied. " + - "See MethodFilter class for pattern syntax.") - public static final OptionValue<String> IntrinsificationsDisabled = new OptionValue<>("Object.clone"); // @formatter:on private final DebugFilter logFilter;
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/DeadCodeEliminationPhase.java Mon Sep 02 16:47:29 2013 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/DeadCodeEliminationPhase.java Mon Sep 02 20:44:49 2013 +0200 @@ -110,9 +110,6 @@ private static void iterateInputs(NodeFlood flood, StructuredGraph graph) { for (Node node : graph.getNodes()) { - if (node instanceof LocalNode) { - flood.add(node); - } if (flood.isMarked(node)) { for (Node input : node.inputs()) { flood.add(input);
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java Mon Sep 02 16:47:29 2013 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java Mon Sep 02 20:44:49 2013 +0200 @@ -54,10 +54,11 @@ private FixedWithNextNode lastFixedNode; private ControlFlowGraph cfg; - public LoweringToolImpl(PhaseContext context, GuardingNode guardAnchor, NodeBitMap activeGuards, ControlFlowGraph cfg) { + public LoweringToolImpl(PhaseContext context, GuardingNode guardAnchor, NodeBitMap activeGuards, FixedWithNextNode lastFixedNode, ControlFlowGraph cfg) { this.context = context; this.guardAnchor = guardAnchor; this.activeGuards = activeGuards; + this.lastFixedNode = lastFixedNode; this.cfg = cfg; } @@ -216,11 +217,10 @@ private void process(final Block b, final NodeBitMap activeGuards, final GuardingNode anchor) { - final LoweringToolImpl loweringTool = new LoweringToolImpl(context, anchor, activeGuards, schedule.getCFG()); + final LoweringToolImpl loweringTool = new LoweringToolImpl(context, anchor, activeGuards, b.getBeginNode(), schedule.getCFG()); // Lower the instructions of this block. List<ScheduledNode> nodes = schedule.nodesFor(b); - loweringTool.setLastFixedNode(b.getBeginNode()); for (Node node : nodes) { if (node.isDeleted()) {
--- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java Mon Sep 02 16:47:29 2013 +0200 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java Mon Sep 02 20:44:49 2013 +0200 @@ -861,7 +861,7 @@ private static List<ScheduledNode> filterSchedulableNodes(List<ScheduledNode> list) { List<ScheduledNode> result = new ArrayList<>(); for (ScheduledNode n : list) { - if (!(n instanceof LocalNode) && !(n instanceof PhiNode)) { + if (!(n instanceof PhiNode)) { result.add(n); } } @@ -984,7 +984,7 @@ } private void addToLatestSorting(Block b, ScheduledNode i, List<ScheduledNode> sortedInstructions, NodeBitMap visited, List<FloatingReadNode> reads, NodeBitMap beforeLastLocation) { - if (i == null || visited.isMarked(i) || cfg.getNodeToBlock().get(i) != b || i instanceof PhiNode || i instanceof LocalNode) { + if (i == null || visited.isMarked(i) || cfg.getNodeToBlock().get(i) != b || i instanceof PhiNode) { return; } @@ -1045,7 +1045,7 @@ private void addToEarliestSorting(Block b, ScheduledNode i, List<ScheduledNode> sortedInstructions, NodeBitMap visited) { ScheduledNode instruction = i; while (true) { - if (instruction == null || visited.isMarked(instruction) || cfg.getNodeToBlock().get(instruction) != b || instruction instanceof PhiNode || instruction instanceof LocalNode) { + if (instruction == null || visited.isMarked(instruction) || cfg.getNodeToBlock().get(instruction) != b || instruction instanceof PhiNode) { return; }
--- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/VirtualUtil.java Mon Sep 02 16:47:29 2013 +0200 +++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/VirtualUtil.java Mon Sep 02 20:44:49 2013 +0200 @@ -67,9 +67,6 @@ } for (Node node : graph.getNodes()) { - if (node instanceof LocalNode) { - flood.add(node); - } if (flood.isMarked(node)) { for (Node input : node.inputs()) { flood.add(input);