few more natives.. pls review I have bad feelings about that jk_new_structure
authorhlopkmar
Thu, 03 Nov 2011 18:28:23 +0000
branchjk_new_structure
changeset 1081 0c91ffb1ef21
parent 1080 f842a3bac28a
child 1082 50c18252e0eb
few more natives.. pls review I have bad feelings about that
src/JavaVM.st
--- a/src/JavaVM.st	Thu Nov 03 18:00:12 2011 +0000
+++ b/src/JavaVM.st	Thu Nov 03 18:28:23 2011 +0000
@@ -68,7 +68,7 @@
 		StdinReplacementFileQuerySignal AssertionsEnabled
 		SimulatedNativeMemory Reflection ZipCache ZipEntryCache
 		ZipLastModTimesCache ZipInflaters JavaPrivilegedAccessQuery
-		ClassRegistry SystemClassLoader ExtClassLoader'
+		ClassRegistry SystemClassLoader ExtClassLoader StartupTime'
 	poolDictionaries:'JavaConstants'
 	category:'Languages-Java-Support'
 !
@@ -1810,15 +1810,15 @@
      Following >>make it working, make it fast<< rule"
     
     ObjectMemory
-        javaJustInTimeCompilation:false;
-        javaNativeCodeOptimization:false.
-    "Java requires a huge stack. Change default to 5 MB"
-    Process defaultMaximumStackSize:1024 * 1024 * 4.
+        javaJustInTimeCompilation: false;
+        javaNativeCodeOptimization: false.
+     "Java requires a huge stack. Change default to 5 MB"
+    Process defaultMaximumStackSize: 1024 * 1024 * 4.
     ClassRegistry := JavaClassRegistry for: self.
     ClassLoaderQuerySignal := Query new.
     JavaObject autoload.
     JavaContext autoload.
-    MonitorTrace ifNil:[self initialize].
+    MonitorTrace ifNil: [ self initialize ].
     self initializeAdditionalJavaProtocol.
     self releaseAllJavaResources.
     JavaConsoleStream := Transcript.
@@ -1834,11 +1834,13 @@
     
     JavaNativeMethod flushAllCachedNativeMethods.
     JavaMethod 
-        allSubInstancesDo:[:m | 
-            m checked:false.
-            m code:nil.
-        ].
-    ObjectMemory flushCaches.    
+        allSubInstancesDo: [
+            :m | 
+            m checked: false.
+            m code: nil.
+        ].
+    ObjectMemory flushCaches.
+    
     "/ sigh - must flush inline caches.
     
     JavaClass startRememberingOrderOfClassInits.
@@ -1860,7 +1862,8 @@
     self initializePrimitiveClasses.
     Java initSystemClass.
     self initializeSystemClassLoader.
-    ObjectMemory addDependent:self.
+    ObjectMemory addDependent: self.
+    StartupTime := OperatingSystem getOSTime.
 
     "
      JavaVM initialize.
@@ -1869,8 +1872,8 @@
     "Created: / 03-01-1998 / 21:29:09 / cg"
     "Modified: / 14-12-1999 / 18:58:56 / cg"
     "Modified: / 15-10-2010 / 15:27:45 / Jan Kurs <kurs.jan@post.cz>"
-    "Modified: / 01-04-2011 / 15:33:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
     "Modified: / 01-11-2011 / 22:16:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-11-2011 / 19:17:42 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
 !
 
 initializeVMIfNoEventThreadRunning
@@ -7340,6 +7343,13 @@
     "Created: / 01-04-2011 / 13:02:06 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
 !
 
+_java_util_zip_ZipFile_close: nativeContext
+
+    <javanative: 'java/util/zip/ZipFile' name: 'close(J)V'>
+
+    ^ UnimplementedNativeMethodSignal raise
+!
+
 _java_util_zip_ZipFile_freeEntry: nativeContext
 
     <javanative: 'java/util/zip/ZipFile' name: 'freeEntry'>
@@ -14688,6 +14698,13 @@
 
 !JavaVM class methodsFor:'native - sun.management'!
 
+_sun_management_VMManagementImpl_getStartupTime: nativeContext 
+    <javanative: 'sun/management/VMManagementImpl' name: 'getStartupTime()J'>
+    ^ StartupTime.
+
+    "Modified: / 03-11-2011 / 19:17:57 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+!
+
 _sun_management_VMManagementImpl_getVersion0: nativeContext 
     <javanative: 'sun/management/VMManagementImpl' name: 'getVersion0'>
     ^ Java as_String: '1.2'.
@@ -14695,24 +14712,28 @@
     "Modified: / 03-11-2011 / 18:42:48 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
 !
 
-_sun_management_VMManagementImpl_initOptionalSupportFields: nativeContext
-
+_sun_management_VMManagementImpl_initOptionalSupportFields: nativeContext 
     <javanative: 'sun/management/VMManagementImpl' name: 'initOptionalSupportFields()V'>
-    |cls|
+    | cls |
     cls := nativeContext receiver.
-    cls instVarNamed:#'compTimeMonitoringSupport' put:0.
-    cls instVarNamed:#'threadContentionMonitoringSupport' put:0.
-    cls instVarNamed:#'currentThreadCpuTimeSupport' put:0.
-    cls instVarNamed:#'otherThreadCpuTimeSupport' put:0.
-    cls instVarNamed:#'bootClassPathSupport' put:0.
-    cls instVarNamed:#'objectMonitorUsageSupport' put:0.
-    cls instVarNamed:#'synchronizerUsageSupport' put:0.
-    cls instVarNamed:#'objectMonitorUsageSupport' put:0.
-    cls instVarNamed:#'synchronizerUsageSupport' put:0.
-    
- ^ self.
-
-    "Modified: / 03-11-2011 / 18:53:30 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+    self breakPoint:#mh.
+    cls instVarNamed: #compTimeMonitoringSupport put: 0.
+    cls instVarNamed: #threadContentionMonitoringSupport put: 0.
+    cls instVarNamed: #currentThreadCpuTimeSupport put: 0.
+    cls instVarNamed: #otherThreadCpuTimeSupport put: 0.
+    cls instVarNamed: #bootClassPathSupport put: 0.
+    cls instVarNamed: #synchronizerUsageSupport put: 0.
+    cls instVarNamed: #objectMonitorUsageSupport put: 0.
+    ^ self.
+
+    "Modified: / 03-11-2011 / 19:29:37 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+!
+
+_sun_management_VMManagementImpl_isThreadCpuTimeEnabled: nativeContext
+
+    <javanative: 'sun/management/VMManagementImpl' name: 'isThreadCpuTimeEnabled()Z'>
+
+    ^ UnimplementedNativeMethodSignal raise
 ! !
 
 !JavaVM class methodsFor:'native - sun.misc'!