4 ms·
Hadn't thought of that, but it sounds interesting. I guess this means that opcodes in your bytecode need to be large enough to store a pointer, this could invol
by frivoal 11y ago
Hadn't thought of that, but it sounds interesting. I guess this means that opcodes in your bytecode need to be large enough to store a pointer, this could involve some tradeoffs in terms of minimizing instructions vs fitting in the cache, but I suppose it could fall on the right side of things often enough.
- sklogic 11y ago32-bit opcodes are ok, even on 64-bit architectures, if you add a constant offset - see how it's done in OCaml.
- frivoal 11y agoAn offset from the first label, or some nearby alignment point? Makes sense. Do you have a pointer to the relevant part of OCaml's source? The whole thing is probably worth a read, but don't think I can set aside enough time for that soon, and it could take me a while to find the right part.
- sklogic 11y agohttps://github.com/ocaml/ocaml/blob/trunk/byterun/interp.c https://github.com/ocaml/ocaml/blob/trunk/byterun/interp.c See the "Next" macro definition.
- frivoal 11y agoNice. Simple and efficient. I am going to read more from that code base. Looks like this might be a nice read as well: https://ocaml.org/docs/papers.html#BytecodeCompilerandBytecodeInterpreter https://ocaml.org/docs/papers.html#BytecodeCompilerandByteco...