1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-07 19:13:02 +00:00

Fix optimization of do_get.

When the target slot (register) is the same as the default
register, do not clobber it.
This commit is contained in:
Calvin Rose
2020-06-28 15:52:59 -05:00
parent 7209ced446
commit a1ea62a923
4 changed files with 17 additions and 4 deletions

View File

@@ -42,6 +42,9 @@ int32_t janetc_emit_ssi(JanetCompiler *c, uint8_t op, JanetSlot s1, JanetSlot s2
int32_t janetc_emit_ssu(JanetCompiler *c, uint8_t op, JanetSlot s1, JanetSlot s2, uint8_t immediate, int wr);
int32_t janetc_emit_sss(JanetCompiler *c, uint8_t op, JanetSlot s1, JanetSlot s2, JanetSlot s3, int wr);
/* Check if two slots are equivalent */
int janetc_sequal(JanetSlot x, JanetSlot y);
/* Move value from one slot to another. Cannot copy to constant slots. */
void janetc_copy(JanetCompiler *c, JanetSlot dest, JanetSlot src);