*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Wed, 25 Oct 2000 12:31:46 +0200
changeset 1420 9a649c1bb8cf
parent 1419 f808d17ff6f5
child 1421 a79002bd96bf
*** empty log message ***
SnapShotImageMemory.st
--- a/SnapShotImageMemory.st	Tue Oct 24 20:23:46 2000 +0200
+++ b/SnapShotImageMemory.st	Wed Oct 25 12:31:46 2000 +0200
@@ -345,7 +345,7 @@
     |nBytes|
 
     (aSymbolRef isImageSymbol) ifFalse:[self halt].
-^ self fetchStringFor:aSymbolRef.
+    ^ self fetchStringFor:aSymbolRef.
 "/    nBytes := aSymbolRef size - (intSize * 3).
 "/    ^ ((ByteArray new:nBytes-1) replaceFrom:1 to:nBytes-1 with:aSymbolRef startingAt:1) asString.
 !
@@ -638,7 +638,7 @@
             nConsts := stream nextUnsignedLongMSB:msb.
             nConsts timesRepeat:[ stream nextUnsignedLongMSB:msb ].
 
-            Transcript showCR:className.
+            "/ Transcript showCR:className.
         ].
 !
 
@@ -766,6 +766,16 @@
     ^ flags bitTest:Behavior flagSymbol 
 !
 
+isJavaMethod    
+    |nm|
+
+    nm := classRef name.
+    ^ (nm = 'JavaMethod'
+      or:[ nm = 'JavaMethodWithException' 
+      or:[ nm = 'JavaMethodWithHandler' 
+      or:[ nm = 'JavaNativeMethod' ]]])
+!
+
 isLazyMethod                               
     ^ classRef name = 'LazyMethod'!
 
@@ -774,7 +784,14 @@
 !
 
 isMethod                               
-    ^ classRef name = 'Method'
+    |cls|
+
+    cls := classRef.
+    [cls notNil] whileTrue:[
+        cls name = 'Method' ifTrue:[^ true].
+        cls := cls superclass
+    ].
+    ^ false.
 !
 
 isMethodDictionary
@@ -783,7 +800,7 @@
 
 isMethodOrLazyMethod                 
     classRef name = 'LazyMethod' ifTrue:[^ true].
-    ^ classRef name = 'Method'
+    ^ self isMethod
 !
 
 isString                               
@@ -928,9 +945,6 @@
 isIgnored
     ^ false!
 
-isJavaMethod
-    ^ self class name = 'JavaMethod'!
-
 isPrivate
     ^ false!
 
@@ -955,9 +969,21 @@
 
     self isMethod ifTrue:[
         mclassSlotOffset := Method instVarOffsetOf:'mclass'.
+    ] ifFalse:[
+        self isJavaMethod ifTrue:[
+            mclassSlotOffset := JavaMethod instVarOffsetOf:'javaClass'.
+        ]
+    ].
+
+    mclassSlotOffset notNil ifTrue:[
         mclassPtr := self at:mclassSlotOffset.
         mclassPtr ~~ 0 ifTrue:[
-            mclass := memory fetchObjectAt:mclassPtr.
+            mclassPtr isInteger ifTrue:[
+                mclass := memory fetchObjectAt:mclassPtr.
+                self at:mclassSlotOffset put:mclass.    
+            ] ifFalse:[
+                mclass := mclassPtr.
+            ].
             mclass isImageBehavior ifFalse:[
                 self halt
             ].
@@ -980,7 +1006,9 @@
             ]
         ].
         self halt.
+        ^ nil.
     ].
+    ^ nil.
     self halt.
 !
 
@@ -1007,9 +1035,14 @@
             ^ self theNonMetaclass package
         ].
         packageSlotOffset := Class instVarOffsetOf:'package'.
-    ].
-    self isMethod ifTrue:[
-        packageSlotOffset := Method instVarOffsetOf:'package'.
+    ] ifFalse:[
+        self isMethod ifTrue:[
+            packageSlotOffset := Method instVarOffsetOf:'package'.
+        ] ifFalse:[
+            self isLazyMethod ifTrue:[
+                packageSlotOffset := Method instVarOffsetOf:'package'.
+            ].
+        ].
     ].
     packageSlotOffset notNil ifTrue:[
         packagePtr := self at:packageSlotOffset.
@@ -1017,7 +1050,10 @@
         packageRef isNil ifTrue:[^ nil].
 
         packageRef isImageSymbol ifFalse:[
-            self halt.
+            packageRef isImageBytes ifFalse:[
+                self halt.
+            ].
+            "/ mhmh - can be a string sometimes ...
         ].
         package := memory fetchStringFor:packageRef.
         ^ package asSymbol
@@ -1026,7 +1062,7 @@
         self halt
     ].
 
-    self halt.
+    ^ nil
 !
 
 previousVersion
@@ -3496,6 +3532,10 @@
 !
 
 isLoaded
+    |superclass|
+
+    superclass := self superclass.
+    superclass isNil ifTrue:[^ true].
     ^ self superclass name ~= 'Autoload'
 !