# HG changeset patch # User Thomas Wuerthinger # Date 1451737608 -3600 # Node ID d455abbf413d60beed1aee51d01ecd196c393fc6 # Parent 9f6dc0676de29c49d0d87d84cdaceb131bf60405 Do not peel loops with loop exits that unwind. diff -r 9f6dc0676de2 -r d455abbf413d graal/com.oracle.graal.loop/src/com/oracle/graal/loop/DefaultLoopPolicies.java --- a/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/DefaultLoopPolicies.java Sat Jan 02 12:46:21 2016 +0100 +++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/DefaultLoopPolicies.java Sat Jan 02 13:26:48 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, 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 @@ -28,11 +28,14 @@ import java.util.List; +import jdk.vm.ci.code.BytecodeFrame; + import com.oracle.graal.debug.Debug; import com.oracle.graal.debug.DebugMetric; import com.oracle.graal.graph.Node; import com.oracle.graal.nodes.AbstractBeginNode; import com.oracle.graal.nodes.ControlSplitNode; +import com.oracle.graal.nodes.FrameState; import com.oracle.graal.nodes.LoopBeginNode; import com.oracle.graal.nodes.MergeNode; import com.oracle.graal.nodes.VirtualState; @@ -67,6 +70,12 @@ if (node instanceof ControlFlowAnchorNode) { return false; } + if (node instanceof FrameState) { + FrameState frameState = (FrameState) node; + if (frameState.bci == BytecodeFrame.AFTER_EXCEPTION_BCI || frameState.bci == BytecodeFrame.UNWIND_BCI) { + return false; + } + } } return true; } else {