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.phases.util;
24
25 import java.util.ArrayList;
26 import java.util.List;
27
28 import org.graalvm.compiler.core.common.cfg.Loop;
29 import org.graalvm.compiler.debug.Debug;
30 import org.graalvm.compiler.debug.GraalError;
31 import org.graalvm.compiler.graph.GraalGraphError;
32 import org.graalvm.compiler.graph.Node;
33 import org.graalvm.compiler.graph.NodeBitMap;
34 import org.graalvm.compiler.nodes.AbstractEndNode;
35 import org.graalvm.compiler.nodes.AbstractMergeNode;
36 import org.graalvm.compiler.nodes.ConstantNode;
37 import org.graalvm.compiler.nodes.EndNode;
38 import org.graalvm.compiler.nodes.FixedNode;
39 import org.graalvm.compiler.nodes.FrameState;
40 import org.graalvm.compiler.nodes.FullInfopointNode;
41 import org.graalvm.compiler.nodes.LoopBeginNode;
42 import org.graalvm.compiler.nodes.LoopExitNode;
43 import org.graalvm.compiler.nodes.PhiNode;
44 import org.graalvm.compiler.nodes.ProxyNode;
45 import org.graalvm.compiler.nodes.StateSplit;
46 import org.graalvm.compiler.nodes.StructuredGraph;
47 import org.graalvm.compiler.nodes.StructuredGraph.GuardsStage;
48 import org.graalvm.compiler.nodes.StructuredGraph.ScheduleResult;
49 import org.graalvm.compiler.nodes.ValueNode;
273 }
274 return result;
275 }
276
277 @Override
278 protected NodeBitMap getInitialState() {
279 NodeBitMap ret = graph.createNodeBitMap();
280 ret.markAll(graph.getNodes().filter(ConstantNode.class));
281 return ret;
282 }
283
284 @Override
285 protected NodeBitMap cloneState(NodeBitMap oldState) {
286 return oldState.copy();
287 }
288 };
289
290 ReentrantBlockIterator.apply(closure, schedule.getCFG().getStartBlock());
291
292 } catch (Throwable t) {
293 Debug.handle(t);
294 }
295 return true;
296 }
297 }
|
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.phases.util;
24
25 import java.util.ArrayList;
26 import java.util.List;
27
28 import org.graalvm.compiler.core.common.cfg.Loop;
29 import org.graalvm.compiler.debug.GraalError;
30 import org.graalvm.compiler.graph.GraalGraphError;
31 import org.graalvm.compiler.graph.Node;
32 import org.graalvm.compiler.graph.NodeBitMap;
33 import org.graalvm.compiler.nodes.AbstractEndNode;
34 import org.graalvm.compiler.nodes.AbstractMergeNode;
35 import org.graalvm.compiler.nodes.ConstantNode;
36 import org.graalvm.compiler.nodes.EndNode;
37 import org.graalvm.compiler.nodes.FixedNode;
38 import org.graalvm.compiler.nodes.FrameState;
39 import org.graalvm.compiler.nodes.FullInfopointNode;
40 import org.graalvm.compiler.nodes.LoopBeginNode;
41 import org.graalvm.compiler.nodes.LoopExitNode;
42 import org.graalvm.compiler.nodes.PhiNode;
43 import org.graalvm.compiler.nodes.ProxyNode;
44 import org.graalvm.compiler.nodes.StateSplit;
45 import org.graalvm.compiler.nodes.StructuredGraph;
46 import org.graalvm.compiler.nodes.StructuredGraph.GuardsStage;
47 import org.graalvm.compiler.nodes.StructuredGraph.ScheduleResult;
48 import org.graalvm.compiler.nodes.ValueNode;
272 }
273 return result;
274 }
275
276 @Override
277 protected NodeBitMap getInitialState() {
278 NodeBitMap ret = graph.createNodeBitMap();
279 ret.markAll(graph.getNodes().filter(ConstantNode.class));
280 return ret;
281 }
282
283 @Override
284 protected NodeBitMap cloneState(NodeBitMap oldState) {
285 return oldState.copy();
286 }
287 };
288
289 ReentrantBlockIterator.apply(closure, schedule.getCFG().getStartBlock());
290
291 } catch (Throwable t) {
292 graph.getDebug().handle(t);
293 }
294 return true;
295 }
296 }
|