Mercurial > hg > truffle
annotate test/compiler/6800154/Test6800154.java @ 12510:11dc3108904f
Fix NodeClass.getFirstLevel(Input|Successor)Positions to use the NODE_LIST constant instead of 0
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Tue, 22 Oct 2013 10:31:32 +0200 |
parents | c18cbe5936b8 |
children |
rev | line source |
---|---|
567
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
1 /* |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
567
diff
changeset
|
2 * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. |
567
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
4 * |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
8 * |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
13 * accompanied this code). |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
14 * |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
18 * |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
567
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
567
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
567
diff
changeset
|
21 * questions. |
567
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
22 */ |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
23 |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
24 /** |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
25 * @test |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
26 * @bug 6800154 |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
27 * @summary Add comments to long_by_long_mulhi() for better understandability |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
28 * |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
29 * @run main/othervm -Xcomp -XX:CompileOnly=Test6800154.divcomp Test6800154 |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
30 */ |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
31 |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
32 import java.net.URLClassLoader; |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
33 |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
34 public class Test6800154 implements Runnable { |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
35 static final long[] DIVIDENDS = { |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
36 0, |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
37 1, |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
38 2, |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
39 1423487, |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
40 4444441, |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
41 4918923241323L, |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
42 -1, |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
43 -24351, |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
44 0x3333, |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
45 0x0000000080000000L, |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
46 0x7fffffffffffffffL, |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
47 0x8000000000000000L |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
48 }; |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
49 |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
50 static final long[] DIVISORS = { |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
51 1, |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
52 2, |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
53 17, |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
54 12342, |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
55 24123, |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
56 143444, |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
57 123444442344L, |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
58 -1, |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
59 -2, |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
60 -4423423234231423L, |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
61 0x0000000080000000L, |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
62 0x7fffffffffffffffL, |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
63 0x8000000000000000L |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
64 }; |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
65 |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
66 // Initialize DIVISOR so that it is final in this class. |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
67 static final long DIVISOR; |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
68 |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
69 static { |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
70 long value = 0; |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
71 try { |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
72 value = Long.decode(System.getProperty("divisor")); |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
73 } catch (Throwable e) { |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
74 } |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
75 DIVISOR = value; |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
76 } |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
77 |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
78 public static void main(String[] args) throws Exception |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
79 { |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
80 Class cl = Class.forName("Test6800154"); |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
81 URLClassLoader apploader = (URLClassLoader) cl.getClassLoader(); |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
82 |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
83 // Iterate over all divisors. |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
84 for (int i = 0; i < DIVISORS.length; i++) { |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
85 System.setProperty("divisor", "" + DIVISORS[i]); |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
86 ClassLoader loader = new URLClassLoader(apploader.getURLs(), apploader.getParent()); |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
87 Class c = loader.loadClass("Test6800154"); |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
88 Runnable r = (Runnable) c.newInstance(); |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
89 r.run(); |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
90 } |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
91 } |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
92 |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
93 public void run() |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
94 { |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
95 // Iterate over all dividends. |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
96 for (int i = 0; i < DIVIDENDS.length; i++) { |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
97 long dividend = DIVIDENDS[i]; |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
98 |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
99 long expected = divint(dividend); |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
100 long result = divcomp(dividend); |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
101 |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
102 if (result != expected) |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
103 throw new InternalError(dividend + " / " + DIVISOR + " failed: " + result + " != " + expected); |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
104 } |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
105 } |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
106 |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
107 static long divint(long a) { return a / DIVISOR; } |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
108 static long divcomp(long a) { return a / DIVISOR; } |
bbef4344adb2
6800154: Add comments to long_by_long_mulhi() for better understandability
twisti
parents:
diff
changeset
|
109 } |