summaryrefslogtreecommitdiff
path: root/vm_dump.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-28 11:02:30 (GMT)
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-28 11:02:30 (GMT)
commit9f60791a0412cae804f13ed3e746a634c7a0731b (patch)
tree49b3f9ff4924a622e13fbdfc9478d34717d19378 /vm_dump.c
parent683eafd973e4db60756f6ee12e1b066e316f026f (diff)
* vm_core.h: revisit the structure of frame, block and env.
[Bug #12628] This patch introduce many changes. * Introduce concept of "Block Handler (BH)" to represent passed blocks. * move rb_control_frame_t::flag to ep[0] (as a special local variable). This flags represents not only frame type, but also env flags such as escaped. * rename `rb_block_t` to `struct rb_block`. * Make Proc, Binding and RubyVM::Env objects wb-protected. Check [Bug #12628] for more details. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_dump.c')
-rw-r--r--vm_dump.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/vm_dump.c b/vm_dump.c
index df0d241..a27d47d 100644
--- a/vm_dump.c
+++ b/vm_dump.c
@@ -38,10 +38,6 @@ control_frame_dump(rb_thread_t *th, rb_control_frame_t *cfp)
const rb_callable_method_entry_t *me;
- if (cfp->block_iseq != 0 && !RUBY_VM_IFUNC_P(cfp->block_iseq)) {
- biseq_name = ""; /* RSTRING(cfp->block_iseq->body->location.label)->ptr; */
- }
-
if (ep < 0 || (size_t)ep > th->stack_size) {
ep = (ptrdiff_t)cfp->ep;
ep_in_heap = 'p';
@@ -95,6 +91,7 @@ control_frame_dump(rb_thread_t *th, rb_control_frame_t *cfp)
}
if (cfp->iseq != 0) {
+#define RUBY_VM_IFUNC_P(ptr) (RB_TYPE_P((VALUE)(ptr), T_IMEMO) && imemo_type((VALUE)ptr) == imemo_ifunc)
if (RUBY_VM_IFUNC_P(cfp->iseq)) {
iseq_name = "<ifunc>";
}
@@ -185,7 +182,7 @@ rb_vmdebug_stack_dump_raw_current(void)
}
void
-rb_vmdebug_env_dump_raw(rb_env_t *env, VALUE *ep)
+rb_vmdebug_env_dump_raw(rb_env_t *env, const VALUE *ep)
{
int i;
fprintf(stderr, "-- env --------------------\n");
@@ -215,13 +212,13 @@ rb_vmdebug_proc_dump_raw(rb_proc_t *proc)
{
rb_env_t *env;
char *selfstr;
- VALUE val = rb_inspect(proc->block.self);
+ VALUE val = rb_inspect(vm_block_self(&proc->block));
selfstr = StringValueCStr(val);
fprintf(stderr, "-- proc -------------------\n");
fprintf(stderr, "self: %s\n", selfstr);
- GetEnvPtr(rb_vm_proc_envval(proc), env);
- rb_vmdebug_env_dump_raw(env, proc->block.ep);
+ GetEnvPtr(VM_ENV_ENVVAL(vm_block_ep(&proc->block)), env);
+ rb_vmdebug_env_dump_raw(env, vm_block_ep(&proc->block));
}
void
@@ -239,7 +236,7 @@ static VALUE *
vm_base_ptr(rb_control_frame_t *cfp)
{
rb_control_frame_t *prev_cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
- VALUE *bp = prev_cfp->sp + cfp->iseq->body->local_size + 1;
+ VALUE *bp = prev_cfp->sp + iseq->body->local_table_size + VM_ENV_DATA_SIZE;
if (cfp->iseq->body->type == ISEQ_TYPE_METHOD) {
bp += 1;