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

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

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

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

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

Name: VMMaker.oscog-eem.2235
Author: eem
Time: 5 June 2017, 10:47:27.353309 am
UUID: 68c9b297-6c1a-4381-8337-102146e7acd3
Ancestors: VMMaker.oscog-nice.2234

Fix regression in VMMaker.oscog-eem.2222.  If primitiveMakePoint no longer checks its receiver the inlined special selector form must.  Add isFloatOrInt: to make checking simpler.

Spur:
Add printOopsExcept: for debugging.  Add printMarkedOops: and printUnmarkedOops: to get round an LLDB limitation with calling printOopsSuchThat:/Except:

=============== Diff against VMMaker.oscog-nice.2234 ===============

Item was changed:
  ----- Method: InterpreterPrimitives>>primitiveMakePoint (in category 'arithmetic integer primitives') -----
  primitiveMakePoint
  <inline: false>
  | rcvr arg pt |
  rcvr := self stackValue: 1.
  arg := self stackTop.
+ (objectMemory isFloatOrInt: arg) ifFalse:
- ((objectMemory isIntegerObject: arg) or: [objectMemory isFloatObject: arg]) ifFalse:
  [^self primitiveFailFor: PrimErrBadArgument].
  pt := objectMemory eeInstantiateSmallClass: (objectMemory splObj: ClassPoint) numSlots: YIndex + 1.
  objectMemory "No need to check since new object is always new."
  storePointerUnchecked: XIndex ofObject: pt withValue: rcvr;
  storePointerUnchecked: YIndex ofObject: pt withValue: arg.
  self pop: 2 thenPush: pt!

Item was added:
+ ----- Method: NewObjectMemory>>isFloatOrInt: (in category 'interpreter access') -----
+ isFloatOrInt: anOop
+ "Answer if anOop is either a SmallInteger or a Float."
+
+ <inline: true>
+
+ ^(self isIntegerObject: anOop)
+  or: [(self compactClassIndexOf: anOop) = ClassFloatCompactIndex]!

Item was added:
+ ----- Method: Spur32BitMemoryManager>>isFloatOrInt: (in category 'interpreter access') -----
+ isFloatOrInt: anOop
+ "Answer if anOop is either a SmallInteger or a Float."
+
+ <inline: true>
+ ^(self isImmediate: anOop)
+ ifTrue: [self isIntegerObject: anOop]
+ ifFalse: [(self classIndexOf: anOop) = ClassFloatCompactIndex]!

Item was added:
+ ----- Method: Spur64BitMemoryManager>>isFloatOrInt: (in category 'interpreter access') -----
+ isFloatOrInt: anOop
+ "Answer if anOop is either a SmallInteger or a Float."
+
+ <inline: true>
+ ^(self isImmediate: anOop)
+ ifTrue: [(self isCharacterObject: anOop) not]
+ ifFalse: [(self classIndexOf: anOop) = ClassFloatCompactIndex]!

Item was added:
+ ----- Method: SpurMemoryManager>>isFloatOrInt: (in category 'interpreter access') -----
+ isFloatOrInt: anOop
+ "Answer if anOop is either a SmallInteger or a Float."
+
+ self subclassResponsibility!

Item was added:
+ ----- Method: SpurMemoryManager>>printMarkedOops (in category 'debug printing') -----
+ printMarkedOops
+ <api>
+ <option: #LLDB>
+ self printOopsSuchThat: #isMarked!

Item was added:
+ ----- Method: SpurMemoryManager>>printOopsExcept: (in category 'debug printing') -----
+ printOopsExcept: function
+ <api>
+ <var: #function declareC: 'sqInt (*function)(sqInt)'>
+ <inline: #never>
+ | n |
+ n := 0.
+ self allHeapEntitiesDo:
+ [:o|
+ (self perform: function with: o) ifFalse:
+ [n := n + 1.
+ self printEntity: o]].
+ n > 4 ifTrue: "rabbits"
+ [self printNum: n; print: ' objects'; cr]!

Item was changed:
  ----- Method: SpurMemoryManager>>printOopsSuchThat: (in category 'debug printing') -----
  printOopsSuchThat: function
  <api>
  <var: #function declareC: 'sqInt (*function)(sqInt)'>
+ <inline: #never>
+ | n |
+ n := 0.
  self allHeapEntitiesDo:
  [:o|
  (self perform: function with: o) ifTrue:
+ [n := n + 1.
+ self printEntity: o]].
+ n > 4 ifTrue: "rabbits"
+ [self printNum: n; print: ' objects'; cr]!
- [self printEntity: o]]!

Item was added:
+ ----- Method: SpurMemoryManager>>printUnmarkedOops (in category 'debug printing') -----
+ printUnmarkedOops
+ <api>
+ <option: #LLDB>
+ self printOopsExcept: #isMarked!

Item was changed:
  ----- Method: StackInterpreter>>bytecodePrimMakePoint (in category 'common selector sends') -----
  bytecodePrimMakePoint
+ "Inline primitiveMakePoint for the benefit of the interpreter. Externalizing the
+ sp & fp, then internalizing and testign for primitive failure add much overhead.
+ So simply inline the relatively small ammount of code directly."
+ | rcvr arg pt |
+ rcvr := self internalStackValue: 1.
+ arg := self internalStackTop.
+ ((objectMemory isFloatOrInt: rcvr)
+ and: [objectMemory isFloatOrInt: arg]) ifTrue:
+ [pt := objectMemory eeInstantiateSmallClass: (objectMemory splObj: ClassPoint) numSlots: YIndex + 1.
+ objectMemory "No need to check since new object is always new."
+ storePointerUnchecked: XIndex ofObject: pt withValue: rcvr;
+ storePointerUnchecked: YIndex ofObject: pt withValue: arg.
+ self internalPop: 2 thenPush: pt.
+ ^self fetchNextBytecode "success"].
 
- self initPrimCall.
- self externalizeIPandSP.
- self primitiveMakePoint.
- self internalizeIPandSP.
- self successful ifTrue: [^ self fetchNextBytecode "success"].
-
  messageSelector := self specialSelector: 11.
  argumentCount := 1.
  self normalSend!

Item was changed:
  ----- Method: VMBasicConstants class>>namesDefinedAtCompileTime (in category 'C translation') -----
  namesDefinedAtCompileTime
  "Answer the set of names for variables that should be defined at compile time.
  Some of these get default values during simulation, and hence get defaulted in
  the various initializeMiscConstants methods.  But that they have values should
  /not/ cause the code generator to do dead code elimination based on their
  default values."
  ^#( VMBIGENDIAN
  IMMUTABILITY
  STACKVM COGVM COGMTVM SPURVM
  PharoVM "Pharo vs Squeak"
  EnforceAccessControl "Newspeak"
+ CheckRememberedInTrampoline "IMMUTABILITY"
+ LLDB) "As of lldb-370.0.42 Swift-3.1, passing funciton parameters to printOopsSuchThat fails with Internal error [IRForTarget]: Couldn't rewrite one of the arguments of a function call.  Turning off link time optimization with -fno0lto has no effect.  hence we define some debugging functions as being <option: LLDB>"!
- CheckRememberedInTrampoline) "IMMUTABILITY"!