VM Maker: VMMaker.oscog-eem.2592.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.2592.mcz

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

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

Name: VMMaker.oscog-eem.2592
Author: eem
Time: 24 November 2019, 7:31:01.460535 pm
UUID: 760ff6d7-453c-4ba2-a154-ca5e68ecc0ec
Ancestors: VMMaker.oscog-tpr.2591

Fix a bogus assert fail in cloning an OS or FFI error object on failing a primitive.  On Spur we shouldn't check for a known class index, as a PrimitiveError does not have a known class.

=============== Diff against VMMaker.oscog-tpr.2591 ===============

Item was added:
+ ----- Method: SpurMemoryManager>>eeInstantiateAnySmallClassIndex:format:numSlots: (in category 'instantiation') -----
+ eeInstantiateAnySmallClassIndex: classIndex format: objFormat numSlots: numSlots
+ "Instantiate a small instance of a class.  ee stands for execution engine and
+ implies that this allocation will *NOT* cause a GC.  small implies the object will have
+ less than 255 slots. N.B. the instantiated object IS NOT FILLED and must be completed
+ before returning it to Smalltalk. Since this call is used in routines that do just that we
+ are safe.  Break this rule and die in GC.  Result is guaranteed to be young."
+ <inline: true>
+ self assert: (numSlots >= 0 and: [classIndex ~= 0 and: [(self classAtIndex: classIndex) ~= nilObj]]).
+ self assert: (objFormat < self firstByteFormat
+ ifTrue: [objFormat]
+ ifFalse: [objFormat bitAnd: self byteFormatMask])
+ = (self instSpecOfClass: (self classAtIndex: classIndex)).
+ ^self allocateSmallNewSpaceSlots: numSlots format: objFormat classIndex: classIndex!

Item was changed:
  ----- Method: StackInterpreter>>cloneOSErrorObj:numSlots: (in category 'message sending') -----
  cloneOSErrorObj: errObj numSlots: numSlots
  "If errObj is a pointer object with at least two slots, then answer a clone
   of the error object with the second slot set to the value of osErrorCode,
   and if an PrimErrFFIException, then the third slow with the exceptionPC."
  | clone |
  <inline: true>
  clone := objectMemory hasSpurMemoryManagerAPI
  ifTrue: [objectMemory
+ eeInstantiateAnySmallClassIndex: (objectMemory classIndexOf: errObj)
- eeInstantiateSmallClassIndex: (objectMemory classIndexOf: errObj)
  format: objectMemory nonIndexablePointerFormat
  numSlots: numSlots]
  ifFalse: [objectMemory
  eeInstantiateSmallClass: (objectMemory fetchClassOfNonImm: errObj)
  numSlots: numSlots].
  0 to: numSlots - 1 do:
  [:i| objectMemory
  storePointerUnchecked: i
  ofObject: clone
  withValue: (objectMemory fetchPointer: i ofObject: errObj)].
  (numSlots > 2
  and: [primFailCode = PrimErrFFIException])
  ifTrue:
  [objectMemory
  storePointerUnchecked: 1
  ofObject: clone
  withValue: (self positive64BitIntegerFor: (self cCoerceSimple: osErrorCode to: #usqLong));
  storePointerUnchecked: 2
  ofObject: clone
  withValue: (self positiveMachineIntegerFor: exceptionPC)]
  ifFalse:
  [objectMemory
  storePointerUnchecked: 1
  ofObject: clone
  withValue: (self signed64BitIntegerFor: osErrorCode)].
  ^clone!