mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* compile.c: rename iseq_translate_direct_threaded_code()
to iseq_translate_threaded_code(). * eval_intern.h, yarvcore.h: mv EXEC_EVENT_HOOK() and exec_event_hooks() to yarvcore.h. * insnhelper.ci, vm.c: mv yarv_finish_insn_seq to vm.c. * insns.def (opt_call_c_function): fix to use RESTORE_REGS(). * iseq.c (rb_iseq_build_for_ruby2cext): fix to allocate iseq. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0a75feb94a
commit
ee457d92c2
8 changed files with 71 additions and 49 deletions
|
@ -227,39 +227,8 @@ VALUE rb_obj_is_proc(VALUE);
|
|||
void rb_vm_check_redefinition_opt_method(NODE *node);
|
||||
VALUE rb_vm_call_cfunc(VALUE recv, VALUE (*func)(VALUE), VALUE arg, rb_block_t *blockptr, VALUE filename);
|
||||
void rb_thread_terminate_all(void);
|
||||
|
||||
VALUE rb_vm_set_eval_stack(rb_thread_t *, VALUE iseq);
|
||||
void rb_vm_set_eval_stack(rb_thread_t *, VALUE iseq);
|
||||
|
||||
#define ruby_cbase() vm_get_cbase(GET_THREAD())
|
||||
|
||||
|
||||
/* tracer */
|
||||
static void inline
|
||||
exec_event_hooks(rb_event_hook_t *hook, rb_event_flag_t flag, VALUE self, ID id, VALUE klass)
|
||||
{
|
||||
while (hook) {
|
||||
if (flag & hook->flag) {
|
||||
(*hook->func)(flag, hook->data, self, id, klass);
|
||||
}
|
||||
hook = hook->next;
|
||||
}
|
||||
}
|
||||
|
||||
#define EXEC_EVENT_HOOK(th, flag, self, id, klass) do { \
|
||||
rb_event_flag_t wait_event__ = th->event_flags; \
|
||||
if (UNLIKELY(wait_event__)) { \
|
||||
if (wait_event__ & (flag | RUBY_EVENT_VM)) { \
|
||||
VALUE self__ = (self), klass__ = (klass); \
|
||||
ID id__ = (id); \
|
||||
if (wait_event__ & flag) { \
|
||||
exec_event_hooks(th->event_hooks, flag, self__, id__, klass__); \
|
||||
} \
|
||||
if (wait_event__ & RUBY_EVENT_VM) { \
|
||||
exec_event_hooks(th->vm->event_hooks, flag, self__, id__, klass__); \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
||||
#endif /* EVAL_INTERN_H_INCLUDED */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue