1 /*
2 * Copyright (c) 2013, 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 */
23
24 /*
25 * @test
26 * @bug 8027232
27 * @summary ensures that j.l.i.InvokerByteCodeGenerator and ASM visitMethodInsn
28 * generate bytecodes with correct constant pool references
29 * @modules java.base/jdk.internal.org.objectweb.asm
30 * jdk.jdeps/com.sun.tools.classfile
31 * @compile -XDignore.symbol.file LambdaAsm.java LUtils.java
32 * @run main/othervm LambdaAsm
33 */
34 import com.sun.tools.classfile.Attribute;
35 import com.sun.tools.classfile.ClassFile;
36 import com.sun.tools.classfile.Code_attribute;
37 import com.sun.tools.classfile.ConstantPool;
38 import com.sun.tools.classfile.ConstantPool.CPInfo;
39 import com.sun.tools.classfile.Instruction;
40 import com.sun.tools.classfile.Method;
41 import java.io.ByteArrayInputStream;
42 import java.io.File;
43 import java.util.ArrayList;
44 import java.nio.file.DirectoryStream;
45 import java.nio.file.Path;
46 import jdk.internal.org.objectweb.asm.ClassWriter;
47 import jdk.internal.org.objectweb.asm.MethodVisitor;
48
49 import static java.nio.file.Files.*;
50 import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
1 /*
2 * Copyright (c) 2013, 2015, 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 */
23
24 /*
25 * @test
26 * @bug 8027232
27 * @summary ensures that j.l.i.InvokerByteCodeGenerator and ASM visitMethodInsn
28 * generate bytecodes with correct constant pool references
29 * @modules java.base/jdk.internal.org.objectweb.asm
30 * jdk.jdeps/com.sun.tools.classfile
31 * jdk.compiler
32 * @compile -XDignore.symbol.file LambdaAsm.java LUtils.java
33 * @run main/othervm LambdaAsm
34 */
35 import com.sun.tools.classfile.Attribute;
36 import com.sun.tools.classfile.ClassFile;
37 import com.sun.tools.classfile.Code_attribute;
38 import com.sun.tools.classfile.ConstantPool;
39 import com.sun.tools.classfile.ConstantPool.CPInfo;
40 import com.sun.tools.classfile.Instruction;
41 import com.sun.tools.classfile.Method;
42 import java.io.ByteArrayInputStream;
43 import java.io.File;
44 import java.util.ArrayList;
45 import java.nio.file.DirectoryStream;
46 import java.nio.file.Path;
47 import jdk.internal.org.objectweb.asm.ClassWriter;
48 import jdk.internal.org.objectweb.asm.MethodVisitor;
49
50 import static java.nio.file.Files.*;
51 import static jdk.internal.org.objectweb.asm.Opcodes.*;
|