Smalltalk.st
changeset 18385 2d0a9c256e0e
parent 18384 bc41e6ca5a7c
child 18389 387190d575f5
child 18560 a37464a68e70
--- a/Smalltalk.st	Fri May 22 20:19:16 2015 +0200
+++ b/Smalltalk.st	Fri May 22 20:41:08 2015 +0200
@@ -609,8 +609,10 @@
      Here, a few specific initializations are done, then the actual initialization is
      done inside an error handler in basicInitializeSystem.
      Notice:
-	this is NOT called when an image is restarted;
-	in this case the show starts in Smalltalk>>restart."
+        this is called by the VM's main entry. You will not find senders from Smalltalk.
+     Also Notice:
+        this is NOT called when an image is restarted;
+        in this case the show starts in Smalltalk>>restart."
 
     |idx|
 
@@ -620,79 +622,79 @@
     AbstractOperatingSystem initializeConcreteClass.
 
     CommandLineArguments isEmptyOrNil ifTrue:[
-	CommandLineArguments := #('stx') asOrderedCollection.
+        CommandLineArguments := #('stx') asOrderedCollection.
     ].
     CommandLine := CommandLineArguments copy.
     CommandLineArguments := CommandLineArguments asOrderedCollection.
     CommandName := CommandLineArguments removeFirst. "/ the command
 
     (idx := CommandLineArguments indexOf:'--silentStartup') ~~ 0 ifTrue:[
-	SilentLoading := true.
-	CommandLineArguments removeIndex:idx
+        SilentLoading := true.
+        CommandLineArguments removeIndex:idx
     ] ifFalse:[
-	SilentLoading := false.
+        SilentLoading := false.
     ].
     (idx := CommandLineArguments indexOf:'--verboseLoading') ~~ 0 ifTrue:[
-	VerboseLoading := true.
-	CommandLineArguments removeIndex:idx
+        VerboseLoading := true.
+        CommandLineArguments removeIndex:idx
     ] ifFalse:[
-	VerboseLoading := false.
+        VerboseLoading := false.
     ].
     (idx := CommandLineArguments indexOf:'--verboseStartup') ~~ 0 ifTrue:[
-	VerboseLoading := true.
-	VerboseStartup := true.
-	CommandLineArguments removeIndex:idx
+        VerboseLoading := true.
+        VerboseStartup := true.
+        CommandLineArguments removeIndex:idx
     ] ifFalse:[
-	VerboseStartup := false.
+        VerboseStartup := false.
     ].
     (idx := CommandLineArguments indexOf:'--verbose') ~~ 0 ifTrue:[
-	Verbose := true.
-	VerboseLoading := true.
-	VerboseStartup := true.
-	CommandLineArguments removeIndex:idx
+        Verbose := true.
+        VerboseLoading := true.
+        VerboseStartup := true.
+        CommandLineArguments removeIndex:idx
     ] ifFalse:[
-	Verbose := false.
+        Verbose := false.
     ].
 
     DebuggingStandAlone := false.
 
     StandAlone ifTrue:[
-	InfoPrinting := false.
-	ObjectMemory infoPrinting:false.
-	IgnoreAssertions := true.
-
-	idx := CommandLineArguments indexOf:'--debug'.
-	idx ~~ 0 ifTrue:[
-	    DebuggingStandAlone := true.
-	].
-	DebuggingStandAlone ifTrue:[
-	    Inspector := MiniInspector.
-	    Debugger := MiniDebugger.
-	    IgnoreAssertions := false.
-	].
+        InfoPrinting := false.
+        ObjectMemory infoPrinting:false.
+        IgnoreAssertions := true.
+
+        idx := CommandLineArguments indexOf:'--debug'.
+        idx ~~ 0 ifTrue:[
+            DebuggingStandAlone := true.
+        ].
+        DebuggingStandAlone ifTrue:[
+            Inspector := MiniInspector.
+            Debugger := MiniDebugger.
+            IgnoreAssertions := false.
+        ].
     ] ifFalse:[
-	"/
-	"/ define low-level debugging tools - graphical classes are not prepared yet
-	"/ to handle things.
-	"/ This will bring us into the MiniDebugger when an error occurs during startup.
-	"/
-	Inspector := MiniInspector.
-	Debugger := MiniDebugger.
-	IgnoreAssertions := false.
+        "/
+        "/ define low-level debugging tools - graphical classes are not prepared yet
+        "/ to handle things.
+        "/ This will bring us into the MiniDebugger when an error occurs during startup.
+        "/
+        Inspector := MiniInspector.
+        Debugger := MiniDebugger.
+        IgnoreAssertions := false.
     ].
 
     Error handle:[:ex |
-	StandAlone ifTrue:[
-	    DebuggingStandAlone ifFalse:[
-		'Startup Error - use "--debug" command line argument for more info' errorPrintCR.
-		Smalltalk exit:1.
-	    ].
-	    'Smalltalk [error]: Error during early initialization:' errorPrintCR.
-	    thisContext fullPrintAll.
-	].
-	ex reject.
+        StandAlone ifTrue:[
+            DebuggingStandAlone ifFalse:[
+                'Startup Error - use "--debug" command line argument for more info' errorPrintCR.
+                Smalltalk exit:1.
+            ].
+            'Smalltalk [error]: Error during early initialization:' errorPrintCR.
+            thisContext fullPrintAll.
+        ].
+        ex reject.
     ] do:[
-	self basicInitializeSystem
+        self basicInitializeSystem
     ].
 
     "Modified: / 12-10-2010 / 11:27:47 / cg"
@@ -3896,21 +3898,23 @@
 
 restart
     "startup after an image has been loaded;
+     This is called by the VM's main entry - you should not find senders from Smalltalk.
+
      there are three change-notifications made to dependents of ObjectMemory,
      which allow a stepwise re-init: #earlyRestart, #restarted and #returnFromSnapshot.
 
      #earlySystemInstallation is sent for ST80 compatibility
 
      #earlyRestart is send first, nothing has been setup yet.
-		   (should be used to flush all device dependent entries)
+                   (should be used to flush all device dependent entries)
 
      #restarted is send right after.
-		   (should be used to recreate external resources (fds, bitmaps etc)
+                   (should be used to recreate external resources (fds, bitmaps etc)
 
      #returnFromSnapshot is sent last
-		   (should be used to restart processes, reOpen Streams which cannot
-		    be automatically be reopened (i.e. Sockets, Pipes) and so on.
-		   (Notice that positionable fileStreams are already reopened and repositioned)
+                   (should be used to restart processes, reOpen Streams which cannot
+                    be automatically be reopened (i.e. Sockets, Pipes) and so on.
+                   (Notice that positionable fileStreams are already reopened and repositioned)
      "
 
     |deb insp transcript idx|
@@ -3934,12 +3938,12 @@
 
     idx := CommandLineArguments indexOf:'-q'.
     idx == 0 ifTrue:[
-	idx := CommandLineArguments indexOf:'--silent'.
+        idx := CommandLineArguments indexOf:'--silent'.
     ].
     idx ~~ 0 ifTrue:[
-	Object infoPrinting:false.
-	ObjectMemory infoPrinting:false.
-	CommandLineArguments removeAtIndex:idx.
+        Object infoPrinting:false.
+        ObjectMemory infoPrinting:false.
+        CommandLineArguments removeAtIndex:idx.
     ].
 
     "/ start catching SIGSEGV and SIGBUS
@@ -3965,7 +3969,7 @@
     insp := Inspector.
     deb := Debugger.
     deb notNil ifTrue:[
-	deb reinitialize
+        deb reinitialize
     ].
     Inspector := MiniInspector.
     Debugger := MiniDebugger.
@@ -3978,16 +3982,16 @@
     "/ ObjectFileLoader; therefore, must reload before doing any notifications.
 
     ObjectFileLoader notNil ifTrue:[
-	ObjectFileLoader reloadAllRememberedObjectFiles.
+        ObjectFileLoader reloadAllRememberedObjectFiles.
     ].
 
     "/ invalidate all display connections.
     "/ This is required to avoid trouble if someone accesses
     "/ a display during early startup.
     Screen notNil ifTrue:[
-	Screen allScreens do:[:eachDisplay |
-	    eachDisplay invalidateConnection.
-	].
+        Screen allScreens do:[:eachDisplay |
+            eachDisplay invalidateConnection.
+        ].
     ].
 
     ObjectMemory changed:#earlySystemInstallation.
@@ -3999,7 +4003,7 @@
     "/ flush device handles & recreate OS resources (if possible)
     "/ (mostly view/GC/color & font stuff)
     ObjectMemory
-	changed:#earlyRestart; changed:#restarted.
+        changed:#earlyRestart; changed:#restarted.
 
     "/ start catching SIGINT and SIGQUIT
     OperatingSystem enableUserInterrupts.
@@ -4010,78 +4014,78 @@
     "/ reading if smalltalk_r.rc may be suppressed by the --faststart argument.
     idx := CommandLineArguments indexOf:'--faststart'.
     idx == 0 ifTrue:[
-	idx := CommandLineArguments indexOf:'--fastStart'.
+        idx := CommandLineArguments indexOf:'--fastStart'.
     ].
     idx ~~ 0 ifTrue:[
-	CommandLineArguments removeAtIndex:idx.
+        CommandLineArguments removeAtIndex:idx.
     ] ifFalse:[
-	CallbackSignal := QuerySignal new.
-	[
-	    Class withoutUpdatingChangesDo:[
-		(self fileIn:(self commandName , '_r.rc')) ifFalse:[
-		    "no _r.rc file where executable is; try default smalltalk_r.rc"
-		    self fileIn:'smalltalk_r.rc'
-		].
-	    ]
-	] on:CallbackSignal do:[:ex|
-	    "/ now, display and view-stuff works;
-	    "/ back to the previous debugging interface
-	    Inspector := insp.
-	    Debugger := deb.
-
-	    "/ reinstall Transcript, if not changed during restart.
-	    "/ if there was no Transcript, go to stderr
-	    (transcript notNil and:[Transcript == Stderr]) ifTrue:[
-		Transcript := transcript.
-	    ].
-	    Initializing := false.
-	    ex proceed.
-	].
-	CallbackSignal := nil.
+        CallbackSignal := QuerySignal new.
+        [
+            Class withoutUpdatingChangesDo:[
+                (self fileIn:(self commandName , '_r.rc')) ifFalse:[
+                    "no _r.rc file where executable is; try default smalltalk_r.rc"
+                    self fileIn:'smalltalk_r.rc'
+                ].
+            ]
+        ] on:CallbackSignal do:[:ex|
+            "/ now, display and view-stuff works;
+            "/ back to the previous debugging interface
+            Inspector := insp.
+            Debugger := deb.
+
+            "/ reinstall Transcript, if not changed during restart.
+            "/ if there was no Transcript, go to stderr
+            (transcript notNil and:[Transcript == Stderr]) ifTrue:[
+                Transcript := transcript.
+            ].
+            Initializing := false.
+            ex proceed.
+        ].
+        CallbackSignal := nil.
     ].
 
     "/ reinitialization (restart) of Display is normally performed
     "/ in the restart script. If this has not been run for some reason,
     "/ do in now.
     Initializing ifTrue:[
-	Display notNil ifTrue:[
-	    [
-		Display reinitializeFor:Screen defaultDisplayName.
-	    ] on:Screen deviceOpenErrorSignal do:[
-		'Smalltalk [error]: Cannot restart connection to: ' errorPrint.
-		Screen defaultDisplayName errorPrintCR.
-		OperatingSystem exit:1.
-	    ].
-	].
-	"/ now, display and view-stuff works;
-	"/ back to the previous debugging interface
-
-	Inspector := insp.
-	Debugger := deb.
-
-	"/ reinstall Transcript, if not changed during restart.
-	"/ if there was no Transcript, go to stderr
-
-	(transcript notNil and:[Transcript == Stderr]) ifTrue:[
-	    Transcript := transcript.
-	].
-	Initializing := false.
+        Display notNil ifTrue:[
+            [
+                Display reinitializeFor:Screen defaultDisplayName.
+            ] on:Screen deviceOpenErrorSignal do:[
+                'Smalltalk [error]: Cannot restart connection to: ' errorPrint.
+                Screen defaultDisplayName errorPrintCR.
+                OperatingSystem exit:1.
+            ].
+        ].
+        "/ now, display and view-stuff works;
+        "/ back to the previous debugging interface
+
+        Inspector := insp.
+        Debugger := deb.
+
+        "/ reinstall Transcript, if not changed during restart.
+        "/ if there was no Transcript, go to stderr
+
+        (transcript notNil and:[Transcript == Stderr]) ifTrue:[
+            Transcript := transcript.
+        ].
+        Initializing := false.
     ].
     Screen notNil ifTrue:[
-	"clean up leftover screens (and views) that haven't been reopened.
-	 Operate on a copy, since brokenConnection removes us from AllScreens"
-	Screen allScreens copy do:[:eachDisplay |
-	    eachDisplay isOpen ifFalse:[
-		'Smalltalk [info]: cannot reopen secondary display: ' errorPrint.
-		eachDisplay errorPrintCR.
-		eachDisplay cleanupAfterDispatch; brokenConnection.
-	    ]
-	].
+        "clean up leftover screens (and views) that haven't been reopened.
+         Operate on a copy, since brokenConnection removes us from AllScreens"
+        Screen allScreens copy do:[:eachDisplay |
+            eachDisplay isOpen ifFalse:[
+                'Smalltalk [info]: cannot reopen secondary display: ' errorPrint.
+                eachDisplay errorPrintCR.
+                eachDisplay cleanupAfterDispatch; brokenConnection.
+            ]
+        ].
     ].
 
     deb := insp := transcript := nil.   "avoid dangling refs"
     (StartupClass perform:#keepSplashWindowOpen ifNotUnderstood:[false]) ifFalse:[
-	self hideSplashWindow.   "/ if there is one, it's now time to hide it
+        self hideSplashWindow.   "/ if there is one, it's now time to hide it
     ].
     self mainStartup:true
 
@@ -8280,11 +8284,11 @@
 !Smalltalk class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.1132 2015-05-22 18:19:16 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.1133 2015-05-22 18:41:08 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.1132 2015-05-22 18:19:16 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.1133 2015-05-22 18:41:08 cg Exp $'
 !
 
 version_SVN