Hello,
Try :
Smalltalk compactClassesArray at: 5 put: nil.
LargePositiveInteger becomeUncompact.
LargePositiveInteger becomeCompactSimplyAt: 5.
then:
LargePositiveInteger indexIfCompact.
is correct.
Same script is needed for LargeNegativeInteger.
I think this bug is due to the introduction of LargeInteger class in Pharo
3 (common superclass of LargePositiveInteger and LargeNegativeInteger).
Now this is strange that the script I gave you worked because if you look
at
TBehavior>>checkCanBeUncompact
"Certain classes cannot be uncompacted in CogVM. If you download VMMaker
and see the VM code, these are as defined by
StackInterpreter>>#checkAssumedCompactClasses and the ones that can't be
uncompacted are the following: "
({ Array. LargeNegativeInteger. LargePositiveInteger. Float. MethodContext
} includes: self)
ifTrue: [ self error: 'Class ', self name, ' cannot be uncompact. ' ]
However it seems that it worked with #becomeCompactSimplyAt
2014-02-24 11:33 GMT+01:00 Martin Dias <[email protected]>:
> Hi,
>
> I found this comment in TBehavior>>indexIfCompact :
>
> "Verify if the compactClassesArray and indexIfCompact are coheren
> Smalltalk compactClassesArray doWithIndex:
> [:c :i | c == nil ifFalse:
> [c indexIfCompact = i ifFalse: [self halt]]]
> "
>
> Since it *does* halt, I rewrote to:
>
> | inconsistencies |
> inconsistencies := OrderedCollection new.
>
> Smalltalk compactClassesArray doWithIndex: [ :class :index |
> class ifNotNil: [
> class indexIfCompact = index ifFalse: [
> inconsistencies add: { class. index. class indexIfCompact } ]]].
>
> inconsistencies."---> an OrderedCollection({LargeNegativeInteger. 4. 0}
> {LargePositiveInteger. 5. 0})"
>
> I checked that in Pharo 2 they are consistent, so I guess this should be
> fixed.
>
> I ignore deep vm internals so... how would you fix this?
>
> I tried to #becomeUncompact to then #becomeCompact again, but it didn't
> work out-of-the-box.
>
> Cheers,
> Martín
>