[VM-dev] What the difference in method format between 32 and 64 bits images?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[VM-dev] What the difference in method format between 32 and 64 bits images?

Denis Kudriashov
 
Hi 

I am testing serialization library and now I have problem with compiled methods.
I try to materialise 64bits method in 32bits image and otherwise. Both is not working (but in same image everything is fine).

I investigated following difference with "Margitude>>between:and:" as example:

(Margitude>>between:and:) size.  "=> 64bits->46; 32bits->30"

(Margitude>>between:and:)  header. "same 34078723 for 64 and 32 bits"

(Margitude>>between:and:)  initialPC. "=> 64bits-> 33; 32bits->17"

Is there any formula to convert these values between 64 and 32 bits?

Best regards,
Denis
Reply | Threaded
Open this post in threaded view
|

Re: [VM-dev] What the difference in method format between 32 and 64 bits images?

Eliot Miranda-2
 
Hi Denis,

On Wed, Apr 12, 2017 at 8:42 AM, Denis Kudriashov <[hidden email]> wrote:
 
Hi 

I am testing serialization library and now I have problem with compiled methods.
I try to materialise 64bits method in 32bits image and otherwise. Both is not working (but in same image everything is fine).

I investigated following difference with "Margitude>>between:and:" as example:

(Margitude>>between:and:) size.  "=> 64bits->46; 32bits->30"

(Margitude>>between:and:)  header. "same 34078723 for 64 and 32 bits"

(Margitude>>between:and:)  initialPC. "=> 64bits-> 33; 32bits->17"

Is there any formula to convert these values between 64 and 32 bits?

read CompiledCode's comment and initialPC.  The initialPC comes after n + 1 literals (the first word of a method is a header SmallInteger; after that are numLiterals literals).  So the initialPC is 

initialPC
"Answer the program counter for the receiver's first bytecode."

^ (self numLiterals + 1) * Smalltalk wordSize + 1



Best regards,
Denis




--
_,,,^..^,,,_
best, Eliot
Reply | Threaded
Open this post in threaded view
|

Re: [VM-dev] What the difference in method format between 32 and 64 bits images?

Denis Kudriashov
 
Thank's Eliot. Now I have another question in another mail

2017-04-12 18:31 GMT+02:00 Eliot Miranda <[hidden email]>:
 
Hi Denis,

On Wed, Apr 12, 2017 at 8:42 AM, Denis Kudriashov <[hidden email]> wrote:
 
Hi 

I am testing serialization library and now I have problem with compiled methods.
I try to materialise 64bits method in 32bits image and otherwise. Both is not working (but in same image everything is fine).

I investigated following difference with "Margitude>>between:and:" as example:

(Margitude>>between:and:) size.  "=> 64bits->46; 32bits->30"

(Margitude>>between:and:)  header. "same 34078723 for 64 and 32 bits"

(Margitude>>between:and:)  initialPC. "=> 64bits-> 33; 32bits->17"

Is there any formula to convert these values between 64 and 32 bits?

read CompiledCode's comment and initialPC.  The initialPC comes after n + 1 literals (the first word of a method is a header SmallInteger; after that are numLiterals literals).  So the initialPC is 

initialPC
"Answer the program counter for the receiver's first bytecode."

^ (self numLiterals + 1) * Smalltalk wordSize + 1



Best regards,
Denis




--
_,,,^..^,,,_
best, Eliot