diff options
author | John Hawthorn <john@hawthorn.email> | 2022-12-01 11:51:18 -0800 |
---|---|---|
committer | John Hawthorn <john@hawthorn.email> | 2022-12-01 16:31:54 -0800 |
commit | def258e77544409df507c0fa153cf40e84d65082 (patch) | |
tree | 4bdd4d09c918d51a0ef1d9c325283883599c3806 /vm_core.h | |
parent | dcbea7671be74a328f115c6410980f54c872c478 (diff) | |
download | ruby-def258e77544409df507c0fa153cf40e84d65082.tar.gz |
Improve packing of iseq_constant_body struct
By moving the two bools into a packing gap above the mark_bits
pointer/union we can save 8 bytes in the struct and avoid an extra cache
line (328 bytes vs 320 bytes).
Co-authored-by: Adam Hess <HParker@github.com>
Diffstat (limited to 'vm_core.h')
-rw-r--r-- | vm_core.h | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -483,10 +483,6 @@ struct rb_iseq_constant_body { unsigned int icvarc_size; // Number of ICVARC caches unsigned int ci_size; unsigned int stack_max; /* for stack overflow check */ - union { - iseq_bits_t * list; /* Find references for GC */ - iseq_bits_t single; - } mark_bits; bool catch_except_p; // If a frame of this ISeq may catch exception, set true. // If true, this ISeq is leaf *and* backtraces are not used, for example, @@ -495,6 +491,12 @@ struct rb_iseq_constant_body { // ObjectSpace#trace_object_allocations. // For more details, see: https://bugs.ruby-lang.org/issues/16956 bool builtin_inline_p; + + union { + iseq_bits_t * list; /* Find references for GC */ + iseq_bits_t single; + } mark_bits; + struct rb_id_table *outer_variables; const rb_iseq_t *mandatory_only_iseq; |