FFI: FFI-Kernel-mt.115.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

FFI: FFI-Kernel-mt.115.mcz

commits-2
Marcel Taeumel uploaded a new version of FFI-Kernel to project FFI:
http://source.squeak.org/FFI/FFI-Kernel-mt.115.mcz

==================== 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|
  existingMethod getSourceFromFile asString = aString ifTrue:
  [^self]].
+ 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'!