OSDN Git Service

* testsuite/libjava.jvmti/natevents.cc (do_callback_arg_tests):
[pf3gnuchains/gcc-fork.git] / libjava / testsuite / libjava.jvmti / natevents.cc
1 #include <gcj/cni.h>
2
3 #include <jvm.h>
4 #include <jvmti.h>
5 #include <stdio.h>
6
7 #include "jvmti-int.h"
8 #include "events.h"
9
10 void
11 print_events ()
12 {
13 #define DO(X)                                   \
14   do                                            \
15     {                                           \
16       if (JVMTI_REQUESTED_EVENT (X))            \
17         printf (#X ",");                        \
18     }                                           \
19   while (0)
20
21   printf ("RequestedEvents: ");
22   DO (VMInit);
23   DO (VMDeath);
24   DO (ThreadStart);
25   DO (ThreadEnd);
26   DO (ClassFileLoadHook);
27   DO (ClassLoad);
28   DO (ClassPrepare);
29   DO (VMStart);
30   DO (Exception);
31   DO (ExceptionCatch);
32   DO (SingleStep);
33   DO (FramePop);
34   DO (Breakpoint);
35   DO (FieldAccess);
36   DO (FieldModification);
37   DO (MethodEntry);
38   DO (MethodExit);
39   DO (NativeMethodBind);
40   DO (CompiledMethodLoad);
41   DO (CompiledMethodUnload);
42   DO (DynamicCodeGenerated);
43   DO (DataDumpRequest);
44   DO (MonitorWait);
45   DO (MonitorWaited);
46   DO (MonitorContendedEnter);
47   DO (MonitorContendedEntered);
48   DO (GarbageCollectionStart);
49   DO (GarbageCollectionFinish);
50   DO (ObjectFree);
51   DO (VMObjectAlloc);
52   printf ("\n");
53 #undef DO
54 }
55
56 static void
57 VMInitCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread)
58 {
59   printf ("VMInitCB jni_env=%p thread=%p\n", jni_env, thread);
60 }
61
62 static void
63 VMDeathCB (jvmtiEnv *env, JNIEnv *jni_env)
64 {
65   printf ("VMDeathCB jni_env=%p\n", jni_env);
66 }
67
68 static void
69 ThreadStartCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread)
70 {
71   printf ("ThreadStartCB jni_env=%p thread=%p\n", jni_env, thread);
72 }
73
74 static void
75 ThreadEndCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread)
76 {
77   printf ("ThreadEndCB jni_env=%p thread=%p\n", jni_env, thread);
78 }
79
80 static void
81 ClassFileLoadHookCB (jvmtiEnv *env, JNIEnv *jni_env,
82                      jclass class_being_redefined, jobject loader,
83                      const char *name, jobject protection_domain,
84                      jint class_data_len, const unsigned char *class_data,
85                      jint *new_class_data_len, unsigned char **new_class_data)
86 {
87   printf ("ClassFileLoadHookCB jni_env=%p class_being_redefined=%p loader=%p",
88           jni_env, class_being_redefined, loader);
89   printf (" name=%s protection_domain=%p class_data_len=%d class_data=%p",
90           name, protection_domain, (int) class_data_len, class_data);
91   printf (" new_class_data_len=%p new_class_data=%p\n", new_class_data_len,
92           new_class_data);
93 }
94
95 static void
96 ClassLoadCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread, jclass klass)
97 {
98   printf ("ClassLoadCB jni_env=%p thread=%p klass=%p\n", jni_env, thread,
99           klass);
100 }
101
102 static void
103 ClassPrepareCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread, jclass klass)
104 {
105   printf ("ClassPrepareCB jni_env=%p thread=%p klass=%p\n", jni_env,
106           thread, klass);
107 }
108
109 static void
110 VMStartCB (jvmtiEnv *env, JNIEnv *jni_env)
111 {
112   printf ("VMStartCB jni_env=%p\n", jni_env);
113 }
114
115 static void
116 ExceptionCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread, jmethodID method,
117              jlocation location, jobject exception, jmethodID catch_method,
118              jlocation catch_location)
119 {
120   printf ("ExceptionCB jni_env=%p thread=%p method=%p location=%#llx", jni_env,
121           thread, method, (unsigned long long) location);
122   printf (" exception=%p catch_method=%p catch_location=%#llx\n", exception,
123           catch_method, (unsigned long long) catch_location);
124 }
125
126 static void
127 ExceptionCatchCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread,
128                   jmethodID method, jlocation location, jobject exception)
129 {
130   printf ("ExceptionCatchCB jni_env=%p thread=%p method=%p location=%#llx",
131           jni_env, thread, method, (unsigned long long) location);
132   printf (" exception=%p\n", exception);
133 }
134
135 static void
136 SingleStepCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread, jmethodID method,
137               jlocation location)
138 {
139   printf ("SingleStepCB jni_env=%p thread=%p method=%p location=%#llx\n", 
140           jni_env, thread, method, (unsigned long long) location);
141 }
142
143 static void
144 FramePopCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread, jmethodID method,
145             jboolean was_popped_by_exception)
146 {
147   printf ("FramePopCB jni_env=%p thread=%p method=%p", jni_env, thread,
148           method);
149   printf (" was_pooped_by_exception=%d\n", (was_popped_by_exception ?
150                                             1 : 0));
151 }
152
153 static void
154 BreakpointCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread, jmethodID method,
155               jlocation location)
156 {
157   printf ("BreakpointCB  jni_env=%p thread=%p method=%p location=%#llx\n",
158           jni_env, thread, method, (unsigned long long) location);
159 }
160
161 static void
162 FieldAccessCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread,
163                jmethodID method, jlocation location, jclass field_klass,
164                jobject object, jfieldID field)
165 {
166   printf ("FieldAccessCB jni_env=%p thread=%p method=%p location=%#llx",
167           jni_env, thread, method, (unsigned long long) location);
168   printf (" field_klass=%p object=%p field=%p\n", field_klass, object, field);
169 }
170
171 static void
172 FieldModificationCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread,
173                      jmethodID method, jlocation location, jclass field_klass,
174                      jobject object, jfieldID field, char signature_type,
175                      jvalue new_value)
176
177 {
178   printf ("FieldModificationCB  jni_env=%p thread=%p method=%p location=%#llx",
179           jni_env, thread, method, (unsigned long long) location);
180   printf (" field_klass=%p object=%p field=%p signature_type=%c", field_klass,
181           object, field, signature_type);
182   printf (" new_value=%d\n", (int) new_value.i);
183 }
184
185 static void
186 MethodEntryCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread,
187                jmethodID method)
188 {
189   printf ("MethodEntryCB jni_env=%p thread=%p method=%p\n", jni_env, thread,
190           method);
191 }
192
193 static void
194 MethodExitCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread,
195               jmethodID method, jboolean was_popped_by_exception,
196               jvalue return_value)
197 {
198   printf ("MethodExitCB jni_env=%p thread=%p method=%p", jni_env, thread,
199           method);
200   printf (" was_popped_by_exception=%d return_value=%d\n",
201           (was_popped_by_exception) ? 1 : 0, (int) return_value.i);
202 }
203
204 static void
205 NativeMethodBindCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread,
206                     jmethodID method, void *address, void **new_address_ptr)
207 {
208   printf ("NativeMethodBindCB jni_env=%p thread=%p method=%p", jni_env,
209           thread, method);
210   printf (" address=%p new_address_ptr=%p\n", address, new_address_ptr);
211 }
212
213 static void
214 CompiledMethodLoadCB (jvmtiEnv *env, jmethodID method, jint code_size,
215                       const void *code_addr, jint map_length,
216                       const jvmtiAddrLocationMap *map,
217                       const void *compile_info)
218 {
219   printf ("CompiledMethodLoadCB method=%p code_size=%#x code_addr=%p",
220           method, (unsigned) code_size, code_addr);
221   printf (" map_length=%d map=%p compile_info=%p\n", (int) map_length, map,
222           compile_info);
223 }
224
225 static void
226 CompiledMethodUnloadCB (jvmtiEnv *env, jmethodID method, const void *code_addr)
227 {
228   printf ("CompiledMethodUnloadCB method=%p code_addr=%p\n", method, 
229           code_addr);
230 }
231
232 static void
233 DynamicCodeGeneratedCB (jvmtiEnv *env, const char *name, const void *address,
234                         jint length)
235 {
236   printf ("DynamicCodeGeneratedCB name=%s address=%p length=%d\n", name,
237           address, (int) length);
238 }
239
240 static void
241 DataDumpRequestCB (jvmtiEnv *env)
242 {
243   printf ("DataDumpRequestCB\n");
244 }
245
246 static void
247 MonitorWaitCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread, jobject object,
248                jlong timeout)
249 {
250   printf ("MonitorWaitCB jni_env=%p thread=%p object=%p timeout=%ld\n",
251           jni_env, thread, object, (long) timeout);
252 }
253
254 static void
255 MonitorWaitedCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread,
256                  jobject object, jboolean timed_out)
257 {
258   printf ("MonitorWaitedCB jni_env=%p thread=%p object=%p timed_out=%d\n",
259           jni_env, thread, object, (timed_out) ? 1 : 0);
260 }
261
262 static void
263 MonitorContendedEnterCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread,
264                          jobject object)
265 {
266   printf ("MonitorContendedEnterCB jni_env=%p thread=%p object=%p\n",
267           jni_env, thread, object);
268 }
269
270 static void
271 MonitorContendedEnteredCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread,
272                            jobject object)
273 {
274   printf ("MonitorContendedEnteredCB jni_env=%p thread=%p object=%p\n",
275           jni_env, thread, object);
276 }
277
278 static void
279 GarbageCollectionStartCB (jvmtiEnv *env)
280 {
281   printf ("GarbageCollectionStartCB\n");
282 }
283
284 static void
285 GarbageCollectionFinishCB (jvmtiEnv *env)
286 {
287   printf ("GarbageCollectionFinishCB\n");
288 }
289
290 static void
291 ObjectFreeCB (jvmtiEnv *env, jlong tag)
292 {
293   printf ("ObjectFreeCB tag=%ld\n", (long) tag);
294 }
295
296 static void
297 VMObjectAllocCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread,
298                  jobject object, jclass object_klass, jlong size)
299 {
300   printf ("VMObjectAllocCB jni_env=%p thread=%p object=%p", jni_env,
301           thread, object);
302   printf (" object_klass=%p size=%ld\n", object_klass, (long) size);
303 }
304
305 static void
306 do_enable_tests ()
307 {
308   printf ("- enable tests -\n");
309   JavaVM *vm = _Jv_GetJavaVM ();
310   jvmtiEnv *env[3];
311   int i;
312   for (i = 0; i < 3; ++i)
313     {
314       vm->GetEnv (reinterpret_cast<void **> (&env[i]), JVMTI_VERSION_1_0);
315       printf ("created JVMTI environment #%d\n", i);
316     }
317
318   jvmtiEventCallbacks callbacks;
319   memset (&callbacks, 0, sizeof (jvmtiEventCallbacks));
320
321   printf ("setting callbacks for envs\n");
322   callbacks.VMInit = VMInitCB;
323   env[0]->SetEventCallbacks (&callbacks, sizeof (callbacks));
324   callbacks.VMDeath = VMDeathCB;
325   env[1]->SetEventCallbacks (&callbacks, sizeof (callbacks));
326   callbacks.ThreadEnd = ThreadEndCB;
327   env[2]->SetEventCallbacks (&callbacks, sizeof (callbacks));
328   print_events ();
329
330   printf ("enable VM_INIT for env0, env1, env2\n");
331   env[0]->SetEventNotificationMode (JVMTI_ENABLE, JVMTI_EVENT_VM_INIT, NULL);
332   env[1]->SetEventNotificationMode (JVMTI_ENABLE, JVMTI_EVENT_VM_INIT, NULL);
333   env[2]->SetEventNotificationMode (JVMTI_ENABLE, JVMTI_EVENT_VM_INIT, NULL);
334   print_events ();
335
336   printf ("enable VM_DEATH for env1,env2\n");
337   env[1]->SetEventNotificationMode (JVMTI_ENABLE, JVMTI_EVENT_VM_DEATH, NULL);
338   env[2]->SetEventNotificationMode (JVMTI_ENABLE, JVMTI_EVENT_VM_DEATH, NULL);
339   print_events ();
340
341   /* Used to use a non-NULL event thread, but that causes problems
342      when SetEventNotificationMode tries to validate the thread. */
343   printf ("enable THREAD_END for env2\n");
344   env[2]->SetEventNotificationMode (JVMTI_ENABLE, JVMTI_EVENT_THREAD_END,
345                                     NULL);
346   print_events ();
347
348   printf ("disposing of env1\n");
349   env[1]->DisposeEnvironment ();
350   print_events ();
351
352   printf ("disposing of env0\n");
353   env[0]->DisposeEnvironment ();
354   print_events ();
355
356   printf ("disable VMInit in env2\n");
357   env[2]->SetEventNotificationMode (JVMTI_DISABLE, JVMTI_EVENT_VM_INIT, NULL);
358   print_events ();
359
360   printf ("clear VMDeath callback in env2\n");
361   callbacks.VMDeath = NULL;
362   env[2]->SetEventCallbacks (&callbacks, sizeof (callbacks));
363   print_events ();
364
365   printf ("sending VMInit\n");
366   _Jv_JVMTI_PostEvent (JVMTI_EVENT_VM_INIT, (jthread) 0x1234,
367                        (JNIEnv *) 0x5678);
368
369   printf ("sending ThreadEnd\n");
370   _Jv_JVMTI_PostEvent (JVMTI_EVENT_THREAD_END, (jthread) 0x1234,
371                        (JNIEnv *) 0x5678);
372
373   /* See comment above re: SetEventNotificationMode and validity
374      checking
375   printf ("sending ThreadEnd (no match)\n");
376   _Jv_JVMTI_PostEvent (JVMTI_EVENT_THREAD_END, (jthread) 0x4321,
377                        (JNIEnv *) 0x5678);
378   */
379
380   printf ("sending VMDeath\n");
381   _Jv_JVMTI_PostEvent (JVMTI_EVENT_VM_DEATH, (jthread) NULL,
382                        (JNIEnv *) 0x5678);
383
384   printf ("disposing of env2\n");
385   env[2]->DisposeEnvironment ();
386   print_events ();
387 }
388
389 static void
390 do_callback_arg_tests ()
391 {
392   printf ("- callback arg tests -\n");
393   JavaVM *vm = _Jv_GetJavaVM ();
394   jvmtiEnv *env;
395   vm->GetEnv (reinterpret_cast<void **> (&env), JVMTI_VERSION_1_0);
396
397   // Define all the callbacks
398 #define DEFINE(Event) callbacks.Event = Event ## CB;
399   jvmtiEventCallbacks callbacks;
400   DEFINE(VMInit);
401   DEFINE(VMDeath);
402   DEFINE(ThreadStart);
403   DEFINE(ThreadEnd);
404   DEFINE(ClassFileLoadHook);
405   DEFINE(ClassLoad);
406   DEFINE(ClassPrepare);
407   DEFINE(VMStart);
408   DEFINE(Exception);
409   DEFINE(ExceptionCatch);
410   DEFINE(SingleStep);
411   DEFINE(FramePop);
412   DEFINE(Breakpoint);
413   DEFINE(FieldAccess);
414   DEFINE(FieldModification);
415   DEFINE(MethodEntry);
416   DEFINE(MethodExit);
417   DEFINE(NativeMethodBind);
418   DEFINE(CompiledMethodLoad);
419   DEFINE(CompiledMethodUnload);
420   DEFINE(DynamicCodeGenerated);
421   DEFINE(DataDumpRequest);
422   DEFINE(MonitorWait);
423   DEFINE(MonitorWaited);
424   DEFINE(MonitorContendedEnter);
425   DEFINE(MonitorContendedEntered);
426   DEFINE(GarbageCollectionStart);
427   DEFINE(GarbageCollectionFinish);
428   DEFINE(ObjectFree);
429   DEFINE(VMObjectAlloc);
430 #undef DEFINE
431   env->SetEventCallbacks (&callbacks, sizeof (callbacks));
432
433   // Enable all the callbacks
434 #define ENABLE(Event)                                                   \
435   env->SetEventNotificationMode (JVMTI_ENABLE, JVMTI_EVENT_ ## Event, NULL)
436   ENABLE (VM_INIT);
437   ENABLE (VM_DEATH);
438   ENABLE (THREAD_START);
439   ENABLE (THREAD_END);
440   ENABLE (CLASS_FILE_LOAD_HOOK);
441   ENABLE (CLASS_LOAD);
442   ENABLE (CLASS_PREPARE);
443   ENABLE (VM_START);
444   ENABLE (EXCEPTION);
445   ENABLE (EXCEPTION_CATCH);
446   ENABLE (SINGLE_STEP);
447   ENABLE (FRAME_POP);
448   ENABLE (BREAKPOINT);
449   ENABLE (FIELD_ACCESS);
450   ENABLE (FIELD_MODIFICATION);
451   ENABLE (METHOD_ENTRY);
452   ENABLE (METHOD_EXIT);
453   ENABLE (NATIVE_METHOD_BIND);
454   ENABLE (COMPILED_METHOD_LOAD);
455   ENABLE (COMPILED_METHOD_UNLOAD);
456   ENABLE (DYNAMIC_CODE_GENERATED);
457   ENABLE (DATA_DUMP_REQUEST);
458   ENABLE (MONITOR_WAIT);
459   ENABLE (MONITOR_WAITED);
460   ENABLE (MONITOR_CONTENDED_ENTER);
461   ENABLE (MONITOR_CONTENDED_ENTERED);
462   ENABLE (GARBAGE_COLLECTION_START);
463   ENABLE (GARBAGE_COLLECTION_FINISH);
464   ENABLE (OBJECT_FREE);
465   ENABLE (VM_OBJECT_ALLOC);
466
467   // All events should now be enabled.
468   print_events ();
469
470   _Jv_JVMTI_PostEvent (JVMTI_EVENT_VM_INIT, (jthread) 0x2, (JNIEnv *) 0x1);
471   _Jv_JVMTI_PostEvent (JVMTI_EVENT_VM_DEATH, (jthread) 0x2, (JNIEnv *) 0x1);
472   _Jv_JVMTI_PostEvent (JVMTI_EVENT_THREAD_START, (jthread) 0x2,
473                        (JNIEnv *) 0x1);
474   _Jv_JVMTI_PostEvent (JVMTI_EVENT_THREAD_END, (jthread) 0x2,
475                        (JNIEnv *) 0x1);
476   _Jv_JVMTI_PostEvent (JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, (jthread) 0xb00,
477                        (JNIEnv *) 0x1, (jclass) 0x2, (jobject) 0x3,
478                        "4", (jobject) 0x5, (jint) 6,
479                        (const unsigned char *) 0x7, (jint *) 0x8,
480                        (unsigned char **) 0x9);
481   _Jv_JVMTI_PostEvent (JVMTI_EVENT_CLASS_LOAD, (jthread) 0x2, (JNIEnv *) 0x1,
482                        (jclass) 0x3);
483   _Jv_JVMTI_PostEvent (JVMTI_EVENT_CLASS_PREPARE, (jthread) 0x2,
484                        (JNIEnv *) 0x1, (jclass) 0x3);
485   _Jv_JVMTI_PostEvent (JVMTI_EVENT_VM_START, (jthread) 0xb00, (JNIEnv *) 0x1);
486   _Jv_JVMTI_PostEvent (JVMTI_EVENT_EXCEPTION, (jthread) 0x2, (JNIEnv *) 0x1,
487                        (jmethodID) 0x3, (jlocation) 0x4, (jobject) 0x5,
488                        (jmethodID) 0x6, (jlocation) 0x7);
489   _Jv_JVMTI_PostEvent (JVMTI_EVENT_EXCEPTION_CATCH, (jthread) 0x2,
490                        (JNIEnv *) 0x1, (jmethodID) 0x3, (jlocation) 0x4,
491                        (jobject) 0x5);
492   _Jv_JVMTI_PostEvent (JVMTI_EVENT_SINGLE_STEP, (jthread) 0x2, (JNIEnv *) 0x1,
493                        (jmethodID) 0x3, (jlocation) 0x4);
494   _Jv_JVMTI_PostEvent (JVMTI_EVENT_FRAME_POP, (jthread) 0x2, (JNIEnv *) 0x1,
495                        (jmethodID) 0x3, 4);
496   _Jv_JVMTI_PostEvent (JVMTI_EVENT_BREAKPOINT, (jthread) 0x2, (JNIEnv *) 0x1,
497                        (jmethodID) 0x3, (jlocation) 0x4);
498   _Jv_JVMTI_PostEvent (JVMTI_EVENT_FIELD_ACCESS, (jthread) 0x2,
499                        (JNIEnv *) 0x1, (jmethodID) 0x3, (jlocation) 0x4,
500                        (jclass) 0x5, (jobject) 0x6, (jfieldID) 0x7);
501   jvalue value;
502   value.l = (jobject) 0x9;
503   _Jv_JVMTI_PostEvent (JVMTI_EVENT_FIELD_MODIFICATION, (jthread) 0x2,
504                        (JNIEnv *) 0x1, (jmethodID) 0x3, (jlocation) 0x4,
505                        (jclass) 0x5, (jobject) 0x6, (jfieldID) 0x7,
506                        (int) '8', value);
507   _Jv_JVMTI_PostEvent (JVMTI_EVENT_METHOD_ENTRY, (jthread) 0x2,
508                        (JNIEnv *) 0x1, (jmethodID) 0x3);
509   jvalue value2;
510   value2.i = 5;
511   _Jv_JVMTI_PostEvent (JVMTI_EVENT_METHOD_EXIT, (jthread) 0x2,
512                        (JNIEnv *) 0x1, (jmethodID) 0x3, 4, value2);
513   _Jv_JVMTI_PostEvent (JVMTI_EVENT_NATIVE_METHOD_BIND, (jthread) 0x2,
514                        (JNIEnv *) 0x1, (jmethodID) 0x3, (void *) 0x4,
515                        (void **) 0x5);
516   _Jv_JVMTI_PostEvent (JVMTI_EVENT_COMPILED_METHOD_LOAD, (jthread) 0xb00,
517                        (jmethodID) 0x1, (jint) 2, (const void *) 0x3,
518                        (jint) 4, (const jvmtiAddrLocationMap *) 0x5,
519                        (const void *) 0x6);
520   _Jv_JVMTI_PostEvent (JVMTI_EVENT_COMPILED_METHOD_UNLOAD, (jthread) 0xb00,
521                        (jmethodID) 0x1, (const void *) 0x2);
522   _Jv_JVMTI_PostEvent (JVMTI_EVENT_DYNAMIC_CODE_GENERATED, (jthread) 0xb00,
523                        "1", (const void *) 0x2, (jint) 3);
524   _Jv_JVMTI_PostEvent (JVMTI_EVENT_DATA_DUMP_REQUEST, (jthread) 0xb00);
525   _Jv_JVMTI_PostEvent (JVMTI_EVENT_MONITOR_WAIT, (jthread) 0x2,
526                        (JNIEnv *) 0x1, (jobject) 0x3, (jlong) 4);
527   _Jv_JVMTI_PostEvent (JVMTI_EVENT_MONITOR_WAITED, (jthread) 0x2,
528                        (JNIEnv *) 0x1, (jobject) 0x3, (int) 4);
529   _Jv_JVMTI_PostEvent (JVMTI_EVENT_MONITOR_CONTENDED_ENTER, (jthread) 0x2,
530                        (JNIEnv *) 0x1, (jobject) 0x3);
531   _Jv_JVMTI_PostEvent (JVMTI_EVENT_MONITOR_CONTENDED_ENTERED, (jthread) 0x2,
532                        (JNIEnv *) 0x1, (jobject) 0x3);
533   _Jv_JVMTI_PostEvent (JVMTI_EVENT_GARBAGE_COLLECTION_START, (jthread) 0xb00);
534   _Jv_JVMTI_PostEvent (JVMTI_EVENT_GARBAGE_COLLECTION_FINISH, (jthread) 0xb00);
535   _Jv_JVMTI_PostEvent (JVMTI_EVENT_OBJECT_FREE, (jthread) 0xb00, (jlong) 1);
536   _Jv_JVMTI_PostEvent (JVMTI_EVENT_VM_OBJECT_ALLOC, (jthread) 0x2,
537                        (JNIEnv *) 0x1, (jobject) 0x3, (jclass) 0x4,
538                        (jlong) 5);
539 }
540
541 void
542 events::do_events_tests ()
543 {
544   do_enable_tests ();
545   do_callback_arg_tests ();
546 }