Remove vm_assert_env

This commit is contained in:
Peter Zhu 2024-10-31 11:34:09 -04:00
parent 843b4f49ee
commit 645a0c9ea7
Notes: git 2024-10-31 17:52:45 +00:00
2 changed files with 2 additions and 11 deletions

2
vm.c
View File

@ -171,7 +171,7 @@ vm_ep_in_heap_p_(const rb_execution_context_t *ec, const VALUE *ep)
if (!UNDEF_P(envval)) {
const rb_env_t *env = (const rb_env_t *)envval;
VM_ASSERT(vm_assert_env(envval));
VM_ASSERT(imemo_type_p(envval, imemo_env));
VM_ASSERT(VM_ENV_FLAGS(ep, VM_ENV_FLAG_ESCAPED));
VM_ASSERT(env->ep == ep);
}

View File

@ -1489,22 +1489,13 @@ VM_ENV_ESCAPED_P(const VALUE *ep)
return VM_ENV_FLAGS(ep, VM_ENV_FLAG_ESCAPED) ? 1 : 0;
}
#if VM_CHECK_MODE > 0
static inline int
vm_assert_env(VALUE obj)
{
VM_ASSERT(obj == Qundef || imemo_type_p(obj, imemo_env));
return 1;
}
#endif
RBIMPL_ATTR_NONNULL((1))
static inline VALUE
VM_ENV_ENVVAL(const VALUE *ep)
{
VALUE envval = ep[VM_ENV_DATA_INDEX_ENV];
VM_ASSERT(VM_ENV_ESCAPED_P(ep));
VM_ASSERT(vm_assert_env(envval));
VM_ASSERT(envval == Qundef || imemo_type_p(envval, imemo_env));
return envval;
}