[Vm-dev] VM Maker: VMMaker.oscog-eem.858.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Aug 13 02:11:26 UTC 2014
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.858.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.858
Author: eem
Time: 12 August 2014, 7:08:58.89 pm
UUID: 740d3777-1263-41f8-b628-6a18468208b1
Ancestors: VMMaker.oscog-eem.857
Oops! Fix regression in last change. Deleted an extra line by accident.
=============== Diff against VMMaker.oscog-eem.857 ===============
Item was changed:
----- Method: Spur32BitMemoryManager>>instantiateClass:indexableSize: (in category 'instantiation') -----
instantiateClass: classObj indexableSize: nElements
<var: #nElements type: #usqInt>
| instSpec classFormat numSlots classIndex newObj fillValue |
classFormat := self formatOfClass: classObj.
instSpec := self instSpecOfClassFormat: classFormat.
fillValue := 0.
instSpec caseOf: {
[self arrayFormat] ->
[nElements > self maxSlotsForAlloc ifTrue:
[^nil].
numSlots := nElements.
fillValue := nilObj].
[self indexablePointersFormat] ->
[nElements > (self maxSlotsForAlloc - (self fixedFieldsOfClassFormat: classFormat)) ifTrue:
[^nil].
numSlots := (self fixedFieldsOfClassFormat: classFormat) + nElements.
fillValue := nilObj].
[self weakArrayFormat] ->
[nElements > (self maxSlotsForAlloc - (self fixedFieldsOfClassFormat: classFormat)) ifTrue:
[^nil].
numSlots := (self fixedFieldsOfClassFormat: classFormat) + nElements.
fillValue := nilObj].
[self sixtyFourBitIndexableFormat] ->
[nElements > (self maxSlotsForAlloc / 2) ifTrue:
[^nil].
numSlots := nElements * 2].
[self firstLongFormat] ->
[nElements > self maxSlotsForAlloc ifTrue:
[^nil].
numSlots := nElements].
[self firstShortFormat] ->
[numSlots := nElements + 1 // 2.
numSlots > self maxSlotsForAlloc ifTrue:
[^nil].
instSpec := instSpec + (nElements bitAnd: 1)].
[self firstByteFormat] ->
[numSlots := nElements + 3 // 4.
numSlots > self maxSlotsForAlloc ifTrue:
+ [^nil].
+ instSpec := instSpec + (4 - nElements bitAnd: 3)] }
- [^nil]] }
otherwise: ["some Squeak images include funky fixed subclasses of abstract variable
superclasses. e.g. DirectoryEntry as a subclass of ArrayedCollection.
Allow fixed classes to be instantiated here iff nElements = 0."
(nElements ~= 0 or: [instSpec > self lastPointerFormat]) ifTrue:
[^nil].
numSlots := self fixedFieldsOfClassFormat: classFormat]. "non-indexable"
classIndex := self ensureBehaviorHash: classObj.
classIndex < 0 ifTrue:
[coInterpreter primitiveFailFor: classIndex negated.
^nil].
numSlots > self maxSlotsForNewSpaceAlloc
ifTrue: [newObj := self allocateSlotsInOldSpace: numSlots format: instSpec classIndex: classIndex]
ifFalse: [newObj := self allocateSlots: numSlots format: instSpec classIndex: classIndex].
newObj ifNotNil:
[self fillObj: newObj numSlots: numSlots with: fillValue].
^newObj!
More information about the Vm-dev
mailing list