VM Maker: VMMaker.oscog-eem.2079.mcz

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

VM Maker: VMMaker.oscog-eem.2079.mcz

Eliot Miranda uploaded a new version of VMMaker to project VM Maker:

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

Name: VMMaker.oscog-eem.2079
Author: eem
Time: 9 January 2017, 12:23:31.735273 pm
UUID: 00ef0ca2-fca0-4dc0-baa9-e65e98fda15a
Ancestors: VMMaker.oscog-eem.2078

Fix code generation for bitInvert64, fixing recently generated 64-bit sources.
Fix indenting for not.
Fix cogitClass for StackInterpreter[Primitives] to avoid unnecessary CCodeGenerator initialization.

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

Item was changed:
  ----- Method: CCodeGenerator>>generateBitInvert:on:indent: (in category 'C translation') -----
  generateBitInvert: msgNode on: aStream indent: level
  "Generate the C code for this message onto the given stream.
  If the selector is bitInvert32 then cast to unsigned int to ensure
  a 32-bit value on 64-bit platforms."
+ | castToUnsignedInt castToUnsignedLong castToUnsignedLongLong |
+ (castToUnsignedInt := msgNode selector = #bitInvert32) ifTrue:
- | castToUnsignedInt |
- castToUnsignedInt := msgNode selector = #bitInvert32.
- castToUnsignedInt ifTrue:
  [aStream nextPutAll: '(unsigned int)'].
  aStream nextPut: $~.
+ (castToUnsignedLong := msgNode selector = #bitInvert64 and: [vmClass notNil and: [vmClass objectMemoryClass wordSize = 8]]) ifTrue:
+ [aStream nextPutAll: '(usqIntptr_t)'].
+ (castToUnsignedLongLong := msgNode selector = #bitInvert64 and: [vmClass isNil or: [vmClass objectMemoryClass wordSize = 4]]) ifTrue:
+ [aStream nextPutAll: '(unsigned long long)'].
+ self assert: castToUnsignedInt asBit + castToUnsignedLong asBit + castToUnsignedLongLong asBit <= 1. "We should only do a single cast"
  self emitCExpression: msgNode receiver on: aStream!

Item was changed:
  ----- Method: CCodeGenerator>>generateNot:on:indent: (in category 'C translation') -----
  generateNot: msgNode on: aStream indent: level
  "Generate the C code for this message onto the given stream."
  aStream nextPutAll: '!!'.
+ self emitCExpression: msgNode receiver on: aStream indent: level!
- self emitCExpression: msgNode receiver on: aStream.!

Item was changed:
  ----- Method: VMClass class>>cogitClass (in category 'accessing class hierarchy') -----
+ "Answer the cogitClass in effect.  Ensure that StackInterpreter has a nil cogitClass."
+ (self isInterpreterClass and: [self hasCogit not]) ifTrue:
+ [^nil].
  ^initializationOptions ifNotNil:
  [Smalltalk classNamed: (initializationOptions
  at: #Cogit
  ifAbsent: [#SimpleStackBasedCogit])]!