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

commits at source.squeak.org commits at source.squeak.org
Tue Aug 9 17:33:20 UTC 2022


Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog.seperateMarking-eem.3247.mcz

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

Name: VMMaker.oscog.seperateMarking-eem.3247
Author: eem
Time: 9 August 2022, 10:33:04.340144 am
UUID: 49743454-c7e5-41e8-bf77-432cdd52d7bb
Ancestors: VMMaker.oscog.seperateMarking-WoC.3246

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.seperateMarking-WoC.3246 ===============

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