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 <gnu/classpath/SystemProperties.h>
20 #include <gnu/gcj/runtime/BootClassLoader.h>
21 #include <java/lang/Class.h>
22 #include <java/lang/ClassLoader.h>
23 #include <java/lang/Thread.h>
24 #include <java/lang/Throwable.h>
25 #include <java/lang/VMClassLoader.h>
26 #include <java/lang/reflect/Field.h>
27 #include <java/lang/reflect/Modifier.h>
28 #include <java/util/Collection.h>
29 #include <java/util/HashMap.h>
30 #include <java/net/URL.h>
32 extern struct JNINativeInterface _Jv_JNIFunctions
;
34 struct _Jv_rawMonitorID
37 _Jv_ConditionVariable_t condition
;
40 // Some commonly-used checks
42 #define THREAD_DEFAULT_TO_CURRENT(jthread) \
43 if (jthread == NULL) jthread = java::lang::Thread::currentThread ();
45 #define THREAD_CHECK_VALID(jthread) \
46 if (!java::lang::Thread::class$.isAssignableFrom (&(jthread->class$))) \
47 return JVMTI_ERROR_INVALID_THREAD;
49 #define THREAD_CHECK_IS_ALIVE(thread) \
50 if (!thread->isAlive ()) return JVMTI_ERROR_THREAD_NOT_ALIVE;
52 // FIXME: if current phase is not set in Phases,
53 // return JVMTI_ERROR_WRONG_PHASE
54 #define REQUIRE_PHASE(Env, Phases)
56 #define NULL_CHECK(Ptr) \
57 if (Ptr == NULL) return JVMTI_ERROR_NULL_POINTER;
59 static jvmtiError JNICALL
60 _Jv_JVMTI_SuspendThread (MAYBE_UNUSED jvmtiEnv
*env
, jthread thread
)
62 using namespace java::lang
;
64 THREAD_DEFAULT_TO_CURRENT (thread
);
65 THREAD_CHECK_VALID (thread
);
67 Thread
*t
= reinterpret_cast<Thread
*> (thread
);
68 THREAD_CHECK_IS_ALIVE (t
);
70 _Jv_Thread_t
*data
= _Jv_ThreadGetData (t
);
71 _Jv_SuspendThread (data
);
72 return JVMTI_ERROR_NONE
;
75 static jvmtiError JNICALL
76 _Jv_JVMTI_ResumeThread (MAYBE_UNUSED jvmtiEnv
*env
, jthread thread
)
78 using namespace java::lang
;
80 THREAD_DEFAULT_TO_CURRENT (thread
);
81 THREAD_CHECK_VALID (thread
);
83 Thread
*t
= reinterpret_cast<Thread
*> (thread
);
84 THREAD_CHECK_IS_ALIVE (t
);
86 _Jv_Thread_t
*data
= _Jv_ThreadGetData (t
);
87 _Jv_ResumeThread (data
);
88 return JVMTI_ERROR_NONE
;
91 static jvmtiError JNICALL
92 _Jv_JVMTI_InterruptThread (MAYBE_UNUSED jvmtiEnv
*env
, jthread thread
)
94 using namespace java::lang
;
96 REQUIRE_PHASE (env
, JVMTI_PHASE_LIVE
);
97 // FIXME: capability handling? 'can_signal_thread'
99 return JVMTI_ERROR_INVALID_THREAD
;
100 THREAD_CHECK_VALID (thread
);
101 Thread
*real_thread
= reinterpret_cast<Thread
*> (thread
);
102 THREAD_CHECK_IS_ALIVE (real_thread
);
103 real_thread
->interrupt();
104 return JVMTI_ERROR_NONE
;
107 static jvmtiError JNICALL
108 _Jv_JVMTI_CreateRawMonitor (MAYBE_UNUSED jvmtiEnv
*env
, const char *name
,
109 jrawMonitorID
*result
)
111 REQUIRE_PHASE (env
, JVMTI_PHASE_ONLOAD
| JVMTI_PHASE_LIVE
);
114 *result
= (jrawMonitorID
) _Jv_Malloc (sizeof (_Jv_rawMonitorID
));
115 _Jv_MutexInit (&(*result
)->mutex
);
116 _Jv_CondInit (&(*result
)->condition
);
117 return JVMTI_ERROR_NONE
;
120 static jvmtiError JNICALL
121 _Jv_JVMTI_DestroyRawMonitor (MAYBE_UNUSED jvmtiEnv
*env
, jrawMonitorID monitor
)
123 REQUIRE_PHASE (env
, JVMTI_PHASE_ONLOAD
| JVMTI_PHASE_LIVE
);
124 // Note we have no better way of knowing whether this object is
125 // really a raw monitor.
127 return JVMTI_ERROR_INVALID_MONITOR
;
128 // FIXME: perform checks on monitor, release it if this thread owns
130 #ifdef _Jv_HaveMutexDestroy
131 _Jv_MutexDestroy (&monitor
->mutex
);
134 return JVMTI_ERROR_NONE
;
137 static jvmtiError JNICALL
138 _Jv_JVMTI_RawMonitorEnter (MAYBE_UNUSED jvmtiEnv
*env
, jrawMonitorID monitor
)
141 return JVMTI_ERROR_INVALID_MONITOR
;
142 _Jv_MutexLock (&monitor
->mutex
);
143 return JVMTI_ERROR_NONE
;
146 static jvmtiError JNICALL
147 _Jv_JVMTI_RawMonitorExit (MAYBE_UNUSED jvmtiEnv
*env
, jrawMonitorID monitor
)
150 return JVMTI_ERROR_INVALID_MONITOR
;
151 if (_Jv_MutexUnlock (&monitor
->mutex
))
152 return JVMTI_ERROR_NOT_MONITOR_OWNER
;
153 return JVMTI_ERROR_NONE
;
156 static jvmtiError JNICALL
157 _Jv_JVMTI_RawMonitorWait (MAYBE_UNUSED jvmtiEnv
*env
, jrawMonitorID monitor
)
160 return JVMTI_ERROR_INVALID_MONITOR
;
161 int r
= _Jv_CondWait (&monitor
->condition
, &monitor
->mutex
, 0, 0);
162 if (r
== _JV_NOT_OWNER
)
163 return JVMTI_ERROR_NOT_MONITOR_OWNER
;
164 if (r
== _JV_INTERRUPTED
)
165 return JVMTI_ERROR_INTERRUPT
;
166 return JVMTI_ERROR_NONE
;
169 static jvmtiError JNICALL
170 _Jv_JVMTI_RawMonitorNotify (MAYBE_UNUSED jvmtiEnv
*env
, jrawMonitorID monitor
)
173 return JVMTI_ERROR_INVALID_MONITOR
;
174 if (_Jv_CondNotify (&monitor
->condition
, &monitor
->mutex
) == _JV_NOT_OWNER
)
175 return JVMTI_ERROR_NOT_MONITOR_OWNER
;
176 return JVMTI_ERROR_NONE
;
179 static jvmtiError JNICALL
180 _Jv_JVMTI_RawMonitorNotifyAll (MAYBE_UNUSED jvmtiEnv
*env
,
181 jrawMonitorID monitor
)
184 return JVMTI_ERROR_INVALID_MONITOR
;
185 if (_Jv_CondNotifyAll (&monitor
->condition
, &monitor
->mutex
)
187 return JVMTI_ERROR_NOT_MONITOR_OWNER
;
188 return JVMTI_ERROR_NONE
;
191 static jvmtiError JNICALL
192 _Jv_JVMTI_Allocate (MAYBE_UNUSED jvmtiEnv
*env
, jlong size
,
193 unsigned char **result
)
196 return JVMTI_ERROR_ILLEGAL_ARGUMENT
;
202 *result
= (unsigned char *) _Jv_MallocUnchecked (size
);
204 return JVMTI_ERROR_OUT_OF_MEMORY
;
206 return JVMTI_ERROR_NONE
;
209 static jvmtiError JNICALL
210 _Jv_JVMTI_Deallocate (MAYBE_UNUSED jvmtiEnv
*env
, unsigned char *mem
)
214 return JVMTI_ERROR_NONE
;
217 static jvmtiError JNICALL
218 _Jv_JVMTI_GetClassModifiers (MAYBE_UNUSED jvmtiEnv
*env
, jclass klass
,
221 REQUIRE_PHASE (env
, JVMTI_PHASE_START
| JVMTI_PHASE_LIVE
);
222 // Don't bother checking KLASS' type.
224 return JVMTI_ERROR_INVALID_CLASS
;
226 *mods
= klass
->getModifiers();
227 return JVMTI_ERROR_NONE
;
230 static jvmtiError JNICALL
231 _Jv_JVMTI_GetClassMethods (MAYBE_UNUSED jvmtiEnv
*env
, jclass klass
,
232 jint
*count_ptr
, jmethodID
**methods_ptr
)
234 REQUIRE_PHASE (env
, JVMTI_PHASE_START
| JVMTI_PHASE_LIVE
);
235 // FIXME: capability can_maintain_original_method_order
236 // Don't bother checking KLASS' type.
238 return JVMTI_ERROR_INVALID_CLASS
;
239 NULL_CHECK (count_ptr
);
240 NULL_CHECK (methods_ptr
);
241 *count_ptr
= JvNumMethods(klass
);
243 *methods_ptr
= (jmethodID
*) _Jv_Malloc (*count_ptr
* sizeof (jmethodID
));
244 jmethodID start
= JvGetFirstMethod (klass
);
245 for (jint i
= 0; i
< *count_ptr
; ++i
)
247 (*methods_ptr
)[i
] = start
+ i
;
249 return JVMTI_ERROR_NONE
;
252 static jvmtiError JNICALL
253 _Jv_JVMTI_IsInterface (MAYBE_UNUSED jvmtiEnv
*env
, jclass klass
,
256 REQUIRE_PHASE (env
, JVMTI_PHASE_START
| JVMTI_PHASE_LIVE
);
258 return JVMTI_ERROR_INVALID_CLASS
;
260 *result
= klass
->isInterface();
261 return JVMTI_ERROR_NONE
;
264 static jvmtiError JNICALL
265 _Jv_JVMTI_IsArrayClass (MAYBE_UNUSED jvmtiEnv
*env
, jclass klass
,
268 REQUIRE_PHASE (env
, JVMTI_PHASE_START
| JVMTI_PHASE_LIVE
);
270 return JVMTI_ERROR_INVALID_CLASS
;
272 *result
= klass
->isArray();
273 return JVMTI_ERROR_NONE
;
276 static jvmtiError JNICALL
277 _Jv_JVMTI_GetClassLoader (MAYBE_UNUSED jvmtiEnv
*env
, jclass klass
,
280 REQUIRE_PHASE (env
, JVMTI_PHASE_START
| JVMTI_PHASE_LIVE
);
282 return JVMTI_ERROR_INVALID_CLASS
;
284 *result
= klass
->getClassLoaderInternal();
285 return JVMTI_ERROR_NONE
;
288 static jvmtiError JNICALL
289 _Jv_JVMTI_GetObjectHashCode (MAYBE_UNUSED jvmtiEnv
*env
, jobject obj
,
292 REQUIRE_PHASE (env
, JVMTI_PHASE_START
| JVMTI_PHASE_LIVE
);
294 return JVMTI_ERROR_INVALID_OBJECT
;
296 *result
= _Jv_HashCode (obj
);
297 return JVMTI_ERROR_NONE
;
300 static jvmtiError JNICALL
301 _Jv_JVMTI_GetFieldModifiers (MAYBE_UNUSED jvmtiEnv
*env
, jclass klass
,
302 jfieldID field
, jint
*result
)
304 REQUIRE_PHASE (env
, JVMTI_PHASE_START
| JVMTI_PHASE_LIVE
);
306 return JVMTI_ERROR_INVALID_CLASS
;
308 return JVMTI_ERROR_INVALID_FIELDID
;
310 *result
= field
->getModifiers();
311 return JVMTI_ERROR_NONE
;
314 static jvmtiError JNICALL
315 _Jv_JVMTI_IsFieldSynthetic (MAYBE_UNUSED jvmtiEnv
*env
, jclass klass
,
316 jfieldID field
, jboolean
*result
)
318 REQUIRE_PHASE (env
, JVMTI_PHASE_START
| JVMTI_PHASE_LIVE
);
320 return JVMTI_ERROR_INVALID_CLASS
;
322 return JVMTI_ERROR_INVALID_FIELDID
;
325 // FIXME: capability can_get_synthetic_attribute
326 *result
= ((field
->getModifiers() & java::lang::reflect::Modifier::SYNTHETIC
)
328 return JVMTI_ERROR_NONE
;
331 static jvmtiError JNICALL
332 _Jv_JVMTI_GetMethodModifiers (MAYBE_UNUSED jvmtiEnv
*env
, jmethodID method
,
335 REQUIRE_PHASE (env
, JVMTI_PHASE_START
| JVMTI_PHASE_LIVE
);
337 return JVMTI_ERROR_INVALID_METHODID
;
340 // FIXME: mask off some internal bits...
341 *result
= method
->accflags
;
342 return JVMTI_ERROR_NONE
;
345 static jvmtiError JNICALL
346 _Jv_JVMTI_IsMethodNative (MAYBE_UNUSED jvmtiEnv
*env
, jmethodID method
,
349 REQUIRE_PHASE (env
, JVMTI_PHASE_START
| JVMTI_PHASE_LIVE
);
351 return JVMTI_ERROR_INVALID_METHODID
;
354 *result
= ((method
->accflags
& java::lang::reflect::Modifier::NATIVE
) != 0);
355 return JVMTI_ERROR_NONE
;
358 static jvmtiError JNICALL
359 _Jv_JVMTI_IsMethodSynthetic (MAYBE_UNUSED jvmtiEnv
*env
, jmethodID method
,
362 REQUIRE_PHASE (env
, JVMTI_PHASE_START
| JVMTI_PHASE_LIVE
);
364 return JVMTI_ERROR_INVALID_METHODID
;
367 // FIXME capability can_get_synthetic_attribute
369 *result
= ((method
->accflags
& java::lang::reflect::Modifier::SYNTHETIC
)
371 return JVMTI_ERROR_NONE
;
374 static jvmtiError JNICALL
375 _Jv_JVMTI_GetClassLoaderClasses (MAYBE_UNUSED jvmtiEnv
*env
,
380 using namespace java::lang
;
381 using namespace java::util
;
383 REQUIRE_PHASE (env
, JVMTI_PHASE_LIVE
);
384 NULL_CHECK (count_ptr
);
385 NULL_CHECK (result_ptr
);
387 ClassLoader
*loader
= (ClassLoader
*) init_loader
;
389 loader
= VMClassLoader::bootLoader
;
391 Collection
*values
= loader
->loadedClasses
->values();
392 jobjectArray array
= values
->toArray();
393 *count_ptr
= array
->length
;
394 jobject
*elts
= elements (array
);
395 jclass
*result
= (jclass
*) _Jv_Malloc (*count_ptr
* sizeof (jclass
));
396 // FIXME: JNI references...
397 memcpy (result
, elts
, *count_ptr
* sizeof (jclass
));
399 *result_ptr
= result
;
401 return JVMTI_ERROR_NONE
;
404 static jvmtiError JNICALL
405 _Jv_JVMTI_ForceGarbageCollection (MAYBE_UNUSED jvmtiEnv
*env
)
407 REQUIRE_PHASE (env
, JVMTI_PHASE_LIVE
);
409 return JVMTI_ERROR_NONE
;
412 static jvmtiError JNICALL
413 _Jv_JVMTI_SetJNIFunctionTable (MAYBE_UNUSED jvmtiEnv
*env
,
414 const jniNativeInterface
*function_table
)
416 REQUIRE_PHASE (env
, JVMTI_PHASE_START
| JVMTI_PHASE_LIVE
);
417 NULL_CHECK (function_table
);
418 memcpy (&_Jv_JNIFunctions
, function_table
, sizeof (jniNativeInterface
));
419 return JVMTI_ERROR_NONE
;
422 static jvmtiError JNICALL
423 _Jv_JVMTI_GetJNIFunctionTable (MAYBE_UNUSED jvmtiEnv
*env
,
424 jniNativeInterface
**function_table
)
426 REQUIRE_PHASE (env
, JVMTI_PHASE_START
| JVMTI_PHASE_LIVE
);
427 NULL_CHECK (function_table
);
429 = (jniNativeInterface
*) _Jv_Malloc (sizeof (jniNativeInterface
));
430 memcpy (*function_table
, &_Jv_JNIFunctions
, sizeof (jniNativeInterface
));
431 return JVMTI_ERROR_NONE
;
434 static jvmtiError JNICALL
435 _Jv_JVMTI_DisposeEnvironment (jvmtiEnv
*env
)
437 // All we need to do is free memory allocated by _Jv_GetJVMTIEnv
439 return JVMTI_ERROR_NONE
;
442 static jvmtiError JNICALL
443 _Jv_JVMTI_GetSystemProperty (MAYBE_UNUSED jvmtiEnv
*env
, const char *property
,
446 REQUIRE_PHASE (env
, JVMTI_PHASE_ONLOAD
| JVMTI_PHASE_LIVE
);
447 NULL_CHECK (property
);
450 jstring name
= JvNewStringUTF(property
);
451 jstring result_str
= gnu::classpath::SystemProperties::getProperty(name
);
453 if (result_str
== NULL
)
454 return JVMTI_ERROR_NOT_AVAILABLE
;
456 int len
= JvGetStringUTFLength (result_str
);
457 *result
= (char *) _Jv_Malloc (len
+ 1);
458 JvGetStringUTFRegion (result_str
, 0, result_str
->length(), *result
);
459 (*result
)[len
] = '\0';
461 return JVMTI_ERROR_NONE
;
464 static jvmtiError JNICALL
465 _Jv_JVMTI_SetSystemProperty (MAYBE_UNUSED jvmtiEnv
*env
, const char *property
,
468 REQUIRE_PHASE (env
, JVMTI_PHASE_ONLOAD
);
470 NULL_CHECK (property
);
473 // FIXME: When would a property not be writeable?
474 return JVMTI_ERROR_NONE
;
477 jstring prop_str
= JvNewStringUTF(property
);
478 jstring value_str
= JvNewStringUTF(value
);
479 gnu::classpath::SystemProperties::setProperty(prop_str
, value_str
);
480 return JVMTI_ERROR_NONE
;
483 static jvmtiError JNICALL
484 _Jv_JVMTI_GetTime (MAYBE_UNUSED jvmtiEnv
*env
, jlong
*nanos_ptr
)
486 NULL_CHECK (nanos_ptr
);
487 *nanos_ptr
= _Jv_platform_nanotime();
488 return JVMTI_ERROR_NONE
;
491 static jvmtiError JNICALL
492 _Jv_JVMTI_GetAvailableProcessors (MAYBE_UNUSED jvmtiEnv
*env
,
493 jint
*nprocessors_ptr
)
495 NULL_CHECK (nprocessors_ptr
);
496 #ifdef _SC_NPROCESSORS_ONLN
497 *nprocessors_ptr
= sysconf(_SC_NPROCESSORS_ONLN
);
499 *nprocessors_ptr
= 1;
501 return JVMTI_ERROR_NONE
;
504 static jvmtiError JNICALL
505 _Jv_JVMTI_AddToBootstrapClassLoaderSearch (MAYBE_UNUSED jvmtiEnv
*env
,
508 using namespace java::lang
;
509 using namespace java::net
;
510 using namespace gnu::gcj::runtime
;
512 REQUIRE_PHASE (env
, JVMTI_PHASE_ONLOAD
);
513 NULL_CHECK (segment
);
515 jstring str_segment
= JvNewStringUTF(segment
);
519 url
= new URL(JvNewStringUTF("file"), NULL
, str_segment
);
521 catch (jthrowable ignore
)
523 return JVMTI_ERROR_ILLEGAL_ARGUMENT
;
526 BootClassLoader
*loader
= VMClassLoader::bootLoader
;
527 // Don't call this too early.
528 // assert (loader != NULL);
530 return JVMTI_ERROR_NONE
;
533 static jvmtiError JNICALL
534 _Jv_JVMTI_SetVerboseFlag (MAYBE_UNUSED jvmtiEnv
*env
, jvmtiVerboseFlag flag
,
539 case JVMTI_VERBOSE_OTHER
:
540 case JVMTI_VERBOSE_GC
:
541 case JVMTI_VERBOSE_JNI
:
544 case JVMTI_VERBOSE_CLASS
:
545 gcj::verbose_class_flag
= value
;
548 return JVMTI_ERROR_ILLEGAL_ARGUMENT
;
550 return JVMTI_ERROR_NONE
;
553 static jvmtiError JNICALL
554 _Jv_JVMTI_GetObjectSize (MAYBE_UNUSED jvmtiEnv
*env
, jobject object
,
557 REQUIRE_PHASE (env
, JVMTI_PHASE_START
| JVMTI_PHASE_LIVE
);
559 return JVMTI_ERROR_INVALID_OBJECT
;
562 jclass klass
= object
->getClass();
563 if (klass
->isArray())
565 jclass comp
= klass
->getComponentType();
567 = (jint
) (_Jv_uintptr_t
) _Jv_GetArrayElementFromElementType(NULL
,
568 klass
->getComponentType());
569 // FIXME: correct for primitive types?
570 jint compSize
= comp
->size();
571 __JArray
*array
= (__JArray
*) object
;
572 *result
= base
+ array
->length
* compSize
;
576 // Note that if OBJECT is a String then it may (if
577 // str->data==str) take more space. Do we care?
578 *result
= klass
->size();
580 return JVMTI_ERROR_NONE
;
583 #define RESERVED NULL
584 #define UNIMPLEMENTED NULL
586 struct _Jv_jvmtiEnv _Jv_JVMTI_Interface
=
588 RESERVED
, // reserved1
589 UNIMPLEMENTED
, // SetEventNotification
590 RESERVED
, // reserved3
591 UNIMPLEMENTED
, // GetAllThreads
592 _Jv_JVMTI_SuspendThread
, // SuspendThread
593 _Jv_JVMTI_ResumeThread
, // ResumeThread
594 UNIMPLEMENTED
, // StopThread
595 _Jv_JVMTI_InterruptThread
, // InterruptThread
596 UNIMPLEMENTED
, // GetThreadInfo
597 UNIMPLEMENTED
, // GetOwnedMonitorInfo
598 UNIMPLEMENTED
, // GetCurrentContendedMonitor
599 UNIMPLEMENTED
, // RunAgentThread
600 UNIMPLEMENTED
, // GetTopThreadGroups
601 UNIMPLEMENTED
, // GetThreadGroupInfo
602 UNIMPLEMENTED
, // GetThreadGroupChildren
603 UNIMPLEMENTED
, // GetFrameCount
604 UNIMPLEMENTED
, // GetThreadState
605 RESERVED
, // reserved18
606 UNIMPLEMENTED
, // GetFrameLocation
607 UNIMPLEMENTED
, // NotifyPopFrame
608 UNIMPLEMENTED
, // GetLocalObject
609 UNIMPLEMENTED
, // GetLocalInt
610 UNIMPLEMENTED
, // GetLocalLong
611 UNIMPLEMENTED
, // GetLocalFloat
612 UNIMPLEMENTED
, // GetLocalDouble
613 UNIMPLEMENTED
, // SetLocalObject
614 UNIMPLEMENTED
, // SetLocalInt
615 UNIMPLEMENTED
, // SetLocalLong
616 UNIMPLEMENTED
, // SetLocalFloat
617 UNIMPLEMENTED
, // SetLocalDouble
618 _Jv_JVMTI_CreateRawMonitor
, // CreateRawMonitor
619 _Jv_JVMTI_DestroyRawMonitor
, // DestroyRawMonitor
620 _Jv_JVMTI_RawMonitorEnter
, // RawMonitorEnter
621 _Jv_JVMTI_RawMonitorExit
, // RawMonitorExit
622 _Jv_JVMTI_RawMonitorWait
, // RawMonitorWait
623 _Jv_JVMTI_RawMonitorNotify
, // RawMonitorNotify
624 _Jv_JVMTI_RawMonitorNotifyAll
, // RawMonitorNotifyAll
625 UNIMPLEMENTED
, // SetBreakpoint
626 UNIMPLEMENTED
, // ClearBreakpoint
627 RESERVED
, // reserved40
628 UNIMPLEMENTED
, // SetFieldAccessWatch
629 UNIMPLEMENTED
, // ClearFieldAccessWatch
630 UNIMPLEMENTED
, // SetFieldModificationWatch
631 UNIMPLEMENTED
, // ClearFieldModificationWatch
632 RESERVED
, // reserved45
633 _Jv_JVMTI_Allocate
, // Allocate
634 _Jv_JVMTI_Deallocate
, // Deallocate
635 UNIMPLEMENTED
, // GetClassSignature
636 UNIMPLEMENTED
, // GetClassStatus
637 UNIMPLEMENTED
, // GetSourceFileName
638 _Jv_JVMTI_GetClassModifiers
, // GetClassModifiers
639 _Jv_JVMTI_GetClassMethods
, // GetClassMethods
640 UNIMPLEMENTED
, // GetClassFields
641 UNIMPLEMENTED
, // GetImplementedInterfaces
642 _Jv_JVMTI_IsInterface
, // IsInterface
643 _Jv_JVMTI_IsArrayClass
, // IsArrayClass
644 _Jv_JVMTI_GetClassLoader
, // GetClassLoader
645 _Jv_JVMTI_GetObjectHashCode
, // GetObjectHashCode
646 UNIMPLEMENTED
, // GetObjectMonitorUsage
647 UNIMPLEMENTED
, // GetFieldName
648 UNIMPLEMENTED
, // GetFieldDeclaringClass
649 _Jv_JVMTI_GetFieldModifiers
, // GetFieldModifiers
650 _Jv_JVMTI_IsFieldSynthetic
, // IsFieldSynthetic
651 UNIMPLEMENTED
, // GetMethodName
652 UNIMPLEMENTED
, // GetMethodDeclaringClass
653 _Jv_JVMTI_GetMethodModifiers
, // GetMethodModifers
654 RESERVED
, // reserved67
655 UNIMPLEMENTED
, // GetMaxLocals
656 UNIMPLEMENTED
, // GetArgumentsSize
657 UNIMPLEMENTED
, // GetLineNumberTable
658 UNIMPLEMENTED
, // GetMethodLocation
659 UNIMPLEMENTED
, // GetLocalVariableTable
660 RESERVED
, // reserved73
661 RESERVED
, // reserved74
662 UNIMPLEMENTED
, // GetBytecodes
663 _Jv_JVMTI_IsMethodNative
, // IsMethodNative
664 _Jv_JVMTI_IsMethodSynthetic
, // IsMethodSynthetic
665 UNIMPLEMENTED
, // GetLoadedClasses
666 _Jv_JVMTI_GetClassLoaderClasses
, // GetClassLoaderClasses
667 UNIMPLEMENTED
, // PopFrame
668 RESERVED
, // reserved81
669 RESERVED
, // reserved82
670 RESERVED
, // reserved83
671 RESERVED
, // reserved84
672 RESERVED
, // reserved85
673 RESERVED
, // reserved86
674 UNIMPLEMENTED
, // RedefineClasses
675 UNIMPLEMENTED
, // GetVersionNumber
676 UNIMPLEMENTED
, // GetCapabilities
677 UNIMPLEMENTED
, // GetSourceDebugExtension
678 UNIMPLEMENTED
, // IsMethodObsolete
679 UNIMPLEMENTED
, // SuspendThreadList
680 UNIMPLEMENTED
, // ResumeThreadList
681 RESERVED
, // reserved94
682 RESERVED
, // reserved95
683 RESERVED
, // reserved96
684 RESERVED
, // reserved97
685 RESERVED
, // reserved98
686 RESERVED
, // reserved99
687 UNIMPLEMENTED
, // GetAllStackTraces
688 UNIMPLEMENTED
, // GetThreadListStackTraces
689 UNIMPLEMENTED
, // GetThreadLocalStorage
690 UNIMPLEMENTED
, // SetThreadLocalStorage
691 UNIMPLEMENTED
, // GetStackTrace
692 RESERVED
, // reserved105
693 UNIMPLEMENTED
, // GetTag
694 UNIMPLEMENTED
, // SetTag
695 _Jv_JVMTI_ForceGarbageCollection
, // ForceGarbageCollection
696 UNIMPLEMENTED
, // IterateOverObjectsReachable
697 UNIMPLEMENTED
, // IterateOverReachableObjects
698 UNIMPLEMENTED
, // IterateOverHeap
699 UNIMPLEMENTED
, // IterateOverInstanceOfClass
700 RESERVED
, // reserved113
701 UNIMPLEMENTED
, // GetObjectsWithTags
702 RESERVED
, // reserved115
703 RESERVED
, // reserved116
704 RESERVED
, // reserved117
705 RESERVED
, // reserved118
706 RESERVED
, // reserved119
707 _Jv_JVMTI_SetJNIFunctionTable
, // SetJNIFunctionTable
708 _Jv_JVMTI_GetJNIFunctionTable
, // GetJNIFunctionTable
709 UNIMPLEMENTED
, // SetEventCallbacks
710 UNIMPLEMENTED
, // GenerateEvents
711 UNIMPLEMENTED
, // GetExtensionFunctions
712 UNIMPLEMENTED
, // GetExtensionEvents
713 UNIMPLEMENTED
, // SetExtensionEventCallback
714 _Jv_JVMTI_DisposeEnvironment
, // DisposeEnvironment
715 UNIMPLEMENTED
, // GetErrorName
716 UNIMPLEMENTED
, // GetJLocationFormat
717 UNIMPLEMENTED
, // GetSystemProperties
718 _Jv_JVMTI_GetSystemProperty
, // GetSystemProperty
719 _Jv_JVMTI_SetSystemProperty
, // SetSystemProperty
720 UNIMPLEMENTED
, // GetPhase
721 UNIMPLEMENTED
, // GetCurrentThreadCpuTimerInfo
722 UNIMPLEMENTED
, // GetCurrentThreadCpuTime
723 UNIMPLEMENTED
, // GetThreadCpuTimerInfo
724 UNIMPLEMENTED
, // GetThreadCpuTime
725 UNIMPLEMENTED
, // GetTimerInfo
726 _Jv_JVMTI_GetTime
, // GetTime
727 UNIMPLEMENTED
, // GetPotentialCapabilities
728 RESERVED
, // reserved141
729 UNIMPLEMENTED
, // AddCapabilities
730 UNIMPLEMENTED
, // RelinquishCapabilities
731 _Jv_JVMTI_GetAvailableProcessors
, // GetAvailableProcessors
732 RESERVED
, // reserved145
733 RESERVED
, // reserved146
734 UNIMPLEMENTED
, // GetEnvironmentLocalStorage
735 UNIMPLEMENTED
, // SetEnvironmentLocalStorage
736 _Jv_JVMTI_AddToBootstrapClassLoaderSearch
, // AddToBootstrapClassLoaderSearch
737 _Jv_JVMTI_SetVerboseFlag
, // SetVerboseFlag
738 RESERVED
, // reserved151
739 RESERVED
, // reserved152
740 RESERVED
, // reserved153
741 _Jv_JVMTI_GetObjectSize
// GetObjectSize
745 _Jv_GetJVMTIEnv (void)
748 = (_Jv_JVMTIEnv
*) _Jv_MallocUnchecked (sizeof (_Jv_JVMTIEnv
));
749 env
->p
= &_Jv_JVMTI_Interface
;