< prev index next >

test/hotspot/jtreg/runtime/ReservedStack/ReservedStackTest.java

Print this page
rev 59383 : [mq]: final
   1 /*
   2  * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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  */


 220             long l20, l21, l22, l23, l24, l25, l26, l27, l28, l30, l31, l32, l33, l34, l35, l36, l37;
 221             counter++;
 222             try {
 223                 recursiveCall();
 224             } catch (StackOverflowError e) {
 225             }
 226             decounter--;
 227             if (decounter == 0) {
 228                 setupSOEFrame = counter;
 229                 testStartFrame = counter - deframe;
 230                 test.run();
 231             }
 232         }
 233     }
 234 
 235     private static boolean isAlwaysSupportedPlatform() {
 236         return Platform.isAix() ||
 237             (Platform.isLinux() &&
 238              (Platform.isPPC() || Platform.isS390x() || Platform.isX64() ||
 239               Platform.isX86() || Platform.isAArch64())) ||
 240             Platform.isOSX() ||
 241             Platform.isSolaris();
 242     }
 243 
 244     private static boolean isNeverSupportedPlatform() {
 245         return !isAlwaysSupportedPlatform();
 246     }
 247 
 248     private static boolean isSupportedPlatform;
 249 
 250     private static void initIsSupportedPlatform() throws Exception {
 251         // In order to dynamicaly determine if the platform supports the reserved
 252         // stack area, run with -XX:StackReservedPages=1 and see if we get the
 253         // expected warning message for platforms that don't support it.
 254         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:StackReservedPages=1", "-version");
 255         OutputAnalyzer output = new OutputAnalyzer(pb.start());
 256         System.out.println("StackReservedPages=1 log: [" + output.getOutput() + "]");
 257         if (output.getExitValue() != 0) {
 258             String msg = "Could not launch with -XX:StackReservedPages=1: exit " + output.getExitValue();
 259             System.err.println("FAILED: " + msg);
 260             throw new RuntimeException(msg);
 261         }


   1 /*
   2  * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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  */


 220             long l20, l21, l22, l23, l24, l25, l26, l27, l28, l30, l31, l32, l33, l34, l35, l36, l37;
 221             counter++;
 222             try {
 223                 recursiveCall();
 224             } catch (StackOverflowError e) {
 225             }
 226             decounter--;
 227             if (decounter == 0) {
 228                 setupSOEFrame = counter;
 229                 testStartFrame = counter - deframe;
 230                 test.run();
 231             }
 232         }
 233     }
 234 
 235     private static boolean isAlwaysSupportedPlatform() {
 236         return Platform.isAix() ||
 237             (Platform.isLinux() &&
 238              (Platform.isPPC() || Platform.isS390x() || Platform.isX64() ||
 239               Platform.isX86() || Platform.isAArch64())) ||
 240             Platform.isOSX();

 241     }
 242 
 243     private static boolean isNeverSupportedPlatform() {
 244         return !isAlwaysSupportedPlatform();
 245     }
 246 
 247     private static boolean isSupportedPlatform;
 248 
 249     private static void initIsSupportedPlatform() throws Exception {
 250         // In order to dynamicaly determine if the platform supports the reserved
 251         // stack area, run with -XX:StackReservedPages=1 and see if we get the
 252         // expected warning message for platforms that don't support it.
 253         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:StackReservedPages=1", "-version");
 254         OutputAnalyzer output = new OutputAnalyzer(pb.start());
 255         System.out.println("StackReservedPages=1 log: [" + output.getOutput() + "]");
 256         if (output.getExitValue() != 0) {
 257             String msg = "Could not launch with -XX:StackReservedPages=1: exit " + output.getExitValue();
 258             System.err.println("FAILED: " + msg);
 259             throw new RuntimeException(msg);
 260         }


< prev index next >