jdk

Форк
0
76 строк · 2.9 Кб
1
/*
2
 * Copyright (c) 2021, Google LLC. 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 input for the fix for JDK-8174954, which checks for an expected
26
 * IllegalAccessError when the parameter type of an invokedynamic is
27
 * inaccessible.
28
 *
29
 * The test assumes that given the string concatenation expression "" + param,
30
 * javac generates an invokedynamic that uses the specific type of param. The
31
 * fix for JDK-8273914 make javac eagerly convert param to a String before
32
 * passing it to the invokedynamic call, which avoids the accessibility issue
33
 * the test is trying to exercise.
34
 *
35
 * This jasm file contains the bytecode javac generated before the fix for
36
 * JDK-8273914, to continue to exercise the invokedynamic behaviour that
37
 * JDK-8174954 is testing.
38
 */
39

40
package  p5;
41

42
super public class c5
43
	version 61:0
44
{
45
  public Method "<init>":"()V"
46
	stack 1 locals 1
47
  {
48
		aload_0;
49
		invokespecial	Method java/lang/Object."<init>":"()V";
50
		return;
51
  }
52
  public Method method5:"(Lp2/c2;)V"
53
	stack 2 locals 2
54
  {
55
		getstatic	Field java/lang/System.out:"Ljava/io/PrintStream;";
56
		aload_1;
57
		invokedynamic	InvokeDynamic REF_invokeStatic:Method java/lang/invoke/StringConcatFactory.makeConcatWithConstants:"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;":makeConcatWithConstants:"(Lp2/c2;)Ljava/lang/String;" {
58
			String "In c5\'s method5 with param = "
59
		};
60
		invokevirtual	Method java/io/PrintStream.println:"(Ljava/lang/String;)V";
61
		return;
62
  }
63
  public Method methodAddReadEdge:"(Ljava/lang/Module;)V"
64
	stack 2 locals 2
65
  {
66
		ldc	class c5;
67
		invokevirtual	Method java/lang/Class.getModule:"()Ljava/lang/Module;";
68
		aload_1;
69
		invokevirtual	Method java/lang/Module.addReads:"(Ljava/lang/Module;)Ljava/lang/Module;";
70
		pop;
71
		return;
72
  }
73

74
  public static final InnerClass Lookup=class java/lang/invoke/MethodHandles$Lookup of class java/lang/invoke/MethodHandles;
75

76
} // end Class c5
77

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.