Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.542.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.542 Author: eem Time: 6 December 2013, 2:13:39.319 pm UUID: e3b3cd61-d781-4934-bc89-dcf72256eb95 Ancestors: VMMaker.oscog-eem.541 Mo' betta automation for generating VMs. =============== Diff against VMMaker.oscog-eem.541 =============== Item was added: + ----- Method: VMMaker class>>configuirationNameFromSelector: (in category 'confs-support') ----- + configuirationNameFromSelector: aSelector + ^(aSelector piecesCutWhere: [:a :b| a isLowercase and: [b isUppercase]]) allButFirst fold: [:a :b| a, ' ', b]! Item was changed: ----- Method: VMMaker class>>generateConfiguration (in category 'configurations') ----- generateConfiguration "VMMaker generateConfiguration" | configCategoryName selectors | configCategoryName := self class whichCategoryIncludesSelector: thisContext selector. selectors := Set new. self class organization categories do: [:cat| (cat endsWith: configCategoryName) ifTrue: [selectors addAll: (self class organization listAtCategoryNamed: cat)]]. selectors remove: thisContext selector. selectors := selectors asArray sort. (UIManager default + chooseFrom: (selectors collect: [:sel| self configuirationNameFromSelector: sel]) - chooseFrom: (selectors collect: - [:sel| (sel piecesCutWhere: [:a :b| a isLowercase and: [b isUppercase]]) allButFirst - fold: [:a :b| a, ' ', b]]) values: selectors) ifNotNil: [:choice| self perform: choice]! Item was added: + ----- Method: VMMaker>>configurationNameIfAny (in category 'generate sources') ----- + configurationNameIfAny + ^(thisContext findContextSuchThat: [:ctxt| ctxt receiver == VMMaker and: [ctxt method methodReference category = #configurations]]) + ifNotNil: [:ctxt| (self class configuirationNameFromSelector: ctxt selector), ' '] + ifNil: [' ']! Item was changed: ----- Method: VMMaker>>needsToRegenerateCogitFile (in category 'generate sources') ----- needsToRegenerateCogitFile "Check the timestamp for the relevant classes and then the timestamp for the main source file (e.g. interp.c) file if it already exists. Answer if the file needs regenerating." | cogitClass cogitClasses tStamp | cogitClasses := (cogitClass := self cogitClass) withAllSuperclasses copyUpThrough: Cogit. cogitClasses addAllLast: (cogitClass ancilliaryClasses: self options). tStamp := cogitClasses inject: 0 into: [:tS :cl| tS max: cl timeStamp]. "don't translate if the file is newer than my timeStamp" (self coreVMDirectory entryAt: cogitClass sourceFileName ifAbsent: [nil]) ifNotNil: [:fstat| tStamp < fstat modificationTime ifTrue: + [^self confirm: 'The ', self configurationNameIfAny, cogitClass printString, ' classes have not been modified since\ the source file was last generated.\Do you still want to regenerate it?' withCRs]]. - [^self confirm: 'The ', cogitClass printString, ' classes have not been modified since\ the source file was last generated.\Do you still want to regenerate it?' withCRs]]. ^true ! Item was changed: ----- Method: VMMaker>>needsToRegenerateInterpreterFile (in category 'initialize') ----- needsToRegenerateInterpreterFile "Check the timestamp for the relevant classes and then the timestamp for the main source file (e.g. interp.c) if it already exists. Answer if the file needs regenerating." | classes tStamp | classes := self interpreterClass withAllSuperclasses copyUpTo: VMClass. self interpreterClass objectMemoryClass ifNotNil: [:objectMemoryClass| classes addAllLast: (objectMemoryClass withAllSuperclasses copyUpTo: VMClass)]. classes copy do: [:class| classes addAllLast: (class ancilliaryClasses: self options)]. tStamp := classes inject: 0 into: [:tS :cl| tS max: cl timeStamp]. "don't translate if the file is newer than my timeStamp" (self coreVMDirectory entryAt: self interpreterFilename ifAbsent: [nil]) ifNotNil: [:fstat| tStamp < fstat modificationTime ifTrue: + [^self confirm: 'The ', self configurationNameIfAny, 'interpreter classes have not been modified since\ the interpreter file was last generated.\Do you still want to regenerate their source file?' withCRs]]. - [^self confirm: 'The interpreter classes have not been modified since\ the interpreter file was last generated.\Do you still want to regenerate their source file?' withCRs]]. ^true ! |
Free forum by Nabble | Edit this page |