[Vm-dev] VM Maker: VMMaker.oscog-eem.651.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Mar 19 21:31:43 UTC 2014
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.651.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.651
Author: eem
Time: 19 March 2014, 2:29:27.436 pm
UUID: 4fc53472-12b1-487f-8620-d0fc2eff1662
Ancestors: VMMaker.oscog-eem.650
Prune youngReferrers amd flush icache after freeUnmarkedMachineCode.
Protect byteSizeOfInstanceOf:withIndexableSlots: against integer
overflow.
=============== Diff against VMMaker.oscog-eem.650 ===============
Item was changed:
----- Method: Cogit>>freeUnmarkedMachineCode (in category 'jit - api') -----
freeUnmarkedMachineCode
"Free machine-code methods whose compiled methods are unmarked
and open PICs whose selectors are not marked."
<api>
<option: #SpurMemoryManager>
+ | cogMethod freedMethod |
- | cogMethod |
<var: #cogMethod type: #'CogMethod *'>
+ freedMethod := false.
cogMethod := self cCoerceSimple: methodZoneBase to: #'CogMethod *'.
[cogMethod < methodZone limitZony] whileTrue:
[(cogMethod cmType = CMMethod
and: [(objectMemory isMarked: cogMethod methodObject) not]) ifTrue:
+ [freedMethod := true.
+ self freeMethod: cogMethod].
- [self freeMethod: cogMethod].
(cogMethod cmType = CMOpenPIC
and: [(objectMemory isImmediate: cogMethod selector) not
and: [(objectMemory isMarked: cogMethod selector) not]]) ifTrue:
+ [freedMethod := true.
+ self freeMethod: cogMethod].
- [self freeMethod: cogMethod].
cogMethod := methodZone methodAfter: cogMethod].
+ freedMethod ifTrue:
+ [self unlinkSendsToFree.
+ methodZone pruneYoungReferrers.
+ processor flushICacheFrom: codeBase to: methodZone limitZony asInteger]!
- self unlinkSendsToFree!
Item was added:
+ ----- Method: Spur32BitMemoryManager>>logBytesPerSlot (in category 'header format') -----
+ logBytesPerSlot
+ ^2!
Item was changed:
+ ----- Method: Spur64BitMemoryManager>>bytesPerSlot (in category 'accessing') -----
- ----- Method: Spur64BitMemoryManager>>bytesPerSlot (in category 'header format') -----
bytesPerSlot
^8!
Item was added:
+ ----- Method: Spur64BitMemoryManager>>logBytesPerSlot (in category 'accessing') -----
+ logBytesPerSlot
+ ^3!
Item was changed:
----- Method: SpurMemoryManager>>byteSizeOfInstanceOf:withIndexableSlots: (in category 'indexing primitive support') -----
byteSizeOfInstanceOf: classObj withIndexableSlots: nElements
| 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 bytesPerSlot = 4 ifTrue: [nElements * 2] ifFalse: [nElements]].
[self firstLongFormat] ->
[numSlots := self bytesPerSlot = 4 ifTrue: [nElements] ifFalse: [nElements + 1 // 2]].
[self firstShortFormat] ->
[numSlots := self bytesPerSlot = 4 ifTrue: [nElements + 1 // 2] ifFalse: [nElements + 3 // 4]].
[self firstByteFormat] ->
[numSlots := nElements + (self bytesPerSlot - 1) // self bytesPerSlot].
[self firstCompiledMethodFormat] -> "Assume nElements is derived from CompiledMethod>>basicSize."
[numSlots := nElements + (self bytesPerSlot - 1) // self bytesPerSlot] }
otherwise: [^PrimErrBadReceiver negated]. "non-indexable"
+ numSlots >= (1 << (self bytesPerSlot * 8 - self logBytesPerSlot)) ifTrue:
+ [^PrimErrLimitExceeded negated].
^self objectBytesForSlots: numSlots!
More information about the Vm-dev
mailing list