[Vm-dev] Sometimes it's too easy, part II
bert at freudenbergs.de
Fri Jan 27 16:51:54 UTC 2017
On Thu, Jan 26, 2017 at 5:52 PM, Eliot Miranda <eliot.miranda at gmail.com>
> - a) change the code generator to use usqInt as the default type in place
> of sqInt?
> - b) add a new default type, e.g. oop_t, which is the same as usqInt?
> - c) change sqInt to be unsigned and add e.g. ssqInt as a signed type
> - d) add a new default type, e.g. oop_t, which is the same as char *?
> - e) use void * instead of char * (too horrible bow to contemplate cuz one
> can't compare void *)
I'd think b should work fine. sqOop as suggested by Tim sounds good.
> Bert, is there a similar analysis for SqueakJS or are the C types
> irrelevant and ignored?
Well, most of SqueakJS is written by hand and not generated. That is the
interpreter, jit, most plugins. Non-immediate oops are direct object
references, there is no way to access their numeric value.
Where it is relevant is in the Slang sources for a couple of plugins that I
translated to JS. My VMMakerJS subclasses the regular code generator and I
had to add a crude type inference mechanism and some special-case hacks to
make sized pointer arithmetic and signed/unsigned stuff work.
I guess if I had to touch it again (still using the generated code from 2
years ago) I may be better off using the oscog version instead of baking my
own type inferencer. In any case, a clear distinction between pointers and
arithmetic types would be a Good Thing.
- Bert -
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Vm-dev