i thinking that become is unnecessary, it can be just at:put: into method dictionary, so eventually all methods will be updated (after restarting permanent processes) On 20 February 2013 11:13, Guillermo Polito <guillermopolito@gmail.com> wrote:
I summon Eliot :).
On Wed, Feb 20, 2013 at 11:03 AM, Marcus Denker <marcus.denker@inria.fr> wrote:
On Feb 20, 2013, at 11:01 AM, Guillermo Polito <guillermopolito@gmail.com> wrote:
'cause you don't know if the method has trailer or not I think... There are empty trailers and trailers embedding source (directly in the image)... isn't it?
Not for those methods installed in classes⦠we are updating an existing pointer here.
Marcus
On Wed, Feb 20, 2013 at 10:52 AM, Marcus Denker <marcus.denker@inria.fr> wrote:
On Feb 20, 2013, at 10:45 AM, Guillermo Polito <guillermopolito@gmail.com> wrote:
Hi!
There is this bug open I was taking a look yesterday:
http://code.google.com/p/pharo/issues/detail?can=2&start=0&num=100&q=Milesto...
The condense sources compacts the changes and source files, and adds a new method trailer to a compiled method with it's new source pointer. In order to do that, it does a #becomeForward: to the method.
CompiledMethod>>setSourcePointer: srcPointer "We can't change the trailer of existing method, since it could have completely different format. Therefore we need to generate a copy with new trailer, containing an scrPointer, and then #become it" | trailer copy | trailer := CompiledMethodTrailer new sourcePointer: srcPointer. copy := self copyWithTrailerBytes: trailer.
self becomeForward: copy. ^ copy
So far, with simple methods, so good.
However, there are cases, in which becoming the compiled method, breaks processes, sometimes getting a crash in the VM. For example:
(Delay class>>#handleTimerEvent) setSourcePosition: 200 inFile: 1
(ProcessorScheduler class>>#idleProcess) setSourcePosition: 200 inFile: 1
My assumption is that the #becomeForward: of compiled methods do not get well with the stack mapping in the vm... But just guessing.
I wonder why we don't just update the pointer. That is: we keep the method the same, rewrite the pointer, and nothing else.
Marcus
-- Best regards, Igor Stasenko.