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

commits at source.squeak.org commits at source.squeak.org
Mon Mar 30 03:15:58 UTC 2020


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

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

Name: VMMaker.oscog-eem.2735
Author: eem
Time: 29 March 2020, 8:15:45.667712 pm
UUID: 001c245b-2f3a-4d8e-923f-b4acac100afe
Ancestors: VMMaker.oscog-eem.2734

Allow volatile variables into the VM's variable structure.  Make sure CFramePointer and CStackPointer are marked volatile.

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

Item was changed:
  ----- Method: CCodeGeneratorGlobalStructure>>placeInStructure: (in category 'C code generator') -----
  placeInStructure: var
  	"See if we should put this array into a structure.
  	The variables listed are hardcoded as C in the interpreter thus they don't get resolved via TVariableNode logic.
  	Also let's ignore variables that have special definitions that require initialization, and the function def which has problems."
  
  	| check |
  	check := variableDeclarations at: var ifAbsent: [''].
  	(check includes: $=) ifTrue: [^false].
  	(check includes: $() ifTrue: [^false].
  	(check includesSubstring: 'static') ifTrue: [^false].
- 	(check includesSubstring: 'volatile') ifTrue: [^false].
  
  	^(vmClass mustBeGlobal: var) not!

Item was changed:
  ----- Method: CoInterpreter class>>declareCVarsIn: (in category 'translation') -----
  declareCVarsIn: aCCodeGenerator
  	"Override to avoid repeating StackInterpreter's declarations and add our own extensions"
  	self class == thisContext methodClass ifFalse: [^self]. "Don't duplicate decls in subclasses"
  	aCCodeGenerator
  		addHeaderFile:'"sqCogStackAlignment.h"';
  		addHeaderFile:'"cogmethod.h"'.
  	NewspeakVM ifTrue:
  		[aCCodeGenerator addHeaderFile:'"nssendcache.h"'].
  	aCCodeGenerator
  		addHeaderFile: (aCCodeGenerator vmClass isThreadedVM 
  			ifTrue: ['"cointerpmt.h"'] 
  			ifFalse: ['"cointerp.h"']);
  		addHeaderFile:'"cogit.h"'.
  	aCCodeGenerator vmClass
  		declareInterpreterVersionIn: aCCodeGenerator
  		defaultName: aCCodeGenerator interpreterVersion.
  	aCCodeGenerator
  		var: #heapBase type: #usqInt;
  		var: #statCodeCompactionUsecs type: #usqLong;
  		var: #maxLiteralCountForCompile
  			declareC: 'sqInt maxLiteralCountForCompile = MaxLiteralCountForCompile /* ', MaxLiteralCountForCompile printString, ' */';
  		var: #minBackwardJumpCountForCompile
  			declareC: 'sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* ', MinBackwardJumpCountForCompile printString, ' */'.
  	aCCodeGenerator removeVariable: 'atCache'. "Way too much trouble than it's worth in the Cog VM"
  	aCCodeGenerator
  		var: #primTraceLogIndex type: #'unsigned char';
  		var: #primTraceLog declareC: 'sqInt primTraceLog[256]';
  		var: #traceLog
  		declareC: 'sqInt traceLog[TraceBufferSize /* ', TraceBufferSize printString, ' */]';
  		var: #traceSources type: #'char *' array: TraceSources.
  	aCCodeGenerator
+ 		var: #CFramePointer type: #'volatile usqIntptr_t';
+ 		var: #CStackPointer type: #'volatile usqIntptr_t'!
- 		var: #CFramePointer type: #'usqIntptr_t';
- 		var: #CStackPointer type: #'usqIntptr_t'!



More information about the Vm-dev mailing list