1 // jvmti.cc - JVMTI implementation
3 /* Copyright (C) 2006 Free Software Foundation
5 This file is part of libgcj.
7 This software is copyrighted work licensed under the terms of the
8 Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
15 #include <java-threads.h>
19 #include <gcj/method.h>
21 #include <gnu/classpath/SystemProperties.h>
22 #include <gnu/gcj/runtime/BootClassLoader.h>
23 #include <java/lang/Class.h>
24 #include <java/lang/ClassLoader.h>
25 #include <java/lang/Thread.h>
26 #include <java/lang/Throwable.h>
27 #include <java/lang/VMClassLoader.h>
28 #include <java/lang/reflect/Field.h>
29 #include <java/lang/reflect/Modifier.h>
30 #include <java/util/Collection.h>
31 #include <java/util/HashMap.h>
32 #include <java/net/URL.h>
34 extern struct JNINativeInterface _Jv_JNIFunctions
;
36 struct _Jv_rawMonitorID
39 _Jv_ConditionVariable_t condition
;
42 // Some commonly-used checks
44 #define THREAD_DEFAULT_TO_CURRENT(jthread) \
45 if (jthread == NULL) jthread = java::lang::Thread::currentThread ();
47 #define THREAD_CHECK_VALID(jthread) \
48 if (!java::lang::Thread::class$.isAssignableFrom (&(jthread->class$))) \
49 return JVMTI_ERROR_INVALID_THREAD;
51 #define THREAD_CHECK_IS_ALIVE(thread) \
52 if (!thread->isAlive ()) return JVMTI_ERROR_THREAD_NOT_ALIVE;
54 // FIXME: if current phase is not set in Phases,
55 // return JVMTI_ERROR_WRONG_PHASE
56 #define REQUIRE_PHASE(Env, Phases)
58 #define NULL_CHECK(Ptr) \
59 if (Ptr == NULL) return JVMTI_ERROR_NULL_POINTER;
61 static jvmtiError JNICALL
62 _Jv_JVMTI_SuspendThread (MAYBE_UNUSED jvmtiEnv
*env
, jthread thread
)
64 using namespace java::lang
;
66 THREAD_DEFAULT_TO_CURRENT (thread
);
67 THREAD_CHECK_VALID (thread
);
69 Thread
*t
= reinterpret_cast<Thread
*> (thread
);
70 THREAD_CHECK_IS_ALIVE (t
);
72 _Jv_Thread_t
*data
= _Jv_ThreadGetData (t
);
73 _Jv_SuspendThread (data
);
74 return JVMTI_ERROR_NONE
;
77 static jvmtiError JNICALL
78 _Jv_JVMTI_ResumeThread (MAYBE_UNUSED jvmtiEnv
*env
, jthread thread
)
80 using namespace java::lang
;
82 THREAD_DEFAULT_TO_CURRENT (thread
);
83 THREAD_CHECK_VALID (thread
);
85 Thread
*t
= reinterpret_cast<Thread
*> (thread
);
86 THREAD_CHECK_IS_ALIVE (t
);
88 _Jv_Thread_t
*data
= _Jv_ThreadGetData (t
);
89 _Jv_ResumeThread (data
);
90 return JVMTI_ERROR_NONE
;
93 static jvmtiError JNICALL
94 _Jv_JVMTI_InterruptThread (MAYBE_UNUSED jvmtiEnv
*env
, jthread thread
)
96 using namespace java::lang
;
98 REQUIRE_PHASE (env
, JVMTI_PHASE_LIVE
);
99 // FIXME: capability handling? 'can_signal_thread'
101 return JVMTI_ERROR_INVALID_THREAD
;
102 THREAD_CHECK_VALID (thread
);
103 Thread
*real_thread
= reinterpret_cast<Thread
*> (thread
);
104 THREAD_CHECK_IS_ALIVE (real_thread
);
105 real_thread
->interrupt();
106 return JVMTI_ERROR_NONE
;
109 static jvmtiError JNICALL
110 _Jv_JVMTI_CreateRawMonitor (MAYBE_UNUSED jvmtiEnv
*env
, const char *name
,
111 jrawMonitorID
*result
)
113 REQUIRE_PHASE (env
, JVMTI_PHASE_ONLOAD
| JVMTI_PHASE_LIVE
);
116 *result
= (jrawMonitorID
) _Jv_Malloc (sizeof (_Jv_rawMonitorID
));
117 _Jv_MutexInit (&(*result
)->mutex
);
118 _Jv_CondInit (&(*result
)->condition
);
119 return JVMTI_ERROR_NONE
;
122 static jvmtiError JNICALL
123 _Jv_JVMTI_DestroyRawMonitor (MAYBE_UNUSED jvmtiEnv
*env
, jrawMonitorID monitor
)
125 REQUIRE_PHASE (env
, JVMTI_PHASE_ONLOAD
| JVMTI_PHASE_LIVE
);
126 // Note we have no better way of knowing whether this object is
127 // really a raw monitor.
129 return JVMTI_ERROR_INVALID_MONITOR
;
130 // FIXME: perform checks on monitor, release it if this thread owns
132 #ifdef _Jv_HaveMutexDestroy
133 _Jv_MutexDestroy (&monitor
->mutex
);
136 return JVMTI_ERROR_NONE
;
139 static jvmtiError JNICALL
140 _Jv_JVMTI_RawMonitorEnter (MAYBE_UNUSED jvmtiEnv
*env
, jrawMonitorID monitor
)
143 return JVMTI_ERROR_INVALID_MONITOR
;
144 _Jv_MutexLock (&monitor
->mutex
);
145 return JVMTI_ERROR_NONE
;
148 static jvmtiError JNICALL
149 _Jv_JVMTI_RawMonitorExit (MAYBE_UNUSED jvmtiEnv
*env
, jrawMonitorID monitor
)
152 return JVMTI_ERROR_INVALID_MONITOR
;
153 if (_Jv_MutexUnlock (&monitor
->mutex
))
154 return JVMTI_ERROR_NOT_MONITOR_OWNER
;
155 return JVMTI_ERROR_NONE
;
158 static jvmtiError JNICALL
159 _Jv_JVMTI_RawMonitorWait (MAYBE_UNUSED jvmtiEnv
*env
, jrawMonitorID monitor
)
162 return JVMTI_ERROR_INVALID_MONITOR
;
163 int r
= _Jv_CondWait (&monitor
->condition
, &monitor
->mutex
, 0, 0);
164 if (r
== _JV_NOT_OWNER
)
165 return JVMTI_ERROR_NOT_MONITOR_OWNER
;
166 if (r
== _JV_INTERRUPTED
)
167 return JVMTI_ERROR_INTERRUPT
;
168 return JVMTI_ERROR_NONE
;
171 static jvmtiError JNICALL
172 _Jv_JVMTI_RawMonitorNotify (MAYBE_UNUSED jvmtiEnv
*env
, jrawMonitorID monitor
)
175 return JVMTI_ERROR_INVALID_MONITOR
;
176 if (_Jv_CondNotify (&monitor
->condition
, &monitor
->mutex
) == _JV_NOT_OWNER
)
177 return JVMTI_ERROR_NOT_MONITOR_OWNER
;
178 return JVMTI_ERROR_NONE
;
181 static jvmtiError JNICALL
182 _Jv_JVMTI_RawMonitorNotifyAll (MAYBE_UNUSED jvmtiEnv
*env
,
183 jrawMonitorID monitor
)
186 return JVMTI_ERROR_INVALID_MONITOR
;
187 if (_Jv_CondNotifyAll (&monitor
->condition
, &monitor
->mutex
)
189 return JVMTI_ERROR_NOT_MONITOR_OWNER
;
190 return JVMTI_ERROR_NONE
;
193 static jvmtiError JNICALL
194 _Jv_JVMTI_Allocate (MAYBE_UNUSED jvmtiEnv
*env
, jlong size
,
195 unsigned char **result
)
198 return JVMTI_ERROR_ILLEGAL_ARGUMENT
;
204 *result
= (unsigned char *) _Jv_MallocUnchecked (size
);
206 return JVMTI_ERROR_OUT_OF_MEMORY
;
208 return JVMTI_ERROR_NONE
;
211 static jvmtiError JNICALL
212 _Jv_JVMTI_Deallocate (MAYBE_UNUSED jvmtiEnv
*env
, unsigned char *mem
)
216 return JVMTI_ERROR_NONE
;
219 static jvmtiError JNICALL
220 _Jv_JVMTI_GetClassModifiers (MAYBE_UNUSED jvmtiEnv
*env
, jclass klass
,
223 REQUIRE_PHASE (env
, JVMTI_PHASE_START
| JVMTI_PHASE_LIVE
);
224 // Don't bother checking KLASS' type.
226 return JVMTI_ERROR_INVALID_CLASS
;
228 *mods
= klass
->getModifiers();
229 return JVMTI_ERROR_NONE
;
232 static jvmtiError JNICALL
233 _Jv_JVMTI_GetClassMethods (MAYBE_UNUSED jvmtiEnv
*env
, jclass klass
,
234 jint
*count_ptr
, jmethodID
**methods_ptr
)
236 REQUIRE_PHASE (env
, JVMTI_PHASE_START
| JVMTI_PHASE_LIVE
);
237 // FIXME: capability can_maintain_original_method_order
238 // Don't bother checking KLASS' type.
240 return JVMTI_ERROR_INVALID_CLASS
;
241 NULL_CHECK (count_ptr
);
242 NULL_CHECK (methods_ptr
);
243 *count_ptr
= JvNumMethods(klass
);
245 *methods_ptr
= (jmethodID
*) _Jv_Malloc (*count_ptr
* sizeof (jmethodID
));
246 jmethodID start
= JvGetFirstMethod (klass
);
247 for (jint i
= 0; i
< *count_ptr
; ++i
)
249 (*methods_ptr
)[i
] = start
+ i
;
251 return JVMTI_ERROR_NONE
;
254 static jvmtiError JNICALL
255 _Jv_JVMTI_IsInterface (MAYBE_UNUSED jvmtiEnv
*env
, jclass klass
,
258 REQUIRE_PHASE (env
, JVMTI_PHASE_START
| JVMTI_PHASE_LIVE
);
260 return JVMTI_ERROR_INVALID_CLASS
;
262 *result
= klass
->isInterface();
263 return JVMTI_ERROR_NONE
;
266 static jvmtiError JNICALL
267 _Jv_JVMTI_IsArrayClass (MAYBE_UNUSED jvmtiEnv
*env
, jclass klass
,
270 REQUIRE_PHASE (env
, JVMTI_PHASE_START
| JVMTI_PHASE_LIVE
);
272 return JVMTI_ERROR_INVALID_CLASS
;
274 *result
= klass
->isArray();
275 return JVMTI_ERROR_NONE
;
278 static jvmtiError JNICALL
279 _Jv_JVMTI_GetClassLoader (MAYBE_UNUSED jvmtiEnv
*env
, jclass klass
,
282 REQUIRE_PHASE (env
, JVMTI_PHASE_START
| JVMTI_PHASE_LIVE
);
284 return JVMTI_ERROR_INVALID_CLASS
;
286 *result
= klass
->getClassLoaderInternal();
287 return JVMTI_ERROR_NONE
;
290 static jvmtiError JNICALL
291 _Jv_JVMTI_GetObjectHashCode (MAYBE_UNUSED jvmtiEnv
*env
, jobject obj
,
294 REQUIRE_PHASE (env
, JVMTI_PHASE_START
| JVMTI_PHASE_LIVE
);
296 return JVMTI_ERROR_INVALID_OBJECT
;
298 *result
= _Jv_HashCode (obj
);
299 return JVMTI_ERROR_NONE
;
302 static jvmtiError JNICALL
303 _Jv_JVMTI_GetFieldModifiers (MAYBE_UNUSED jvmtiEnv
*env
, jclass klass
,
304 jfieldID field
, jint
*result
)
306 REQUIRE_PHASE (env
, JVMTI_PHASE_START
| JVMTI_PHASE_LIVE
);
308 return JVMTI_ERROR_INVALID_CLASS
;
310 return JVMTI_ERROR_INVALID_FIELDID
;
312 *result
= field
->getModifiers();
313 return JVMTI_ERROR_NONE
;
316 static jvmtiError JNICALL
317 _Jv_JVMTI_IsFieldSynthetic (MAYBE_UNUSED jvmtiEnv
*env
, jclass klass
,
318 jfieldID field
, jboolean
*result
)
320 REQUIRE_PHASE (env
, JVMTI_PHASE_START
| JVMTI_PHASE_LIVE
);
322 return JVMTI_ERROR_INVALID_CLASS
;
324 return JVMTI_ERROR_INVALID_FIELDID
;
327 // FIXME: capability can_get_synthetic_attribute
328 *result
= ((field
->getModifiers() & java::lang::reflect::Modifier::SYNTHETIC
)
330 return JVMTI_ERROR_NONE
;
333 static jvmtiError JNICALL
334 _Jv_JVMTI_GetMethodModifiers (MAYBE_UNUSED jvmtiEnv
*env
, jmethodID method
,
337 REQUIRE_PHASE (env
, JVMTI_PHASE_START
| JVMTI_PHASE_LIVE
);
339 return JVMTI_ERROR_INVALID_METHODID
;
342 // FIXME: mask off some internal bits...
343 *result
= method
->accflags
;
344 return JVMTI_ERROR_NONE
;
347 static jvmtiError JNICALL
348 _Jv_JVMTI_IsMethodNative (MAYBE_UNUSED jvmtiEnv
*env
, jmethodID method
,
351 REQUIRE_PHASE (env
, JVMTI_PHASE_START
| JVMTI_PHASE_LIVE
);
353 return JVMTI_ERROR_INVALID_METHODID
;
356 *result
= ((method
->accflags
& java::lang::reflect::Modifier::NATIVE
) != 0);
357 return JVMTI_ERROR_NONE
;
360 static jvmtiError JNICALL
361 _Jv_JVMTI_IsMethodSynthetic (MAYBE_UNUSED jvmtiEnv
*env
, jmethodID method
,
364 REQUIRE_PHASE (env
, JVMTI_PHASE_START
| JVMTI_PHASE_LIVE
);
366 return JVMTI_ERROR_INVALID_METHODID
;
369 // FIXME capability can_get_synthetic_attribute
371 *result
= ((method
->accflags
& java::lang::reflect::Modifier::SYNTHETIC
)
373 return JVMTI_ERROR_NONE
;
376 static jvmtiError JNICALL
377 _Jv_JVMTI_GetClassLoaderClasses (MAYBE_UNUSED jvmtiEnv
*env
,
382 using namespace java::lang
;
383 using namespace java::util
;
385 REQUIRE_PHASE (env
, JVMTI_PHASE_LIVE
);
386 NULL_CHECK (count_ptr
);
387 NULL_CHECK (result_ptr
);
389 ClassLoader
*loader
= (ClassLoader
*) init_loader
;
391 loader
= VMClassLoader::bootLoader
;
393 Collection
*values
= loader
->loadedClasses
->values();
394 jobjectArray array
= values
->toArray();
395 *count_ptr
= array
->length
;
396 jobject
*elts
= elements (array
);
397 jclass
*result
= (jclass
*) _Jv_Malloc (*count_ptr
* sizeof (jclass
));
398 // FIXME: JNI references...
399 memcpy (result
, elts
, *count_ptr
* sizeof (jclass
));
401 *result_ptr
= result
;
403 return JVMTI_ERROR_NONE
;
406 static jvmtiError JNICALL
407 _Jv_JVMTI_ForceGarbageCollection (MAYBE_UNUSED jvmtiEnv
*env
)
409 REQUIRE_PHASE (env
, JVMTI_PHASE_LIVE
);
411 return JVMTI_ERROR_NONE
;
414 static jvmtiError JNICALL
415 _Jv_JVMTI_SetJNIFunctionTable (MAYBE_UNUSED jvmtiEnv
*env
,
416 const jniNativeInterface
*function_table
)
418 REQUIRE_PHASE (env
, JVMTI_PHASE_START
| JVMTI_PHASE_LIVE
);
419 NULL_CHECK (function_table
);
420 memcpy (&_Jv_JNIFunctions
, function_table
, sizeof (jniNativeInterface
));
421 return JVMTI_ERROR_NONE
;
424 static jvmtiError JNICALL
425 _Jv_JVMTI_GetJNIFunctionTable (MAYBE_UNUSED jvmtiEnv
*env
,
426 jniNativeInterface
**function_table
)
428 REQUIRE_PHASE (env
, JVMTI_PHASE_START
| JVMTI_PHASE_LIVE
);
429 NULL_CHECK (function_table
);
431 = (jniNativeInterface
*) _Jv_Malloc (sizeof (jniNativeInterface
));
432 memcpy (*function_table
, &_Jv_JNIFunctions
, sizeof (jniNativeInterface
));
433 return JVMTI_ERROR_NONE
;
436 static jvmtiError JNICALL
437 _Jv_JVMTI_DisposeEnvironment (jvmtiEnv
*env
)
439 // All we need to do is free memory allocated by _Jv_GetJVMTIEnv
441 return JVMTI_ERROR_NONE
;
444 static jvmtiError JNICALL
445 _Jv_JVMTI_GetSystemProperty (MAYBE_UNUSED jvmtiEnv
*env
, const char *property
,
448 REQUIRE_PHASE (env
, JVMTI_PHASE_ONLOAD
| JVMTI_PHASE_LIVE
);
449 NULL_CHECK (property
);
452 jstring name
= JvNewStringUTF(property
);
453 jstring result_str
= gnu::classpath::SystemProperties::getProperty(name
);
455 if (result_str
== NULL
)
456 return JVMTI_ERROR_NOT_AVAILABLE
;
458 int len
= JvGetStringUTFLength (result_str
);
459 *result
= (char *) _Jv_Malloc (len
+ 1);
460 JvGetStringUTFRegion (result_str
, 0, result_str
->length(), *result
);
461 (*result
)[len
] = '\0';
463 return JVMTI_ERROR_NONE
;
466 static jvmtiError JNICALL
467 _Jv_JVMTI_SetSystemProperty (MAYBE_UNUSED jvmtiEnv
*env
, const char *property
,
470 REQUIRE_PHASE (env
, JVMTI_PHASE_ONLOAD
);
472 NULL_CHECK (property
);
475 // FIXME: When would a property not be writeable?
476 return JVMTI_ERROR_NONE
;
479 jstring prop_str
= JvNewStringUTF(property
);
480 jstring value_str
= JvNewStringUTF(value
);
481 gnu::classpath::SystemProperties::setProperty(prop_str
, value_str
);
482 return JVMTI_ERROR_NONE
;
485 static jvmtiError JNICALL
486 _Jv_JVMTI_GetTime (MAYBE_UNUSED jvmtiEnv
*env
, jlong
*nanos_ptr
)
488 NULL_CHECK (nanos_ptr
);
489 *nanos_ptr
= _Jv_platform_nanotime();
490 return JVMTI_ERROR_NONE
;
493 static jvmtiError JNICALL
494 _Jv_JVMTI_GetAvailableProcessors (MAYBE_UNUSED jvmtiEnv
*env
,
495 jint
*nprocessors_ptr
)
497 NULL_CHECK (nprocessors_ptr
);
498 #ifdef _SC_NPROCESSORS_ONLN
499 *nprocessors_ptr
= sysconf(_SC_NPROCESSORS_ONLN
);
501 *nprocessors_ptr
= 1;
503 return JVMTI_ERROR_NONE
;
506 static jvmtiError JNICALL
507 _Jv_JVMTI_AddToBootstrapClassLoaderSearch (MAYBE_UNUSED jvmtiEnv
*env
,
510 using namespace java::lang
;
511 using namespace java::net
;
512 using namespace gnu::gcj::runtime
;
514 REQUIRE_PHASE (env
, JVMTI_PHASE_ONLOAD
);
515 NULL_CHECK (segment
);
517 jstring str_segment
= JvNewStringUTF(segment
);
521 url
= new URL(JvNewStringUTF("file"), NULL
, str_segment
);
523 catch (jthrowable ignore
)
525 return JVMTI_ERROR_ILLEGAL_ARGUMENT
;
528 BootClassLoader
*loader
= VMClassLoader::bootLoader
;
529 // Don't call this too early.
530 // assert (loader != NULL);
532 return JVMTI_ERROR_NONE
;
535 static jvmtiError JNICALL
536 _Jv_JVMTI_SetVerboseFlag (MAYBE_UNUSED jvmtiEnv
*env
, jvmtiVerboseFlag flag
,
541 case JVMTI_VERBOSE_OTHER
:
542 case JVMTI_VERBOSE_GC
:
543 case JVMTI_VERBOSE_JNI
:
546 case JVMTI_VERBOSE_CLASS
:
547 gcj::verbose_class_flag
= value
;
550 return JVMTI_ERROR_ILLEGAL_ARGUMENT
;
552 return JVMTI_ERROR_NONE
;
555 static jvmtiError JNICALL
556 _Jv_JVMTI_GetObjectSize (MAYBE_UNUSED jvmtiEnv
*env
, jobject object
,
559 REQUIRE_PHASE (env
, JVMTI_PHASE_START
| JVMTI_PHASE_LIVE
);
561 return JVMTI_ERROR_INVALID_OBJECT
;
564 jclass klass
= object
->getClass();
565 if (klass
->isArray())
567 jclass comp
= klass
->getComponentType();
569 = (jint
) (_Jv_uintptr_t
) _Jv_GetArrayElementFromElementType(NULL
,
570 klass
->getComponentType());
571 // FIXME: correct for primitive types?
572 jint compSize
= comp
->size();
573 __JArray
*array
= (__JArray
*) object
;
574 *result
= base
+ array
->length
* compSize
;
578 // Note that if OBJECT is a String then it may (if
579 // str->data==str) take more space. Do we care?
580 *result
= klass
->size();
582 return JVMTI_ERROR_NONE
;
585 #define RESERVED NULL
586 #define UNIMPLEMENTED NULL
588 struct _Jv_jvmtiEnv _Jv_JVMTI_Interface
=
590 RESERVED
, // reserved1
591 UNIMPLEMENTED
, // SetEventNotification
592 RESERVED
, // reserved3
593 UNIMPLEMENTED
, // GetAllThreads
594 _Jv_JVMTI_SuspendThread
, // SuspendThread
595 _Jv_JVMTI_ResumeThread
, // ResumeThread
596 UNIMPLEMENTED
, // StopThread
597 _Jv_JVMTI_InterruptThread
, // InterruptThread
598 UNIMPLEMENTED
, // GetThreadInfo
599 UNIMPLEMENTED
, // GetOwnedMonitorInfo
600 UNIMPLEMENTED
, // GetCurrentContendedMonitor
601 UNIMPLEMENTED
, // RunAgentThread
602 UNIMPLEMENTED
, // GetTopThreadGroups
603 UNIMPLEMENTED
, // GetThreadGroupInfo
604 UNIMPLEMENTED
, // GetThreadGroupChildren
605 UNIMPLEMENTED
, // GetFrameCount
606 UNIMPLEMENTED
, // GetThreadState
607 RESERVED
, // reserved18
608 UNIMPLEMENTED
, // GetFrameLocation
609 UNIMPLEMENTED
, // NotifyPopFrame
610 UNIMPLEMENTED
, // GetLocalObject
611 UNIMPLEMENTED
, // GetLocalInt
612 UNIMPLEMENTED
, // GetLocalLong
613 UNIMPLEMENTED
, // GetLocalFloat
614 UNIMPLEMENTED
, // GetLocalDouble
615 UNIMPLEMENTED
, // SetLocalObject
616 UNIMPLEMENTED
, // SetLocalInt
617 UNIMPLEMENTED
, // SetLocalLong
618 UNIMPLEMENTED
, // SetLocalFloat
619 UNIMPLEMENTED
, // SetLocalDouble
620 _Jv_JVMTI_CreateRawMonitor
, // CreateRawMonitor
621 _Jv_JVMTI_DestroyRawMonitor
, // DestroyRawMonitor
622 _Jv_JVMTI_RawMonitorEnter
, // RawMonitorEnter
623 _Jv_JVMTI_RawMonitorExit
, // RawMonitorExit
624 _Jv_JVMTI_RawMonitorWait
, // RawMonitorWait
625 _Jv_JVMTI_RawMonitorNotify
, // RawMonitorNotify
626 _Jv_JVMTI_RawMonitorNotifyAll
, // RawMonitorNotifyAll
627 UNIMPLEMENTED
, // SetBreakpoint
628 UNIMPLEMENTED
, // ClearBreakpoint
629 RESERVED
, // reserved40
630 UNIMPLEMENTED
, // SetFieldAccessWatch
631 UNIMPLEMENTED
, // ClearFieldAccessWatch
632 UNIMPLEMENTED
, // SetFieldModificationWatch
633 UNIMPLEMENTED
, // ClearFieldModificationWatch
634 RESERVED
, // reserved45
635 _Jv_JVMTI_Allocate
, // Allocate
636 _Jv_JVMTI_Deallocate
, // Deallocate
637 UNIMPLEMENTED
, // GetClassSignature
638 UNIMPLEMENTED
, // GetClassStatus
639 UNIMPLEMENTED
, // GetSourceFileName
640 _Jv_JVMTI_GetClassModifiers
, // GetClassModifiers
641 _Jv_JVMTI_GetClassMethods
, // GetClassMethods
642 UNIMPLEMENTED
, // GetClassFields
643 UNIMPLEMENTED
, // GetImplementedInterfaces
644 _Jv_JVMTI_IsInterface
, // IsInterface
645 _Jv_JVMTI_IsArrayClass
, // IsArrayClass
646 _Jv_JVMTI_GetClassLoader
, // GetClassLoader
647 _Jv_JVMTI_GetObjectHashCode
, // GetObjectHashCode
648 UNIMPLEMENTED
, // GetObjectMonitorUsage
649 UNIMPLEMENTED
, // GetFieldName
650 UNIMPLEMENTED
, // GetFieldDeclaringClass
651 _Jv_JVMTI_GetFieldModifiers
, // GetFieldModifiers
652 _Jv_JVMTI_IsFieldSynthetic
, // IsFieldSynthetic
653 UNIMPLEMENTED
, // GetMethodName
654 UNIMPLEMENTED
, // GetMethodDeclaringClass
655 _Jv_JVMTI_GetMethodModifiers
, // GetMethodModifers
656 RESERVED
, // reserved67
657 UNIMPLEMENTED
, // GetMaxLocals
658 UNIMPLEMENTED
, // GetArgumentsSize
659 UNIMPLEMENTED
, // GetLineNumberTable
660 UNIMPLEMENTED
, // GetMethodLocation
661 UNIMPLEMENTED
, // GetLocalVariableTable
662 RESERVED
, // reserved73
663 RESERVED
, // reserved74
664 UNIMPLEMENTED
, // GetBytecodes
665 _Jv_JVMTI_IsMethodNative
, // IsMethodNative
666 _Jv_JVMTI_IsMethodSynthetic
, // IsMethodSynthetic
667 UNIMPLEMENTED
, // GetLoadedClasses
668 _Jv_JVMTI_GetClassLoaderClasses
, // GetClassLoaderClasses
669 UNIMPLEMENTED
, // PopFrame
670 RESERVED
, // reserved81
671 RESERVED
, // reserved82
672 RESERVED
, // reserved83
673 RESERVED
, // reserved84
674 RESERVED
, // reserved85
675 RESERVED
, // reserved86
676 UNIMPLEMENTED
, // RedefineClasses
677 UNIMPLEMENTED
, // GetVersionNumber
678 UNIMPLEMENTED
, // GetCapabilities
679 UNIMPLEMENTED
, // GetSourceDebugExtension
680 UNIMPLEMENTED
, // IsMethodObsolete
681 UNIMPLEMENTED
, // SuspendThreadList
682 UNIMPLEMENTED
, // ResumeThreadList
683 RESERVED
, // reserved94
684 RESERVED
, // reserved95
685 RESERVED
, // reserved96
686 RESERVED
, // reserved97
687 RESERVED
, // reserved98
688 RESERVED
, // reserved99
689 UNIMPLEMENTED
, // GetAllStackTraces
690 UNIMPLEMENTED
, // GetThreadListStackTraces
691 UNIMPLEMENTED
, // GetThreadLocalStorage
692 UNIMPLEMENTED
, // SetThreadLocalStorage
693 UNIMPLEMENTED
, // GetStackTrace
694 RESERVED
, // reserved105
695 UNIMPLEMENTED
, // GetTag
696 UNIMPLEMENTED
, // SetTag
697 _Jv_JVMTI_ForceGarbageCollection
, // ForceGarbageCollection
698 UNIMPLEMENTED
, // IterateOverObjectsReachable
699 UNIMPLEMENTED
, // IterateOverReachableObjects
700 UNIMPLEMENTED
, // IterateOverHeap
701 UNIMPLEMENTED
, // IterateOverInstanceOfClass
702 RESERVED
, // reserved113
703 UNIMPLEMENTED
, // GetObjectsWithTags
704 RESERVED
, // reserved115
705 RESERVED
, // reserved116
706 RESERVED
, // reserved117
707 RESERVED
, // reserved118
708 RESERVED
, // reserved119
709 _Jv_JVMTI_SetJNIFunctionTable
, // SetJNIFunctionTable
710 _Jv_JVMTI_GetJNIFunctionTable
, // GetJNIFunctionTable
711 UNIMPLEMENTED
, // SetEventCallbacks
712 UNIMPLEMENTED
, // GenerateEvents
713 UNIMPLEMENTED
, // GetExtensionFunctions
714 UNIMPLEMENTED
, // GetExtensionEvents
715 UNIMPLEMENTED
, // SetExtensionEventCallback
716 _Jv_JVMTI_DisposeEnvironment
, // DisposeEnvironment
717 UNIMPLEMENTED
, // GetErrorName
718 UNIMPLEMENTED
, // GetJLocationFormat
719 UNIMPLEMENTED
, // GetSystemProperties
720 _Jv_JVMTI_GetSystemProperty
, // GetSystemProperty
721 _Jv_JVMTI_SetSystemProperty
, // SetSystemProperty
722 UNIMPLEMENTED
, // GetPhase
723 UNIMPLEMENTED
, // GetCurrentThreadCpuTimerInfo
724 UNIMPLEMENTED
, // GetCurrentThreadCpuTime
725 UNIMPLEMENTED
, // GetThreadCpuTimerInfo
726 UNIMPLEMENTED
, // GetThreadCpuTime
727 UNIMPLEMENTED
, // GetTimerInfo
728 _Jv_JVMTI_GetTime
, // GetTime
729 UNIMPLEMENTED
, // GetPotentialCapabilities
730 RESERVED
, // reserved141
731 UNIMPLEMENTED
, // AddCapabilities
732 UNIMPLEMENTED
, // RelinquishCapabilities
733 _Jv_JVMTI_GetAvailableProcessors
, // GetAvailableProcessors
734 RESERVED
, // reserved145
735 RESERVED
, // reserved146
736 UNIMPLEMENTED
, // GetEnvironmentLocalStorage
737 UNIMPLEMENTED
, // SetEnvironmentLocalStorage
738 _Jv_JVMTI_AddToBootstrapClassLoaderSearch
, // AddToBootstrapClassLoaderSearch
739 _Jv_JVMTI_SetVerboseFlag
, // SetVerboseFlag
740 RESERVED
, // reserved151
741 RESERVED
, // reserved152
742 RESERVED
, // reserved153
743 _Jv_JVMTI_GetObjectSize
// GetObjectSize
747 _Jv_GetJVMTIEnv (void)
750 = (_Jv_JVMTIEnv
*) _Jv_MallocUnchecked (sizeof (_Jv_JVMTIEnv
));
751 env
->p
= &_Jv_JVMTI_Interface
;