[Vm-dev] VM Maker Inbox: VMMaker.oscog-fn.2757.mcz

commits at source.squeak.org commits at source.squeak.org
Fri May 29 08:31:22 UTC 2020


A new version of VMMaker was added to project VM Maker Inbox:
http://source.squeak.org/VMMakerInbox/VMMaker.oscog-fn.2757.mcz

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

Name: VMMaker.oscog-fn.2757
Author: fn
Time: 29 May 2020, 10:29:35.998527 am
UUID: 52be099f-82ff-4e19-a4d7-cebeb9271919
Ancestors: VMMaker.oscog-ul.2756

Update and fix SlangTests>>testSimpleMethod after recent sqInt-related changes.

=============== Diff against VMMaker.oscog-ul.2756 ===============

Item was changed:
  ----- Method: SlangTests>>testSimpleMethod (in category 'tests') -----
  testSimpleMethod
  	| codeGenerator tMethod code |
  	codeGenerator := CCodeGenerator new.
  	tMethod := codeGenerator compileToTMethodSelector: #extBBytecode in: StackInterpreter.
  	self assert: #(	#'['
  					byte #':=' self fetchByte #'.'
  					self fetchNextBytecode #'.'
  					extB #':=' #(numExtB #= 0 and: #'[' byte #> 127 #']')
  									ifTrue: #'[' byte #- 256 #']'
  									ifFalse: #'[' #(extB bitShift: 8) #+ byte #']' #'.'
  					numExtB #':=' numExtB #+ 1 #'.'
  					#'^' self
  					#']')
  		equals: (Scanner new scanTokens: tMethod parseTree printString).
  	code := String streamContents: [:s| tMethod emitCCodeOn: s generator: codeGenerator].
  	code := code allButFirst: (code indexOfSubCollection: 'sqInt') - 1.
  	self assert:  #('sqInt' 'extBBytecode(void)' '{' 'sqInt' 'byte;'
  					'byte' '=' 'fetchByte();'
  					'fetchNextBytecode();'
  					'extB' '=' '((numExtB' '==' '0)' '&&' '(byte' '>' '0x7F)'
  						'?' 'byte' '-' '256'
+ 						':' '((((sqInt)((usqInt)(extB)' '<<' '8))))' '+' 'byte);'
- 						':' '(((usqInt)' 'extB' '<<' '8))' '+' 'byte);'
  					'numExtB' '+=' '1;' 'return' 'self;' '}')
  		equals: (code findTokens: Character separators) asArray !



More information about the Vm-dev mailing list