diff --git a/PBBuilder-LanguageDefinition.package/PBLanguageDefinitionPharoCandle.class/instance/classRoles.st b/PBBuilder-LanguageDefinition.package/PBLanguageDefinitionPharoCandle.class/instance/classRoles.st index 12e92f4..362a5b9 100644 --- a/PBBuilder-LanguageDefinition.package/PBLanguageDefinitionPharoCandle.class/instance/classRoles.st +++ b/PBBuilder-LanguageDefinition.package/PBLanguageDefinitionPharoCandle.class/instance/classRoles.st @@ -14,6 +14,7 @@ classRoles #Association -> #PCAssociation. #BlockClosure -> #PCBlock. #MethodContext -> #PCMethodContext. + #Message -> #PCMessage. #Point -> #PCPoint. #Process -> #PCProcess. #Semaphore -> #PCSemaphore. @@ -29,5 +30,7 @@ classRoles #Dictionary -> #PCDictionary. #ClassVariable -> #PCAssociation. #ClassInstaller -> #PCClassBuilder. - #Smalltalk -> #PCSmalltalk + #Smalltalk -> #PCSmalltalk. + #SystemDictionary -> #PCDictionary. + #System -> #PCSystem } asDictionary \ No newline at end of file diff --git a/PBBuilder-LanguageDefinition.package/PBLanguageDefinitionPharoCodeParadise.class/README.md b/PBBuilder-LanguageDefinition.package/PBLanguageDefinitionPharoCodeParadise.class/README.md new file mode 100644 index 0000000..e69de29 diff --git a/PBBuilder-LanguageDefinition.package/PBLanguageDefinitionPharoCodeParadise.class/instance/classRoles.st b/PBBuilder-LanguageDefinition.package/PBLanguageDefinitionPharoCodeParadise.class/instance/classRoles.st new file mode 100644 index 0000000..3d80a1c --- /dev/null +++ b/PBBuilder-LanguageDefinition.package/PBLanguageDefinitionPharoCodeParadise.class/instance/classRoles.st @@ -0,0 +1,36 @@ +as yet unclassified +classRoles + ^{ + #ProtoObject -> #Object. + #ProcessorScheduler -> #ProcessorScheduler. + #Context -> #MethodContext. + #Class -> #Class. + #Metaclass -> #Metaclass. + #Array -> #Array. + #MethodDictionary -> #MethodDictionary. + #CompiledMethod -> #CompiledMethod. + #Character -> #Character. + #ByteArray -> #ByteArray. + #Association -> #Association. + #BlockClosure -> #Block. + #MethodContext -> #MethodContext. + #Message -> #Message. + #Point -> #Point. + #Process -> #Process. + #Semaphore -> #Semaphore. + #ByteString -> #ByteString. + #ByteSymbol -> #Symbol. + #True -> #True. + #False -> #False. + #UndefinedObject -> #UndefinedObject. + #Float -> #Float. + #SmallInteger -> #SmallInteger. + #LargePositiveInteger -> #LargePositiveInteger. + #LargeNegativeInteger -> #LargeNegativeInteger. + #Dictionary -> #Dictionary. + #ClassVariable -> #Association. + #ClassInstaller -> #ClassBuilder. + #Smalltalk -> #SmalltalkImage. + #SystemDictionary -> #SystemDictionary. + #System -> #System + } asDictionary \ No newline at end of file diff --git a/PBBuilder-LanguageDefinition.package/PBLanguageDefinitionPharoCodeParadise.class/instance/clean.st b/PBBuilder-LanguageDefinition.package/PBLanguageDefinitionPharoCodeParadise.class/instance/clean.st new file mode 100644 index 0000000..6ce9ed8 --- /dev/null +++ b/PBBuilder-LanguageDefinition.package/PBLanguageDefinitionPharoCodeParadise.class/instance/clean.st @@ -0,0 +1,4 @@ +cleaning +clean + + self cleanWithMetaclassNamed: #Metaclass \ No newline at end of file diff --git a/PBBuilder-LanguageDefinition.package/PBLanguageDefinitionPharoCodeParadise.class/properties.json b/PBBuilder-LanguageDefinition.package/PBLanguageDefinitionPharoCodeParadise.class/properties.json new file mode 100644 index 0000000..7c880fa --- /dev/null +++ b/PBBuilder-LanguageDefinition.package/PBLanguageDefinitionPharoCodeParadise.class/properties.json @@ -0,0 +1,11 @@ +{ + "commentStamp" : "", + "super" : "PBLanguageDefinitionPharoCandle", + "category" : "PBBuilder-LanguageDefinition", + "classinstvars" : [ ], + "pools" : [ ], + "classvars" : [ ], + "instvars" : [ ], + "name" : "PBLanguageDefinitionPharoCodeParadise", + "type" : "normal" +} \ No newline at end of file diff --git a/PBManager.package/PBBuilder.class/instance/writeImageNamed..st b/PBManager.package/PBBuilder.class/instance/writeImageNamed..st index e655b6a..101a5e8 100644 --- a/PBManager.package/PBBuilder.class/instance/writeImageNamed..st +++ b/PBManager.package/PBBuilder.class/instance/writeImageNamed..st @@ -3,7 +3,7 @@ writeImageNamed: aString | imageFileReference aDictionary pbImage | imageFileReference := (self locationOfBootstrappedImages pathString, '/', aString, '.', PBImageInDisk imageExtension) asFileReference. imageFileReference exists ifTrue: [ - ^ nil ]. + "^ nil" ]. self pbRepository pbBootstrapper builder writeImageIn: imageFileReference . aDictionary := { diff --git a/PBManager.package/PBImageBuilderCandle.class/instance/arrayClass.st b/PBManager.package/PBImageBuilderCandle.class/instance/arrayClass.st new file mode 100644 index 0000000..2de358d --- /dev/null +++ b/PBManager.package/PBImageBuilderCandle.class/instance/arrayClass.st @@ -0,0 +1,4 @@ +accessing +arrayClass + + ^ self classWithRole: #Array \ No newline at end of file diff --git a/PBManager.package/PBImageBuilderCandle.class/instance/associationClass.st b/PBManager.package/PBImageBuilderCandle.class/instance/associationClass.st index 5e1c222..db7c196 100644 --- a/PBManager.package/PBImageBuilderCandle.class/instance/associationClass.st +++ b/PBManager.package/PBImageBuilderCandle.class/instance/associationClass.st @@ -1,4 +1,4 @@ accessing associationClass - ^ self classNamed: (systemDefinition classWithRole: #Association) name \ No newline at end of file + ^ self classWithRole: #Association \ No newline at end of file diff --git a/PBManager.package/PBImageBuilderCandle.class/instance/createInitialObjects.st b/PBManager.package/PBImageBuilderCandle.class/instance/createInitialObjects.st index 4ca6a0d..7cc961f 100644 --- a/PBManager.package/PBImageBuilderCandle.class/instance/createInitialObjects.st +++ b/PBManager.package/PBImageBuilderCandle.class/instance/createInitialObjects.st @@ -5,13 +5,15 @@ createInitialObjects "We add the main globals in the bootstrap environment before a system dictionary exists. These globals are needed to create a system dictionary, and will be used by the AST interpreter" self bootstrapEnvironment at: #Processor put: objectSpace nilObject. self bootstrapEnvironment at: #Smalltalk put: objectSpace nilObject. - self bootstrapEnvironment at: #Undeclared put: (self bootstrapInterpreter evaluateCode: 'PCDictionary new'). + self bootstrapEnvironment at: #Undeclared put: (self bootstrapInterpreter evaluateCode: 'theDictionary new' withTemps: { 'theDictionary' -> (self classWithRole: #Dictionary) mirror }). classLoader initializeClassPools. rsDictionary := self bootstrapInterpreter - evaluateCode: 'aClassNamesCollection asDictionary' - withTemps: { + evaluateCode: 'dictionaryClass withAll: aClassNamesCollection' + withTemps: { + 'dictionaryClass' -> + (self classWithRole: #SystemDictionary) mirror . 'aClassNamesCollection' -> (self objectSpace newArrayWithAll: (self bootstrapEnvironment associations collect: [ :assoc | @@ -25,13 +27,16 @@ createInitialObjects rsDictionary at: assoc key put: assoc value ]. " - smalltalk := self bootstrapInterpreter evaluateCode: 'Smalltalk := PCSmalltalk new instVarAt: 1 put: aSystemDictionary ; yourself.' - withTemps: { 'aSystemDictionary' -> rsDictionary }. + smalltalk := self bootstrapInterpreter evaluateCode: 'Smalltalk := theSmalltalk new instVarAt: 1 put: aSystemDictionary ; yourself.' + withTemps: { + 'theSmalltalk' -> (self classWithRole: #Smalltalk) mirror. + 'aSystemDictionary' -> rsDictionary }. self bootstrapEnvironment at: #Smalltalk put: smalltalk. self bootstrapInterpreter evaluateCode: 'Smalltalk globals at: #Smalltalk put: Smalltalk'. espellBackend systemDictionary: (smalltalk instanceVariableAtIndex: 1). - self bootstrapInterpreter evaluateCode: 'PCString initialize.'. +" self bootstrapInterpreter evaluateCode: 'theString initialize.' withTemps: { 'theString' -> (self classWithRole: #ByteString) mirror }." + self bootstrapInterpreter evaluateCode: 'theFloat initialize.' withTemps: { 'theFloat' -> (self classWithRole: #Float) mirror }. self checkpoint: 'created_initial_objects'. diff --git a/PBManager.package/PBImageBuilderCandle.class/instance/createVMStubs.st b/PBManager.package/PBImageBuilderCandle.class/instance/createVMStubs.st index 7899d6b..bce0f9b 100644 --- a/PBManager.package/PBImageBuilderCandle.class/instance/createVMStubs.st +++ b/PBManager.package/PBImageBuilderCandle.class/instance/createVMStubs.st @@ -18,35 +18,35 @@ createVMStubs objectSpace falseObject: objectSpace falseObject. objectSpace trueObject: objectSpace trueObject. - objectSpace nilObject setClass: (self createStubForClassNamed: #PCUndefinedObject). - objectSpace falseObject setClass: (self createStubForClassNamed: #PCFalse). - objectSpace trueObject setClass: (self createStubForClassNamed: #PCTrue). + objectSpace nilObject setClass: (self createStubForClassWithRole: #UndefinedObject). + objectSpace falseObject setClass: (self createStubForClassWithRole: #False). + objectSpace trueObject setClass: (self createStubForClassWithRole: #True). - objectSpace backend smallIntegerClass: (self createStubForClassNamed: #PCSmallInteger). - objectSpace backend characterClass: (self createStubForClassNamed: #PCCharacter). - objectSpace backend byteSymbolClass: (self createStubForClassNamed: #PCSymbol). - objectSpace backend byteStringClass: (self createStubForClassNamed: #PCString). - objectSpace backend byteArrayClass: (self createStubForClassNamed: #PCByteArray). - objectSpace backend associationClass: (self createStubForClassNamed: #PCAssociation). - objectSpace backend arrayClass: (self createStubForClassNamed: #PCArray). + objectSpace backend smallIntegerClass: (self createStubForClassWithRole: #SmallInteger). + objectSpace backend characterClass: (self createStubForClassWithRole: #Character). + objectSpace backend byteSymbolClass: (self createStubForClassWithRole: #ByteSymbol). + objectSpace backend byteStringClass: (self createStubForClassWithRole: #ByteString). + objectSpace backend byteArrayClass: (self createStubForClassWithRole: #ByteArray). + objectSpace backend associationClass: (self createStubForClassWithRole: #Association). + objectSpace backend arrayClass: (self createStubForClassWithRole: #Array). objectSpace backend symbolTableClass: objectSpace backend byteSymbolClass. - objectSpace backend largeNegativeIntegerClass: (self createStubForClassNamed: #PCLargeNegativeInteger). - objectSpace backend largePositiveIntegerClass: (self createStubForClassNamed: #PCLargePositiveInteger). - objectSpace backend methodClass: (self createStubForClassNamed: #PCCompiledMethod). - objectSpace backend floatClass: (self createStubForClassNamed: #PCFloat). - objectSpace backend contextClass: (self createStubForClassNamed: #PCMethodContext). - objectSpace backend processClass: (self createStubForClassNamed: #PCProcess). - objectSpace backend blockClass: (self createStubForClassNamed: #PCBlock). - "objectSpace backend fullBlockClass: (self createStubForClassNamed: #PCFullBlockClosure)." - objectSpace backend messageClass: (self createStubForClassNamed: #PCMessage). - objectSpace backend semaphoreClass: (self createStubForClassNamed: #PCSemaphore). + objectSpace backend largeNegativeIntegerClass: (self createStubForClassWithRole: #LargeNegativeInteger). + objectSpace backend largePositiveIntegerClass: (self createStubForClassWithRole: #LargePositiveInteger). + objectSpace backend methodClass: (self createStubForClassWithRole: #CompiledMethod). + objectSpace backend floatClass: (self createStubForClassWithRole: #Float). + objectSpace backend contextClass: (self createStubForClassWithRole: #MethodContext). + objectSpace backend processClass: (self createStubForClassWithRole: #Process). + objectSpace backend blockClass: (self createStubForClassWithRole: #BlockClosure). + "objectSpace backend fullBlockClass: (self createStubForClassWithRole: #FullBlockClosure)." + objectSpace backend messageClass: (self createStubForClassWithRole: #Message). + objectSpace backend semaphoreClass: (self createStubForClassWithRole: #Semaphore). "Point is required in the special objects array because it is used to instantiate point objects faster. If we do not put it here, the VM will crash. Lots of tests in kernel use it." - objectSpace backend pointClass: (self createStubForClassNamed: #PCPoint). + objectSpace backend pointClass: (self createStubForClassWithRole: #Point). - objectSpace backend processorAssociation: (self classNamed: #PCAssociation) mirror basicNew. + objectSpace backend processorAssociation: self newAssociation. objectSpace backend processorAssociation - instanceVariableAtIndex: 2 put: (self createStubForClassNamed: #PCProcessorScheduler) basicNew. - objectSpace backend specialSelectors: ((self classNamed: #PCArray) mirror basicNew: 64) \ No newline at end of file + instanceVariableAtIndex: 2 put: (self createStubForClassWithRole: #ProcessorScheduler) basicNew. + objectSpace backend specialSelectors: (self newArray: 64) \ No newline at end of file diff --git a/PBManager.package/PBImageBuilderCandle.class/instance/formatOfClass..st b/PBManager.package/PBImageBuilderCandle.class/instance/formatOfClass..st index 81fe0bb..8c4d215 100644 --- a/PBManager.package/PBImageBuilderCandle.class/instance/formatOfClass..st +++ b/PBManager.package/PBImageBuilderCandle.class/instance/formatOfClass..st @@ -6,8 +6,8 @@ formatOfClass: aRFiClass | newHeap instSize newInstSpec | newHeap := objectSpace backend simulator objectMemory. - ((aRFiClass name = 'PCSmallInteger') - or: [(aRFiClass name = 'PCCharacter')]) ifTrue: + ((aRFiClass name = (self classNameWithRole: #SmallInteger)) + or: [(aRFiClass name = (self classNameWithRole: #Character))]) ifTrue: [^ newHeap integerObjectOf: newHeap instSpecForImmediateClasses << 16]. instSize := aRFiClass instSize. newInstSpec := self instSpecOfClass: aRFiClass. diff --git a/PBManager.package/PBImageBuilderCandle.class/instance/initializeImage.st b/PBManager.package/PBImageBuilderCandle.class/instance/initializeImage.st index 344e3e5..12b9bfb 100644 --- a/PBManager.package/PBImageBuilderCandle.class/instance/initializeImage.st +++ b/PBManager.package/PBImageBuilderCandle.class/instance/initializeImage.st @@ -1,19 +1,21 @@ running initializeImage - | process association | + | processor process association | self flag: 'should migrate this method'. self checkpoint: 'image_initialization'. self initializeSpecialObjectArray. - self bootstrapInterpreter + processor := self bootstrapInterpreter evaluateCode: ' - Processor := PCProcessorScheduler basicNew. - Processor initProcessLists.' - withTemps: #(). + Processor := theProcessorScheduler basicNew + initProcessLists ; + yourself' + withTemps: { 'theProcessorScheduler' -> (self classWithRole: #ProcessorScheduler) mirror }. - + self bootstrapEnvironment at: #Processor put: processor. + self bootstrapInterpreter evaluateCode: 'Smalltalk globals at: #Processor put: theProcessor' withTemps: { 'theProcessor' -> processor }. " objectSpace backend processorAssociation: (self bootstrapInterpreter evaluateCode: 'Smalltalk globals associationAt: #Processor.'). @@ -24,12 +26,15 @@ initializeImage association instanceVariableAtIndex: 2 put: (self bootstrapEnvironment at: #Processor). objectSpace backend processorAssociation: association . - process := objectSpace createProcessWithPriority: 3 doing: 'PCSystem start' withTemps: #(). + process := objectSpace createProcessWithPriority: 3 doing: (self classNameWithRole: #System), ' start' withTemps: #(). objectSpace installAsActiveProcess: process withProcessor: (self bootstrapEnvironment at: #Processor). +" The specialObjectsArray is already installed above self bootstrapInterpreter - evaluateCode: 'PCSystem specialObjectsArray: newArray.' - withTemps: { 'newArray' -> objectSpace backend specialObjectsArray }. + evaluateCode: 'theSystem specialObjectsArray: newArray.' + withTemps: { + 'theSystem' -> (self classWithRole: #System) mirror. + 'newArray' -> objectSpace backend specialObjectsArray }." self followForwardingPointers. diff --git a/PBManager.package/PBImageBuilderCandle.class/instance/initializeSpecialObjectArray.st b/PBManager.package/PBImageBuilderCandle.class/instance/initializeSpecialObjectArray.st index 7b82b72..f202544 100644 --- a/PBManager.package/PBImageBuilderCandle.class/instance/initializeSpecialObjectArray.st +++ b/PBManager.package/PBImageBuilderCandle.class/instance/initializeSpecialObjectArray.st @@ -5,5 +5,7 @@ initializeSpecialObjectArray " objectSpace specialObjectsArray: self newSpecialObjectsArray. self bootstrapInterpreter - evaluateCode: 'PCSystem specialObjectsArray: newArray.' - withTemps: { 'newArray' -> objectSpace backend specialObjectsArray }. \ No newline at end of file + evaluateCode: 'theSystem specialObjectsArray: newArray.' + withTemps: { + 'theSystem' -> (self classWithRole: #System) mirror. + 'newArray' -> objectSpace backend specialObjectsArray }. \ No newline at end of file diff --git a/PBManager.package/PBImageBuilderCandle.class/instance/newArray..st b/PBManager.package/PBImageBuilderCandle.class/instance/newArray..st new file mode 100644 index 0000000..485d98a --- /dev/null +++ b/PBManager.package/PBImageBuilderCandle.class/instance/newArray..st @@ -0,0 +1,4 @@ +accessing +newArray: size + + ^ self arrayClass mirror basicNew: size \ No newline at end of file diff --git a/PBManager.package/PBSpurClassLoaderCandle.class/instance/classDefinitionFor..st b/PBManager.package/PBSpurClassLoaderCandle.class/instance/classDefinitionFor..st index 0191579..e52de85 100644 --- a/PBManager.package/PBSpurClassLoaderCandle.class/instance/classDefinitionFor..st +++ b/PBManager.package/PBSpurClassLoaderCandle.class/instance/classDefinitionFor..st @@ -2,14 +2,14 @@ stubs classDefinitionFor: aClass "Answer a String that defines the receiver." - | type classInstallerName | + | type classInstaller | type := self typeFor: aClass. - classInstallerName := (systemDefinition classWithRole: #ClassInstaller). + classInstaller := (systemDefinition classWithRole: #ClassInstaller). ^ '| newClass | - newClass := (PCClassBuilder new + newClass := ({classInstaller} new superclass: {superClass}; name: ''{name}''; instVarNames: {instanceVariablesString}; @@ -19,6 +19,7 @@ classDefinitionFor: aClass build. newClass' format: { + 'classInstaller' -> classInstaller. 'superClass' -> (aClass superclass ifNil: ['nil'] ifNotNil: [ :superclass | superclass name ]). 'name' -> aClass name. 'type' -> type. diff --git a/PBManager.package/PBSpurClassLoaderCandle.class/instance/metaclassClass.st b/PBManager.package/PBSpurClassLoaderCandle.class/instance/metaclassClass.st index d00f802..a9b12d3 100644 --- a/PBManager.package/PBSpurClassLoaderCandle.class/instance/metaclassClass.st +++ b/PBManager.package/PBSpurClassLoaderCandle.class/instance/metaclassClass.st @@ -5,8 +5,8 @@ metaclassClass Ok, so here we really go down and create the metaclass from nothing. We will use this metaclass to create all the others" | aClassMapping theNewMetaclass theNewMetaclassClass classFormat metaclassFormat metaclassIndex classIndex | - environment at: #PCMetaclass ifPresent: [ :aClass | ^ aClass ]. - aClassMapping := systemDefinition classNamed: #PCMetaclass. + aClassMapping := systemDefinition classWithRole: #Metaclass. + environment at: aClassMapping name asSymbol ifPresent: [ :aClass | ^ aClass ]. classFormat := self formatOfClass: aClassMapping. metaclassFormat := self formatOfClass: aClassMapping metaclass.