ruby-changes:62590
From: wanabe <ko1@a...>
Date: Sun, 16 Aug 2020 20:59:45 +0900 (JST)
Subject: [ruby-changes:62590] 3a4be429b5 (master): Refactor to reduce "swap" instruction of pattern matching
https://git.ruby-lang.org/ruby.git/commit/?id=3a4be429b5 From 3a4be429b50062122d1616256de38649464d3146 Mon Sep 17 00:00:00 2001 From: wanabe <s.wanabe@g...> Date: Sun, 16 Aug 2020 18:53:39 +0900 Subject: Refactor to reduce "swap" instruction of pattern matching diff --git a/compile.c b/compile.c index f2ab7c3..519e12f 100644 --- a/compile.c +++ b/compile.c @@ -6333,6 +6333,7 @@ compile_case3(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const orig_no https://github.com/ruby/ruby/blob/trunk/compile.c#L6333 INIT_ANCHOR(body_seq); INIT_ANCHOR(cond_seq); + ADD_INSN(head, line, putnil); /* allocate stack for cached #deconstruct value */ CHECK(COMPILE(head, "case base", node->nd_head)); branches = decl_branch_base(iseq, node, "case"); @@ -6345,8 +6346,6 @@ compile_case3(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const orig_no https://github.com/ruby/ruby/blob/trunk/compile.c#L6346 endlabel = NEW_LABEL(line); elselabel = NEW_LABEL(line); - ADD_INSN(head, line, putnil); /* allocate stack for cached #deconstruct value */ - ADD_INSN(head, line, swap); ADD_SEQ(ret, head); /* case VAL */ while (type == NODE_IN) { -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/