2 * Back 2 Browser Bytecode Translator
3 * Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, version 2 of the License.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. Look for COPYING file in the top folder.
16 * If not, see http://opensource.org/licenses/GPL-2.0.
19 Java 4 Browser Bytecode Translator
20 Copyright (C) 2012-2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
22 This program is free software: you can redistribute it and/or modify
23 it under the terms of the GNU General Public License as published by
24 the Free Software Foundation, version 2 of the License.
26 This program is distributed in the hope that it will be useful,
27 but WITHOUT ANY WARRANTY; without even the implied warranty of
28 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 GNU General Public License for more details.
31 You should have received a copy of the GNU General Public License
32 along with this program. Look for COPYING file in the top folder.
33 If not, see http://opensource.org/licenses/GPL-2.0.
35 package org.apidesign.vm4brwsr;
39 * @author Jaroslav Tulach <jtulach@netbeans.org>
43 short[] shorts = { 2, 3 };
44 int[] ints = { 4, 5, 6 };
45 float[] floats = { 7, 8, 9, 10 };
46 double[][] doubles = { {11}, {12}, {13}, {14}, {15} };
47 char[] chars = { 'a', 'b' };
71 private static final Array[] ARR = { new Array(), new Array(), new Array() };
73 private static Array[] arr() {
76 private static <T> T[] filter(T[] in) {
80 public static double sum() {
82 for (int i = 0; i < arr().length; i++) {
83 sum += arr()[i].bytes();
84 sum += arr()[i].shorts();
85 sum += arr()[i].ints()[2];
86 sum += arr()[i].floats();
87 sum += filter(arr())[i].doubles();
91 public static int simple() {
92 int[] arr = { 0, 1, 2, 3, 4, 5 };
95 for (int i = 0; i < arr.length; i++) {
101 static void arraycopy(char[] value, int srcBegin, char[] dst, int dstBegin, int count) {
102 while (count-- > 0) {
103 dst[dstBegin++] = value[srcBegin++];
107 public static char copyArray() {
108 char[] arr = { '0' };
109 arraycopy(arr()[0].chars, 0, arr, 0, 1);