diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-04-25 14:29:58 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-10-12 16:20:41 +0900 |
| commit | eddd3249793b3b307da2fe7734d5923cd238a35b (patch) | |
| tree | 8575bd761c26472c9dbb6a81cdeb65a2b3ecc3bd /mrbgems/mruby-compiler/core/codegen.c | |
| parent | f221f4e0fa08da25498042b2cd61331af40294e5 (diff) | |
| download | mruby-eddd3249793b3b307da2fe7734d5923cd238a35b.tar.gz mruby-eddd3249793b3b307da2fe7734d5923cd238a35b.zip | |
Add `MRB_SYM()` for inline symbols.
Diffstat (limited to 'mrbgems/mruby-compiler/core/codegen.c')
| -rw-r--r-- | mrbgems/mruby-compiler/core/codegen.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/mrbgems/mruby-compiler/core/codegen.c b/mrbgems/mruby-compiler/core/codegen.c index c64ffc473..c0d130182 100644 --- a/mrbgems/mruby-compiler/core/codegen.c +++ b/mrbgems/mruby-compiler/core/codegen.c @@ -737,7 +737,7 @@ for_body(codegen_scope *s, node *tree) genop_2(s, OP_BLOCK, cursp(), s->irep->rlen-1); push();pop(); /* space for a block */ pop(); - idx = new_sym(s, mrb_intern_lit(s->mrb, "each")); + idx = new_sym(s, MRB_SYM(each)); genop_3(s, OP_SENDB, cursp(), idx, 0); } @@ -1489,14 +1489,14 @@ codegen(codegen_scope *s, node *tree, int val) gen_move(s, cursp(), exc, 0); push_n(2); pop_n(2); /* space for one arg and a block */ pop(); - genop_3(s, OP_SEND, cursp(), new_sym(s, mrb_intern_lit(s->mrb, "__case_eqq")), 1); + genop_3(s, OP_SEND, cursp(), new_sym(s, MRB_SYM(__case_eqq)), 1); } else { if (n4) { codegen(s, n4->car, VAL); } else { - genop_2(s, OP_GETCONST, cursp(), new_sym(s, mrb_intern_lit(s->mrb, "StandardError"))); + genop_2(s, OP_GETCONST, cursp(), new_sym(s, MRB_SYM(StandardError))); push(); } pop(); @@ -1739,7 +1739,7 @@ codegen(codegen_scope *s, node *tree, int val) gen_move(s, cursp(), head, 0); push(); push(); pop(); pop(); pop(); if (nint(n->car->car) == NODE_SPLAT) { - genop_3(s, OP_SEND, cursp(), new_sym(s, mrb_intern_lit(s->mrb, "__case_eqq")), 1); + genop_3(s, OP_SEND, cursp(), new_sym(s, MRB_SYM(__case_eqq)), 1); } else { genop_3(s, OP_SEND, cursp(), new_sym(s, mrb_intern_lit(s->mrb, "===")), 1); @@ -2266,7 +2266,7 @@ codegen(codegen_scope *s, node *tree, int val) pop_n(n+1); genop_2S(s, OP_BLKPUSH, cursp(), (ainfo<<4)|(lv & 0xf)); if (sendv) n = CALL_MAXARGS; - genop_3(s, OP_SEND, cursp(), new_sym(s, mrb_intern_lit(s->mrb, "call")), n); + genop_3(s, OP_SEND, cursp(), new_sym(s, MRB_SYM(call)), n); if (val) push(); } break; @@ -2618,7 +2618,7 @@ codegen(codegen_scope *s, node *tree, int val) { node *n; int ai = mrb_gc_arena_save(s->mrb); - int sym = new_sym(s, mrb_intern_lit(s->mrb, "Kernel")); + int sym = new_sym(s, MRB_SYM(Kernel)); genop_1(s, OP_LOADSELF, cursp()); push(); @@ -2698,7 +2698,7 @@ codegen(codegen_scope *s, node *tree, int val) } push(); /* space for a block */ pop_n(argc+2); - sym = new_sym(s, mrb_intern_lit(s->mrb, "compile")); + sym = new_sym(s, MRB_SYM(compile)); genop_3(s, OP_SEND, cursp(), sym, argc); mrb_gc_arena_restore(s->mrb, ai); push(); @@ -2752,7 +2752,7 @@ codegen(codegen_scope *s, node *tree, int val) } push(); /* space for a block */ pop_n(argc+2); - sym = new_sym(s, mrb_intern_lit(s->mrb, "compile")); + sym = new_sym(s, MRB_SYM(compile)); genop_3(s, OP_SEND, cursp(), sym, argc); mrb_gc_arena_restore(s->mrb, ai); push(); |
