< prev index next >

test/compiler/uncommontrap/StackOverflowGuardPagesOff.java

Print this page
rev 11557 : 8132919: use package in compiler tests
Reviewed-by: duke


   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 
  24 /*
  25  * @test
  26  * @bug 8029383
  27  * @summary stack overflow if callee is marked for deoptimization causes crash
  28  * @run main/othervm -XX:TieredStopAtLevel=1 -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,StackOverflowGuardPagesOff::m1 -XX:CompileCommand=exclude,StackOverflowGuardPagesOff::m2 -Xss512K -XX:-UseOnStackReplacement StackOverflowGuardPagesOff
  29  *





  30  */
  31 


  32 // This test calls m2 recursively until a stack overflow. Then calls
  33 // m3 that calls m1. m1 triggers B's class loading, as a result m1 and
  34 // m3 needs to be deoptimized. Deoptimization of m1 causes a stack
  35 // overflow exception to be thrown which is propagated to m3 in the
  36 // deopt blob. If the guard pages are no enabled, the stack bang in
  37 // the deopt blob triggers a crash.
  38 public class StackOverflowGuardPagesOff {
  39 
  40     static class A {
  41         void m() {}
  42     }
  43 
  44     static class B extends A {
  45         void m() {}
  46     }
  47 
  48     static void m1(boolean deopt, A a) {
  49         long l0, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12,
  50         l13, l14, l15, l16, l17, l18, l19, l20, l21, l22, l23, l24,
  51         l25, l26, l27, l28, l29, l30, l31, l32, l33, l34, l35, l36,




   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 
  24 /*
  25  * @test
  26  * @bug 8029383
  27  * @summary stack overflow if callee is marked for deoptimization causes crash

  28  *
  29  * @run main/othervm -XX:TieredStopAtLevel=1 -XX:-BackgroundCompilation
  30  *      -XX:CompileCommand=dontinline,compiler.uncommontrap.StackOverflowGuardPagesOff::m1
  31  *      -XX:CompileCommand=exclude,compiler.uncommontrap.StackOverflowGuardPagesOff::m2
  32  *      -Xss512K -XX:-UseOnStackReplacement
  33  *      compiler.uncommontrap.StackOverflowGuardPagesOff
  34  */
  35 
  36 package compiler.uncommontrap;
  37 
  38 // This test calls m2 recursively until a stack overflow. Then calls
  39 // m3 that calls m1. m1 triggers B's class loading, as a result m1 and
  40 // m3 needs to be deoptimized. Deoptimization of m1 causes a stack
  41 // overflow exception to be thrown which is propagated to m3 in the
  42 // deopt blob. If the guard pages are no enabled, the stack bang in
  43 // the deopt blob triggers a crash.
  44 public class StackOverflowGuardPagesOff {
  45 
  46     static class A {
  47         void m() {}
  48     }
  49 
  50     static class B extends A {
  51         void m() {}
  52     }
  53 
  54     static void m1(boolean deopt, A a) {
  55         long l0, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12,
  56         l13, l14, l15, l16, l17, l18, l19, l20, l21, l22, l23, l24,
  57         l25, l26, l27, l28, l29, l30, l31, l32, l33, l34, l35, l36,


< prev index next >