summaryrefslogtreecommitdiff
path: root/vm_core.h
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2022-12-01 11:51:18 -0800
committerJohn Hawthorn <john@hawthorn.email>2022-12-01 16:31:54 -0800
commitdef258e77544409df507c0fa153cf40e84d65082 (patch)
tree4bdd4d09c918d51a0ef1d9c325283883599c3806 /vm_core.h
parentdcbea7671be74a328f115c6410980f54c872c478 (diff)
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>
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6847
Diffstat (limited to 'vm_core.h')
-rw-r--r--vm_core.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/vm_core.h b/vm_core.h
index 98ac69b1e8..e921629619 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -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;