CompiledMethods???

Bob Arning arning at charm.net
Wed Jun 14 16:16:00 UTC 2000


On Wed, 14 Jun 2000 11:37:36 +0500 jchludzinski at worldkey.net wrote:
>I tried to call "generate:" on a MethodNode produced by calling "parse:in:notifying:"
>on a Compiler instance. The argument to "generate:" is "trailer" defined as:
>
>"The argument, trailer, is the references to the source code that is stored with 
>every CompiledMethod."
>
>When I use a string of the method text as the trailer, the message dies in
>"at:put:" for CompiledMethod (subclassed from ByteArray).  Apparently this method 
>expects something other than an Integer for an index(?).
>
>Is the actual text for "trailer" incorrect (apparently so)?  What should I use?

John,

This is a slightly tricky area that may change in the not-too-distant future. Currently there are a couple of possible configurations

1) If you have source/changes files, then the trailer is four bytes encoding the file number and position.

2) If you do not have sources/changes files, then the names of the method args and temps are stored in a compressed format here to permit more readable decompilation of the bytecodes.

If you want to learn more about this, check the methods in the "source code management" category of CompiledMethod.

If you simply want a CompiledMethod that has no stored source, you can do:

	method _ methodNode generate: #(0 0 0 0).

Cheers,
Bob





More information about the Squeak-dev mailing list