Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2583.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2583 Author: eem Time: 15 November 2019, 4:57:55.824146 pm UUID: 729111df-a2cf-4c96-8f49-e4869c9d333d Ancestors: VMMaker.oscog-eem.2582 ImageChecker: ImageChecker must not specify excluding unmarked objects, since objects are unmarked on load. Have its main routine respond to a -version argument. Slang: Call an Open Smalltalk VM an Open Smalltalk VM. =============== Diff against VMMaker.oscog-eem.2582 =============== Item was changed: ----- Method: CCodeGenerator>>interpreterVersion (in category 'accessing') ----- interpreterVersion + ^self vmClass interpreterVersion, '[', self vmClass objectMemoryClass memoryManagerVersionName, ']'! - ^self vmClass interpreterVersion, '[', self vmClass objectMemoryClass memoryManagerVersion, ']'! Item was changed: + ----- Method: ImageLeakChecker>>ioExitWithErrorCode: (in category 'implementation') ----- - ----- Method: ImageLeakChecker>>ioExitWithErrorCode: (in category 'api') ----- ioExitWithErrorCode: ec <inline: true> self exit: ec! Item was changed: ----- Method: ImageLeakChecker>>main:_: (in category 'api') ----- main: argc _: argv <var: 'argc' type: #int> <var: 'argv' declareC: 'char *argv[]'> <returnTypeC: #int> <api> + | forVersion argi ifh ok | - | argi ifh ok | <var: 'ifh' type: #'FILE *'> argi := 1. + forVersion := false. + [argi < argc + and: [((argv at: argi) at: 0) = $-]] whileTrue: + [(self strcmp: (self asCommandLineArgument: 'version') _: (argv at: argi)) = 0 ifTrue: + ['%s\n' printf: (self cCode: 'interpreterVersion' inSmalltalk: ['don''t ask silly questions']). + forVersion := true]. + (self strcmp: (self asCommandLineArgument: 'verbose') _: (argv at: argi)) = 0 ifTrue: + [verbose := true]. - (argc >= 2 - and: [(self strcmp: (self asCommandLineArgument: 'verbose') _: (argv at: argi)) = 0]) ifTrue: - [verbose := true. argi := argi + 1]. + (argc = argi and: [forVersion]) ifTrue: + [^0]. (argc ~= (argi + 1) or: [(ifh := self sqImageFileOpen: (argv at: argi) _: 'rb') = 0]) ifTrue: + ['Usage: %s [%s] [%s] imageFileName\n' printf: {(argv at: 0). self asCommandLineArgument: 'verbose'. self asCommandLineArgument: 'version'}. + ^self cCode: [1] inSmalltalk: [false]]. - ['Usage: %s [%s] imageFileName\n' printf: {(argv at: 0). self asCommandLineArgument: 'verbose'}. - ^self cCode: [1] inSmalltalk: [false]]. self readImageFromFile: ifh HeapSize: 0 StartingAt: 0. self sqImageFileClose: ifh. ok := objectMemory runLeakCheckerForResult: GCModeFull. (verbose and: [ok]) ifTrue: ['Image %s is free of leaks\n' printf: {(argv at: argi)}]. ^self cCode: [ok ifTrue: [0] ifFalse: [2]] inSmalltalk: [ok]! Item was changed: + ----- Method: ImageLeakChecker>>plugInNotifyUser: (in category 'implementation') ----- - ----- Method: ImageLeakChecker>>plugInNotifyUser: (in category 'api') ----- plugInNotifyUser: msg "This is used in macros in sq.h, sigh..." <api> <returnTypeC: #int> <var: 'msg' type: #'char *'> self error: msg! Item was changed: ----- Method: ImageLeakChecker>>runLeakCheckerForResult: (in category 'implementation') ----- runLeakCheckerForResult: gcModes objectMemory clearLeakMapAndMapAccessibleObjects. + ^objectMemory checkHeapIntegrity: false classIndicesShouldBeValid: true! - ^objectMemory checkHeapIntegrity: true classIndicesShouldBeValid: true! Item was added: + ----- Method: Interpreter class>>objectMemoryClass (in category 'accessing class hierarchy') ----- + objectMemoryClass + ^ObjectMemory! Item was added: + ----- Method: ObjectMemory class>>memoryManagerName (in category 'accessing') ----- + memoryManagerName + ^ 'SqueakV3'! Item was removed: - ----- Method: ObjectMemory class>>memoryManagerVersion (in category 'accessing') ----- - memoryManagerVersion - ^ 'SqueakV3'! Item was added: + ----- Method: SpurMemoryManager class>>memoryManagerName (in category 'accessing') ----- + memoryManagerName + ^ 'Spur'! Item was removed: - ----- Method: SpurMemoryManager class>>memoryManagerVersion (in category 'accessing') ----- - memoryManagerVersion - ^ 'Spur'! Item was changed: ----- Method: VMClass class>>declareInterpreterVersionIn:defaultName: (in category 'translation') ----- declareInterpreterVersionIn: aCCodeGenerator defaultName: defaultName + | objMemName | + objMemName := aCCodeGenerator vmClass objectMemoryClass memoryManagerName. NewspeakVM ifTrue: ["Newspeak as of mid 2011 derives SystemScope systemName from the interpreterVersion (via system attribute 1004) by copying up to but not including the last space, provided the string ends with a digit. So spaces must be eliminated from the Monitcello version string, and we can't surround it with square brackets." (aCCodeGenerator shortMonticelloDescriptionForClass: self) last isDigit ifFalse: [self error: 'Newspeak expects interpreterVersion ends with a digit']. aCCodeGenerator var: #interpreterVersion declareC: 'const char *interpreterVersion = "Newspeak Virtual Machine ', + ('[',objMemName,'] '), ((aCCodeGenerator shortMonticelloDescriptionForClass: self) copyReplaceAll: ' ' with: '_'), '"'. ^self]. aCCodeGenerator var: #interpreterVersion + declareC: 'const char *interpreterVersion = "Open Smalltalk ', defaultName, ' VM [', + objMemName, ' ', + (aCCodeGenerator shortMonticelloDescriptionForClass: self),']"'! - declareC: 'const char *interpreterVersion = "Croquet Closure ', defaultName, ' VM [', - (aCCodeGenerator shortMonticelloDescriptionForClass: self),']"'.! Item was added: + ----- Method: VMClass class>>memoryManagerName (in category 'accessing') ----- + memoryManagerName + ^ self subclassResponsibility! Item was removed: - ----- Method: VMClass class>>memoryManagerVersion (in category 'accessing') ----- - memoryManagerVersion - ^ self subclassResponsibility! |
Free forum by Nabble | Edit this page |