Hi Sean,

> On Jun 21, 2018, at 5:48 AM, Sean P. DeNigris <[email protected]> wrote:
> 
> Max Leske wrote
>> if you discovered a compiler 
>> bug it would help to post the information.
> 
> I'm not sure if it's a bug, but here is the info I know:
> 1. Serialized a block in #60540 32-bit
> 2. Materialized it in same version 64-bit  and it was "broken", i.e.:
>    a. It can't be serialized again as indicated above
>    b. Strangely, its print string in the GT Inspector is the entire source
> code of #outerContext instead of the source code of just the block

Looks like the bug is that Fuel is not adjusting the pcs in Contexts and 
BlockClosures when loading something saved in a different word size.  
CompiledCode (CompiledMethod & CompiledBlock) is a hybrid object, the first 
part being object references (the method’s header followed by its literals), 
the second part being bytes (the bytecodes for the method and any additional 
info encoded in trailing bytes).  So in 32 bits a pc is (4*numLiterals+1) less 
than it is in 64 bits, and Fuel and other code must adjust things accordingly.  
See CompiledCode>>#initialPC

> 
> aBlock:
> - The following instVars are the same in both images: startup = 56, numArgs
> = 1
> - outerContext also seems the same, with the only obvious exception that the
> #method bytecodes are not all the same
>  - sender = nil
>  - pc = 45
>  - method = (SmallBaselineLoadScript>>#descriptionConflictBlock)
>  - closureOrNil = nil
>  - receiver = aSmallBaselineLoadScript
> 
> Let me know if you would like any more info…
> 
> 
> 
> 
> -----
> Cheers,
> Sean
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
> 

Reply via email to