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 /**
26 * @test
27 * @bug 6732154
28 * @summary REG: Printing an Image using image/gif doc flavor crashes the VM, Solsparc
29 *
30 * @run main/othervm -Xcomp -XX:CompileOnly="Test6732154::ascii85Encode" Test6732154
31 */
32 public class Test6732154 {
33
34 // Exact copy of sun.print.PSPrinterJob.ascii85Encode([b)[b
35 private byte[] ascii85Encode(byte[] inArr) {
36 byte[] outArr = new byte[((inArr.length+4) * 5 / 4) + 2];
37 long p1 = 85;
38 long p2 = p1*p1;
39 long p3 = p1*p2;
40 long p4 = p1*p3;
41 byte pling = '!';
42
43 int i = 0;
44 int olen = 0;
45 long val, rem;
46
47 while (i+3 < inArr.length) {
48 val = ((long)((inArr[i++]&0xff))<<24) +
49 ((long)((inArr[i++]&0xff))<<16) +
50 ((long)((inArr[i++]&0xff))<< 8) +
51 ((long)(inArr[i++]&0xff));
|
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 /**
26 * @test
27 * @bug 6732154
28 * @summary REG: Printing an Image using image/gif doc flavor crashes the VM, Solsparc
29 *
30 * @run main/othervm -Xcomp
31 * -XX:CompileCommand=compileonly,compiler.c2.Test6732154::ascii85Encode
32 * compiler.c2.Test6732154
33 */
34
35 package compiler.c2;
36
37 public class Test6732154 {
38
39 // Exact copy of sun.print.PSPrinterJob.ascii85Encode([b)[b
40 private byte[] ascii85Encode(byte[] inArr) {
41 byte[] outArr = new byte[((inArr.length+4) * 5 / 4) + 2];
42 long p1 = 85;
43 long p2 = p1*p1;
44 long p3 = p1*p2;
45 long p4 = p1*p3;
46 byte pling = '!';
47
48 int i = 0;
49 int olen = 0;
50 long val, rem;
51
52 while (i+3 < inArr.length) {
53 val = ((long)((inArr[i++]&0xff))<<24) +
54 ((long)((inArr[i++]&0xff))<<16) +
55 ((long)((inArr[i++]&0xff))<< 8) +
56 ((long)(inArr[i++]&0xff));
|