janet-lang / janet

A dynamic language and bytecode vm
https://janet-lang.org
MIT License
3.45k stars 223 forks source link

Use vm_commit #1200

Closed sogaiu closed 1 year ago

sogaiu commented 1 year ago

This PR contains a suggestion to use vm_commit(); in place of janet_stack_frame(stack)->pc = pc;.

The vm_commit(); construct is used elsewhere within the JOP_CALL handling in which this instance of janet_stack_frame(stack)->pc = pc; appears:

Perhaps it makes sense to use vm_commit(); on line 983 as well?

Though I can see that if one wanted to leave the JANET_FUNCTION-handling parts of JOP_CALL and JOP_TAILCALL easier to compare, perhaps not using vm_commit(); might be preferrable.

bakpakin commented 1 year ago

LGTM