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

commits at source.squeak.org commits at source.squeak.org
Thu Feb 5 22:49:53 UTC 2015


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

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

Name: VMMaker.oscog-eem.1045
Author: eem
Time: 5 February 2015, 2:48:26.718 pm
UUID: afe6083b-7ae4-4670-9338-4db5a0538104
Ancestors: VMMaker.oscog-eem.1044

Make getModuleName simulate for the
LargeIntegers plugin's primGetModuleName.

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

Item was changed:
  ----- Method: CCodeGenerator>>declareModuleName: (in category 'public') -----
  declareModuleName: nameString
  	"add the declaration of a module name, version and local/external tag"
  
  	self var: #moduleName declareC:'const char *moduleName =
  #ifdef SQUEAK_BUILTIN_PLUGIN
  	"', nameString,' (i)"
  #else
  	"', nameString,' (e)"
  #endif
+ '.
+ 	"and for run-time use, answer the string"
+ 	^nameString, ' (i)'!
- '.!

Item was changed:
  ----- Method: InterpreterPlugin>>getModuleName (in category 'initialize') -----
  getModuleName
  	"Note: This is hardcoded so it can be run from Squeak.
  	The module name is used for validating a module *after*
  	it is loaded to check if it does really contain the module
  	we're thinking it contains. This is important!!"
  	<returnTypeC:'const char*'>
  	<export: true>
+ 	^self cCode: [moduleName]
+ 		inSmalltalk:
+ 			[self class codeGeneratorClass new pluginClass: self class]!
- 	^moduleName!

Item was added:
+ ----- Method: InterpreterPlugin>>st:rn:cpy: (in category 'simulation support') -----
+ st: aString rn: bString cpy: n
+ 	<doNotGenerate>
+ 	^interpreterProxy st: aString rn: bString cpy: n!

Item was added:
+ ----- Method: InterpreterPlugin>>strlen: (in category 'simulation support') -----
+ strlen: aCString
+ 	<doNotGenerate>
+ 	^interpreterProxy strlen: aCString!

Item was changed:
  ----- Method: LargeIntegersPlugin>>primGetModuleName (in category 'control & support primitives') -----
  primGetModuleName
  	"If calling this primitive fails, then C module does not exist."
+ 	| strLen strOop |
- 	| strLen strOop strPtr |
- 	<var: #strPtr type: 'char *'>
  	self debugCode: [self msg: 'primGetModuleName'].
  	self
  		primitive: 'primGetModuleName'
  		parameters: #()
  		receiver: #Oop.
  	strLen := self strlen: self getModuleName.
  	strOop := interpreterProxy instantiateClass: interpreterProxy classString indexableSize: strLen.
+ 	self st: (interpreterProxy firstIndexableField: strOop)
+ 		rn: self getModuleName
+ 		cpy: strLen.
- 	strPtr := interpreterProxy firstIndexableField: strOop.
- 	0 to: strLen - 1 do: [:i | strPtr at: i put: (self getModuleName at: i)].
  	^strOop!

Item was changed:
  ----- Method: VMPluginCodeGenerator>>pluginClass: (in category 'public') -----
  pluginClass: aPluginClass
+ 	"Set the plugin class and name when generating plugins.
+ 	 And for run-time use, answer the name string."
- 	"Set the plugin class and name when generating plugins."
  	| packageId |
  	pluginClass := aPluginClass.
  	pluginName := pluginClass moduleName.
  	packageId := self shortMonticelloDescriptionForClass: pluginClass.
  	(packageId beginsWith: pluginClass name) ifTrue:
  		[packageId := packageId allButFirst: pluginClass name size].
  	(packageId beginsWith: pluginName) ifTrue:
  		[packageId := packageId allButFirst: pluginName size].
+ 	^self declareModuleName: pluginClass moduleNameAndVersion, packageId!
- 	self declareModuleName: pluginClass moduleNameAndVersion, packageId!



More information about the Vm-dev mailing list