Remove has_source_hash from iseq_body

We can use a special value of 0 in source_hash to denote that it does not
have source_hash. This removes the has_source_hash field which saves us 8
bytes per iseq.
This commit is contained in:
Peter Zhu committed 2026-08-21 08:35:40 +09:00
1 parent ba269a0e9f
commit ae574e7219
5 files changed
+15 -19
Notes: git 2026-08-20 23:36:12 +00:00

No files matched your search

+2 -1
View File
@@ -1119,7 +1119,8 @@ rb_source_hash_update(rb_source_hash_state_t *state, const uint8_t *ptr, size_t
uint64_t
rb_source_hash_finalize(const rb_source_hash_state_t *state)
{
return state->hash;
/* A hash of 0 means no source hash, so remap it to another value. */
return state->hash == 0 ? 1 : state->hash;
}
VALUE