author | alanb |
Fri, 07 Apr 2017 08:04:46 +0000 | |
changeset 44520 | 0553e129e0ec |
parent 43665 | 4bb003cad9b9 |
permissions | -rw-r--r-- |
36508 | 1 |
/* |
43665
4bb003cad9b9
8173393: Module system implementation refresh (2/2017)
alanb
parents:
36508
diff
changeset
|
2 |
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. |
36508 | 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 |
* package p3; |
|
26 |
* public class c3ReadEdge { |
|
27 |
* public c3ReadEdge() { |
|
43665
4bb003cad9b9
8173393: Module system implementation refresh (2/2017)
alanb
parents:
36508
diff
changeset
|
28 |
* // Establish read edge from module m1x, where c3ReadEdge is defined, |
36508 | 29 |
* // to the unnamed module, where c4 will be defined. |
43665
4bb003cad9b9
8173393: Module system implementation refresh (2/2017)
alanb
parents:
36508
diff
changeset
|
30 |
* Module m1x = c3ReadEdge.class.getModule(); |
36508 | 31 |
* ClassLoader loader = c3ReadEdge.class.getClassLoader(); |
32 |
* Module unnamed_module = loader.getUnnamedModule(); |
|
43665
4bb003cad9b9
8173393: Module system implementation refresh (2/2017)
alanb
parents:
36508
diff
changeset
|
33 |
* m1x.addReads(unnamed_module); |
36508 | 34 |
* // Attempt access - access should succeed |
35 |
* c4 c4_obj = new c4(); |
|
36 |
* c4_obj.method4(); |
|
37 |
* } |
|
38 |
* } |
|
39 |
*/ |
|
40 |
||
41 |
class p3/c3ReadEdge { |
|
42 |
0xCAFEBABE; |
|
43 |
0; // minor version |
|
44 |
52; // version |
|
45 |
[40] { // Constant Pool |
|
46 |
; // first element is empty |
|
47 |
Method #10 #17; // #1 at 0x0A |
|
48 |
class #18; // #2 at 0x0F |
|
49 |
Method #19 #20; // #3 at 0x12 |
|
50 |
Method #19 #21; // #4 at 0x17 |
|
51 |
Method #22 #23; // #5 at 0x1C |
|
52 |
Method #24 #25; // #6 at 0x21 |
|
53 |
class #26; // #7 at 0x26 |
|
54 |
Method #7 #17; // #8 at 0x29 |
|
55 |
Method #7 #27; // #9 at 0x2E |
|
56 |
class #28; // #10 at 0x33 |
|
57 |
Utf8 "<init>"; // #11 at 0x36 |
|
58 |
Utf8 "()V"; // #12 at 0x3F |
|
59 |
Utf8 "Code"; // #13 at 0x45 |
|
60 |
Utf8 "LineNumberTable"; // #14 at 0x4C |
|
61 |
Utf8 "SourceFile"; // #15 at 0x5E |
|
62 |
Utf8 "c3ReadEdge.java"; // #16 at 0x6B |
|
63 |
NameAndType #11 #12; // #17 at 0x7D |
|
64 |
Utf8 "p3/c3ReadEdge"; // #18 at 0x82 |
|
65 |
class #29; // #19 at 0x92 |
|
66 |
NameAndType #30 #31; // #20 at 0x95 |
|
67 |
NameAndType #32 #33; // #21 at 0x9A |
|
68 |
class #34; // #22 at 0x9F |
|
69 |
NameAndType #35 #31; // #23 at 0xA2 |
|
70 |
class #36; // #24 at 0xA7 |
|
71 |
NameAndType #37 #38; // #25 at 0xAA |
|
72 |
Utf8 "c4"; // #26 at 0xAF |
|
73 |
NameAndType #39 #12; // #27 at 0xB7 |
|
74 |
Utf8 "java/lang/Object"; // #28 at 0xBC |
|
75 |
Utf8 "java/lang/Class"; // #29 at 0xCF |
|
76 |
Utf8 "getModule"; // #30 at 0xE1 |
|
44520
0553e129e0ec
8177530: Module system implementation refresh (4/2017)
alanb
parents:
43665
diff
changeset
|
77 |
Utf8 "()Ljava/lang/Module;"; // #31 at 0xED |
36508 | 78 |
Utf8 "getClassLoader"; // #32 at 0x010C |
79 |
Utf8 "()Ljava/lang/ClassLoader;"; // #33 at 0x011D |
|
80 |
Utf8 "java/lang/ClassLoader"; // #34 at 0x0139 |
|
81 |
Utf8 "getUnnamedModule"; // #35 at 0x0151 |
|
44520
0553e129e0ec
8177530: Module system implementation refresh (4/2017)
alanb
parents:
43665
diff
changeset
|
82 |
Utf8 "java/lang/Module"; // #36 at 0x0164 |
36508 | 83 |
Utf8 "addReads"; // #37 at 0x017F |
44520
0553e129e0ec
8177530: Module system implementation refresh (4/2017)
alanb
parents:
43665
diff
changeset
|
84 |
Utf8 "(Ljava/lang/Module;)Ljava/lang/Module;"; // #38 at 0x018A |
36508 | 85 |
Utf8 "method4"; // #39 at 0x01C3 |
86 |
} // Constant Pool |
|
87 |
||
88 |
0x0021; // access |
|
89 |
#2;// this_cpx |
|
90 |
#10;// super_cpx |
|
91 |
||
92 |
[0] { // Interfaces |
|
93 |
} // Interfaces |
|
94 |
||
95 |
[0] { // fields |
|
96 |
} // fields |
|
97 |
||
98 |
[1] { // methods |
|
99 |
{ // Member at 0x01D9 |
|
100 |
0x0001; // access |
|
101 |
#11; // name_cpx |
|
102 |
#12; // sig_cpx |
|
103 |
[1] { // Attributes |
|
104 |
Attr(#13, 94) { // Code at 0x01E1 |
|
105 |
2; // max_stack |
|
106 |
5; // max_locals |
|
107 |
Bytes[42]{ |
|
108 |
0x2AB700011202B600; |
|
109 |
0x034C1202B600044D; |
|
110 |
0x2CB600054E2B2DB6; |
|
111 |
0x000657BB000759B7; |
|
112 |
0x00083A041904B600; |
|
113 |
0x09B1; |
|
114 |
}; |
|
115 |
[0] { // Traps |
|
116 |
} // end Traps |
|
117 |
[1] { // Attributes |
|
118 |
Attr(#14, 34) { // LineNumberTable at 0x021D |
|
119 |
[8] { // LineNumberTable |
|
120 |
0 32; // at 0x0229 |
|
121 |
4 38; // at 0x022D |
|
122 |
10 39; // at 0x0231 |
|
123 |
16 40; // at 0x0235 |
|
124 |
21 41; // at 0x0239 |
|
125 |
27 44; // at 0x023D |
|
126 |
36 45; // at 0x0241 |
|
127 |
41 46; // at 0x0245 |
|
128 |
} |
|
129 |
} // end LineNumberTable |
|
130 |
} // Attributes |
|
131 |
} // end Code |
|
132 |
} // Attributes |
|
133 |
} // Member |
|
134 |
} // methods |
|
135 |
||
136 |
[1] { // Attributes |
|
137 |
Attr(#15, 2) { // SourceFile at 0x0247 |
|
138 |
#16; |
|
139 |
} // end SourceFile |
|
140 |
} // Attributes |
|
141 |
} // end class p3/c3ReadEdge |