On Tue, Apr 26, 2011 at 6:59 PM, Eliot Miranda
<eliot.miranda@gmail.com> wrote:
Mariano,
�� �the point is that it is classes that manage adding methods to classes and hence it is their private behavior to flush the VM's method cache. �
Ok...I agree, but still it is misleading when we are talking about "method cache". Because methods are in classes...so I promise everybody that didn't know and you ask what Behavior >> flushCache does, and everybody will say that it flushed the cache of the methods of that class, not the whole cache. I can understand CompiledMethod >> flushCache and even Symbol >> flushCache ... but this one looks really strange.
�
You'll see "self flushCache" in Smalltalk-80 v2 images.
that makes more sense indeed
�
�Now of course the VM provides selective cache flushing but back in the day adding or removing a method implied flushing the whole cache. �Personally I don't see that this justifies adding Smalltalk vm yet. �I would wait until you have a few more use cases.
Sorry but in this case, I disagree. I think the opposite: it is the perfect moment to reify the VM in the image and start using it. Why?� exactly because right now we have few uses and it is really easy to migrate. In fact, for Behavior >> flushCache there are only 3 senders.� And I don't pretend to remove them right now, but with the normal deprecation policy. This is, in Pharo 1.3 we let the messages like Behavior >> flushCache,� SmalltalkImage >> vmVersion, etc. But we let them as deprecated explaining that now they should use XXX. And of course, inside the image we do fix the senders.
In fact, in Pharo 1.3, the method SmalltalkImage >> vm
��� "Answer the object to query about virtual machine."
���
��� ^self
already exists :)
I see the following possible behavior for VM right now (I mean, the following methods are already in SmalltalkImage):
- #flushCache
- #buildDate
- #interpreterSourceVersion
- #platformSourceVersion
- #versionLabel
- #extraVMMemory
- #extraVMMemory:
- #gcBiasToGrow:
- #gcBiasToGrowLimit:
- #getVMParameters
- #primitiveGCBiasToGrow:
- #vmParameterAt:
-#vmParameterAt:put:
- #reportCPUandRAM
- #vmStatisticsReportString
- #vmStatisticsShortString
So....I think they are enough. And the sooner we do this, the easier it would be to reify the VM in the image.