History

Various module and class updates in sun ns

Dmitry Kabak (userdima committed 13 years ago

Commit c9890111 parent f2982d48 files · +328 −38Browse files

Showing the changes to java/pkg (8 of 8 files). Show all

Unified · Split

8 files
  1. java/pkg/sun/misc/OSEnvironment.java +38 −0
  2. java/pkg/sun/misc/Unsafe.java +5 −4
  3. java/pkg/sun/misc/Unsafe_L.b +91 −26
  4. java/pkg/sun/misc/Unsafe_L.m +5 −5
  5. java/pkg/sun/misc/Version_L.b +66 −0
  6. java/pkg/sun/misc/Version_L.m +16 −0
  7. java/pkg/sun/nio/cs/FastCharsetProvider.java +0 −2
  8. java/pkg/sun/reflect/Reflection_L.b +107 −1
java/pkg/sun/misc/OSEnvironment.java+38−0
@@ -0,0 +1,38 @@
1/*
2 * Copyright (c) 2005, 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. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26package sun.misc;
27
28public class OSEnvironment {
29
30 /*
31 * Initialize any miscellenous operating system settings that need to be set
32 * for the class libraries.
33 */
34 public static void initialize() {
35 // no-op on Solaris and Linux
36 }
37
38}
java/pkg/sun/misc/Unsafe.java+5−4
@@ -43,7 +43,7 @@ public final class Unsafe { · 42 unmodified lines
43 private static native void registerNatives();43 private static native void registerNatives();
44 static {44 static {
45 registerNatives();45 registerNatives();
46 sun.reflect.Reflection.registerMethodsToFilter(Unsafe.class, "getUnsafe");46 //sun.reflect.Reflection.registerMethodsToFilter(Unsafe.class, "getUnsafe");
47 }47 }
48 48
49 private Unsafe() {}49 private Unsafe() {}
@@ -81,9 +81,10 @@ public final class Unsafe { · 31 unmodified lines
81 * access to the system properties.81 * access to the system properties.
82 */82 */
83 public static Unsafe getUnsafe() {83 public static Unsafe getUnsafe() {
84 Class cc = sun.reflect.Reflection.getCallerClass(2);84 // [Infenro] TODO: uncomment this! IMPORTANT
85 if (cc.getClassLoader() != null)85 //Class cc = sun.reflect.Reflection.getCallerClass(2);
86 throw new SecurityException("Unsafe");86 //if (cc.getClassLoader() != null)
87 // throw new SecurityException("Unsafe");
87 return theUnsafe;88 return theUnsafe;
88 }89 }
89 90
java/pkg/sun/misc/Unsafe_L.b+91−26
@@ -20,7 +20,7 @@ include "jni.m"; · 19 unmodified lines
20 JObject : import jni;20 JObject : import jni;
21 21
22#>> extra pre includes here22#>> extra pre includes here
23 23 low: Low;
24#<<24#<<
25 25
26include "Unsafe_L.m";26include "Unsafe_L.m";
@@ -34,285 +34,330 @@ init( jni_p : JNI ) · 7 unmodified lines
34 # save java native inteface mod instance34 # save java native inteface mod instance
35 jni = jni_p;35 jni = jni_p;
36 #>>extra initialization here36 #>>extra initialization here
37 low = jni->LowMod();
37 #<<38 #<<
38}39}
39 40
40allocateInstance_rClass_rObject( this : ref Unsafe_obj, p0 : JClass) : JObject41allocateInstance_rClass_rObject( this : ref Unsafe_obj, p0 : JClass) : JObject
41{#>>42{#>>
43 # FIXME
42 return nil;44 return nil;
43}#<<45}#<<
44 46
45copyMemory_rObject_J_rObject_J_J_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : JObject,p3 : big,p4 : big)47copyMemory_rObject_J_rObject_J_J_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : JObject,p3 : big,p4 : big)
46{#>>48{#>>
49 # FIXME
47}#<<50}#<<
48 51
49park_Z_J_V( this : ref Unsafe_obj, p0 : byte,p1 : big)52park_Z_J_V( this : ref Unsafe_obj, p0 : byte,p1 : big)
50{#>>53{#>>
54 # FIXME
51}#<<55}#<<
52 56
53unpark_rObject_V( this : ref Unsafe_obj, p0 : JObject)57unpark_rObject_V( this : ref Unsafe_obj, p0 : JObject)
54{#>>58{#>>
59 # FIXME
55}#<<60}#<<
56 61
57getObject_rObject_J_rObject( this : ref Unsafe_obj, p0 : JObject,p1 : big) : JObject62getObject_rObject_J_rObject( this : ref Unsafe_obj, p0 : JObject,p1 : big) : JObject
58{#>>63{#>>
59 return nil;64 return low->GetObj(p0.mod, int p1);
60}#<<65}#<<
61 66
62putObject_rObject_J_rObject_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : JObject)67putObject_rObject_J_rObject_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : JObject)
63{#>>68{#>>
69 low->SetObj(p0.mod, int p1, p2);
64}#<<70}#<<
65 71
66getBoolean_rObject_J_Z( this : ref Unsafe_obj, p0 : JObject,p1 : big) : byte72getBoolean_rObject_J_Z( this : ref Unsafe_obj, p0 : JObject,p1 : big) : int
67{#>>73{#>>
68 return byte 0;74 return low->GetInt(p0.mod, int p1);
69}#<<75}#<<
70 76
71putBoolean_rObject_J_Z_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : byte)77putBoolean_rObject_J_Z_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : int)
72{#>>78{#>>
79 low->SetInt(p0.mod, int p1, p2);
73}#<<80}#<<
74 81
75getByte_J_B( this : ref Unsafe_obj, p0 : big) : byte82getByte_J_B( this : ref Unsafe_obj, p0 : big) : byte
76{#>>83{#>>
84 # FIXME
77 return byte 0;85 return byte 0;
78}#<<86}#<<
79 87
80getByte_rObject_J_B( this : ref Unsafe_obj, p0 : JObject,p1 : big) : byte88getByte_rObject_J_B( this : ref Unsafe_obj, p0 : JObject,p1 : big) : byte
81{#>>89{#>>
82 return byte 0;90 return low->GetByte(p0.mod, int p1);
83}#<<91}#<<
84 92
85putByte_J_B_V( this : ref Unsafe_obj, p0 : big,p1 : byte)93putByte_J_B_V( this : ref Unsafe_obj, p0 : big,p1 : byte)
86{#>>94{#>>
95 # FIXME
87}#<<96}#<<
88 97
89putByte_rObject_J_B_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : byte)98putByte_rObject_J_B_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : byte)
90{#>>99{#>>
100 low->SetByte(p0.mod, int p1, p2);
91}#<<101}#<<
92 102
93getShort_rObject_J_S( this : ref Unsafe_obj, p0 : JObject,p1 : big) : int103getShort_rObject_J_S( this : ref Unsafe_obj, p0 : JObject,p1 : big) : int
94{#>>104{#>>
95 return 0;105 return low->GetInt(p0.mod, int p1);
96}#<<106}#<<
97 107
98getShort_J_S( this : ref Unsafe_obj, p0 : big) : int108getShort_J_S( this : ref Unsafe_obj, p0 : big) : int
99{#>>109{#>>
110 # FIXME
100 return 0;111 return 0;
101}#<<112}#<<
102 113
103putShort_rObject_J_S_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : int)114putShort_rObject_J_S_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : int)
104{#>>115{#>>
116 low->SetInt(p0.mod, int p1, p2);
105}#<<117}#<<
106 118
107putShort_J_S_V( this : ref Unsafe_obj, p0 : big,p1 : int)119putShort_J_S_V( this : ref Unsafe_obj, p0 : big,p1 : int)
108{#>>120{#>>
121 # FIXME
109}#<<122}#<<
110 123
111getChar_J_C( this : ref Unsafe_obj, p0 : big) : int124getChar_J_C( this : ref Unsafe_obj, p0 : big) : int
112{#>>125{#>>
126 # FIXME
113 return 0;127 return 0;
114}#<<128}#<<
115 129
116getChar_rObject_J_C( this : ref Unsafe_obj, p0 : JObject,p1 : big) : int130getChar_rObject_J_C( this : ref Unsafe_obj, p0 : JObject,p1 : big) : int
117{#>>131{#>>
118 return 0;132 return low->GetInt(p0.mod, int p1);
119}#<<133}#<<
120 134
121putChar_J_C_V( this : ref Unsafe_obj, p0 : big,p1 : int)135putChar_J_C_V( this : ref Unsafe_obj, p0 : big,p1 : int)
122{#>>136{#>>
137 # FIXME
123}#<<138}#<<
124 139
125putChar_rObject_J_C_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : int)140putChar_rObject_J_C_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : int)
126{#>>141{#>>
142 low->SetInt(p0.mod, int p1, p2);
127}#<<143}#<<
128 144
129getInt_rObject_J_I( this : ref Unsafe_obj, p0 : JObject,p1 : big) : int145getInt_rObject_J_I( this : ref Unsafe_obj, p0 : JObject,p1 : big) : int
130{#>>146{#>>
131 return 0;147 return low->GetInt(p0.mod, int p1);
132}#<<148}#<<
133 149
134getInt_J_I( this : ref Unsafe_obj, p0 : big) : int150getInt_J_I( this : ref Unsafe_obj, p0 : big) : int
135{#>>151{#>>
152 # FIXME
136 return 0;153 return 0;
137}#<<154}#<<
138 155
139putInt_J_I_V( this : ref Unsafe_obj, p0 : big,p1 : int)156putInt_J_I_V( this : ref Unsafe_obj, p0 : big,p1 : int)
140{#>>157{#>>
158 # FIXME
141}#<<159}#<<
142 160
143putInt_rObject_J_I_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : int)161putInt_rObject_J_I_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : int)
144{#>>162{#>>
163 low->SetInt(p0.mod, int p1, p2);
145}#<<164}#<<
146 165
147getLong_rObject_J_J( this : ref Unsafe_obj, p0 : JObject,p1 : big) : big166getLong_rObject_J_J( this : ref Unsafe_obj, p0 : JObject,p1 : big) : big
148{#>>167{#>>
149 return big 0;168 return low->GetBig(p0.mod, int p1);
150}#<<169}#<<
151 170
152getLong_J_J( this : ref Unsafe_obj, p0 : big) : big171getLong_J_J( this : ref Unsafe_obj, p0 : big) : big
153{#>>172{#>>
173 # FIXME
154 return big 0;174 return big 0;
155}#<<175}#<<
156 176
157putLong_J_J_V( this : ref Unsafe_obj, p0 : big,p1 : big)177putLong_J_J_V( this : ref Unsafe_obj, p0 : big,p1 : big)
158{#>>178{#>>
179 # FIXME
159}#<<180}#<<
160 181
161putLong_rObject_J_J_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : big)182putLong_rObject_J_J_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : big)
162{#>>183{#>>
184 low->SetBig(p0.mod, int p1, p2);
163}#<<185}#<<
164 186
165getFloat_J_F( this : ref Unsafe_obj, p0 : big) : real187getFloat_J_F( this : ref Unsafe_obj, p0 : big) : real
166{#>>188{#>>
189 # FIXME
167 return 0.0;190 return 0.0;
168}#<<191}#<<
169 192
170getFloat_rObject_J_F( this : ref Unsafe_obj, p0 : JObject,p1 : big) : real193getFloat_rObject_J_F( this : ref Unsafe_obj, p0 : JObject,p1 : big) : real
171{#>>194{#>>
172 return 0.0;195 return low->GetReal(p0.mod, int p1);
173}#<<196}#<<
174 197
175putFloat_J_F_V( this : ref Unsafe_obj, p0 : big,p1 : real)198putFloat_J_F_V( this : ref Unsafe_obj, p0 : big,p1 : real)
176{#>>199{#>>
200 # FIXME
177}#<<201}#<<
178 202
179putFloat_rObject_J_F_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : real)203putFloat_rObject_J_F_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : real)
180{#>>204{#>>
205 low->SetReal(p0.mod, int p1, p2);
181}#<<206}#<<
182 207
183getDouble_J_D( this : ref Unsafe_obj, p0 : big) : real208getDouble_J_D( this : ref Unsafe_obj, p0 : big) : real
184{#>>209{#>>
210 # FIXME
185 return 0.0;211 return 0.0;
186}#<<212}#<<
187 213
188getDouble_rObject_J_D( this : ref Unsafe_obj, p0 : JObject,p1 : big) : real214getDouble_rObject_J_D( this : ref Unsafe_obj, p0 : JObject,p1 : big) : real
189{#>>215{#>>
190 return 0.0;216 return low->GetReal(p0.mod, int p1);
191}#<<217}#<<
192 218
193putDouble_J_D_V( this : ref Unsafe_obj, p0 : big,p1 : real)219putDouble_J_D_V( this : ref Unsafe_obj, p0 : big,p1 : real)
194{#>>220{#>>
221 # FIXME
195}#<<222}#<<
196 223
197putDouble_rObject_J_D_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : real)224putDouble_rObject_J_D_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : real)
198{#>>225{#>>
226 low->SetReal(p0.mod, int p1, p2);
199}#<<227}#<<
200 228
201getObjectVolatile_rObject_J_rObject( this : ref Unsafe_obj, p0 : JObject,p1 : big) : JObject229getObjectVolatile_rObject_J_rObject( this : ref Unsafe_obj, p0 : JObject,p1 : big) : JObject
202{#>>230{#>>
203 return nil;231 return getObject_rObject_J_rObject(this, p0, p1);
204}#<<232}#<<
205 233
206putObjectVolatile_rObject_J_rObject_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : JObject)234putObjectVolatile_rObject_J_rObject_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : JObject)
207{#>>235{#>>
236 putObject_rObject_J_rObject_V(this, p0, p1, p2);
208}#<<237}#<<
209 238
210getBooleanVolatile_rObject_J_Z( this : ref Unsafe_obj, p0 : JObject,p1 : big) : byte239getBooleanVolatile_rObject_J_Z( this : ref Unsafe_obj, p0 : JObject,p1 : big) : int
211{#>>240{#>>
212 return byte 0;241 return getBoolean_rObject_J_Z(this, p0, p1);
213}#<<242}#<<
214 243
215putBooleanVolatile_rObject_J_Z_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : byte)244putBooleanVolatile_rObject_J_Z_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : int)
216{#>>245{#>>
246 putBoolean_rObject_J_Z_V(this, p0, p1, p2);
217}#<<247}#<<
218 248
219getByteVolatile_rObject_J_B( this : ref Unsafe_obj, p0 : JObject,p1 : big) : byte249getByteVolatile_rObject_J_B( this : ref Unsafe_obj, p0 : JObject,p1 : big) : byte
220{#>>250{#>>
221 return byte 0;251 return getByte_rObject_J_B(this, p0, p1);
222}#<<252}#<<
223 253
224putByteVolatile_rObject_J_B_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : byte)254putByteVolatile_rObject_J_B_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : byte)
225{#>>255{#>>
256 putByte_rObject_J_B_V(this, p0, p1, p2);
226}#<<257}#<<
227 258
228getShortVolatile_rObject_J_S( this : ref Unsafe_obj, p0 : JObject,p1 : big) : int259getShortVolatile_rObject_J_S( this : ref Unsafe_obj, p0 : JObject,p1 : big) : int
229{#>>260{#>>
230 return 0;261 return getShort_rObject_J_S(this, p0, p1);
231}#<<262}#<<
232 263
233putShortVolatile_rObject_J_S_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : int)264putShortVolatile_rObject_J_S_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : int)
234{#>>265{#>>
266 putShort_rObject_J_S_V(this, p0, p1, p2);
235}#<<267}#<<
236 268
237getCharVolatile_rObject_J_C( this : ref Unsafe_obj, p0 : JObject,p1 : big) : int269getCharVolatile_rObject_J_C( this : ref Unsafe_obj, p0 : JObject,p1 : big) : int
238{#>>270{#>>
239 return 0;271 return getChar_rObject_J_C(this, p0, p1);
240}#<<272}#<<
241 273
242putCharVolatile_rObject_J_C_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : int)274putCharVolatile_rObject_J_C_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : int)
243{#>>275{#>>
276 putChar_rObject_J_C_V(this, p0, p1, p2);
244}#<<277}#<<
245 278
246getIntVolatile_rObject_J_I( this : ref Unsafe_obj, p0 : JObject,p1 : big) : int279getIntVolatile_rObject_J_I( this : ref Unsafe_obj, p0 : JObject,p1 : big) : int
247{#>>280{#>>
248 return 0;281 return getInt_rObject_J_I(this, p0, p1);
249}#<<282}#<<
250 283
251putIntVolatile_rObject_J_I_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : int)284putIntVolatile_rObject_J_I_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : int)
252{#>>285{#>>
286 putInt_rObject_J_I_V(this, p0, p1, p2);
253}#<<287}#<<
254 288
255getLongVolatile_rObject_J_J( this : ref Unsafe_obj, p0 : JObject,p1 : big) : big289getLongVolatile_rObject_J_J( this : ref Unsafe_obj, p0 : JObject,p1 : big) : big
256{#>>290{#>>
257 return big 0;291 return getLong_rObject_J_J(this, p0, p1);
258}#<<292}#<<
259 293
260putLongVolatile_rObject_J_J_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : big)294putLongVolatile_rObject_J_J_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : big)
261{#>>295{#>>
296 putLong_rObject_J_J_V(this, p0, p1, p2);
262}#<<297}#<<
263 298
264getFloatVolatile_rObject_J_F( this : ref Unsafe_obj, p0 : JObject,p1 : big) : real299getFloatVolatile_rObject_J_F( this : ref Unsafe_obj, p0 : JObject,p1 : big) : real
265{#>>300{#>>
266 return 0.0;301 return getFloat_rObject_J_F(this, p0, p1);
267}#<<302}#<<
268 303
269putFloatVolatile_rObject_J_F_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : real)304putFloatVolatile_rObject_J_F_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : real)
270{#>>305{#>>
306 putFloat_rObject_J_F_V(this, p0, p1, p2);
271}#<<307}#<<
272 308
273getDoubleVolatile_rObject_J_D( this : ref Unsafe_obj, p0 : JObject,p1 : big) : real309getDoubleVolatile_rObject_J_D( this : ref Unsafe_obj, p0 : JObject,p1 : big) : real
274{#>>310{#>>
275 return 0.0;311 return getDouble_rObject_J_D(this, p0, p1);
276}#<<312}#<<
277 313
278putDoubleVolatile_rObject_J_D_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : real)314putDoubleVolatile_rObject_J_D_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : real)
279{#>>315{#>>
316 putDouble_rObject_J_D_V(this, p0, p1, p2);
280}#<<317}#<<
281 318
282getAddress_J_J( this : ref Unsafe_obj, p0 : big) : big319getAddress_J_J( this : ref Unsafe_obj, p0 : big) : big
283{#>>320{#>>
321 # FIXME
284 return big 0;322 return big 0;
285}#<<323}#<<
286 324
287putAddress_J_J_V( this : ref Unsafe_obj, p0 : big,p1 : big)325putAddress_J_J_V( this : ref Unsafe_obj, p0 : big,p1 : big)
288{#>>326{#>>
327 # FIXME
289}#<<328}#<<
290 329
291compareAndSwapObject_rObject_J_rObject_rObject_Z( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : JObject,p3 : JObject) : byte330compareAndSwapObject_rObject_J_rObject_rObject_Z( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : JObject,p3 : JObject) : byte
292{#>>331{#>>
332 # FIXME
293 return byte 0;333 return byte 0;
294}#<<334}#<<
295 335
296compareAndSwapLong_rObject_J_J_J_Z( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : big,p3 : big) : byte336compareAndSwapLong_rObject_J_J_J_Z( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : big,p3 : big) : byte
297{#>>337{#>>
338 # FIXME
298 return byte 0;339 return byte 0;
299}#<<340}#<<
300 341
301compareAndSwapInt_rObject_J_I_I_Z( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : int,p3 : int) : byte342compareAndSwapInt_rObject_J_I_I_Z( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : int,p3 : int) : byte
302{#>>343{#>>
344 # FIXME
303 return byte 0;345 return byte 0;
304}#<<346}#<<
305 347
306putOrderedObject_rObject_J_rObject_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : JObject)348putOrderedObject_rObject_J_rObject_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : JObject)
307{#>>349{#>>
350 putObject_rObject_J_rObject_V(this, p0, p1, p2);
308}#<<351}#<<
309 352
310putOrderedLong_rObject_J_J_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : big)353putOrderedLong_rObject_J_J_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : big)
311{#>>354{#>>
355 putOrderedLong_rObject_J_J_V(this, p0, p1, p2);
312}#<<356}#<<
313 357
314putOrderedInt_rObject_J_I_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : int)358putOrderedInt_rObject_J_I_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : int)
315{#>>359{#>>
360 putOrderedInt_rObject_J_I_V(this, p0, p1, p2);
316}#<<361}#<<
317 362
318registerNatives_V( )363registerNatives_V( )
@@ -321,95 +366,115 @@ registerNatives_V( ) · 2 unmodified lines
321 366
322throwException_rThrowable_V( this : ref Unsafe_obj, p0 : JObject)367throwException_rThrowable_V( this : ref Unsafe_obj, p0 : JObject)
323{#>>368{#>>
369 jni->Throw(p0);
324}#<<370}#<<
325 371
326defineClass_rString_aB_I_I_rClassLoader_rProtectionDomain_rClass( this : ref Unsafe_obj, p0 : JString,p1 : JArrayB,p2 : int,p3 : int,p4 : JObject,p5 : JObject) : JClass372defineClass_rString_aB_I_I_rClassLoader_rProtectionDomain_rClass( this : ref Unsafe_obj, p0 : JString,p1 : JArrayB,p2 : int,p3 : int,p4 : JObject,p5 : JObject) : JClass
327{#>>373{#>>
374 jni->FatalError("defineAnonymousClass is not implemented");
328 return nil;375 return nil;
329}#<<376}#<<
330 377
331defineClass_rString_aB_I_I_rClass( this : ref Unsafe_obj, p0 : JString,p1 : JArrayB,p2 : int,p3 : int) : JClass378defineClass_rString_aB_I_I_rClass( this : ref Unsafe_obj, p0 : JString,p1 : JArrayB,p2 : int,p3 : int) : JClass
332{#>>379{#>>
380 jni->FatalError("defineAnonymousClass is not implemented");
333 return nil;381 return nil;
334}#<<382}#<<
335 383
336objectFieldOffset_rField_J( this : ref Unsafe_obj, p0 : JObject) : big384objectFieldOffset_rField_J( this : ref Unsafe_obj, p0 : JObject) : big
337{#>>385{#>>
386 # FIXME
338 return big 0;387 return big 0;
339}#<<388}#<<
340 389
341staticFieldBase_rField_rObject( this : ref Unsafe_obj, p0 : JObject) : JObject390staticFieldBase_rField_rObject( this : ref Unsafe_obj, p0 : JObject) : JObject
342{#>>391{#>>
392 # FIXME
343 return nil;393 return nil;
344}#<<394}#<<
345 395
346allocateMemory_J_J( this : ref Unsafe_obj, p0 : big) : big396allocateMemory_J_J( this : ref Unsafe_obj, p0 : big) : big
347{#>>397{#>>
398 # FIXME
348 return big 0;399 return big 0;
349}#<<400}#<<
350 401
351reallocateMemory_J_J_J( this : ref Unsafe_obj, p0 : big,p1 : big) : big402reallocateMemory_J_J_J( this : ref Unsafe_obj, p0 : big,p1 : big) : big
352{#>>403{#>>
404 # FIXME
353 return big 0;405 return big 0;
354}#<<406}#<<
355 407
356setMemory_rObject_J_J_B_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : big,p3 : byte)408setMemory_rObject_J_J_B_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : big,p3 : byte)
357{#>>409{#>>
410 # FIXME
358}#<<411}#<<
359 412
360freeMemory_J_V( this : ref Unsafe_obj, p0 : big)413freeMemory_J_V( this : ref Unsafe_obj, p0 : big)
361{#>>414{#>>
415 # FIXME
362}#<<416}#<<
363 417
364staticFieldOffset_rField_J( this : ref Unsafe_obj, p0 : JObject) : big418staticFieldOffset_rField_J( this : ref Unsafe_obj, p0 : JObject) : big
365{#>>419{#>>
420 # FIXME
366 return big 0;421 return big 0;
367}#<<422}#<<
368 423
369ensureClassInitialized_rClass_V( this : ref Unsafe_obj, p0 : JClass)424ensureClassInitialized_rClass_V( this : ref Unsafe_obj, p0 : JClass)
370{#>>425{#>>
426 jni->FindClass(p0.class.name);
371}#<<427}#<<
372 428
373arrayBaseOffset_rClass_I( this : ref Unsafe_obj, p0 : JClass) : int429arrayBaseOffset_rClass_I( this : ref Unsafe_obj, p0 : JClass) : int
374{#>>430{#>>
431 # FIXME
375 return 0;432 return 0;
376}#<<433}#<<
377 434
378arrayIndexScale_rClass_I( this : ref Unsafe_obj, p0 : JClass) : int435arrayIndexScale_rClass_I( this : ref Unsafe_obj, p0 : JClass) : int
379{#>>436{#>>
437 # FIXME
380 return 0;438 return 0;
381}#<<439}#<<
382 440
383addressSize_I( this : ref Unsafe_obj) : int441addressSize_I( this : ref Unsafe_obj) : int
384{#>>442{#>>
385 return 0;443 # TODO: obtain that value somehow?
444 return 4;
386}#<<445}#<<
387 446
388pageSize_I( this : ref Unsafe_obj) : int447pageSize_I( this : ref Unsafe_obj) : int
389{#>>448{#>>
449 # FIXME
390 return 0;450 return 0;
391}#<<451}#<<
392 452
393defineAnonymousClass_rClass_aB_aObject_rClass( this : ref Unsafe_obj, p0 : JClass,p1 : JArrayB,p2 : JArrayJObject) : JClass453defineAnonymousClass_rClass_aB_aObject_rClass( this : ref Unsafe_obj, p0 : JClass,p1 : JArrayB,p2 : JArrayJObject) : JClass
394{#>>454{#>>
455 jni->FatalError("defineAnonymousClass is not implemented");
395 return nil;456 return nil;
396}#<<457}#<<
397 458
398monitorEnter_rObject_V( this : ref Unsafe_obj, p0 : JObject)459monitorEnter_rObject_V( this : ref Unsafe_obj, p0 : JObject)
399{#>>460{#>>
461 jni->MonitorEnter(p0);
400}#<<462}#<<
401 463
402monitorExit_rObject_V( this : ref Unsafe_obj, p0 : JObject)464monitorExit_rObject_V( this : ref Unsafe_obj, p0 : JObject)
403{#>>465{#>>
466 jni->MonitorExit(p0);
404}#<<467}#<<
405 468
406tryMonitorEnter_rObject_Z( this : ref Unsafe_obj, p0 : JObject) : byte469tryMonitorEnter_rObject_Z( this : ref Unsafe_obj, p0 : JObject) : int
407{#>>470{#>>
408 return byte 0;471 jni->MonitorEnter(p0);
472 return 1; # TODO: check something
409}#<<473}#<<
410 474
411getLoadAverage_aD_I_I( this : ref Unsafe_obj, p0 : JArrayD,p1 : int) : int475getLoadAverage_aD_I_I( this : ref Unsafe_obj, p0 : JArrayD,p1 : int) : int
412{#>>476{#>>
477 # FIXME
413 return 0;478 return 0;
414}#<<479}#<<
415 480
java/pkg/sun/misc/Unsafe_L.m+5−5
@@ -14,8 +14,8 @@ Unsafe_L : module · 13 unmodified lines
14 unpark_rObject_V : fn( this : ref Unsafe_obj, p0 : JObject);14 unpark_rObject_V : fn( this : ref Unsafe_obj, p0 : JObject);
15 getObject_rObject_J_rObject : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big) : JObject;15 getObject_rObject_J_rObject : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big) : JObject;
16 putObject_rObject_J_rObject_V : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : JObject);16 putObject_rObject_J_rObject_V : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : JObject);
17 getBoolean_rObject_J_Z : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big) : byte;17 getBoolean_rObject_J_Z : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big) : int;
18 putBoolean_rObject_J_Z_V : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : byte);18 putBoolean_rObject_J_Z_V : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : int);
19 getByte_J_B : fn( this : ref Unsafe_obj, p0 : big) : byte;19 getByte_J_B : fn( this : ref Unsafe_obj, p0 : big) : byte;
20 getByte_rObject_J_B : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big) : byte;20 getByte_rObject_J_B : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big) : byte;
21 putByte_J_B_V : fn( this : ref Unsafe_obj, p0 : big,p1 : byte);21 putByte_J_B_V : fn( this : ref Unsafe_obj, p0 : big,p1 : byte);
@@ -46,8 +46,8 @@ Unsafe_L : module · 24 unmodified lines
46 putDouble_rObject_J_D_V : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : real);46 putDouble_rObject_J_D_V : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : real);
47 getObjectVolatile_rObject_J_rObject : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big) : JObject;47 getObjectVolatile_rObject_J_rObject : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big) : JObject;
48 putObjectVolatile_rObject_J_rObject_V : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : JObject);48 putObjectVolatile_rObject_J_rObject_V : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : JObject);
49 getBooleanVolatile_rObject_J_Z : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big) : byte;49 getBooleanVolatile_rObject_J_Z : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big) : int;
50 putBooleanVolatile_rObject_J_Z_V : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : byte);50 putBooleanVolatile_rObject_J_Z_V : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : int);
51 getByteVolatile_rObject_J_B : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big) : byte;51 getByteVolatile_rObject_J_B : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big) : byte;
52 putByteVolatile_rObject_J_B_V : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : byte);52 putByteVolatile_rObject_J_B_V : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : byte);
53 getShortVolatile_rObject_J_S : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big) : int;53 getShortVolatile_rObject_J_S : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big) : int;
@@ -89,7 +89,7 @@ Unsafe_L : module · 35 unmodified lines
89 defineAnonymousClass_rClass_aB_aObject_rClass : fn( this : ref Unsafe_obj, p0 : JClass,p1 : JArrayB,p2 : JArrayJObject) : JClass;89 defineAnonymousClass_rClass_aB_aObject_rClass : fn( this : ref Unsafe_obj, p0 : JClass,p1 : JArrayB,p2 : JArrayJObject) : JClass;
90 monitorEnter_rObject_V : fn( this : ref Unsafe_obj, p0 : JObject);90 monitorEnter_rObject_V : fn( this : ref Unsafe_obj, p0 : JObject);
91 monitorExit_rObject_V : fn( this : ref Unsafe_obj, p0 : JObject);91 monitorExit_rObject_V : fn( this : ref Unsafe_obj, p0 : JObject);
92 tryMonitorEnter_rObject_Z : fn( this : ref Unsafe_obj, p0 : JObject) : byte;92 tryMonitorEnter_rObject_Z : fn( this : ref Unsafe_obj, p0 : JObject) : int;
93 getLoadAverage_aD_I_I : fn( this : ref Unsafe_obj, p0 : JArrayD,p1 : int) : int;93 getLoadAverage_aD_I_I : fn( this : ref Unsafe_obj, p0 : JArrayD,p1 : int) : int;
94 94
95};95};
java/pkg/sun/misc/Version_L.b+66−0
@@ -0,0 +1,66 @@
1implement Version_L;
2
3include "jni.m";
4 jni : JNI;
5 ClassModule,
6 JString,
7 JArray,
8 JArrayI,
9 JArrayC,
10 JArrayB,
11 JArrayS,
12 JArrayJ,
13 JArrayF,
14 JArrayD,
15 JArrayZ,
16 JArrayJObject,
17 JArrayJClass,
18 JArrayJString,
19 JClass,
20 JObject : import jni;
21
22#>> extra pre includes here
23
24#<<
25
26include "Version_L.m";
27
28#>> extra post includes here
29
30#<<
31
32init( jni_p : JNI )
33{
34 # save java native inteface mod instance
35 jni = jni_p;
36 #>>extra initialization here
37 #<<
38}
39
40getJvmSpecialVersion_rString( ) : JString
41{#>>
42 # official jvm returns empty string here,
43 # and I have no idea what should really be returned
44 return jni->NewString("");
45}#<<
46
47getJdkSpecialVersion_rString( ) : JString
48{#>>
49 # official jvm returns empty string here,
50 # and I have no idea what should really be returned
51 return jni->NewString("");
52}#<<
53
54getJvmVersionInfo_Z( ) : int
55{#>>
56 # TODO: implement
57 # returning false means that Version
58 # will parse info from java.vm.version prop
59 return 0;
60}#<<
61
62getJdkVersionInfo_V( )
63{#>>
64 # TODO: implement
65}#<<
66
java/pkg/sun/misc/Version_L.m+16−0
@@ -0,0 +1,16 @@
1# generated file edit with care
2
3Version_L : module
4{
5 Version_obj : adt
6 {
7 cl_mod : ClassModule;
8 };
9
10 init : fn( jni_p : JNI );
11 getJvmSpecialVersion_rString : fn( ) : JString;
12 getJdkSpecialVersion_rString : fn( ) : JString;
13 getJvmVersionInfo_Z : fn( ) : int;
14 getJdkVersionInfo_V : fn( );
15
16};
java/pkg/sun/nio/cs/FastCharsetProvider.java+0−2
@@ -119,8 +119,6 @@ public class FastCharsetProvider · 118 unmodified lines
119 Class c = Class.forName(packagePrefix + "." + cln,119 Class c = Class.forName(packagePrefix + "." + cln,
120 true,120 true,
121 this.getClass().getClassLoader());121 this.getClass().getClassLoader());
122 debugPrintString("===");
123 debugPrintString(c.getName());
124 cs = (Charset)c.newInstance();122 cs = (Charset)c.newInstance();
125 cache.put(csn, cs);123 cache.put(csn, cs);
126 return cs;124 return cs;
java/pkg/sun/reflect/Reflection_L.b+107−1
@@ -17,7 +17,8 @@ include "jni.m"; · 16 unmodified lines
17 JArrayJClass,17 JArrayJClass,
18 JArrayJString,18 JArrayJString,
19 JClass,19 JClass,
20 JObject : import jni;20 JObject,
21 Value : import jni;
21 22
22#>> extra pre includes here23#>> extra pre includes here
23 24
@@ -42,8 +43,113 @@ getClassAccessFlags_rClass_I( p0 : JClass) : int · 18 unmodified lines
42 return 0;43 return 0;
43}#<<44}#<<
44 45
46shouldskip(class: string): int
47{
48 skipclasses := array [] of {
49 "classloader.dis",
50 "javaassist.dis",
51 "jvm.dis",
52 "low.dis",
53 "jni.dis",
54 "sh.dis"
55 };
56 for (i := 0; i < len skipclasses; i++) {
57 l := len skipclasses[i];
58 # Check the string suffix equality
59 if (len class >= l && class[len class - l :] == skipclasses[i])
60 return 1;
61 }
62 return 0;
63}
64getstack(pid: int, ch: chan of list of string)
65{
66 stoppid(pid);
67
68 # Read stacktrace
69 stackfd := jni->sys->open("/prog/" + string pid + "/stack", jni->sys->OREAD);
70 buf := array [4096] of byte;
71 jni->sys->read(stackfd, buf, len buf);
72 stack := string buf;
73 # And then parse the data line by line
74 (nil, lines) := jni->sys->tokenize(stack, "\n");
75 stacklines: list of string;
76 for (it := lines; it != nil; it = tl it) {
77 (nitems, items) := jni->sys->tokenize(hd it, " ");
78 # Six's column is module name
79 if (nitems != 6)
80 continue;
81 stackclass := hd tl tl tl tl tl items;
82 # Skip jvm modules
83 if (!shouldskip(stackclass))
84 stacklines = stackclass :: stacklines;
85 }
86
87 # Reverse the list
88 result: list of string;
89 for (it = stacklines; it != nil; it = tl it)
90 result = hd it :: result;
91
92 resumepid(pid);
93
94 ch <-= result;
95}
96
97progcmd(pid: int, cmd: string)
98{
99 dbgfd := jni->sys->open("/prog/" + string pid + "/dbgctl", jni->sys->ORDWR);
100 jni->sys->fprint(dbgfd, "%s", cmd);
101}
102stoppid(pid: int)
103{
104 progcmd(pid, "stop");
105}
106resumepid(pid: int)
107{
108 progcmd(pid, "unstop");
109}
110
111classname(stackitem: string): string
112{
113 if (len stackitem > 2 && stackitem[:2] == "N-")
114 return stackitem[2:];
115 return stackitem;
116}
117forname(class: string): JClass
118{
119 {
120 if (class != nil && class[0] == '[')
121 return jni->LookupArrayClass(class);
122 else
123 return jni->GetClassObject(jni->InternalFindClass(class));
124 }
125 exception e {
126 "JLD:e0*" =>
127 jni->ThrowException( "java.lang.ClassNotFoundException", class);
128 }
129
130 return nil;
131}
132
45getCallerClass_I_rClass( p0 : int) : JClass133getCallerClass_I_rClass( p0 : int) : JClass
46{#>>134{#>>
135 # Some really dumb implementation
136 # TODO: think of better way to do this
137 pid := jni->sys->pctl(0, nil);
138 return nil;
139
140 stackch := chan of list of string;
141 spawn getstack(pid, stackch);
142 trace := <-stackch;
143
144 idx := 0;
145 for (it := trace; it != nil; it = tl it) {
146 if (idx++ == p0) {
147 class := classname(hd it);
148 jni->sys->fprint(jni->sys->fildes(2), "Returning '%s'\n", class);
149 return forname(class);
150 }
151 }
152
47 return nil;153 return nil;
48}#<<154}#<<
49 155