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 (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+
26+package sun.misc;
27+
28+public 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
4343 private static native void registerNatives();
4444 static {
4545 registerNatives();
46− sun.reflect.Reflection.registerMethodsToFilter(Unsafe.class, "getUnsafe");
46+ //sun.reflect.Reflection.registerMethodsToFilter(Unsafe.class, "getUnsafe");
4747 }
4848
4949 private Unsafe() {}
@@ -81,9 +81,10 @@ public final class Unsafe { · 31 unmodified lines
8181 * access to the system properties.
8282 */
8383 public static Unsafe getUnsafe() {
84− Class cc = sun.reflect.Reflection.getCallerClass(2);
85− if (cc.getClassLoader() != null)
86− throw new SecurityException("Unsafe");
84+ // [Infenro] TODO: uncomment this! IMPORTANT
85+ //Class cc = sun.reflect.Reflection.getCallerClass(2);
86+ //if (cc.getClassLoader() != null)
87+ // throw new SecurityException("Unsafe");
8788 return theUnsafe;
8889 }
8990
java/pkg/sun/misc/Unsafe_L.b+91−26
@@ -20,7 +20,7 @@ include "jni.m"; · 19 unmodified lines
2020 JObject : import jni;
2121
2222 #>> extra pre includes here
23−
23+ low: Low;
2424 #<<
2525
2626 include "Unsafe_L.m";
@@ -34,285 +34,330 @@ init( jni_p : JNI ) · 7 unmodified lines
3434 # save java native inteface mod instance
3535 jni = jni_p;
3636 #>>extra initialization here
37+ low = jni->LowMod();
3738 #<<
3839 }
3940
4041 allocateInstance_rClass_rObject( this : ref Unsafe_obj, p0 : JClass) : JObject
4142 {#>>
43+ # FIXME
4244 return nil;
4345 }#<<
4446
4547 copyMemory_rObject_J_rObject_J_J_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : JObject,p3 : big,p4 : big)
4648 {#>>
49+ # FIXME
4750 }#<<
4851
4952 park_Z_J_V( this : ref Unsafe_obj, p0 : byte,p1 : big)
5053 {#>>
54+ # FIXME
5155 }#<<
5256
5357 unpark_rObject_V( this : ref Unsafe_obj, p0 : JObject)
5458 {#>>
59+ # FIXME
5560 }#<<
5661
5762 getObject_rObject_J_rObject( this : ref Unsafe_obj, p0 : JObject,p1 : big) : JObject
5863 {#>>
59− return nil;
64+ return low->GetObj(p0.mod, int p1);
6065 }#<<
6166
6267 putObject_rObject_J_rObject_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : JObject)
6368 {#>>
69+ low->SetObj(p0.mod, int p1, p2);
6470 }#<<
6571
66−getBoolean_rObject_J_Z( this : ref Unsafe_obj, p0 : JObject,p1 : big) : byte
72+getBoolean_rObject_J_Z( this : ref Unsafe_obj, p0 : JObject,p1 : big) : int
6773 {#>>
68− return byte 0;
74+ return low->GetInt(p0.mod, int p1);
6975 }#<<
7076
71−putBoolean_rObject_J_Z_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : byte)
77+putBoolean_rObject_J_Z_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : int)
7278 {#>>
79+ low->SetInt(p0.mod, int p1, p2);
7380 }#<<
7481
7582 getByte_J_B( this : ref Unsafe_obj, p0 : big) : byte
7683 {#>>
84+ # FIXME
7785 return byte 0;
7886 }#<<
7987
8088 getByte_rObject_J_B( this : ref Unsafe_obj, p0 : JObject,p1 : big) : byte
8189 {#>>
82− return byte 0;
90+ return low->GetByte(p0.mod, int p1);
8391 }#<<
8492
8593 putByte_J_B_V( this : ref Unsafe_obj, p0 : big,p1 : byte)
8694 {#>>
95+ # FIXME
8796 }#<<
8897
8998 putByte_rObject_J_B_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : byte)
9099 {#>>
100+ low->SetByte(p0.mod, int p1, p2);
91101 }#<<
92102
93103 getShort_rObject_J_S( this : ref Unsafe_obj, p0 : JObject,p1 : big) : int
94104 {#>>
95− return 0;
105+ return low->GetInt(p0.mod, int p1);
96106 }#<<
97107
98108 getShort_J_S( this : ref Unsafe_obj, p0 : big) : int
99109 {#>>
110+ # FIXME
100111 return 0;
101112 }#<<
102113
103114 putShort_rObject_J_S_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : int)
104115 {#>>
116+ low->SetInt(p0.mod, int p1, p2);
105117 }#<<
106118
107119 putShort_J_S_V( this : ref Unsafe_obj, p0 : big,p1 : int)
108120 {#>>
121+ # FIXME
109122 }#<<
110123
111124 getChar_J_C( this : ref Unsafe_obj, p0 : big) : int
112125 {#>>
126+ # FIXME
113127 return 0;
114128 }#<<
115129
116130 getChar_rObject_J_C( this : ref Unsafe_obj, p0 : JObject,p1 : big) : int
117131 {#>>
118− return 0;
132+ return low->GetInt(p0.mod, int p1);
119133 }#<<
120134
121135 putChar_J_C_V( this : ref Unsafe_obj, p0 : big,p1 : int)
122136 {#>>
137+ # FIXME
123138 }#<<
124139
125140 putChar_rObject_J_C_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : int)
126141 {#>>
142+ low->SetInt(p0.mod, int p1, p2);
127143 }#<<
128144
129145 getInt_rObject_J_I( this : ref Unsafe_obj, p0 : JObject,p1 : big) : int
130146 {#>>
131− return 0;
147+ return low->GetInt(p0.mod, int p1);
132148 }#<<
133149
134150 getInt_J_I( this : ref Unsafe_obj, p0 : big) : int
135151 {#>>
152+ # FIXME
136153 return 0;
137154 }#<<
138155
139156 putInt_J_I_V( this : ref Unsafe_obj, p0 : big,p1 : int)
140157 {#>>
158+ # FIXME
141159 }#<<
142160
143161 putInt_rObject_J_I_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : int)
144162 {#>>
163+ low->SetInt(p0.mod, int p1, p2);
145164 }#<<
146165
147166 getLong_rObject_J_J( this : ref Unsafe_obj, p0 : JObject,p1 : big) : big
148167 {#>>
149− return big 0;
168+ return low->GetBig(p0.mod, int p1);
150169 }#<<
151170
152171 getLong_J_J( this : ref Unsafe_obj, p0 : big) : big
153172 {#>>
173+ # FIXME
154174 return big 0;
155175 }#<<
156176
157177 putLong_J_J_V( this : ref Unsafe_obj, p0 : big,p1 : big)
158178 {#>>
179+ # FIXME
159180 }#<<
160181
161182 putLong_rObject_J_J_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : big)
162183 {#>>
184+ low->SetBig(p0.mod, int p1, p2);
163185 }#<<
164186
165187 getFloat_J_F( this : ref Unsafe_obj, p0 : big) : real
166188 {#>>
189+ # FIXME
167190 return 0.0;
168191 }#<<
169192
170193 getFloat_rObject_J_F( this : ref Unsafe_obj, p0 : JObject,p1 : big) : real
171194 {#>>
172− return 0.0;
195+ return low->GetReal(p0.mod, int p1);
173196 }#<<
174197
175198 putFloat_J_F_V( this : ref Unsafe_obj, p0 : big,p1 : real)
176199 {#>>
200+ # FIXME
177201 }#<<
178202
179203 putFloat_rObject_J_F_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : real)
180204 {#>>
205+ low->SetReal(p0.mod, int p1, p2);
181206 }#<<
182207
183208 getDouble_J_D( this : ref Unsafe_obj, p0 : big) : real
184209 {#>>
210+ # FIXME
185211 return 0.0;
186212 }#<<
187213
188214 getDouble_rObject_J_D( this : ref Unsafe_obj, p0 : JObject,p1 : big) : real
189215 {#>>
190− return 0.0;
216+ return low->GetReal(p0.mod, int p1);
191217 }#<<
192218
193219 putDouble_J_D_V( this : ref Unsafe_obj, p0 : big,p1 : real)
194220 {#>>
221+ # FIXME
195222 }#<<
196223
197224 putDouble_rObject_J_D_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : real)
198225 {#>>
226+ low->SetReal(p0.mod, int p1, p2);
199227 }#<<
200228
201229 getObjectVolatile_rObject_J_rObject( this : ref Unsafe_obj, p0 : JObject,p1 : big) : JObject
202230 {#>>
203− return nil;
231+ return getObject_rObject_J_rObject(this, p0, p1);
204232 }#<<
205233
206234 putObjectVolatile_rObject_J_rObject_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : JObject)
207235 {#>>
236+ putObject_rObject_J_rObject_V(this, p0, p1, p2);
208237 }#<<
209238
210−getBooleanVolatile_rObject_J_Z( this : ref Unsafe_obj, p0 : JObject,p1 : big) : byte
239+getBooleanVolatile_rObject_J_Z( this : ref Unsafe_obj, p0 : JObject,p1 : big) : int
211240 {#>>
212− return byte 0;
241+ return getBoolean_rObject_J_Z(this, p0, p1);
213242 }#<<
214243
215−putBooleanVolatile_rObject_J_Z_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : byte)
244+putBooleanVolatile_rObject_J_Z_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : int)
216245 {#>>
246+ putBoolean_rObject_J_Z_V(this, p0, p1, p2);
217247 }#<<
218248
219249 getByteVolatile_rObject_J_B( this : ref Unsafe_obj, p0 : JObject,p1 : big) : byte
220250 {#>>
221− return byte 0;
251+ return getByte_rObject_J_B(this, p0, p1);
222252 }#<<
223253
224254 putByteVolatile_rObject_J_B_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : byte)
225255 {#>>
256+ putByte_rObject_J_B_V(this, p0, p1, p2);
226257 }#<<
227258
228259 getShortVolatile_rObject_J_S( this : ref Unsafe_obj, p0 : JObject,p1 : big) : int
229260 {#>>
230− return 0;
261+ return getShort_rObject_J_S(this, p0, p1);
231262 }#<<
232263
233264 putShortVolatile_rObject_J_S_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : int)
234265 {#>>
266+ putShort_rObject_J_S_V(this, p0, p1, p2);
235267 }#<<
236268
237269 getCharVolatile_rObject_J_C( this : ref Unsafe_obj, p0 : JObject,p1 : big) : int
238270 {#>>
239− return 0;
271+ return getChar_rObject_J_C(this, p0, p1);
240272 }#<<
241273
242274 putCharVolatile_rObject_J_C_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : int)
243275 {#>>
276+ putChar_rObject_J_C_V(this, p0, p1, p2);
244277 }#<<
245278
246279 getIntVolatile_rObject_J_I( this : ref Unsafe_obj, p0 : JObject,p1 : big) : int
247280 {#>>
248− return 0;
281+ return getInt_rObject_J_I(this, p0, p1);
249282 }#<<
250283
251284 putIntVolatile_rObject_J_I_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : int)
252285 {#>>
286+ putInt_rObject_J_I_V(this, p0, p1, p2);
253287 }#<<
254288
255289 getLongVolatile_rObject_J_J( this : ref Unsafe_obj, p0 : JObject,p1 : big) : big
256290 {#>>
257− return big 0;
291+ return getLong_rObject_J_J(this, p0, p1);
258292 }#<<
259293
260294 putLongVolatile_rObject_J_J_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : big)
261295 {#>>
296+ putLong_rObject_J_J_V(this, p0, p1, p2);
262297 }#<<
263298
264299 getFloatVolatile_rObject_J_F( this : ref Unsafe_obj, p0 : JObject,p1 : big) : real
265300 {#>>
266− return 0.0;
301+ return getFloat_rObject_J_F(this, p0, p1);
267302 }#<<
268303
269304 putFloatVolatile_rObject_J_F_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : real)
270305 {#>>
306+ putFloat_rObject_J_F_V(this, p0, p1, p2);
271307 }#<<
272308
273309 getDoubleVolatile_rObject_J_D( this : ref Unsafe_obj, p0 : JObject,p1 : big) : real
274310 {#>>
275− return 0.0;
311+ return getDouble_rObject_J_D(this, p0, p1);
276312 }#<<
277313
278314 putDoubleVolatile_rObject_J_D_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : real)
279315 {#>>
316+ putDouble_rObject_J_D_V(this, p0, p1, p2);
280317 }#<<
281318
282319 getAddress_J_J( this : ref Unsafe_obj, p0 : big) : big
283320 {#>>
321+ # FIXME
284322 return big 0;
285323 }#<<
286324
287325 putAddress_J_J_V( this : ref Unsafe_obj, p0 : big,p1 : big)
288326 {#>>
327+ # FIXME
289328 }#<<
290329
291330 compareAndSwapObject_rObject_J_rObject_rObject_Z( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : JObject,p3 : JObject) : byte
292331 {#>>
332+ # FIXME
293333 return byte 0;
294334 }#<<
295335
296336 compareAndSwapLong_rObject_J_J_J_Z( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : big,p3 : big) : byte
297337 {#>>
338+ # FIXME
298339 return byte 0;
299340 }#<<
300341
301342 compareAndSwapInt_rObject_J_I_I_Z( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : int,p3 : int) : byte
302343 {#>>
344+ # FIXME
303345 return byte 0;
304346 }#<<
305347
306348 putOrderedObject_rObject_J_rObject_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : JObject)
307349 {#>>
350+ putObject_rObject_J_rObject_V(this, p0, p1, p2);
308351 }#<<
309352
310353 putOrderedLong_rObject_J_J_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : big)
311354 {#>>
355+ putOrderedLong_rObject_J_J_V(this, p0, p1, p2);
312356 }#<<
313357
314358 putOrderedInt_rObject_J_I_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : int)
315359 {#>>
360+ putOrderedInt_rObject_J_I_V(this, p0, p1, p2);
316361 }#<<
317362
318363 registerNatives_V( )
@@ -321,95 +366,115 @@ registerNatives_V( ) · 2 unmodified lines
321366
322367 throwException_rThrowable_V( this : ref Unsafe_obj, p0 : JObject)
323368 {#>>
369+ jni->Throw(p0);
324370 }#<<
325371
326372 defineClass_rString_aB_I_I_rClassLoader_rProtectionDomain_rClass( this : ref Unsafe_obj, p0 : JString,p1 : JArrayB,p2 : int,p3 : int,p4 : JObject,p5 : JObject) : JClass
327373 {#>>
374+ jni->FatalError("defineAnonymousClass is not implemented");
328375 return nil;
329376 }#<<
330377
331378 defineClass_rString_aB_I_I_rClass( this : ref Unsafe_obj, p0 : JString,p1 : JArrayB,p2 : int,p3 : int) : JClass
332379 {#>>
380+ jni->FatalError("defineAnonymousClass is not implemented");
333381 return nil;
334382 }#<<
335383
336384 objectFieldOffset_rField_J( this : ref Unsafe_obj, p0 : JObject) : big
337385 {#>>
386+ # FIXME
338387 return big 0;
339388 }#<<
340389
341390 staticFieldBase_rField_rObject( this : ref Unsafe_obj, p0 : JObject) : JObject
342391 {#>>
392+ # FIXME
343393 return nil;
344394 }#<<
345395
346396 allocateMemory_J_J( this : ref Unsafe_obj, p0 : big) : big
347397 {#>>
398+ # FIXME
348399 return big 0;
349400 }#<<
350401
351402 reallocateMemory_J_J_J( this : ref Unsafe_obj, p0 : big,p1 : big) : big
352403 {#>>
404+ # FIXME
353405 return big 0;
354406 }#<<
355407
356408 setMemory_rObject_J_J_B_V( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : big,p3 : byte)
357409 {#>>
410+ # FIXME
358411 }#<<
359412
360413 freeMemory_J_V( this : ref Unsafe_obj, p0 : big)
361414 {#>>
415+ # FIXME
362416 }#<<
363417
364418 staticFieldOffset_rField_J( this : ref Unsafe_obj, p0 : JObject) : big
365419 {#>>
420+ # FIXME
366421 return big 0;
367422 }#<<
368423
369424 ensureClassInitialized_rClass_V( this : ref Unsafe_obj, p0 : JClass)
370425 {#>>
426+ jni->FindClass(p0.class.name);
371427 }#<<
372428
373429 arrayBaseOffset_rClass_I( this : ref Unsafe_obj, p0 : JClass) : int
374430 {#>>
431+ # FIXME
375432 return 0;
376433 }#<<
377434
378435 arrayIndexScale_rClass_I( this : ref Unsafe_obj, p0 : JClass) : int
379436 {#>>
437+ # FIXME
380438 return 0;
381439 }#<<
382440
383441 addressSize_I( this : ref Unsafe_obj) : int
384442 {#>>
385− return 0;
443+ # TODO: obtain that value somehow?
444+ return 4;
386445 }#<<
387446
388447 pageSize_I( this : ref Unsafe_obj) : int
389448 {#>>
449+ # FIXME
390450 return 0;
391451 }#<<
392452
393453 defineAnonymousClass_rClass_aB_aObject_rClass( this : ref Unsafe_obj, p0 : JClass,p1 : JArrayB,p2 : JArrayJObject) : JClass
394454 {#>>
455+ jni->FatalError("defineAnonymousClass is not implemented");
395456 return nil;
396457 }#<<
397458
398459 monitorEnter_rObject_V( this : ref Unsafe_obj, p0 : JObject)
399460 {#>>
461+ jni->MonitorEnter(p0);
400462 }#<<
401463
402464 monitorExit_rObject_V( this : ref Unsafe_obj, p0 : JObject)
403465 {#>>
466+ jni->MonitorExit(p0);
404467 }#<<
405468
406−tryMonitorEnter_rObject_Z( this : ref Unsafe_obj, p0 : JObject) : byte
469+tryMonitorEnter_rObject_Z( this : ref Unsafe_obj, p0 : JObject) : int
407470 {#>>
408− return byte 0;
471+ jni->MonitorEnter(p0);
472+ return 1; # TODO: check something
409473 }#<<
410474
411475 getLoadAverage_aD_I_I( this : ref Unsafe_obj, p0 : JArrayD,p1 : int) : int
412476 {#>>
477+ # FIXME
413478 return 0;
414479 }#<<
415480
java/pkg/sun/misc/Unsafe_L.m+5−5
@@ -14,8 +14,8 @@ Unsafe_L : module · 13 unmodified lines
1414 unpark_rObject_V : fn( this : ref Unsafe_obj, p0 : JObject);
1515 getObject_rObject_J_rObject : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big) : JObject;
1616 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;
18− putBoolean_rObject_J_Z_V : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : 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 : int);
1919 getByte_J_B : fn( this : ref Unsafe_obj, p0 : big) : byte;
2020 getByte_rObject_J_B : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big) : byte;
2121 putByte_J_B_V : fn( this : ref Unsafe_obj, p0 : big,p1 : byte);
@@ -46,8 +46,8 @@ Unsafe_L : module · 24 unmodified lines
4646 putDouble_rObject_J_D_V : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : real);
4747 getObjectVolatile_rObject_J_rObject : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big) : JObject;
4848 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;
50− putBooleanVolatile_rObject_J_Z_V : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : 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 : int);
5151 getByteVolatile_rObject_J_B : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big) : byte;
5252 putByteVolatile_rObject_J_B_V : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big,p2 : byte);
5353 getShortVolatile_rObject_J_S : fn( this : ref Unsafe_obj, p0 : JObject,p1 : big) : int;
@@ -89,7 +89,7 @@ Unsafe_L : module · 35 unmodified lines
8989 defineAnonymousClass_rClass_aB_aObject_rClass : fn( this : ref Unsafe_obj, p0 : JClass,p1 : JArrayB,p2 : JArrayJObject) : JClass;
9090 monitorEnter_rObject_V : fn( this : ref Unsafe_obj, p0 : JObject);
9191 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;
9393 getLoadAverage_aD_I_I : fn( this : ref Unsafe_obj, p0 : JArrayD,p1 : int) : int;
9494
9595 };
java/pkg/sun/misc/Version_L.b+66−0
@@ -0,0 +1,66 @@
1+implement Version_L;
2+
3+include "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+
26+include "Version_L.m";
27+
28+#>> extra post includes here
29+
30+#<<
31+
32+init( jni_p : JNI )
33+{
34+ # save java native inteface mod instance
35+ jni = jni_p;
36+ #>>extra initialization here
37+ #<<
38+}
39+
40+getJvmSpecialVersion_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+
47+getJdkSpecialVersion_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+
54+getJvmVersionInfo_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+
62+getJdkVersionInfo_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+
3+Version_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
119119 Class c = Class.forName(packagePrefix + "." + cln,
120120 true,
121121 this.getClass().getClassLoader());
122− debugPrintString("===");
123− debugPrintString(c.getName());
124122 cs = (Charset)c.newInstance();
125123 cache.put(csn, cs);
126124 return cs;
java/pkg/sun/reflect/Reflection_L.b+107−1
@@ -17,7 +17,8 @@ include "jni.m"; · 16 unmodified lines
1717 JArrayJClass,
1818 JArrayJString,
1919 JClass,
20− JObject : import jni;
20+ JObject,
21+ Value : import jni;
2122
2223 #>> extra pre includes here
2324
@@ -42,8 +43,113 @@ getClassAccessFlags_rClass_I( p0 : JClass) : int · 18 unmodified lines
4243 return 0;
4344 }#<<
4445
46+shouldskip(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+}
64+getstack(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+
97+progcmd(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+}
102+stoppid(pid: int)
103+{
104+ progcmd(pid, "stop");
105+}
106+resumepid(pid: int)
107+{
108+ progcmd(pid, "unstop");
109+}
110+
111+classname(stackitem: string): string
112+{
113+ if (len stackitem > 2 && stackitem[:2] == "N-")
114+ return stackitem[2:];
115+ return stackitem;
116+}
117+forname(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+
45133 getCallerClass_I_rClass( p0 : int) : JClass
46134 {#>>
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+
47153 return nil;
48154 }#<<
49155