Always use load_inst to load bytecode.#7
Conversation
| // bytecode version tag (see yklua for an example). | ||
| __attribute__((yk_idempotent)) | ||
| byte load_inst(const byte *pc) { | ||
| NOOPT_VAL(pc); |
There was a problem hiding this comment.
Is it right to NOOPT_VAL the pc? We don't do this in yklua.
There we NOOPT_VAL the function proto version -- something we have no analog of in ykmicropython.
There was a problem hiding this comment.
Without the NOOPT_VAL it seems that load_inst gets inlined? Maybe you can have a look and see if I'm going mad, but that's what I think has happened.
There was a problem hiding this comment.
Hrm. All I can say is that without NOOPT_VAL llvm is able to "somehow remove" load_inst(), but it's not obviously via inlining. It's kind of hard to see.
I'm going to merge this for now, as I think we have bigger fish to fry.
Maybe we can revisit this later.
micropython uses `*ip` and `ip[n]` and friends to load bytecode directly, such that yk doesn't know those loads are idempotent. This commit fixes that, and hugely reduce the length of traces (by 3x on mandelbrot).
|
Force pushed a fix that should allow this to work when compiled in "not yk" mode. |
micropython uses
*ipandip[n]and friends to load bytecode directly, such that yk doesn't know those loads are idempotent. This commit fixes that, and hugely reduce the length of traces (by 3x on mandelbrot).