[squeak-dev] FFI: FFI-Kernel-mt.115.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Jun 19 08:00:33 UTC 2020

Marcel Taeumel uploaded a new version of FFI-Kernel to project FFI:

==================== Summary ====================

Name: FFI-Kernel-mt.115
Author: mt
Time: 19 June 2020, 10:00:32.312059 am
UUID: a0910ccc-0785-b74c-adab-b65816499d7e
Ancestors: FFI-Kernel-mt.114

Try to deal with the issue of having the wrong generated code present in the image.

(1) Avoid checking in generated field accessors via Monticello by putting them into *'autogenerated - accessing' instead of 'accessing' category

(2) Expand the #generated rule to also generate field accessors if the selector is not yet present (or if <generated> is found if present). That rule is used when re-compiling all struct fields on a platform change. See #compileAllFields.

So, you can still choose to manually manage field accessors by adding them in your own 'accessing' category and removing the <generated> pragma. But then you would be on your own. :-)

=============== Diff against FFI-Kernel-mt.114 ===============

Item was changed:
  ----- Method: ExternalStructure class>>maybeCompileAccessor:withSelector: (in category 'field definition - support') -----
  maybeCompileAccessor: aString withSelector: selector
  	(self compiledMethodAt: selector ifAbsent: []) ifNotNil:
  		existingMethod getSourceFromFile asString = aString ifTrue:
+ 	self compile: aString classified: #'*autogenerated - accessing'!
- 	self compile: aString classified: #accessing!

Item was changed:
  ----- Method: ExternalStructure class>>shouldGenerate:policy: (in category 'field definition - support') -----
  shouldGenerate: fieldname policy: aSymbol 
  	"Answer true if the field accessors must be compiled.
  	Do so according to the following rules:
  	- aSymbol = #always always generate the accessors
  	- aSymbol = #never never generate the accessors
  	- aSymbol = #generated only re-generate the auto-generated accessors
  	- aSymbol = #absent only generate the absent accessors"
  	aSymbol = #never ifTrue: [^ false].
  	aSymbol = #always ifTrue: [^ true].
  	aSymbol = #absent ifTrue: [^ (self methodDictionary includesKey: fieldname) not].
+ 	aSymbol = #generated "includes #absent rule"
+ 		ifTrue: [^ (self methodDictionary includesKey: fieldname) not
+ 				or: [(self methodDictionary at: fieldname) hasPragma: #generated]].
- 	aSymbol = #generated
- 		ifTrue: [^ (self methodDictionary includesKey: fieldname)
- 				and: [(self methodDictionary at: fieldname) pragmas
- 						anySatisfy: [:p | p keyword = #generated]]].
  	self error: 'unknown generation policy'!

More information about the Squeak-dev mailing list