Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.175.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.175 Author: eem Time: 26 June 2012, 1:02:32.636 pm UUID: a4adf9bf-b651-46c9-babd-bcc27b62d599 Ancestors: VMMaker.oscog-eem.174 Warn about api methods being removed. Move stringForCString: up to StackInterpreter. =============== Diff against VMMaker.oscog-eem.174 =============== Item was changed: ----- Method: CCodeGenerator>>reportShouldNotBeRemoved:varList: (in category 'inlining') ----- reportShouldNotBeRemoved: removed varList: varList "Report whether any of the removed methods are still used." | varListAsStrings shouldNotBeRemoved | varListAsStrings := varList collect: [ :sym | sym asString ]. shouldNotBeRemoved := Set new. + removed do: + [:m| + m isAPIMethod ifTrue: + [shouldNotBeRemoved add: m selector]]. methods do: [:m| (m selector = #interpret or: [removed includes: m selector]) ifFalse: [m allCalls do: [:sel| (removed includesKey: sel) ifTrue: [shouldNotBeRemoved add: sel]]]]. vmClass additionalSelectorTables do: [:selectorTable| selectorTable do: [:selOrInteger| selOrInteger isInteger ifFalse: [(removed includesKey: selOrInteger) ifTrue: [shouldNotBeRemoved add: selOrInteger]]]]. shouldNotBeRemoved do: [:sel| | str | str := String streamContents: [:strm| | them | strm nextPutAll: 'Removed '; nextPutAll: sel; nextPutAll: ' because it refers to the local variable'. them := (removed at: sel) freeVariableReferences asSet intersection: varListAsStrings. them size > 1 ifTrue: [strm nextPut: $s. them := self sortStrings: them]. them do: [:var| strm space; nextPutAll: var]. strm nextPutAll: ' of interpret.'; cr; nextPutAll: 'But it is either used outside of interpret or exported!!!!'; cr]. logger ensureCr; show: str. self inform: str]! Item was removed: - ----- Method: CoInterpreter>>stringForCString: (in category 'primitive support') ----- - stringForCString: aCString - "Answer a new String copied from a null-terminated C string, - or nil if out of memory. - Caution: This may invoke the garbage collector." - <api> - <var: 'aCString' type: 'const char *'> - | len newString | - len := self strlen: aCString. - newString := objectMemory instantiateClass: objectMemory classString indexableSize: len. - newString isNil ifFalse: - [self st: (self arrayValueOf: newString) - rn: aCString - cpy: len]. "(char *)strncpy()" - ^newString! Item was added: + ----- Method: StackInterpreter>>stringForCString: (in category 'primitive support') ----- + stringForCString: aCString + "Answer a new String copied from a null-terminated C string, + or nil if out of memory. + Caution: This may invoke the garbage collector." + <api> + <var: 'aCString' type: 'const char *'> + | len newString | + len := self strlen: aCString. + newString := objectMemory instantiateClass: objectMemory classString indexableSize: len. + newString isNil ifFalse: + [self st: (self arrayValueOf: newString) + rn: aCString + cpy: len]. "(char *)strncpy()" + ^newString! |
Free forum by Nabble | Edit this page |