ObjectFileLoader.st
changeset 1250 a7872b606f04
parent 1218 8e2f81f20c85
child 1254 a43cdb1d0126
--- a/ObjectFileLoader.st	Mon Feb 25 20:57:27 2002 +0100
+++ b/ObjectFileLoader.st	Mon Feb 25 20:58:58 2002 +0100
@@ -885,13 +885,13 @@
 
     handle := self loadDynamicObject:aFileName.
     handle isNil ifTrue:[
-	Transcript showCR:('failed to load: ' , aFileName).
-	('ObjectFileLoader [warning]: '
-	 , aFileName
-	 , ' failed. ('
-	 , LinkErrorMessage
-	 , ')') errorPrintCR.
-	^ nil
+        Transcript showCR:('failed to load: ' , aFileName).
+        ('ObjectFileLoader [warning]: '
+         , aFileName
+         , ' failed. ('
+         , LinkErrorMessage
+         , ')') errorPrintCR.
+        ^ nil
     ].
 
     "
@@ -900,9 +900,9 @@
     symName := '_' , aClassName , '_Init'.
     initAddr := self getFunction:symName from:handle.
     initAddr isNil ifTrue:[
-	"try with added underscore"
-	symName := '__' , aClassName , '_Init'.
-	initAddr := self getFunction:symName from:handle.
+        "try with added underscore"
+        symName := '__' , aClassName , '_Init'.
+        initAddr := self getFunction:symName from:handle.
     ].
 
     knownToBeOk := true.
@@ -936,92 +936,92 @@
 "/    ].
 
     initAddr notNil ifTrue:[
-	Verbose ifTrue:[
-	    ('calling init at: ' , (initAddr printStringRadix:16)) infoPrintCR.
-	].
-	info := self performModuleInitAt:initAddr for:aClassName identifyAs:handle.
-	status := info at:1.
-	"
-	 if any classes are missing ...
-	"
-	(status == #missingClass) ifTrue:[
-	    "
-	     ... and we are loading a module ...
-	    "
-	    Transcript showCR:'try for missing class in same object ...'.
-	    Verbose ifTrue:[
-		'try for missing class:' infoPrint. (info at:2) infoPrintCR.
-	    ].
-	    otherClass := self loadClass:(info at:2) fromObjectFile:aFileName.
-	    otherClass notNil ifTrue:[
-		"
-		 try again ...
-		"
-		Transcript showCR:'missing class is here; try again ...'.
-		info := self performModuleInitAt:initAddr for:aClassName identifyAs:handle.
-		status := info at:1.
-	    ]
-	].
-
-	Verbose ifTrue:[
-	    'done init status=' infoPrint. info infoPrintCR.
-	].
-	(status == #unregisteredSuperclass) ifTrue:[
-	    Transcript showCR:'superclass is not registered'.
-	].
-
-	(Symbol hasInterned:aClassName) ifTrue:[
-	    newClass := Smalltalk at:aClassName asSymbol ifAbsent:[nil].
-	    Verbose ifTrue:[
-		'newClass is: ' infoPrint. newClass infoPrintCR
-	    ].
-	    newClass notNil ifTrue:[
-		Smalltalk at:aClassName asSymbol put:newClass.
-
-		(newClass implements:#initialize) ifTrue:[
-		    Verbose ifTrue:[
-			'initialize newClass ...' infoPrintCR
-		    ].
-		    newClass initialize.
-		].
-		"force cache flush"
-		Smalltalk isInitialized ifTrue:[
-		    Smalltalk changed.
-		]
-	    ].
-	] ifFalse:[
-	    'ObjectFileLoader [warning]: class ' errorPrint. aClassName errorPrint.
-	    ' did not define itself' errorPrintCR
-	    "
-	     do not unload - could have installed other classes/methods ...
-	    "
-	].
-	Smalltalk flushCachedClasses.
-	^ newClass
+        Verbose ifTrue:[
+            ('calling init at: ' , (initAddr printStringRadix:16)) infoPrintCR.
+        ].
+        info := self performModuleInitAt:initAddr for:aClassName identifyAs:handle.
+        status := info at:1.
+        "
+         if any classes are missing ...
+        "
+        (status == #missingClass) ifTrue:[
+            "
+             ... and we are loading a module ...
+            "
+            Transcript showCR:'try for missing class in same object ...'.
+            Verbose ifTrue:[
+                'try for missing class:' infoPrint. (info at:2) infoPrintCR.
+            ].
+            otherClass := self loadClass:(info at:2) fromObjectFile:aFileName.
+            otherClass notNil ifTrue:[
+                "
+                 try again ...
+                "
+                Transcript showCR:'missing class is here; try again ...'.
+                info := self performModuleInitAt:initAddr for:aClassName identifyAs:handle.
+                status := info at:1.
+            ]
+        ].
+
+        Verbose ifTrue:[
+            'done init status=' infoPrint. info infoPrintCR.
+        ].
+        (status == #unregisteredSuperclass) ifTrue:[
+            Transcript showCR:'superclass is not registered'.
+        ].
+
+        (Symbol hasInterned:aClassName) ifTrue:[
+            newClass := Smalltalk at:aClassName asSymbol ifAbsent:[nil].
+            Verbose ifTrue:[
+                'newClass is: ' infoPrint. newClass infoPrintCR
+            ].
+            newClass notNil ifTrue:[
+                Smalltalk at:aClassName asSymbol put:newClass.
+
+                (newClass includesSelector:#initialize) ifTrue:[
+                    Verbose ifTrue:[
+                        'initialize newClass ...' infoPrintCR
+                    ].
+                    newClass initialize.
+                ].
+                "force cache flush"
+                Smalltalk isInitialized ifTrue:[
+                    Smalltalk changed.
+                ]
+            ].
+        ] ifFalse:[
+            'ObjectFileLoader [warning]: class ' errorPrint. aClassName errorPrint.
+            ' did not define itself' errorPrintCR
+            "
+             do not unload - could have installed other classes/methods ...
+            "
+        ].
+        Smalltalk flushCachedClasses.
+        ^ newClass
     ].
 
     Verbose ifTrue:[
-	('no symbol: ', symName,' in ',aFileName) infoPrintCR.
+        ('no symbol: ', symName,' in ',aFileName) infoPrintCR.
     ].
 
     "
      unload
     "
     Verbose ifTrue:[
-	'unloading due to init failure:' infoPrint. handle pathName infoPrintCR.
+        'unloading due to init failure:' infoPrint. handle pathName infoPrintCR.
     ].
 
     moreHandles notNil ifTrue:[
-	moreHandles do:[:aHandle |
-	    Verbose ifTrue:[
-		('unloading: ', aHandle printString) infoPrintCR.
-	    ].
-	    self unloadDynamicObject:handle.
-	]
+        moreHandles do:[:aHandle |
+            Verbose ifTrue:[
+                ('unloading: ', aHandle printString) infoPrintCR.
+            ].
+            self unloadDynamicObject:handle.
+        ]
     ].
 
     Verbose ifTrue:[
-	('unloading: ', handle printString) infoPrintCR.
+        ('unloading: ', handle printString) infoPrintCR.
     ].
     self unloadDynamicObject:handle.
     ^ nil
@@ -4097,6 +4097,6 @@
 !ObjectFileLoader class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/ObjectFileLoader.st,v 1.222 2001-11-10 01:06:10 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/ObjectFileLoader.st,v 1.223 2002-02-25 19:58:58 cg Exp $'
 ! !
 ObjectFileLoader initialize!