ruby-changes:62594
From: Nobuyoshi <ko1@a...>
Date: Mon, 17 Aug 2020 14:27:01 +0900 (JST)
Subject: [ruby-changes:62594] 352e923242 (master): Revisit "Refactor to reduce "swap" instruction of pattern matching"
https://git.ruby-lang.org/ruby.git/commit/?id=352e923242 From 352e923242a23ba661a8cf91e4c43c156f7d7519 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Mon, 17 Aug 2020 14:09:20 +0900 Subject: Revisit "Refactor to reduce "swap" instruction of pattern matching" Just moved "case base" after allocating cache space. diff --git a/compile.c b/compile.c index f2ab7c3..8af2f89 100644 --- a/compile.c +++ b/compile.c @@ -6333,8 +6333,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#L6333 INIT_ANCHOR(body_seq); INIT_ANCHOR(cond_seq); - CHECK(COMPILE(head, "case base", node->nd_head)); - branches = decl_branch_base(iseq, node, "case"); node = node->nd_body; @@ -6346,7 +6344,9 @@ compile_case3(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const orig_no https://github.com/ruby/ruby/blob/trunk/compile.c#L6344 elselabel = NEW_LABEL(line); ADD_INSN(head, line, putnil); /* allocate stack for cached #deconstruct value */ - ADD_INSN(head, line, swap); + + CHECK(COMPILE(head, "case base", orig_node->nd_head)); + 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/