Eliot Miranda uploaded a new version of ReleaseBuilder to project The Trunk:
http://source.squeak.org/trunk/ReleaseBuilder-eem.175.mcz
==================== Summary ====================
Name: ReleaseBuilder-eem.175
Author: eem
Time: 16 January 2018, 9:27:21.1982 am
UUID: 76764a70-9b31-4ed9-b812-548875319786
Ancestors: ReleaseBuilder-eem.174
Fix installing the new ReleaseBuilder class>>initialize method so that setNewSystemVersion: works in subclasses (needed e.g. for ReleaseBuilderSqueakland).
=============== Diff against ReleaseBuilder-eem.174 ===============
Item was changed:
----- Method: ReleaseBuilder class>>setNewSystemVersion: (in category 'manual') -----
setNewSystemVersion: version
+ | implementingClass initializeMethodSource |
- | initializeMethodSource |
initializeMethodSource := self initializeTemplate format: {version}.
+ implementingClass := self class whichClassIncludesSelector: #initialize.
+ (implementingClass >> #initialize) getSource asString ~= initializeMethodSource ifTrue:
+ [implementingClass
- (self class >> #initialize) getSource asString ~= initializeMethodSource ifTrue:
- [self class
compile: initializeMethodSource
classified: 'class initialization'].
self initialize.
self assert: (SystemVersion current version beginsWith: self versionString).
SystemVersion current isRelease ifFalse: [
self inform: ('You just changed the system version to {1}.\Please upload the changed ''ReleaseBuilder'' package to\\ {2}\\so that this version change will be official.' translated withCRs format: {SystemVersion current version. self buildRepository description})]!
Eliot Miranda uploaded a new version of ReleaseBuilder to project The Trunk:
http://source.squeak.org/trunk/ReleaseBuilder-eem.173.mcz
==================== Summary ====================
Name: ReleaseBuilder-eem.173
Author: eem
Time: 14 January 2018, 9:41:01.742395 am
UUID: 28681eda-100f-47a1-bd88-9f1a3a767951
Ancestors: ReleaseBuilder-eem.172
Allow the user to answer questions up front, hence allowing running the release process without user intervention,. This to debug the new bytecode set which looks to have a store check issue that is only seen long after the system is recompiied].
=============== Diff against ReleaseBuilder-eem.172 ===============
Item was changed:
Object subclass: #ReleaseBuilder
instanceVariableNames: ''
+ classVariableNames: 'DeferredTask NextMajorVersion NextMinorVersion NextTask QAndA'
- classVariableNames: 'DeferredTask NextMajorVersion NextMinorVersion NextTask'
poolDictionaries: ''
category: 'ReleaseBuilder'!
!ReleaseBuilder commentStamp: 'mt 6/22/2016 18:08' prior: 0!
I'm the script that prepares a trunk image for release.
Just do "ReleaseBuilder doNextStep" repeatedly until the next release is done.
For the final release step:
- If you want to try it locally, change #localBuild to return true.
- Most of the code operates (read-only) on the build repository, which is usually the trunk. For releases, there is a release repository, to which some package versions will be copied from trunk.!
Item was added:
+ ----- Method: ReleaseBuilder class>>askInAdvance (in category 'preparing') -----
+ askInAdvance
+ "Preload QAndA with answers to any questions that will be asked during saving."
+ "ReleaseBuilder askInAdvance"
+ (self systemNavigation allCallsOn: #confirm:orCancel:title: localTo: self class) do:
+ [:methodRef|
+ methodRef compiledMethod methodNode nodesDo:
+ [:node|
+ (node isMessage
+ and: [node selector key == #confirm:orCancel:title:
+ and: [node receiver isVariableNode
+ and: [node receiver key = 'self']]]) ifTrue:
+ [[:questionNode :ingored :titleNode|
+ QAndA
+ at: titleNode key
+ put: (Project uiManager
+ confirm: questionNode key translated
+ orCancel: [^self]
+ title: titleNode key translated)]
+ valueWithArguments: node arguments asArray]]]!
Item was changed:
----- Method: ReleaseBuilder class>>checkForDirtyPackages (in category 'scripts - support') -----
checkForDirtyPackages
| modifiedWorkingCopies unmergedWorkingCopies |
MCWorkingCopy checkModified: true.
modifiedWorkingCopies := MCWorkingCopy allManagers
select: [:wc | wc ancestors size = 1 and: [wc modified] ].
unmergedWorkingCopies := MCWorkingCopy allManagers
select: [:wc | (wc ancestors size = 1) not ].
unmergedWorkingCopies ifNotEmpty: [
"Sort to simplify exploration. MC browser does also show packages sorted."
(modifiedWorkingCopies sorted: [:wc1 :wc2 | wc1 packageName <= wc2 packageName]) explore.
Warning signal: 'There are unmerged packages.'].
modifiedWorkingCopies ifNotEmpty: [
"Sort to simplify exploration. MC browser does also show packages sorted."
(modifiedWorkingCopies sorted: [:wc1 :wc2 | wc1 packageName <= wc2 packageName]) explore.
+ (self
- (Project current uiManager
confirm: 'Do you want to discard all local changes?'
orCancel: [^ Error signal: 'Release building canceled.']
title: 'Dirty Packages Found')
ifTrue: [modifiedWorkingCopies do: [:wc |
[(self buildRepository versionWithInfo: wc ancestors first) load]
on: Warning do: [:warning | warning resume]]]].!
Item was added:
+ ----- Method: ReleaseBuilder class>>clearQAndA (in category 'preparing') -----
+ clearQAndA
+ "Get rid of any previous answers to questions"
+ QAndA := Dictionary new!
Item was added:
+ ----- Method: ReleaseBuilder class>>confirm:orCancel:title: (in category 'preparing') -----
+ confirm: aString orCancel: cancelBlock title: titleString
+ "Allow questions to be answered in advance."
+ ^QAndA
+ at: titleString
+ ifAbsent:
+ [Project uiManager
+ confirm: aString translated
+ orCancel: cancelBlock
+ title: titleString translated]!
Item was changed:
----- Method: ReleaseBuilder class>>initialize (in category 'class initialization') -----
initialize
+
+ QAndA ifNil: [self clearQAndA].
+
"We have to be after AutoStart so that Morphic is up and running."
Smalltalk addToStartUpList: ReleaseBuilder after: AutoStart.
+
+ SystemVersion newVersion: 'Squeak6.0alpha'!
-
- SystemVersion newVersion: 'Squeak6.0alpha'.!
Item was changed:
----- Method: ReleaseBuilder class>>initializeTemplate (in category 'class initialization') -----
initializeTemplate
^ 'initialize
+
+ QAndA ifNil: [self clearQAndA].
+
"We have to be after AutoStart so that Morphic is up and running."
Smalltalk addToStartUpList: ReleaseBuilder after: AutoStart.
+
+ SystemVersion newVersion: ''{1}'''!
-
- SystemVersion newVersion: ''{1}''.'!
Item was changed:
----- Method: ReleaseBuilder class>>recompileAll (in category 'scripts - support') -----
recompileAll
(Smalltalk classNamed: #EncoderForSistaV1) ifNotNil:
[:sistaBytecodeSet|
CompiledCode preferredBytecodeSetEncoderClass ~~ sistaBytecodeSet ifTrue:
+ [(self
- [(Project uiManager
confirm: 'Do you want to make it the default in this release?'
orCancel: [false]
title: 'The SistaV1 Bytecode Set Is Available') ifTrue:
[CompiledCode
installSecondaryBytecodeSet: sistaBytecodeSet;
preferredBytecodeSetEncoderClass: sistaBytecodeSet]]].
Compiler recompileAll!
Item was changed:
----- Method: ReleaseBuilder class>>setNewSystemVersion: (in category 'manual') -----
setNewSystemVersion: version
+ | initializeMethodSource |
+ initializeMethodSource := self initializeTemplate format: {version}.
+ (self class >> #initialize) getSource asString ~= initializeMethodSource ifTrue:
+ [self class
+ compile: initializeMethodSource
+ classified: 'class initialization'].
- self class
- compile: (self initializeTemplate format: {version})
- classified: 'class initialization'.
self initialize.
self assert: (SystemVersion current version beginsWith: self versionString).
SystemVersion current isRelease ifFalse: [
+ self inform: ('You just changed the system version to {1}.\Please upload the changed ''ReleaseBuilder'' package to\\ {2}\\so that this version change will be official.' translated withCRs format: {SystemVersion current version. self buildRepository description})]!
- self inform: ('You just changed the system version to {1}.\Please upload the changed ''ReleaseBuilder'' package to\\ {2}\\so that this version change will be official.' translated withCRs format: {SystemVersion current version. self buildRepository description})].!
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1146.mcz
==================== Summary ====================
Name: Kernel-eem.1146
Author: eem
Time: 13 January 2018, 7:16:52.936871 pm
UUID: 3ff238e6-dc26-491f-96de-a9b1520c4608
Ancestors: Kernel-eem.1145
Follow Clément's lead and redefine CompiledCode>>#= in terms of the subclass responsibility hasSameLiteralsAs: which avoids comparing the last literal in COmpiledBlock (the outerCode pointer) which neatly eliminates infinite recursion and considers iotherwise identical blocks embedded in different methiods as being equal.
=============== Diff against Kernel-eem.1145 ===============
Item was added:
+ ----- Method: CompiledBlock>>hasSameLiteralsAs: (in category 'comparing') -----
+ hasSameLiteralsAs: aMethod
+ "Answer whether the receiver has the same sequence of literals as the argument.
+ Do not fully compare the last literal as this is the outerCode back pointer to the
+ containing method or block, and following it would cause infinite recursion. In any
+ case this is a useful definition because it considers identical block methods in other-
+ wise different containing blocks or methods to be the same, which makes sense."
+ | numLits |
+ numLits := self numLiterals.
+ numLits = aMethod numLiterals ifFalse: [^false].
+ 1 to: numLits - 1 do:
+ [:i| | lit1 lit2 |
+ lit1 := self literalAt: i.
+ lit2 := aMethod literalAt: i.
+ (lit1 == lit2 or: [lit1 literalEqual: lit2]) ifFalse:
+ [^false]].
+ ^(self literalAt: numLits) isCompiledCode = (aMethod literalAt: numLits) isCompiledCode!
Item was changed:
----- Method: CompiledCode>>= (in category 'comparing') -----
+ = aMethod
+ "Answer whether the receiver implements the same code as the argument, aMethod.
- = method
- "Answer whether the receiver implements the same code as the argument, method.
Here ``same code'' means that if the receiver's source is compiled with the same
compiler it should produce the same sequence of bytecodes and literals, same
trailer and same properties. Hence this definition of #= (only one of many plausible
definitions) can be used to quickly identify changes in the compiler's output."
+ self == aMethod ifTrue:
- | numLits |
- self == method ifTrue:
[^true].
+ (aMethod isCompiledCode
+ and: [self size = aMethod size
+ and: [self header = aMethod header]]) ifFalse:"N.B. includes numLiterals comparison."
+ [^false].
- method isCompiledCode ifFalse: [^false].
- self size = method size ifFalse: [^false].
- self header = method header ifFalse: [^false]. "N.B. includes numLiterals comparison."
self initialPC to: self endPC do:
+ [:i | (self at: i) = (aMethod at: i) ifFalse: [^false]].
+ ^self hasSameLiteralsAs: aMethod!
- [:i | (self at: i) = (method at: i) ifFalse: [^false]].
- numLits := self numLiterals.
- 1 to: numLits do:
- [:i| | lit1 lit2 |
- lit1 := self literalAt: i.
- lit2 := method literalAt: i.
- (lit1 == lit2 or: [lit1 literalEqual: lit2]) ifFalse:
- [(i = 1 and: [#(117 120) includes: self primitive])
- ifTrue:
- [lit1 isArray
- ifTrue:
- [(lit2 isArray and: [(lit1 first: 2) = (lit2 first: 2)]) ifFalse:
- [^false]]
- ifFalse: "ExternalLibraryFunction"
- [(lit1 analogousCodeTo: lit2) ifFalse:
- [^false]]]
- ifFalse:
- [i = (numLits - 1)
- ifTrue: "properties"
- [(self properties analogousCodeTo: method properties)
- ifFalse: [^false]]
- ifFalse: "last literal (methodClassAssociation) of class-side methods is not unique"
- "last literal of CompiledBlock is outerMethod and may not be unique."
- [(self isCompiledBlock
- and: [lit1 isCompiledCode
- and: [lit2 isCompiledCode]]) ifTrue:
- [^true].
- (i = numLits
- and: [lit1 isVariableBinding
- and: [lit2 isVariableBinding
- and: [lit1 key == lit2 key
- and: [lit1 value == lit2 value]]]]) ifFalse:
- [^false]]]]].
- ^true!
Item was added:
+ ----- Method: CompiledCode>>hasSameLiteralsAs: (in category 'comparing') -----
+ hasSameLiteralsAs: aMethod
+ "Answer whether the receiver has the same sequence of literals as the argument."
+ self subclassResponsibility!
Item was added:
+ ----- Method: CompiledMethod>>hasSameLiteralsAs: (in category 'comparing') -----
+ hasSameLiteralsAs: aMethod
+ "Answer whether the receiver has the same sequence of literals as the argument.
+ Compare the last literal, which is the class association, specially so as not to
+ differentiate between otherwise identical methods installed in different classes.
+ Compare the first literal carefully if it is the binding informaiton for an FFI or
+ external primitive call. Don't compare all of the state so that linked and unlinked
+ methods are still considered equal."
+ | numLits |
+ numLits := self numLiterals.
+ numLits = aMethod numLiterals ifFalse: [^false].
+ 1 to: numLits do:
+ [:i| | lit1 lit2 |
+ lit1 := self literalAt: i.
+ lit2 := aMethod literalAt: i.
+ (lit1 == lit2 or: [lit1 literalEqual: lit2]) ifFalse:
+ [(i = 1 and: [#(117 120) includes: self primitive])
+ ifTrue:
+ [lit1 isArray
+ ifTrue:
+ [(lit2 isArray and: [(lit1 first: 2) = (lit2 first: 2)]) ifFalse:
+ [^false]]
+ ifFalse: "ExternalLibraryFunction"
+ [(lit1 analogousCodeTo: lit2) ifFalse:
+ [^false]]]
+ ifFalse:
+ [i = (numLits - 1)
+ ifTrue: "properties"
+ [(self properties analogousCodeTo: aMethod properties)
+ ifFalse: [^false]]
+ ifFalse: "last literal (methodClassAssociation) of class-side methods is not unique"
+ "last literal of CompiledBlock is outerMethod and may not be unique."
+ [(self isCompiledBlock
+ and: [lit1 isCompiledCode
+ and: [lit2 isCompiledCode]]) ifTrue:
+ [^true].
+ (i = numLits
+ and: [lit1 isVariableBinding
+ and: [lit2 isVariableBinding
+ and: [lit1 key == lit2 key
+ and: [lit1 value == lit2 value]]]]) ifFalse:
+ [^false]]]]].
+ ^true!
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1145.mcz
==================== Summary ====================
Name: Kernel-eem.1145
Author: eem
Time: 12 January 2018, 3:33:18.61074 pm
UUID: f591fb75-2cc4-41e4-8d9e-f9f72219c0a6
Ancestors: Kernel-eem.1144
Full blokc support for decompileWithTemps
=============== Diff against Kernel-eem.1144 ===============
Item was added:
+ ----- Method: BlockClosure>>homeMethod (in category 'accessing') -----
+ homeMethod
+ ^outerContext method!
Item was changed:
----- Method: CompiledCode>>decompileWithTemps (in category 'decompiling') -----
decompileWithTemps
"Answer the decompiled parse tree that represents self, but with the temp names obtained
either by compiling the source code, or directly if the method has temps in its trailer."
+ ^self homeMethod decompileWithTemps!
- ^self method decompileWithTemps!
Item was changed:
----- Method: CompiledMethod>>decompileWithTemps (in category 'decompiling') -----
decompileWithTemps
"Return the decompiled parse tree that represents self, but with the temp names obtained
either by compiling the sourcecode, or directly if the method has temps in its trailer."
| class selector tempNames source |
class := self methodClass ifNil: [Object].
selector := self selector ifNil: [self defaultSelector].
self holdsTempNames
ifTrue: [tempNames := self tempNamesString]
ifFalse:
+ [| compiler |
+ "No source file or no source (e.g. doits) and no temp names
- ["No source file or no source (e.g. doits) and no temp names
-- decompile without temp names "
((self fileIndex > 0 and: [(SourceFiles at: self fileIndex) isNil])
or: [(source := self getSourceFromFile) isNil]) ifTrue:
[^self decompile].
+ compiler := class newCompiler.
+ compiler parser encoderClass: self encoderClass.
+ tempNames := (compiler
+ parse: source asString
+ in: class
+ notifying: nil)
+ generate: CompiledMethodTrailer empty;
+ schematicTempNamesString].
- tempNames := (class newCompiler
- parse: source asString
- in: class
- notifying: nil)
- generate: CompiledMethodTrailer empty;
- schematicTempNamesString].
^(self decompilerClass new withTempNames: tempNames)
decompile: selector
in: class
method: self methodForDecompile!
Item was added:
+ ----- Method: FullBlockClosure>>homeMethod (in category 'accessing') -----
+ homeMethod
+ ^self compiledBlock homeMethod!
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1144.mcz
==================== Summary ====================
Name: Kernel-eem.1144
Author: eem
Time: 12 January 2018, 11:39:55.477887 am
UUID: df2a5bb9-ac57-44c9-8d5c-d50a8ead225a
Ancestors: Kernel-eem.1143
Have the InstructionPrinter be honest about printing the pushLiteralVariable: bytecode. It's too confusing otherwise.
=============== Diff against Kernel-eem.1143 ===============
Item was changed:
----- Method: InstructionPrinter>>pushLiteralVariable: (in category 'instruction decoding') -----
pushLiteralVariable: anAssociation
+ "Print the Push Value Of anAssociation On Top Of Stack bytecode."
- "Print the Push Contents Of anAssociation On Top Of Stack bytecode."
+ self print: 'pushLitVar: ' , (anAssociation printStringLimitedTo: 64)!
- self print: 'pushLit: ' , anAssociation key!
Eliot Miranda uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-eem.995.mcz
==================== Summary ====================
Name: System-eem.995
Author: eem
Time: 12 January 2018, 9:15:45.697786 am
UUID: cef00121-56e2-4aed-91bc-ac09f60f8e95
Ancestors: System-akg.994
Revise the postscript so that the new PrimitiveError instance replaces the obsolete PrimitiveOSError instance.
=============== Diff against System-akg.994 ===============
Item was changed:
(PackageInfo named: 'System') postscript: '(Smalltalk specialSelectorNames includes: #~~) ifFalse:
["Re-create the specialObjectsArray to let the jit optimize #~~. Also add the new primitive error codes if they are not there yet."
| senders |
senders := #(#~~ #blockCopy:) gather: [ :selector |
"Recompile senders blockCopy: too, just in case."
SystemNavigation default allCallsOn: selector ].
Smalltalk recreateSpecialObjectsArray.
VariableNode initialize.
Decompiler initialize.
senders
do: [ :methodReference |
| class |
class := methodReference actualClass.
class recompile: methodReference selector from: class ]
displayingProgress: ''Recompiling...''].
+ "If PrimitiveError is not in the primitiveErrorTable, or if an instance
+ of a different class is there, then add it."
+ (Smalltalk primitiveErrorTable size < 21
+ or: [(Smalltalk primitiveErrorTable at: 21) class ~~ PrimitiveError]) ifTrue:
- "If PrimitiveOSError is not in the primitiveErrorTable, add it."
- Smalltalk primitiveErrorTable size < 21 ifTrue:
[Smalltalk recreateSpecialObjectsArray]'!
Eliot Miranda uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-akg.994.mcz
==================== Summary ====================
Name: System-akg.994
Author: akg
Time: 8 January 2018, 3:24:14.764929 pm
UUID: ff5974b8-48a2-4d89-92af-a4fc36269edf
Ancestors: System-tpr.993
- Rename PrimitiveOSError class to PrimitiveError
- Rename #isPrimitiveOSError to #isPrimitiveError
PrimitiveError holds an errorName that indicates what type of error it is, e.g. an OS error, thus the class doesn't need the "OS" in the name.
=============== Diff against System-tpr.993 ===============
Item was added:
+ ----- Method: Object>>isPrimitiveError (in category '*system-support') -----
+ isPrimitiveError
+ "Answer a boolean indicating if the receiver is an error object returned by a primitive"
+ ^false!
Item was removed:
- ----- Method: Object>>isPrimitiveOSError (in category '*System-Support-error handling') -----
- isPrimitiveOSError
- ^false!
Item was added:
+ Object subclass: #PrimitiveError
+ instanceVariableNames: 'errorName errorCode'
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'System-Support'!
+
+ !PrimitiveError commentStamp: 'akg 1/8/2018 15:09' prior: 0!
+ A PrimitiveError is used to answer a primitive failure code that has an associated operating system/library error.
+
+ Instance Variables
+ errorName: <Symbol>
+ errorCode: <Integer>
+
+ errorName
+ - typically #'operating system error'
+
+ errorCode
+ - the value of the error, a signed 64-bit value, a representation imposed by the VM; specific clients must map this error value into an unsigned value as appropriate if required
+
+ Typical usage is shown in the ficticious method below:
+
+ primitiveOperation
+ <primitive: 'primitiveOperation' module: 'APlugin' error: error>
+ ^(error isPrimitiveError)
+ ifTrue: [ self processErrorCode: error errorCode ]
+ ifFalse: [ self primitiveFailed ].!
Item was added:
+ ----- Method: PrimitiveError>>errorCode (in category 'accessing') -----
+ errorCode
+
+ ^errorCode!
Item was added:
+ ----- Method: PrimitiveError>>errorCode: (in category 'accessing') -----
+ errorCode: anInteger
+
+ errorCode := anInteger!
Item was added:
+ ----- Method: PrimitiveError>>errorName (in category 'accessing') -----
+ errorName
+
+ ^errorName!
Item was added:
+ ----- Method: PrimitiveError>>errorName: (in category 'accessing') -----
+ errorName: aSymbol
+
+ errorName := aSymbol!
Item was added:
+ ----- Method: PrimitiveError>>isPrimitiveError (in category 'testing') -----
+ isPrimitiveError
+ "Answer a boolean indicating if the receiver is an error object returned by a primitive"
+ ^true!
Item was removed:
- Object subclass: #PrimitiveOSError
- instanceVariableNames: 'errorName errorCode'
- classVariableNames: ''
- poolDictionaries: ''
- category: 'System-Support'!
-
- !PrimitiveOSError commentStamp: 'eem 12/7/2017 19:31' prior: 0!
- A PrimitiveOSError is used to answer a primitive failure code that has an associated operating system/library error.
-
- Instance Variables
- errorName: <Symbol>
- errorValue: <Integer>
-
- errorName
- - typically #'operating system error'
-
- errorValue
- - the value of the error, a signed 64-bit value, a representation imposed by the VM; specific clients must map this error value into an unsigned value as appropriate if required!
Item was removed:
- ----- Method: PrimitiveOSError>>errorCode (in category 'accessing') -----
- errorCode
-
- ^errorCode!
Item was removed:
- ----- Method: PrimitiveOSError>>errorCode: (in category 'accessing') -----
- errorCode: anObject
-
- errorCode := anObject!
Item was removed:
- ----- Method: PrimitiveOSError>>errorName (in category 'accessing') -----
- errorName
-
- ^errorName!
Item was removed:
- ----- Method: PrimitiveOSError>>errorName: (in category 'accessing') -----
- errorName: anObject
-
- errorName := anObject!
Item was removed:
- ----- Method: PrimitiveOSError>>isPrimitiveOSError (in category 'testing') -----
- isPrimitiveOSError
- ^true!
Item was changed:
----- Method: SmalltalkImage>>recreateSpecialObjectsArray (in category 'special objects') -----
recreateSpecialObjectsArray
"Smalltalk recreateSpecialObjectsArray"
"To external package developers:
**** DO NOT OVERRIDE THIS METHOD. *****
If you are writing a plugin and need additional special object(s) for your own use,
use addGCRoot() function and use own, separate special objects registry "
"The Special Objects Array is an array of objects used by the Squeak virtual machine.
Its contents are critical and accesses to it by the VM are unchecked, so don't even
think of playing here unless you know what you are doing."
| newArray |
newArray := Array new: 60.
"Nil false and true get used throughout the VM"
newArray at: 1 put: nil.
newArray at: 2 put: false.
newArray at: 3 put: true.
"This association holds the active process (a ProcessScheduler)"
newArray at: 4 put: (self specialObjectsArray at: 4) "(self bindingOf: #Processor) but it answers an Alias".
"Numerous classes below used for type checking and instantiation"
newArray at: 5 put: Bitmap.
newArray at: 6 put: SmallInteger.
newArray at: 7 put: ByteString.
newArray at: 8 put: Array.
newArray at: 9 put: Smalltalk.
newArray at: 10 put: BoxedFloat64.
newArray at: 11 put: (self globals at: #Context).
newArray at: 12 put: nil. "was BlockContext."
newArray at: 13 put: Point.
newArray at: 14 put: LargePositiveInteger.
newArray at: 15 put: Display.
newArray at: 16 put: Message.
newArray at: 17 put: CompiledMethod.
newArray at: 18 put: ((self specialObjectsArray at: 18) ifNil: [Semaphore new]). "low space Semaphore"
newArray at: 19 put: Semaphore.
newArray at: 20 put: Character.
newArray at: 21 put: #doesNotUnderstand:.
newArray at: 22 put: #cannotReturn:.
newArray at: 23 put: nil. "This is the process signalling low space."
"An array of the 32 selectors that are compiled as special bytecodes,
paired alternately with the number of arguments each takes."
newArray at: 24 put: #( #+ 1 #- 1 #< 1 #> 1 #<= 1 #>= 1 #= 1 #~= 1
#* 1 #/ 1 #\\ 1 #@ 1 #bitShift: 1 #// 1 #bitAnd: 1 #bitOr: 1
#at: 1 #at:put: 2 #size 0 #next 0 #nextPut: 1 #atEnd 0 #== 1 #class 0
#~~ 1 #value 0 #value: 1 #do: 1 #new 0 #new: 1 #x 0 #y 0 ).
"An array of the 255 Characters in ascii order.
Cog inlines table into machine code at: prim so do not regenerate it.
This is nil in Spur, which has immediate Characters."
newArray at: 25 put: (self specialObjectsArray at: 25).
newArray at: 26 put: #mustBeBoolean.
newArray at: 27 put: ByteArray.
newArray at: 28 put: Process.
"An array of up to 31 classes whose instances will have compact headers; an empty array in Spur"
newArray at: 29 put: self compactClassesArray.
newArray at: 30 put: ((self specialObjectsArray at: 30) ifNil: [Semaphore new]). "delay Semaphore"
newArray at: 31 put: ((self specialObjectsArray at: 31) ifNil: [Semaphore new]). "user interrupt Semaphore"
"Entries 32 - 34 unreferenced. Previously these contained prototype instances to be copied for fast initialization"
newArray at: 32 put: nil. "was the prototype Float"
newArray at: 33 put: nil. "was the prototype 4-byte LargePositiveInteger"
newArray at: 34 put: nil. "was the prototype Point"
newArray at: 35 put: #cannotInterpret:.
newArray at: 36 put: nil. "was the prototype MethodContext"
newArray at: 37 put: BlockClosure.
newArray at: 38 put: nil. "was the prototype BlockContext"
"array of objects referred to by external code"
newArray at: 39 put: (self specialObjectsArray at: 39). "external semaphores"
newArray at: 40 put: nil. "Reserved for Mutex in Cog VMs"
newArray at: 41 put: ((self specialObjectsArray at: 41) ifNil: [LinkedList new]). "Reserved for a LinkedList instance for overlapped calls in CogMT"
newArray at: 42 put: ((self specialObjectsArray at: 42) ifNil: [Semaphore new]). "finalization Semaphore"
newArray at: 43 put: LargeNegativeInteger.
"External objects for callout.
Note: Written so that one can actually completely remove the FFI."
newArray at: 44 put: (self at: #ExternalAddress ifAbsent: []).
newArray at: 45 put: (self at: #ExternalStructure ifAbsent: []).
newArray at: 46 put: (self at: #ExternalData ifAbsent: []).
newArray at: 47 put: (self at: #ExternalFunction ifAbsent: []).
newArray at: 48 put: (self at: #ExternalLibrary ifAbsent: []).
newArray at: 49 put: #aboutToReturn:through:.
newArray at: 50 put: #run:with:in:.
"51 reserved for immutability message"
newArray at: 51 put: #attemptToAssign:withIndex:.
newArray at: 52 put: #(nil "nil => generic error" #'bad receiver'
#'bad argument' #'bad index'
#'bad number of arguments'
#'inappropriate operation' #'unsupported operation'
#'no modification' #'insufficient object memory'
#'insufficient C memory' #'not found' #'bad method'
#'internal error in named primitive machinery'
#'object may move' #'resource limit exceeded'
#'object is pinned' #'primitive write beyond end of object'
#'object moved' #'object not pinned' #'callback error'),
+ {PrimitiveError new errorName: #'operating system error'; yourself}.
- {PrimitiveOSError new errorName: #'operating system error'; yourself}.
"53 to 55 are for Alien"
newArray at: 53 put: (self at: #Alien ifAbsent: []).
newArray at: 54 put: #invokeCallbackContext:. "use invokeCallback:stack:registers:jmpbuf: for old Alien callbacks."
newArray at: 55 put: (self at: #UnsafeAlien ifAbsent: []).
"Used to be WeakFinalizationList for WeakFinalizationList hasNewFinalization, obsoleted by ephemeron support."
newArray at: 56 put: nil.
"reserved for foreign callback process"
newArray at: 57 put: (self specialObjectsArray at: 57 ifAbsent: []).
newArray at: 58 put: #unusedBytecode.
"59 reserved for Sista counter tripped message"
newArray at: 59 put: #conditionalBranchCounterTrippedOn:.
"60 reserved for Sista class trap message"
newArray at: 60 put: #classTrapFor:.
"Now replace the virtual machine's reference in one atomic operation"
self specialObjectsArray becomeForward: newArray!