Revisit "Refactor to reduce "swap" instruction of pattern matching"

Just moved "case base" after allocating cache space.
This commit is contained in:
Nobuyoshi Nakada 2020-08-17 14:09:20 +09:00
parent 86260ee986
commit 352e923242
No known key found for this signature in database
GPG Key ID: 7CD2805BFA3770C6

View File

@ -6333,8 +6333,6 @@ compile_case3(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const orig_no
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
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) {