rb_{ary,fnd}_pattern_info: Remove imemo member to reduce memory usage

This is a partial revert commit of 8f096226e1.

NODE layout:

  Before:

       | ARYPTN | FNDPTN | HSHPTN
    ---+--------+--------+-----------
    u1 | pconst | pconst | pconst
    u2 | unused | unused | pkwargs
    u3 | apinfo | fpinfo | pkwrestarg

  After:

       | ARYPTN | FNDPTN | HSHPTN
    ---+--------+--------+-----------
    u1 | imemo  | imemo  | pkwargs
    u2 | pconst | pconst | pconst
    u3 | apinfo | fpinfo | pkwrestarg
This commit is contained in:
Kazuki Tsujimoto 2020-08-02 01:03:43 +09:00
parent b6175c9e4f
commit fcdbdff631
No known key found for this signature in database
GPG key ID: BCEA306C49B81CD7
3 changed files with 19 additions and 63 deletions

6
node.h
View file

@ -273,8 +273,8 @@ typedef struct RNode {
#define nd_brace u2.argc
#define nd_pconst u1.node
#define nd_pkwargs u2.node
#define nd_pkwargs u1.node
#define nd_pconst u2.node
#define nd_pkwrestarg u3.node
#define nd_apinfo u3.apinfo
@ -458,14 +458,12 @@ struct rb_ary_pattern_info {
NODE *pre_args;
NODE *rest_arg;
NODE *post_args;
VALUE imemo;
};
struct rb_fnd_pattern_info {
NODE *pre_rest_arg;
NODE *args;
NODE *post_rest_arg;
VALUE imemo;
};
struct parser_params;