1 /* src/vm/hook.hpp - hook points inside the VM
4 CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
6 This file is part of CACAO.
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2, or (at
11 your option) any later version.
13 This program is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
33 * Hook points are inline functions acting as probes scattered throughout
34 * several VM subsystems. They can be used to implement event generation
35 * or statistics gathering without polluting the source code. Hence all
36 * compiler macro and runtime checks should be done in this file. One
37 * example of where hooks are useful is JVMTI event firing.
40 void breakpoint (Breakpoint *bp);
41 void class_linked (classinfo *c);
42 void class_loaded (classinfo *c);
43 void method_enter (methodinfo *m);
44 void method_exit (methodinfo *m);
45 void method_unwind (methodinfo *m);
46 void native_resolved(methodinfo *m, void *symbol, void **symbolptr);
47 void thread_start (threadobject *t);
48 void thread_end (threadobject *t);
53 inline void Hook::breakpoint(Breakpoint *bp)
55 #if defined(ENABLE_JVMTI)
56 methodinfo* m = bp->method;
57 int32_t l = bp->location;
59 log_message_method("JVMTI: Reached breakpoint in method ", m);
60 log_println("JVMTI: Reached breakpoint at location %d", l);
64 inline void Hook::class_linked(classinfo *c)
69 inline void Hook::class_loaded(classinfo *c)
74 inline void Hook::method_enter(methodinfo *m)
79 inline void Hook::method_exit(methodinfo *m)
84 inline void Hook::method_unwind(methodinfo *m)
89 inline void Hook::native_resolved(methodinfo *m, void *symbol, void **symbolptr)
94 inline void Hook::thread_start(threadobject *t)
99 inline void Hook::thread_end(threadobject *t)
104 inline void Hook::vm_init()
110 #endif /* _HOOK_HPP */
114 * These are local overrides for various environment variables in Emacs.
115 * Please do not remove this and leave it at the end of the file, where
116 * Emacs will automagically detect them.
117 * ---------------------------------------------------------------------
120 * indent-tabs-mode: t
124 * vim:noexpandtab:sw=4:ts=4: