--- a/smalltalk.rc Mon May 13 13:12:33 2002 +0200
+++ b/smalltalk.rc Tue May 21 10:16:25 2002 +0200
@@ -31,6 +31,60 @@
"/ display specifics to "d_<displayName>.rc"
"/ and private user stuff in "private.rc"
"/***************************************************************
+|cpu enableJIT|
+
+'smalltalk.rc [info]: initial startup (snapshot image restart is faster) ...' infoPrintCR.
+
+"/
+"/ the JIT translator is known to work with the following
+"/ architectures:
+"/ ix86 (linux, win32, unixware)
+"/ sgi-mips (irix)
+"/ alpha (osf)
+"/ sparc (solaris) [only tested with v7 & v8 & v9 cpus]
+"/ aix (rs6k) [not very well tested]
+"/
+enableJIT := false.
+
+cpu := OperatingSystem getCPUType.
+(#(
+ 'i386'
+ 'sparc'
+ 'mips'
+ 'alpha'
+) includes:cpu) ifTrue:[
+ enableJIT := true.
+
+ cpu = 'sparc' ifTrue:[
+ "/ for now, disable if we detect running on a sparcV10;
+ "/ Reason:
+ "/ we do not have v10 machines here at Exept (they even do not exist at this time),
+ "/ and therefore have no way of checking if it runs on v10.
+ "/ I dont want ST/X to crash on your side in that case ...
+ "/ ... better run a bit slower than not running at all.
+ "/ Please let us know if it runs and we will remove the code below
+ "/ (which you should do as well).
+
+ ((OperatingSystem getSystemInfo at:#instructionSets) includesString:'sparcv10') ifTrue:[
+ 'smalltalk.rc [warning]: disable JIT for sparcV10 - not yet validated' infoPrintCR.
+ enableJIT := false
+ ]
+ ]
+].
+
+enableJIT ifTrue:[
+ "/ 'smalltalk.rc [info]: turn on JIT ...' infoPrintCR.
+ ObjectMemory justInTimeCompilation:true.
+].
+
+"/ OperatingSystem disableSignal:14.
+
+ObjectMemory infoPrinting:false.
+"/ Smalltalk loadBinaries:true.
+Compiler allowUnderscoreInIdentifier:true.
+Compiler warnUnderscoreInIdentifier:false.
+Compiler warnSTXSpecials:false.
+!
"/
"/ allow definition of the systemPath from an environment variable
@@ -42,7 +96,7 @@
"/ funny viewStyles, colors and stupid strings if wrong.
"/
-|path systemPath|
+|path|
(path := OperatingSystem getEnvironment:'STX_SYSTEMPATH') notNil ifTrue:[
Smalltalk systemPath:(path asCollectionOfSubstringsSeparatedBy:$:)
@@ -56,32 +110,6 @@
Smalltalk systemPath:(Smalltalk systemPath remove:path; yourself).
]
].
-(path := OperatingSystem getEnvironment:'STX_PACKAGEPATH') notNil ifTrue:[
- Smalltalk packagePath:(path asCollectionOfSubstringsSeparatedBy:$:).
- 'smalltalk.rc [info]: setting packagePath from STX_PACKAGEPATH' printCR.
- "/ 'packagePath: ' print. Smalltalk packagePath printCR.
-] ifFalse:[
- "/
- "/ if running in the development environment,
- "/ only use the local packages.
- "/
- ('../../projects' asFilename exists
- and:['../../projects/smalltalk' asFilename exists]) ifTrue:[
- Smalltalk packagePath removeAll; add:'../../..'.
- 'smalltalk.rc [info]: setting packagePath for local operation' printCR.
- "/ 'packagePath: ' print. Smalltalk packagePath printCR.
- ].
-
- "/
- "/ any additional local packages ?.
- "/
- 'packages' asFilename exists ifTrue:[
- Smalltalk packagePath addFirst:'./packages'.
- "/ 'additional local packages' printCR.
- "/ 'packagePath: ' print. Smalltalk packagePath printCR.
- ].
-].
-
'../../libbasic' asFilename exists ifTrue:[
Smalltalk systemPath addFirst:'../..'.
].
@@ -91,62 +119,107 @@
Smalltalk systemPath remove:'.'.
].
Smalltalk systemPath addFirst:'.'.
+
+(path := OperatingSystem getEnvironment:'STX_PACKAGEPATH') notNil ifTrue:[
+ Smalltalk packagePath:(path asCollectionOfSubstringsSeparatedBy:$:).
+ 'smalltalk.rc [info]: setting packagePath from STX_PACKAGEPATH' printCR.
+] ifFalse:[
+ "/
+ "/ if running in the development environment,
+ "/ only use the local packages.
+ "/
+ '../../projects/smalltalk' asFilename exists ifTrue:[
+ Smalltalk packagePath removeAll; add:'../../..'.
+ 'smalltalk.rc [info]: setting packagePath for local operation' printCR.
+ ].
+
+ "/
+ "/ any additional local packages ?.
+ "/
+ 'packages' asFilename exists ifTrue:[
+ Smalltalk packagePath addFirst:'./packages'.
+ "/ 'additional local packages' printCR.
+ ].
+ "/ 'packagePath: ' print. Smalltalk packagePath printCR.
+].
+
Smalltalk flushPathCaches.
!
-|args|
+|args buildClasses openDisplay prevCatchSetting|
-args := Smalltalk commandLineArguments.
+args := Smalltalk commandLineArguments ? #().
+
+buildClasses := false.
((args size > 0) and:[args last = '--buildClasses']) ifTrue:[
'binary' asFilename isDirectory ifFalse:[
'smalltalk.rc [warning]: no binary directory for classes.' errorPrintCR.
- ] ifTrue:[
- "/
- "/ load all lazy classes
- "/
- Autoload subclasses do:[:aClass |
- Autoload autoloadFailedSignal handle:[:ex |
- 'smalltalk.rc [warning]: autoload failed' errorPrintCR.
- ex return.
- ] do:[
- 'smalltalk.rc [info]: loading ' infoPrint. aClass name infoPrint. ' ...' infoPrintCR.
- aClass autoload.
- ]
- ].
-
- "/
- "/ binary save all classes
- "/
- Autoload loadedClasses do:[:cls |
- 'smalltalk.rc [info]: saving binary of ' infoPrint. cls name infoPrint. ' ...' infoPrintCR.
- cls binaryFileOut.
- OperatingSystem executeCommand:'mv *.cls binary'.
- ]
+ Smalltalk exit.
].
- Smalltalk exit
-].
-
-((args includes:'--noBanner') or:[args includes:'-noBanner']) ifFalse:[
- Smalltalk fileIn:'showBanner.rc'.
+ buildClasses := true.
].
+"/ check for display-classes being required and compiled into the system;
+"/ if not, load the display classes.
"/
-"/ check for display-classes being compiled into the system;
-"/ (and if display connection can be established)
-"/ if not, enter a simple read-eval-print loop
+openDisplay := false.
+(Smalltalk isHeadless or:[args includes:'--noDisplay']) ifFalse:[
+ (Smalltalk at:#DeviceWorkstation) isNil ifTrue:[
+ "now view classes compiled into the system.
+ Minimum smalltalk does only contain libbasic, libcomp and librun.
+ FileIn view stuff"
+
+ 'smalltalk.rc [info]: installing required class libraries ...' infoPrintCR.
+ (Smalltalk isClassLibraryLoaded:'libbasic2') ifFalse:[
+ Smalltalk loadPackage:'stx:libbasic2'.
+ ].
+ Smalltalk loadPackage:'stx:libview'.
+ Smalltalk fileInClassLibrary:'XWorkstation' inPackage:'stx:libview'.
+ OperatingSystem isMSWINDOWSlike ifTrue:[
+ Smalltalk fileInClassLibrary:'WinWorkstation' inPackage:'stx:libview'.
+ ].
+ ].
+ openDisplay := true.
+].
+
+"/
+"/ the following are required (either compiled or interpreted) ...
+"/ required classes should be in libbasic
"/
-Smalltalk isHeadless ifFalse:[
- Display isNil ifTrue:[
- (args includes:'--noDisplay') ifFalse:[
- DeviceWorkstation notNil ifTrue:[
- 'smalltalk.rc [warning]: No Display connection.' errorPrintCR.
- 'smalltalk.rc [info]: Either set the DISPLAY environment variable,' infoPrintCR.
- 'smalltalk.rc [info]: or start smalltalk with a -display argument.' infoPrintCR.
- Smalltalk isStandAloneApp ifTrue:[
- Smalltalk exit
- ].
+#(
+ "/ ObsoleteObject
+ "/ BinaryIOManager BinaryInputManager BinaryOutputManager BinaryObjectStorage
+ StringCollection CachingRegistry
+) do:[:s |
+ (Smalltalk at:s) isNil ifTrue:[
+ ('smalltalk.rc [info]: loading ' , s , ' ...') infoPrintCR.
+ Smalltalk fileInClass:s initialize:true lazy:false silent:true
+ ]
+].
+
+"/ Install patches, once everything has been loaded.
+"/ System methods may be overwritten by patches.
+prevCatchSetting := Class catchMethodRedefinitions.
+Class catchMethodRedefinitions:false.
+(Smalltalk secureFileIn:(Smalltalk commandName asFilename withSuffix:'pch')) ifFalse:[
+ Smalltalk isStandAloneApp ifFalse:[
+ Smalltalk secureFileIn:'patches'.
+ ].
+].
+Class catchMethodRedefinitions:prevCatchSetting.
+
+
+openDisplay ifTrue:[
+ "/ open the graphical display
+ [
+ Screen openDefaultDisplay:nil.
+ ] on:Screen deviceOpenErrorSignal do:[:ex|
+ ('smalltalk.rc [warning]: No Display connection to: ', ex parameter) errorPrintCR.
+ 'smalltalk.rc [info]: Either set the DISPLAY environment variable,' infoPrintCR.
+ 'smalltalk.rc [info]: or start smalltalk with a -display argument.' infoPrintCR.
+ Smalltalk isStandAloneApp ifFalse:[
'' errorPrintCR.
'Textmode (enter smalltalk expressions terminated by single exclamation mark;' errorPrintCR.
OperatingSystem isUNIXlike ifTrue:[
@@ -155,14 +228,9 @@
' CTRL-Z to leave line-by-line interpreter.)' errorPrintCR.
].
Smalltalk readEvalPrint.
- Smalltalk exit
- ] ifFalse:[
- Smalltalk isStandAloneApp ifFalse:[
- 'smalltalk.rc [warning]: Configuration without display.' errorPrintCR.
- ]
].
+ Smalltalk exit
].
- ].
].
"/
@@ -173,6 +241,72 @@
"/
"/ Display unBuffered.
+(buildClasses or:[args includes:'--noBanner']) ifFalse:[
+ Smalltalk fileIn:'showBanner.rc'.
+].
+
+"/
+"/ lazy loading
+"/ (faster fileIn) - this is EXPERIMENTAL.
+"/
+"/ - if turned on, an autoload operation will only create methodStubs
+"/ (uncompiled) which trap when called the first time.
+"/ The bytecode compiler will compile them when first executen.
+"/
+"/ - if turned off, an autoload will load & compile the whole class,
+"/ which makes autoloading slower, but avoids the initial delays
+"/
+"/ This is much like just-in-time compilation, but on a higher level.
+"/ If there are any problems with lazy methods, disable the following
+"/ and let me (info@exept.de) know what happened.
+"/
+Autoload compileLazy:true.
+
+"/
+"/ read the abbrev.stc file, extract class names
+"/ and install all nonExisting classes as autoloaded
+"/
+
+Class withoutUpdatingChangesDo:[
+ |needToReactivate|
+
+ HistoryManager notNil ifTrue:[
+ needToReactivate := HistoryManager isActive.
+ HistoryManager deactivate.
+ ] ifFalse:[
+ needToReactivate := false
+ ].
+ 'smalltalk.rc [info]: installing autoloaded classes ...' infoPrintCR.
+ Smalltalk installAutoloadedClasses.
+ needToReactivate ifTrue:[HistoryManager activate].
+].
+
+buildClasses ifTrue:[
+ "/
+ "/ load all lazy classes
+ "/
+ Autoload subclasses do:[:aClass |
+ Autoload autoloadFailedSignal handle:[:ex |
+ 'smalltalk.rc [warning]: autoload failed' errorPrintCR.
+ ex return.
+ ] do:[
+ 'smalltalk.rc [info]: loading ' infoPrint. aClass name infoPrint. ' ...' infoPrintCR.
+ aClass autoload.
+ ]
+ ].
+
+ "/
+ "/ binary save all classes
+ "/
+ Autoload loadedClasses do:[:cls |
+ 'smalltalk.rc [info]: saving binary of ' infoPrint. cls name infoPrint. ' ...' infoPrintCR.
+ cls binaryFileOut.
+ OperatingSystem executeCommand:'mv *.cls binary'.
+ ]
+ Smalltalk exit
+].
+!
+
"/
"/ this starts the incremental GC earlier
"/ (default is 500000)
@@ -232,7 +366,7 @@
ObjectMemory fastMoreOldSpaceAllocation:true.
!
-"/ another experimental (and a secret for now, since I dont want
+"/ another experimental (and a secret for now, since I don't want
"/ you to play with those ;-)
"/ For now, this is experimental. Once the best numbers
"/ have been found, I'll hardwire them and document it ...
@@ -259,52 +393,7 @@
a := #(nil nil nil nil -20 -8 -3 -1 -1 1 16 nil) copy.
].
ObjectMemory tenureParameters:a.
-
-"/
-"/ lazy loading
-"/ (faster fileIn) - this is EXPERIMENTAL.
-"/
-"/ - if turned on, an autoload operation will only create methodStubs
-"/ (uncompiled) which trap when called the first time.
-"/ The bytecode compiler will compile them when first executen.
-"/
-"/ - if turned off, an autoload will load & compile the while class,
-"/ which makes autoloading slower, but avoids the initial delays
-"/
-"/ This is much like just-in-time compilation, but on a higher level.
-"/ If there are any problems with lazy methods, disable the following
-"/ and let me (cg@exept.ssw.de) know what happened.
-"/
-Autoload compileLazy:true.
-
-"/
-"/ read the abbrev.stc file, extract class names
-"/ and install all nonExisting classes as autoloaded
-"/
-HistoryManager notNil ifTrue:[
- needToReactivate := HistoryManager isActive.
- HistoryManager deactivate.
-] ifFalse:[
- needToReactivate := false
-].
-
-Class withoutUpdatingChangesDo:[
- 'smalltalk.rc [info]: installing autoloaded classes ...' infoPrintCR.
- Smalltalk installAutoloadedClasses.
-].
-needToReactivate ifTrue:[HistoryManager activate].
-
-"/
-"/ define the language (you can also set the LANG-shell variable)
-"/ (currently #english, #german and #french are supported).
-"/ some fragments for other languages (japanese ;-) exist.
-"/ Setting it here will override the LANG variable setting,
-"/ if neither set here nor in LANG, #english is the default.
-"/ see (and enhance) the resource files
-"/ Claus: supposed to be done in private.rc or via LANG variable
-"/
-"/ Smalltalk language:#german.
-"/ Smalltalk language:#english.
+!
"/
"/ this defines stuff relating to the host we are running on
@@ -318,8 +407,8 @@
"/ Notice, that the display may be different from the host we run on;
"/ Host specific things are configured in host.rc.
"/
-"/ 'smalltalk.rc [info]: reading ''display.rc'' ...' infoPrintCR.
Display notNil ifTrue:[
+ "/ 'smalltalk.rc [info]: reading ''display.rc'' ...' infoPrintCR.
Smalltalk fileIn:'display.rc'.
].
@@ -340,25 +429,20 @@
"/ - or start stx with a suppress argument.
"/
-Smalltalk isStandAloneApp ifFalse:[
- Smalltalk isHeadless ifFalse:[
- Display notNil ifTrue:[
- (Smalltalk commandLineArguments includes:'--noLicenceBox') ifFalse:[
- Smalltalk addStartBlock:[
- 'smalltalk.rc [info]: show licence conditions ...' infoPrintCR.
+(Smalltalk isStandAloneApp not and:[Display notNil]) ifTrue:[
+ (Smalltalk commandLineArguments includes:'--noLicenceBox') ifFalse:[
+ Smalltalk addStartBlock:[
+ 'smalltalk.rc [info]: show licence conditions ...' infoPrintCR.
- LicenceBox autoload.
-
- LicenceBox licenceRejectSignal handle:[:ex|
- Smalltalk exit
- ] do:[
- (LicenceBox open) ifFalse:[Smalltalk exit].
- Smalltalk at:#LicenceBox put:nil.
- ].
- ]
+ LicenceBox autoload.
+ LicenceBox licenceRejectSignal handle:[:ex|
+ Smalltalk exit
+ ] do:[
+ (LicenceBox open) ifFalse:[Smalltalk exit].
+ Smalltalk at:#LicenceBox put:nil.
+ ].
]
]
- ]
].
!
@@ -399,15 +483,9 @@
"/ Smalltalk at:#Disk put:(Filename rootDirectory)
"/ ].
-Display notNil ifTrue:[
- Smalltalk at:#Window put:(Display class).
- Smalltalk at:#Screen put:(Display class).
- Smalltalk at:#Sensor put:Display.
-] ifFalse:[
- DeviceWorkstation notNil ifTrue:[
- Smalltalk at:#Window put:DeviceWorkstation.
- Smalltalk at:#Screen put:DeviceWorkstation.
- ]
+Screen notNil ifTrue:[
+ Smalltalk at:#Window put:Screen.
+ Smalltalk at:#Sensor put:Screen default.
].
"/
@@ -424,7 +502,7 @@
'smalltalk.rc [info]: reading ''private.rc'' ...' infoPrintCR.
Smalltalk fileIn:'private.rc'.
-DeviceWorkstation notNil ifTrue:[
+Screen notNil ifTrue:[
"/
"/ read saved configuration settings (if any)
"/
@@ -566,7 +644,4 @@
].
]
].
-!
-Smalltalk fileIn:'hideBanner.rc'.
-