codefrau / SqueakJS

A Squeak Smalltalk VM in Javascript
https://squeak.js.org
MIT License
365 stars 75 forks source link

64 bit support (Spur only) #111

Closed codefrau closed 3 years ago

codefrau commented 3 years ago

This may be ready to merge?

I tested by loading Squeak5.3-19435-64bit, which gets converted on-the-fly to 32 bits. It runs, I can save it (as 32 bits) and then resume that 32 bit snapshot.

I have not tried to run that converted 32 bit image on a Cog VM yet.

I'm slightly embarrassed how messy the code turned out, because I basically littered 64-bit checks throughout the snapshot loader, instead of implementing a clean separate loader. Then again, it gets the job done.

Would be nice if someone else confirmed it works.

ccrraaiigg commented 3 years ago

Cool, I'll check it out!

ccrraaiigg commented 3 years ago

Seems to work, very nice! I noticed a couple of "Hacking" messages to the console, thanks for leaving breadcrumbs to the stuff you want to clean up. Yay!

codefrau commented 3 years ago

Ah yes, good eye: https://github.com/codefrau/SqueakJS/pull/111/files#diff-8680771a3acf14bf67c82e29056742767c8003bb33f38f2f9fa8dded84f3cd88

The wordSize needs to be hacked whenever a 64 bit image is loaded and being converted to 32 bits. Should the message be different in that case? Or maybe no message at all?

The wizard is just slow, so I should remove that hack, agreed.