Add ISEQ_BODY macro

Use ISEQ_BODY macro to get the rb_iseq_constant_body of the ISeq. Using
this macro will make it easier for us to change the allocation strategy
of rb_iseq_constant_body when using Variable Width Allocation.
This commit is contained in:
Peter Zhu 2022-03-23 15:19:48 -04:00
parent 04591e1be7
commit 5f10bd634f
Notes: git 2022-03-24 23:04:20 +09:00
28 changed files with 601 additions and 601 deletions

4
eval.c
View file

@ -1816,10 +1816,10 @@ errinfo_place(const rb_execution_context_t *ec)
while (RUBY_VM_VALID_CONTROL_FRAME_P(cfp, end_cfp)) {
if (VM_FRAME_RUBYFRAME_P(cfp)) {
if (cfp->iseq->body->type == ISEQ_TYPE_RESCUE) {
if (ISEQ_BODY(cfp->iseq)->type == ISEQ_TYPE_RESCUE) {
return &cfp->ep[VM_ENV_INDEX_LAST_LVAR];
}
else if (cfp->iseq->body->type == ISEQ_TYPE_ENSURE &&
else if (ISEQ_BODY(cfp->iseq)->type == ISEQ_TYPE_ENSURE &&
!THROW_DATA_P(cfp->ep[VM_ENV_INDEX_LAST_LVAR]) &&
!FIXNUM_P(cfp->ep[VM_ENV_INDEX_LAST_LVAR])) {
return &cfp->ep[VM_ENV_INDEX_LAST_LVAR];