Mercurial > hg > truffle
annotate test/runtime/InitialThreadOverflow/DoOverflow.java @ 16734:7d7fae9e9d17
merge
author | Michael Haupt <michael.haupt@oracle.com> |
---|---|
date | Sat, 09 Aug 2014 08:51:01 -0700 |
parents | d8e99408faad |
children |
rev | line source |
---|---|
12144
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
1 /* |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
4 * |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
8 * |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
13 * accompanied this code). |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
14 * |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
18 * |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
21 * questions. |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
22 */ |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
23 |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
24 public class DoOverflow { |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
25 |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
26 static int count; |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
27 |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
28 public void overflow() { |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
29 count+=1; |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
30 overflow(); |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
31 } |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
32 |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
33 public static void printIt() { |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
34 System.out.println("Going to overflow stack"); |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
35 try { |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
36 new DoOverflow().overflow(); |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
37 } catch(java.lang.StackOverflowError e) { |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
38 System.out.println("Overflow OK " + count); |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
39 } |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
40 } |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
41 } |