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

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

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

Name: VMMaker.oscog-eem.2249
Author: eem
Time: 29 June 2017, 6:10:51.630094 pm
UUID: fd9de82a-e671-4ba0-8a83-445791bac016
Ancestors: VMMaker.oscog-eem.2248

Fix slip in byteSizeOfInstanceOf:withIndexableSlots:errInto: that results in byteSizeOfInstanceOfSize: 0 answering nonsense for non-variable classes, instead of failing as intended.

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

Item was changed:
  ----- Method: SpurMemoryManager>>byteSizeOfInstanceOf:withIndexableSlots:errInto: (in category 'indexing primitive support') -----
  byteSizeOfInstanceOf: classObj withIndexableSlots: nElements errInto: errorBlock
  | instSpec classFormat numSlots |
  <var: 'numSlots' type: #usqInt>
  classFormat := self formatOfClass: classObj.
  instSpec := self instSpecOfClassFormat: classFormat.
  instSpec caseOf: {
  [self arrayFormat] ->
  [numSlots := nElements].
  [self indexablePointersFormat] ->
  [numSlots := (self fixedFieldsOfClassFormat: classFormat) + nElements].
  [self weakArrayFormat] ->
  [numSlots := (self fixedFieldsOfClassFormat: classFormat) + nElements].
  [self sixtyFourBitIndexableFormat] ->
  [numSlots := self bytesPerOop = 4 ifTrue: [nElements * 2] ifFalse: [nElements]].
  [self firstLongFormat] ->
  [numSlots := self bytesPerOop = 4 ifTrue: [nElements] ifFalse: [nElements + 1 // 2]].
  [self firstShortFormat] ->
  [numSlots := self bytesPerOop = 4 ifTrue: [nElements + 1 // 2] ifFalse: [nElements + 3 // 4]].
  [self firstByteFormat] ->
  [numSlots := nElements + (self bytesPerOop - 1) // self bytesPerOop].
  [self firstCompiledMethodFormat] -> "Assume nElements is derived from CompiledMethod>>basicSize."
  [numSlots := nElements + (self bytesPerOop - 1) // self bytesPerOop] }
+ otherwise: [^errorBlock value: PrimErrBadReceiver]. "non-indexable"
- otherwise: [^errorBlock value: PrimErrBadReceiver negated]. "non-indexable"
  numSlots >= (1 asUnsignedInteger << (self bytesPerOop * 8 - self logBytesPerOop)) ifTrue:
  [^errorBlock value: (nElements < 0 ifTrue: [PrimErrBadArgument] ifFalse: [PrimErrLimitExceeded])].
  ^self objectBytesForSlots: numSlots!

Loading...