codefrau / SqueakJS

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

VM parameters for better Pharo support #96

Closed pavel-krivanek closed 4 years ago

pavel-krivanek commented 4 years ago

I used these VM parameters implementation for Pharo that tries to read them

          // 46   size of machine code zone, in bytes (stored in image file header; Cog JIT VM only, otherwise nil)
           case 46: return 0;

           // 49   the size of the external semaphore table (read-write; Cog VMs only)
           case 49: return null;

           // 65   In newer Cog VMs a set of flags describing VM features,
            //      if non-zero bit 0 implies multiple bytecode set support;
            //      if non-zero bit 0 implies read-only object support
            //      (read-only; Cog VMs only; nil in older Cog VMs, a boolean answering multiple bytecode support in not so old Cog VMs)
            case 65: return 0;
codefrau commented 4 years ago

Sounds good - send a pull request, please :)

(null is the default - do we need case 49?)

codefrau commented 4 years ago

Actually, since I'm at it, I will add these lines.

(although technically, the image is supposed to deal with a nil return value from this primitive)