* vm_core.h: introduce VM_FRAME_RUBYFRAME_P()

and VM_FRAME_CFRAME_P().
  Most of case, RUBY_VM_NORMAL_ISEQ_P() is no
  longer needed.

* vm_core.h: introduce rb_obj_is_iseq().

* cont.c, vm.c: VM_FRAME_MAGIC_DUMMY with
  VM_FRAME_FLAG_CFRAME.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2016-08-03 01:50:50 +00:00
parent 0cd7f5fe87
commit 03cad83593
11 changed files with 63 additions and 32 deletions

View file

@ -37,13 +37,12 @@ calc_lineno(const rb_iseq_t *iseq, const VALUE *pc)
int
rb_vm_get_sourceline(const rb_control_frame_t *cfp)
{
int lineno = 0;
const rb_iseq_t *iseq = cfp->iseq;
if (RUBY_VM_NORMAL_ISEQ_P(iseq)) {
lineno = calc_lineno(cfp->iseq, cfp->pc);
if (VM_FRAME_RUBYFRAME_P(cfp) && cfp->iseq) {
return calc_lineno(cfp->iseq, cfp->pc);
}
else {
return 0;
}
return lineno;
}
typedef struct rb_backtrace_location_struct {