[Vm-dev] VM Maker: VMMaker.oscog-eem.3246.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Aug 9 17:36:43 UTC 2022

Eliot Miranda uploaded a new version of VMMaker to project VM Maker:

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

Name: VMMaker.oscog-eem.3246
Author: eem
Time: 9 August 2022, 10:36:26.262524 am
UUID: 93447733-58c1-4419-97c0-06864b9d50ba
Ancestors: VMMaker.oscog-eem.3245

Protect inlining type inference from the horrible optional long-running-primitive check, which declares e.g. longRunningPrimitiveCheckMethod as #if LRPCheck\sqInt longRunningPrimitiveCheckMethod\#endif.

This is another special case for extractTypeFor:fromDeclaration: which strips extern & static from types.  It also needs to strip the #if ... crap.

=============== Diff against VMMaker.oscog-eem.3245 ===============

Item was changed:
  ----- Method: CCodeGenerator>>extractTypeFor:fromDeclaration: (in category 'utilities') -----
  extractTypeFor: aVariable fromDeclaration: aVariableDeclaration
  	"Eliminate inessentials from aVariableDeclaration to answer a C type without the variable,
  	 or initializations etc"
+ 	| decl substrings |
- 	| decl |
  	((aVariableDeclaration beginsWith: 'static ')
  	 or: [aVariableDeclaration beginsWith: 'extern ']) ifTrue:
  		[^self extractTypeFor: aVariable fromDeclaration: (aVariableDeclaration allButFirst: 7)].
+ 	(aVariableDeclaration first = $# and: [aVariableDeclaration includes: $\]) ifTrue:
+ 		[substrings := aVariableDeclaration subStrings: '\'.
+ 		 self assert: (substrings size = 3 and: [substrings last beginsWith: '#']).
+ 		 ^self extractTypeFor: aVariable fromDeclaration: substrings second].
  	decl := (aVariableDeclaration indexOf: $= ifAbsent: [])
  				ifNotNil: [:index| aVariableDeclaration copyFrom: 1 to: index - 1]
  				ifNil: [aVariableDeclaration].
  	decl := decl copyReplaceAll: aVariable with: '' tokenish: [:ch| ch = $_ or: [ch isAlphaNumeric]].
  	^self baseTypeForType: decl!

More information about the Vm-dev mailing list