summaryrefslogtreecommitdiff
path: root/eval_intern.h
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-04-25 03:50:00 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-04-25 03:50:00 +0000
commitabcbd7ea38f64f942a934ba065aabf9da81a21bc (patch)
tree8bf33e560f4c99904d36a1f0681bf5c2ebd34dae /eval_intern.h
parent354844be45efe799031b1a9799e8c6d52cc6b16d (diff)
* yarvcore.h: remove rb_control_frame_t#callee_id.
* vm_macro.def: ditto. * eval_intern.h (exec_event_hooks): fix to check event flags * eval_intern.h (EXEC_EVENT_HOOK): fix to re-check event flags. * ext/probeprofiler : added. this profiler is sampling based profiler. * vm.c: add rb_thread_current_status() API for probeprofiler. * thread.c (rb_thread_execute_interrupts): add comments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval_intern.h')
-rw-r--r--eval_intern.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/eval_intern.h b/eval_intern.h
index ce059ae04b..2bc529db93 100644
--- a/eval_intern.h
+++ b/eval_intern.h
@@ -234,7 +234,9 @@ static void inline
exec_event_hooks(rb_event_hook_t *hook, rb_event_flag_t flag, VALUE self, ID id, VALUE klass)
{
while (hook) {
- (*hook->func)(flag, hook->data, self, id, klass);
+ if (flag & hook->flag) {
+ (*hook->func)(flag, hook->data, self, id, klass);
+ }
hook = hook->next;
}
}
@@ -242,13 +244,15 @@ exec_event_hooks(rb_event_hook_t *hook, rb_event_flag_t flag, VALUE self, ID id,
#define EXEC_EVENT_HOOK(th, flag, self, id, klass) do { \
rb_event_flag_t wait_event__ = th->event_flags; \
if (UNLIKELY(wait_event__)) { \
- 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__); \
+ 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)