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

commits at source.squeak.org commits at source.squeak.org
Tue Jun 16 03:42:58 UTC 2015


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

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

Name: VMMaker.oscog-eem.1355
Author: eem
Time: 15 June 2015, 8:41:02.452 pm
UUID: 9845d764-065b-4f4d-83ec-cb0743402fca
Ancestors: VMMaker.oscog-eem.1354

ARM Cogit:
Fix otherwise clause of inverseOpcodeFor:.

Declare OutOfLineLiteralsManager' literals correctly.

Slang:
Modify typedef printing so that all class names
from the concrete type throguh to the abstract
type are renamed with a define if necessary.
Hence fix compilation of cogitARMv5.c.
(Still have CogOutOfLineLiteralsARMCompiler
methods to implement to get it to link though).

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

Item was changed:
  ----- Method: CogARMCompiler>>inverseOpcodeFor: (in category 'generate machine code - support') -----
  inverseOpcodeFor: armOpcode
  	"Several of the opcodes are inverses.  Answer the inverse for an opcode if it has one.
  	 See Table A3-2 in sec A3.4 Data-processing instructions of the AARM."
  	^armOpcode caseOf: {
  			[AddOpcode]		->	[SubOpcode].
  			[AndOpcode]		->	[BicOpcode].
  			[BicOpcode]		->	[AndOpcode].
  			[CmpOpcode]		->	[CmpNotOpcode].
  			[MoveOpcode]		->	[MoveNotOpcode].
  			[MoveNotOpcode]	->	[MoveOpcode].
  			[SubOpcode]		->	[AddOpcode] }
+ 		otherwise:
+ 			[self error: 'opcode has no inverse'.
+ 			 -1]!
- 		otherwise: [self error: 'opcode has no inverse']!

Item was added:
+ ----- Method: OutOfLineLiteralsManager class>>declareCVarsIn: (in category 'translation') -----
+ declareCVarsIn: aCCodeGenerator
+ 	aCCodeGenerator var: 'literals' type: #'AbstractInstruction *'!

Item was changed:
  ----- Method: VMStructType class>>printTypedefOn: (in category 'translation') -----
  printTypedefOn: aStream
  	aStream nextPutAll: 'typedef struct '.
  	self needsTypeTag ifTrue:
  		[aStream nextPutAll: self structTagName; space].
  	aStream nextPut: ${; cr.
  	self instVarNamesAndTypesForTranslationDo:
  		[:ivn :typeArg| | type |
  		type := typeArg.
  		#(BytesPerWord BaseHeaderSize BytesPerOop) do:
  			[:sizeConstant| | index sizeConstantSize |
  			(type notNil
  			and: [(index := type indexOf: sizeConstant ifAbsent: 0) > 0]) ifTrue:
  				[sizeConstantSize  := VMBasicConstants classPool at: sizeConstant.
  				type := (type at: index + 1) = sizeConstantSize ifTrue:
  							[type := type copyReplaceFrom: index to: index + 1 with: #().
  							 type size = 1 ifTrue: [type first] ifFalse: [type]]]].
  		type ifNotNil:
  			[type isArray
  				ifTrue:
  					[aStream tab: 1.
  					 aStream nextPutAll: type first.
  					 (type first last isSeparator or: [type first last = $*]) ifFalse:
  						[aStream tab: 2].
  					 aStream nextPutAll: ivn.
  					 type last first isSeparator ifFalse:
  						[aStream space].
  					 aStream
  						nextPutAll: type last;
  						nextPut: $;;
  						cr]
  				ifFalse:
  					[aStream tab: 1.
  					 aStream nextPutAll: type.
  					 (type last isSeparator or: [type last = $*]) ifFalse:
  						[aStream tab: 1].
  					 aStream
  						nextPutAll: ivn;
  						nextPut: $;;
  						cr]]].
  	aStream
  		nextPutAll: ' } ';
  		nextPutAll: self structTypeName;
  		nextPut: $;;
  		cr.
  	self name ~= self structTypeName ifTrue:
+ 		[(self withAllSuperclasses copyUpThrough: (self class whichClassIncludesSelector: #structTypeName) theNonMetaClass) do:
+ 			[:structClass|
+ 			 aStream cr; nextPutAll: '#define '; nextPutAll: structClass name; space; nextPutAll: self structTypeName].
+ 		 aStream cr].
- 		[aStream cr; nextPutAll: '#define '; nextPutAll: self name; space; nextPutAll: self structTypeName; cr].
  	aStream flush!



More information about the Vm-dev mailing list