Merged 9195eccdcbd9 and 13b1fc3fa090 development
authorJan Vrany <jan.vrany@fit.cvut.cz>
Wed, 20 Feb 2013 23:36:32 +0000
branchdevelopment
changeset 2381 5dea0cfb9426
parent 2380 9195eccdcbd9 (current diff)
parent 2379 13b1fc3fa090 (diff)
child 2383 9b9a1f72160d
Merged 9195eccdcbd9 and 13b1fc3fa090
Java.st
JavaNativeMethodImpl_OpenJDK7.st
JavaRelease.st
JavaVM.st
libjava.rc
--- a/Java.st	Wed Feb 20 23:05:49 2013 +0000
+++ b/Java.st	Wed Feb 20 23:36:32 2013 +0000
@@ -274,8 +274,8 @@
     Threads := IdentityDictionary new.
 
     ClassPathBundle := JavaClassPathBundle new.
-    ClassPath := OrderedCollection new. "/ for ad-hoc packages
-    SourcePath := OrderedCollection new."/ for ad-hoc packages
+    ClassPath isNil ifTrue:[ClassPath:= OrderedCollection new]. "/ for ad-hoc packages
+    SourcePath isNil ifTrue:[SourcePath := OrderedCollection new]."/ for ad-hoc packages
 
     ThreadsAccess := RecursionLock forMutualExclusion.
     self initializePrettyPrintStyle.
@@ -299,7 +299,7 @@
     "Created: / 03-10-2010 / 15:54:02 / Jan Kurs <kurs.jan@post.cz>"
     "Modified: / 15-10-2010 / 17:37:20 / Jan Kurs <kurs.jan@post.cz>"
     "Modified: / 09-12-2011 / 13:16:15 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
-    "Modified: / 18-02-2013 / 16:52:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 19-02-2013 / 21:04:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 initializePrettyPrintStyle
--- a/JavaNativeMethodImpl_OpenJDK7.st	Wed Feb 20 23:05:49 2013 +0000
+++ b/JavaNativeMethodImpl_OpenJDK7.st	Wed Feb 20 23:36:32 2013 +0000
@@ -499,7 +499,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 
--- a/JavaRelease.st	Wed Feb 20 23:05:49 2013 +0000
+++ b/JavaRelease.st	Wed Feb 20 23:36:32 2013 +0000
@@ -790,11 +790,11 @@
         (h endsWith: '\jre') ifTrue:[
             h := h copyTo: h size - 5
         ].
-        javaHome := h asFilename.
+        h := h asFilename.
 
         "/Do not trust JAVA_HOME, it might be wrong (on Windows machine due
         "/to a registry mess
-        (self validateJavaHome: javaHome) ifTrue:[ ^ javaHome ].
+        (self validateJavaHome: h) ifTrue:[ javaHome := h. ^ javaHome ].
     ].
 
     self javaHomes do:
@@ -816,7 +816,7 @@
     "Modified: / 15-03-2011 / 13:29:14 / Jan Kurs <kursjan@fit.cvut.cz>"
     "Modified: / 15-03-2011 / 13:47:02 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
     "Modified: / 19-07-2012 / 11:08:04 / jv"
-    "Modified: / 12-02-2013 / 15:05:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 20-02-2013 / 02:50:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 searchForSourcePath
@@ -1109,6 +1109,24 @@
 
 !JavaRelease::OpenJDK6 methodsFor:'searching'!
 
+searchForJavaHome
+    | h |
+
+    "Try registry first..."
+    h := self javaHomeOnWindowsFromRegistry.
+    h notNil ifTrue:[ javaHome := h. ^ javaHome ].
+    ^super searchForJavaHome
+
+
+
+    "
+        JavaRelease openJDK7 searchForSourcePath; sourcePath
+        JavaRelease sunJDK6 searchForSourcePath; sourcePath
+    "
+
+    "Created: / 20-02-2013 / 02:55:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 searchForSourcePath
 
     | jdkHome src_zip |
--- a/JavaVM.st	Wed Feb 20 23:05:49 2013 +0000
+++ b/JavaVM.st	Wed Feb 20 23:36:32 2013 +0000
@@ -42,7 +42,7 @@
 !
 
 Object subclass:#Performance
-	instanceVariableNames:'vm'
+	instanceVariableNames:'vm counters'
 	classVariableNames:''
 	poolDictionaries:''
 	privateIn:JavaVM
@@ -1978,6 +1978,8 @@
     "/>  jdk 6
 
     ThreadInterrupts := Dictionary new.
+    PerfCounters := Performance for: self.
+
 
     self initializeClassReader.
     self initializeOpenFileTable.
@@ -1990,7 +1992,6 @@
     ObjectMemory addDependent: self.
     StartupTime := OperatingSystem getOSTime.
     FinalizationLobby startFinalizationProcessAt: 5.
-    PerfCounters := Performance for: self.
 
 
     JavaNativeMethod allInstancesDo:[:e|e nCallsReset ].
@@ -2004,7 +2005,7 @@
     "Modified: / 15-10-2010 / 15:27:45 / Jan Kurs <kurs.jan@post.cz>"
     "Modified: / 24-02-2012 / 13:59:29 / Marcel Hlopko <hlopik@gmail.com>"
     "Modified: / 24-02-2012 / 14:37:06 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
-    "Modified: / 18-02-2013 / 16:54:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 20-02-2013 / 00:13:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 initializeVMIfNoEventThreadRunning
@@ -5975,6 +5976,11 @@
     "Created: / 21-12-2010 / 19:42:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!JavaVM::Performance methodsFor:'accessing'!
+
+counters
+    ^ counters
+! !
 
 !JavaVM::Performance methodsFor:'accessing-counters'!
 
@@ -6029,6 +6035,7 @@
     ].
     ^value
 
+    "Modified (format): / 20-02-2013 / 00:06:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 
@@ -6039,9 +6046,11 @@
     "Now, aJavaVM == JavaVM (i.e, the class JavaVM
     itself, not its instance)"
 
-    vm := aJavaVM
+    vm := aJavaVM.
+    counters := Dictionary new.
 
     "Created: / 21-12-2010 / 19:44:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 20-02-2013 / 00:07:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 
@@ -6680,11 +6689,11 @@
 
 version_HG
 
-    ^ '§Changeset: <not expanded> §'
+    ^ 'Changeset: <not expanded> '
 !
 
 version_SVN
-    ^ '§Id§'
+    ^ 'Id'
 ! !
 
 
--- a/libjava.rc	Wed Feb 20 23:05:49 2013 +0000
+++ b/libjava.rc	Wed Feb 20 23:36:32 2013 +0000
@@ -25,7 +25,7 @@
       VALUE "LegalCopyright", "Copyright Claus Gittinger 1988-2011\nCopyright eXept Software AG 1998-2011\nCopyright Jan Vrany, Jan Kurs and Marcel Hlopko\n          SWING Research Group, Czech Technical University In Prague\0"
       VALUE "ProductName", "Smalltalk/X\0"
       VALUE "ProductVersion", "6.2.3.0\0"
-      VALUE "ProductDate", "Sat, 16 Feb 2013 16:12:45 GMT\0"
+      VALUE "ProductDate", "Wed, 20 Feb 2013 00:17:54 GMT\0"
     END
 
   END