VM Maker Inbox: VMMaker.oscog-fn.2757.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

VM Maker Inbox: VMMaker.oscog-fn.2757.mcz

commits-2
 
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 !