Natives cleaned up a bit. development
authorJan Vrany <jan.vrany@fit.cvut.cz>
Fri, 07 Feb 2014 09:49:00 +0100
branchdevelopment
changeset 3019 c04668cd040d
parent 3018 7ff48afbef00
child 3020 e7c286435bfe
child 3029 bc928fce0f14
Natives cleaned up a bit. Some natives has been backported frm OpenJDK7 to OpenJDK6, they have been moved to a superclass
JavaNativeMethodImpl_OpenJDK6.st
JavaNativeMethodImpl_OpenJDK7.st
--- a/JavaNativeMethodImpl_OpenJDK6.st	Fri Feb 07 09:07:22 2014 +0100
+++ b/JavaNativeMethodImpl_OpenJDK6.st	Fri Feb 07 09:49:00 2014 +0100
@@ -9669,7 +9669,7 @@
 !
 
 _java_lang_Class_getDeclaringClass0: this
-    <javanative: 'java/lang/Class' name: 'getDeclaringClass()Ljava/lang/Class;'>
+    <javanative: 'java/lang/Class' name: 'getDeclaringClass0()Ljava/lang/Class;'>
     "
      /**
      * If the class or interface represented by this {@code Class} object
@@ -9693,7 +9693,7 @@
     enclosingCls isNil ifTrue: [ self error: 'Cannot fins declaring class' ].
     ^ Reflection javaClassObjectForClass: enclosingCls
 
-    "Modified: / 22-01-2014 / 15:25:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 07-02-2014 / 09:44:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 _java_lang_Class_getDeclaringClass: this
@@ -18760,7 +18760,12 @@
 
     <javanative: 'sun/misc/Perf' name: 'createLong(Ljava/lang/String;IIJ)Ljava/nio/ByteBuffer;'>
 
-    ^ JavaVM unimplementedNativeMethodSignal raise
+    | memory |
+
+    memory := JavaVM performance counters at: (Java as_ST_String: a1) ifAbsentPut:[ ByteArray new: 8].
+    ^JAVA java nio HeapByteBuffer new: memory with: 0 with: 8.
+
+    "Modified: / 20-02-2013 / 00:13:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 _sun_misc_Perf_detach: this _: a1
@@ -18788,7 +18793,9 @@
 
     <javanative: 'sun/misc/Perf' name: 'registerNatives()V'>
 
-    ^ JavaVM unimplementedNativeMethodSignal raise
+    "Nothing to do here"
+
+    "Modified: / 11-02-2013 / 02:53:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 _sun_misc_Signal_findSignal: this _:a1
--- a/JavaNativeMethodImpl_OpenJDK7.st	Fri Feb 07 09:07:22 2014 +0100
+++ b/JavaNativeMethodImpl_OpenJDK7.st	Fri Feb 07 09:49:00 2014 +0100
@@ -36,6 +36,15 @@
 
 !JavaNativeMethodImpl_OpenJDK7 class methodsFor:'native - java.io'!
 
+_java_io_FileInputStream_read0: this 
+
+    <javanative: 'java/io/FileInputStream' name: 'read0()I'>
+
+    ^ self _java_io_FileInputStream_read: this
+
+    "Modified: / 07-02-2014 / 09:31:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 _java_io_FileOutputStream_open: this _: a1 _: a2
 
     <javanative: 'java/io/FileOutputStream' name: 'open(Ljava/lang/String;Z)V'>
@@ -534,62 +543,6 @@
 
 !JavaNativeMethodImpl_OpenJDK7 class methodsFor:'native - sun.misc'!
 
-_sun_misc_Perf_attach: this _: a1 _: a2 _: a3
-
-    <javanative: 'sun/misc/Perf' name: 'attach(Ljava/lang/String;II)Ljava/nio/ByteBuffer;'>
-
-    ^ JavaVM unimplementedNativeMethodSignal raise
-!
-
-_sun_misc_Perf_createByteArray: this _: a1 _: a2 _: a3 _: a4 _: a5
-
-    <javanative: 'sun/misc/Perf' name: 'createByteArray(Ljava/lang/String;II[BI)Ljava/nio/ByteBuffer;'>
-
-    ^ JavaVM unimplementedNativeMethodSignal raise
-!
-
-_sun_misc_Perf_createLong: this _: a1 _: a2 _: a3 _: a4 _: a5
-
-    <javanative: 'sun/misc/Perf' name: 'createLong(Ljava/lang/String;IIJ)Ljava/nio/ByteBuffer;'>
-
-    | memory |
-
-    memory := JavaVM performance counters at: (Java as_ST_String: a1) ifAbsentPut:[ ByteArray new: 8].
-    ^JAVA java nio HeapByteBuffer new: memory with: 0 with: 8.
-
-    "Modified: / 20-02-2013 / 00:13:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-_sun_misc_Perf_detach: this _: a1
-
-    <javanative: 'sun/misc/Perf' name: 'detach(Ljava/nio/ByteBuffer;)V'>
-
-    ^ JavaVM unimplementedNativeMethodSignal raise
-!
-
-_sun_misc_Perf_highResCounter: this
-
-    <javanative: 'sun/misc/Perf' name: 'highResCounter()J'>
-
-    ^ JavaVM unimplementedNativeMethodSignal raise
-!
-
-_sun_misc_Perf_highResFrequency: this
-
-    <javanative: 'sun/misc/Perf' name: 'highResFrequency()J'>
-
-    ^ JavaVM unimplementedNativeMethodSignal raise
-!
-
-_sun_misc_Perf_registerNatives: this
-
-    <javanative: 'sun/misc/Perf' name: 'registerNatives()V'>
-
-    "Nothing to do here"
-
-    "Modified: / 11-02-2013 / 02:53:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
 _sun_misc_Unsafe_copyMemory: this _: a1 _: a2 _: a3 _: a4 _: a5 _: a6 _: a7 _: a8
 
     <javanative: 'sun/misc/Unsafe' name: 'copyMemory(Ljava/lang/Object;JLjava/lang/Object;JJ)V'>
@@ -609,30 +562,20 @@
     <javanative: 'sun/misc/Unsafe' name: 'setMemory(Ljava/lang/Object;JJB)V'>
 
     ^ JavaVM unimplementedNativeMethodSignal raise
-! !
-
-!JavaNativeMethodImpl_OpenJDK7 class methodsFor:'native - sun.reflect'!
-
-_sun_reflect_Reflection_getCallerClass0: this _: a1
-
-    <javanative: 'sun/reflect/Reflection' name: 'getCallerClass0(I)Ljava/lang/Class;'>
-
-    "/ Until there is hotspot @CallerSensitive support,
-    "/ depth must always be 2 to get the immediate caller
-    ^ self _sun_reflect_Reflection_getCallerClass: this _: 2
-
-    "Modified (comment): / 11-11-2013 / 21:18:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-_sun_reflect_Reflection_getCallerClass: this
+_sun_misc_Unsafe_shouldBeInitialized: this _: a1 
 
-    <javanative: 'sun/reflect/Reflection' name: 'getCallerClass()Ljava/lang/Class;'>
+    <javanative: 'sun/misc/Unsafe' name: 'shouldBeInitialized(Ljava/lang/Class;)Z'>
 
-    "/ Until there is hotspot @CallerSensitive support,
-    "/ depth must always be 2 to get the immediate caller
-    ^ self _sun_reflect_Reflection_getCallerClass0: this _: 2
+    ^ JavaVM unimplementedNativeMethodSignal raise
+!
 
-    "Modified (comment): / 11-11-2013 / 21:18:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+_sun_misc_VM_latestUserDefinedLoader: this 
+
+    <javanative: 'sun/misc/VM' name: 'latestUserDefinedLoader()Ljava/lang/ClassLoader;'>
+
+    ^ JavaVM unimplementedNativeMethodSignal raise
 ! !
 
 !JavaNativeMethodImpl_OpenJDK7 class methodsFor:'documentation'!