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

commits at source.squeak.org commits at source.squeak.org
Thu May 31 02:50:16 UTC 2018

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

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

Name: VMMaker.oscog-eem.2397
Author: eem
Time: 30 May 2018, 7:49:46.882396 pm
UUID: b696a3c2-2443-4c71-94ef-04a4a9a8c426
Ancestors: VMMaker.oscog-eem.2396

Actually fix Slang not emitting variable declarations for 'extern ...' declarations.

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

Item was changed:
  ----- Method: TMethod>>removeUnusedTempsIn: (in category 'utilities') -----
  removeUnusedTempsIn: aCodeGen
  	"Remove all of the unused temps in this method. Answer a set of the references."
  	"After inlining some variable references are now obsolete, we could fix them there
  	 but the code seems a bit complicated, the other choice to to rebuild the locals
  	 before extruding. This is done here"
  	| usedVariables |
  	usedVariables := self allReferencedVariablesUsing: aCodeGen.
  	"reset the locals to be only those still referred to"
  	locals do:
+ 		 (usedVariables includes: local) ifFalse:
+ 			[(((declarations at: local ifAbsent: ['']) includesSubstring: 'static')
+ 			  or: [(declarations at: local ifAbsent: ['']) includesSubstring: 'extern'])
+ 				ifFalse:
+ 					[locals remove: local.
+ 					 declarations removeKey: local ifAbsent: []]
+ 				ifTrue:
+ 					[usedVariables add: local "In case this is a function declaration, e.g. amInVMThread in ownVM:"]]].
- 		 ((usedVariables includes: local) not
- 		  and: [((declarations at: local ifAbsent: ['']) includesSubstring: 'static') not
- 		  and: [((declarations at: local ifAbsent: ['']) includesSubstring: 'extern') not]]) ifTrue:
- 			[locals remove: local.
- 			 declarations removeKey: local ifAbsent: []]].

More information about the Vm-dev mailing list