blob: b91acb691c0b8719aabd7151ab68ed6104cc21bd [file] [log] [blame]
Alex Light49948e92016-08-11 15:35:28 -07001/* Copyright (C) 2016 The Android Open Source Project
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3 *
4 * This file implements interfaces from the file jvmti.h. This implementation
5 * is licensed under the same terms as the file jvmti.h. The
6 * copyright and license information for the file jvmti.h follows.
7 *
8 * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
9 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
10 *
11 * This code is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License version 2 only, as
13 * published by the Free Software Foundation. Oracle designates this
14 * particular file as subject to the "Classpath" exception as provided
15 * by Oracle in the LICENSE file that accompanied this code.
16 *
17 * This code is distributed in the hope that it will be useful, but WITHOUT
18 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 * version 2 for more details (a copy is included in the LICENSE file that
21 * accompanied this code).
22 *
23 * You should have received a copy of the GNU General Public License version
24 * 2 along with this work; if not, write to the Free Software Foundation,
25 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
26 *
27 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
28 * or visit www.oracle.com if you need additional information or have any
29 * questions.
30 */
31
Alex Light9c20a142016-08-23 15:05:12 -070032#include <string>
33#include <vector>
34
Alex Light49948e92016-08-11 15:35:28 -070035#include <jni.h>
Alex Light9c20a142016-08-23 15:05:12 -070036
Alex Light49948e92016-08-11 15:35:28 -070037#include "openjdkjvmti/jvmti.h"
38
Andreas Gampedb6dcb62016-09-13 09:05:59 -070039#include "art_jvmti.h"
Andreas Gampe77708d92016-10-07 11:48:21 -070040#include "base/mutex.h"
41#include "events-inl.h"
Andreas Gampee54d9922016-10-11 19:55:37 -070042#include "heap.h"
Alex Light49948e92016-08-11 15:35:28 -070043#include "jni_env_ext-inl.h"
Andreas Gampe6dee92e2016-09-12 19:58:13 -070044#include "object_tagging.h"
45#include "obj_ptr-inl.h"
Alex Light9c20a142016-08-23 15:05:12 -070046#include "runtime.h"
Andreas Gampe6dee92e2016-09-12 19:58:13 -070047#include "scoped_thread_state_change-inl.h"
48#include "thread_list.h"
Andreas Gampe77708d92016-10-07 11:48:21 -070049#include "thread-inl.h"
Alex Light9c20a142016-08-23 15:05:12 -070050#include "transform.h"
Alex Light49948e92016-08-11 15:35:28 -070051
52// TODO Remove this at some point by annotating all the methods. It was put in to make the skeleton
53// easier to create.
54#pragma GCC diagnostic ignored "-Wunused-parameter"
55
56namespace openjdkjvmti {
57
Andreas Gampe77708d92016-10-07 11:48:21 -070058EventHandler gEventHandler;
Andreas Gampecc13b222016-10-10 19:09:09 -070059ObjectTagTable gObjectTagTable(&gEventHandler);
Andreas Gampe6dee92e2016-09-12 19:58:13 -070060
Alex Light49948e92016-08-11 15:35:28 -070061class JvmtiFunctions {
62 private:
63 static bool IsValidEnv(jvmtiEnv* env) {
64 return env != nullptr;
65 }
66
67 public:
68 static jvmtiError Allocate(jvmtiEnv* env, jlong size, unsigned char** mem_ptr) {
69 if (!IsValidEnv(env)) {
70 return ERR(INVALID_ENVIRONMENT);
71 }
72 if (mem_ptr == nullptr) {
73 return ERR(NULL_POINTER);
74 }
75 if (size < 0) {
76 return ERR(ILLEGAL_ARGUMENT);
77 } else if (size == 0) {
78 *mem_ptr = nullptr;
79 return OK;
80 }
81 *mem_ptr = static_cast<unsigned char*>(malloc(size));
82 return (*mem_ptr != nullptr) ? OK : ERR(OUT_OF_MEMORY);
83 }
84
85 static jvmtiError Deallocate(jvmtiEnv* env, unsigned char* mem) {
86 if (!IsValidEnv(env)) {
87 return ERR(INVALID_ENVIRONMENT);
88 }
89 if (mem != nullptr) {
90 free(mem);
91 }
92 return OK;
93 }
94
95 static jvmtiError GetThreadState(jvmtiEnv* env, jthread thread, jint* thread_state_ptr) {
96 return ERR(NOT_IMPLEMENTED);
97 }
98
99 static jvmtiError GetCurrentThread(jvmtiEnv* env, jthread* thread_ptr) {
100 return ERR(NOT_IMPLEMENTED);
101 }
102
103 static jvmtiError GetAllThreads(jvmtiEnv* env, jint* threads_count_ptr, jthread** threads_ptr) {
104 return ERR(NOT_IMPLEMENTED);
105 }
106
107 static jvmtiError SuspendThread(jvmtiEnv* env, jthread thread) {
108 return ERR(NOT_IMPLEMENTED);
109 }
110
111 static jvmtiError SuspendThreadList(jvmtiEnv* env,
112 jint request_count,
113 const jthread* request_list,
114 jvmtiError* results) {
115 return ERR(NOT_IMPLEMENTED);
116 }
117
118 static jvmtiError ResumeThread(jvmtiEnv* env, jthread thread) {
119 return ERR(NOT_IMPLEMENTED);
120 }
121
122 static jvmtiError ResumeThreadList(jvmtiEnv* env,
123 jint request_count,
124 const jthread* request_list,
125 jvmtiError* results) {
126 return ERR(NOT_IMPLEMENTED);
127 }
128
129 static jvmtiError StopThread(jvmtiEnv* env, jthread thread, jobject exception) {
130 return ERR(NOT_IMPLEMENTED);
131 }
132
133 static jvmtiError InterruptThread(jvmtiEnv* env, jthread thread) {
134 return ERR(NOT_IMPLEMENTED);
135 }
136
137 static jvmtiError GetThreadInfo(jvmtiEnv* env, jthread thread, jvmtiThreadInfo* info_ptr) {
138 return ERR(NOT_IMPLEMENTED);
139 }
140
141 static jvmtiError GetOwnedMonitorInfo(jvmtiEnv* env,
142 jthread thread,
143 jint* owned_monitor_count_ptr,
144 jobject** owned_monitors_ptr) {
145 return ERR(NOT_IMPLEMENTED);
146 }
147
148 static jvmtiError GetOwnedMonitorStackDepthInfo(jvmtiEnv* env,
149 jthread thread,
150 jint* monitor_info_count_ptr,
151 jvmtiMonitorStackDepthInfo** monitor_info_ptr) {
152 return ERR(NOT_IMPLEMENTED);
153 }
154
155 static jvmtiError GetCurrentContendedMonitor(jvmtiEnv* env,
156 jthread thread,
157 jobject* monitor_ptr) {
158 return ERR(NOT_IMPLEMENTED);
159 }
160
161 static jvmtiError RunAgentThread(jvmtiEnv* env,
162 jthread thread,
163 jvmtiStartFunction proc,
164 const void* arg,
165 jint priority) {
166 return ERR(NOT_IMPLEMENTED);
167 }
168
169 static jvmtiError SetThreadLocalStorage(jvmtiEnv* env, jthread thread, const void* data) {
170 return ERR(NOT_IMPLEMENTED);
171 }
172
173 static jvmtiError GetThreadLocalStorage(jvmtiEnv* env, jthread thread, void** data_ptr) {
174 return ERR(NOT_IMPLEMENTED);
175 }
176
177 static jvmtiError GetTopThreadGroups(jvmtiEnv* env,
178 jint* group_count_ptr,
179 jthreadGroup** groups_ptr) {
180 return ERR(NOT_IMPLEMENTED);
181 }
182
183 static jvmtiError GetThreadGroupInfo(jvmtiEnv* env,
184 jthreadGroup group,
185 jvmtiThreadGroupInfo* info_ptr) {
186 return ERR(NOT_IMPLEMENTED);
187 }
188
189 static jvmtiError GetThreadGroupChildren(jvmtiEnv* env,
190 jthreadGroup group,
191 jint* thread_count_ptr,
192 jthread** threads_ptr,
193 jint* group_count_ptr,
194 jthreadGroup** groups_ptr) {
195 return ERR(NOT_IMPLEMENTED);
196 }
197
198 static jvmtiError GetStackTrace(jvmtiEnv* env,
199 jthread thread,
200 jint start_depth,
201 jint max_frame_count,
202 jvmtiFrameInfo* frame_buffer,
203 jint* count_ptr) {
204 return ERR(NOT_IMPLEMENTED);
205 }
206
207 static jvmtiError GetAllStackTraces(jvmtiEnv* env,
208 jint max_frame_count,
209 jvmtiStackInfo** stack_info_ptr,
210 jint* thread_count_ptr) {
211 return ERR(NOT_IMPLEMENTED);
212 }
213
214 static jvmtiError GetThreadListStackTraces(jvmtiEnv* env,
215 jint thread_count,
216 const jthread* thread_list,
217 jint max_frame_count,
218 jvmtiStackInfo** stack_info_ptr) {
219 return ERR(NOT_IMPLEMENTED);
220 }
221
222 static jvmtiError GetFrameCount(jvmtiEnv* env, jthread thread, jint* count_ptr) {
223 return ERR(NOT_IMPLEMENTED);
224 }
225
226 static jvmtiError PopFrame(jvmtiEnv* env, jthread thread) {
227 return ERR(NOT_IMPLEMENTED);
228 }
229
230 static jvmtiError GetFrameLocation(jvmtiEnv* env,
231 jthread thread,
232 jint depth,
233 jmethodID* method_ptr,
234 jlocation* location_ptr) {
235 return ERR(NOT_IMPLEMENTED);
236 }
237
238 static jvmtiError NotifyFramePop(jvmtiEnv* env, jthread thread, jint depth) {
239 return ERR(NOT_IMPLEMENTED);
240 }
241
242 static jvmtiError ForceEarlyReturnObject(jvmtiEnv* env, jthread thread, jobject value) {
243 return ERR(NOT_IMPLEMENTED);
244 }
245
246 static jvmtiError ForceEarlyReturnInt(jvmtiEnv* env, jthread thread, jint value) {
247 return ERR(NOT_IMPLEMENTED);
248 }
249
250 static jvmtiError ForceEarlyReturnLong(jvmtiEnv* env, jthread thread, jlong value) {
251 return ERR(NOT_IMPLEMENTED);
252 }
253
254 static jvmtiError ForceEarlyReturnFloat(jvmtiEnv* env, jthread thread, jfloat value) {
255 return ERR(NOT_IMPLEMENTED);
256 }
257
258 static jvmtiError ForceEarlyReturnDouble(jvmtiEnv* env, jthread thread, jdouble value) {
259 return ERR(NOT_IMPLEMENTED);
260 }
261
262 static jvmtiError ForceEarlyReturnVoid(jvmtiEnv* env, jthread thread) {
263 return ERR(NOT_IMPLEMENTED);
264 }
265
266 static jvmtiError FollowReferences(jvmtiEnv* env,
267 jint heap_filter,
268 jclass klass,
269 jobject initial_object,
270 const jvmtiHeapCallbacks* callbacks,
271 const void* user_data) {
272 return ERR(NOT_IMPLEMENTED);
273 }
274
275 static jvmtiError IterateThroughHeap(jvmtiEnv* env,
276 jint heap_filter,
277 jclass klass,
278 const jvmtiHeapCallbacks* callbacks,
279 const void* user_data) {
Andreas Gampee54d9922016-10-11 19:55:37 -0700280 HeapUtil heap_util(&gObjectTagTable);
281 return heap_util.IterateThroughHeap(env, heap_filter, klass, callbacks, user_data);
Alex Light49948e92016-08-11 15:35:28 -0700282 }
283
284 static jvmtiError GetTag(jvmtiEnv* env, jobject object, jlong* tag_ptr) {
Andreas Gampe6dee92e2016-09-12 19:58:13 -0700285 if (object == nullptr || tag_ptr == nullptr) {
286 return ERR(NULL_POINTER);
287 }
288
289 JNIEnv* jni_env = GetJniEnv(env);
290 if (jni_env == nullptr) {
291 return ERR(INTERNAL);
292 }
293
294 art::ScopedObjectAccess soa(jni_env);
295 art::ObjPtr<art::mirror::Object> obj = soa.Decode<art::mirror::Object>(object);
296 if (!gObjectTagTable.GetTag(obj.Ptr(), tag_ptr)) {
297 *tag_ptr = 0;
298 }
299
300 return ERR(NONE);
Alex Light49948e92016-08-11 15:35:28 -0700301 }
302
303 static jvmtiError SetTag(jvmtiEnv* env, jobject object, jlong tag) {
Andreas Gampe6dee92e2016-09-12 19:58:13 -0700304 if (object == nullptr) {
305 return ERR(NULL_POINTER);
306 }
307
308 JNIEnv* jni_env = GetJniEnv(env);
309 if (jni_env == nullptr) {
310 return ERR(INTERNAL);
311 }
312
313 art::ScopedObjectAccess soa(jni_env);
314 art::ObjPtr<art::mirror::Object> obj = soa.Decode<art::mirror::Object>(object);
Andreas Gampee54eee12016-10-20 19:03:58 -0700315 gObjectTagTable.Set(obj.Ptr(), tag);
Andreas Gampe6dee92e2016-09-12 19:58:13 -0700316
317 return ERR(NONE);
Alex Light49948e92016-08-11 15:35:28 -0700318 }
319
320 static jvmtiError GetObjectsWithTags(jvmtiEnv* env,
321 jint tag_count,
322 const jlong* tags,
323 jint* count_ptr,
324 jobject** object_result_ptr,
325 jlong** tag_result_ptr) {
Andreas Gampe5e6046b2016-10-25 12:05:53 -0700326 JNIEnv* jni_env = GetJniEnv(env);
327 if (jni_env == nullptr) {
328 return ERR(INTERNAL);
329 }
330
331 art::ScopedObjectAccess soa(jni_env);
332 return gObjectTagTable.GetTaggedObjects(env,
333 tag_count,
334 tags,
335 count_ptr,
336 object_result_ptr,
337 tag_result_ptr);
Alex Light49948e92016-08-11 15:35:28 -0700338 }
339
340 static jvmtiError ForceGarbageCollection(jvmtiEnv* env) {
341 return ERR(NOT_IMPLEMENTED);
342 }
343
344 static jvmtiError IterateOverObjectsReachableFromObject(
345 jvmtiEnv* env,
346 jobject object,
347 jvmtiObjectReferenceCallback object_reference_callback,
348 const void* user_data) {
349 return ERR(NOT_IMPLEMENTED);
350 }
351
352 static jvmtiError IterateOverReachableObjects(jvmtiEnv* env,
353 jvmtiHeapRootCallback heap_root_callback,
354 jvmtiStackReferenceCallback stack_ref_callback,
355 jvmtiObjectReferenceCallback object_ref_callback,
356 const void* user_data) {
357 return ERR(NOT_IMPLEMENTED);
358 }
359
360 static jvmtiError IterateOverHeap(jvmtiEnv* env,
361 jvmtiHeapObjectFilter object_filter,
362 jvmtiHeapObjectCallback heap_object_callback,
363 const void* user_data) {
364 return ERR(NOT_IMPLEMENTED);
365 }
366
367 static jvmtiError IterateOverInstancesOfClass(jvmtiEnv* env,
368 jclass klass,
369 jvmtiHeapObjectFilter object_filter,
370 jvmtiHeapObjectCallback heap_object_callback,
371 const void* user_data) {
372 return ERR(NOT_IMPLEMENTED);
373 }
374
375 static jvmtiError GetLocalObject(jvmtiEnv* env,
376 jthread thread,
377 jint depth,
378 jint slot,
379 jobject* value_ptr) {
380 return ERR(NOT_IMPLEMENTED);
381 }
382
383 static jvmtiError GetLocalInstance(jvmtiEnv* env,
384 jthread thread,
385 jint depth,
386 jobject* value_ptr) {
387 return ERR(NOT_IMPLEMENTED);
388 }
389
390 static jvmtiError GetLocalInt(jvmtiEnv* env,
391 jthread thread,
392 jint depth,
393 jint slot,
394 jint* value_ptr) {
395 return ERR(NOT_IMPLEMENTED);
396 }
397
398 static jvmtiError GetLocalLong(jvmtiEnv* env,
399 jthread thread,
400 jint depth,
401 jint slot,
402 jlong* value_ptr) {
403 return ERR(NOT_IMPLEMENTED);
404 }
405
406 static jvmtiError GetLocalFloat(jvmtiEnv* env,
407 jthread thread,
408 jint depth,
409 jint slot,
410 jfloat* value_ptr) {
411 return ERR(NOT_IMPLEMENTED);
412 }
413
414 static jvmtiError GetLocalDouble(jvmtiEnv* env,
415 jthread thread,
416 jint depth,
417 jint slot,
418 jdouble* value_ptr) {
419 return ERR(NOT_IMPLEMENTED);
420 }
421
422 static jvmtiError SetLocalObject(jvmtiEnv* env,
423 jthread thread,
424 jint depth,
425 jint slot,
426 jobject value) {
427 return ERR(NOT_IMPLEMENTED);
428 }
429
430 static jvmtiError SetLocalInt(jvmtiEnv* env,
431 jthread thread,
432 jint depth,
433 jint slot,
434 jint value) {
435 return ERR(NOT_IMPLEMENTED);
436 }
437
438 static jvmtiError SetLocalLong(jvmtiEnv* env,
439 jthread thread,
440 jint depth,
441 jint slot,
442 jlong value) {
443 return ERR(NOT_IMPLEMENTED);
444 }
445
446 static jvmtiError SetLocalFloat(jvmtiEnv* env,
447 jthread thread,
448 jint depth,
449 jint slot,
450 jfloat value) {
451 return ERR(NOT_IMPLEMENTED);
452 }
453
454 static jvmtiError SetLocalDouble(jvmtiEnv* env,
455 jthread thread,
456 jint depth,
457 jint slot,
458 jdouble value) {
459 return ERR(NOT_IMPLEMENTED);
460 }
461
462 static jvmtiError SetBreakpoint(jvmtiEnv* env, jmethodID method, jlocation location) {
463 return ERR(NOT_IMPLEMENTED);
464 }
465
466 static jvmtiError ClearBreakpoint(jvmtiEnv* env, jmethodID method, jlocation location) {
467 return ERR(NOT_IMPLEMENTED);
468 }
469
470 static jvmtiError SetFieldAccessWatch(jvmtiEnv* env, jclass klass, jfieldID field) {
471 return ERR(NOT_IMPLEMENTED);
472 }
473
474 static jvmtiError ClearFieldAccessWatch(jvmtiEnv* env, jclass klass, jfieldID field) {
475 return ERR(NOT_IMPLEMENTED);
476 }
477
478 static jvmtiError SetFieldModificationWatch(jvmtiEnv* env, jclass klass, jfieldID field) {
479 return ERR(NOT_IMPLEMENTED);
480 }
481
482 static jvmtiError ClearFieldModificationWatch(jvmtiEnv* env, jclass klass, jfieldID field) {
483 return ERR(NOT_IMPLEMENTED);
484 }
485
486 static jvmtiError GetLoadedClasses(jvmtiEnv* env, jint* class_count_ptr, jclass** classes_ptr) {
Andreas Gampeaa8b60c2016-10-12 12:51:25 -0700487 HeapUtil heap_util(&gObjectTagTable);
488 return heap_util.GetLoadedClasses(env, class_count_ptr, classes_ptr);
Alex Light49948e92016-08-11 15:35:28 -0700489 }
490
491 static jvmtiError GetClassLoaderClasses(jvmtiEnv* env,
492 jobject initiating_loader,
493 jint* class_count_ptr,
494 jclass** classes_ptr) {
495 return ERR(NOT_IMPLEMENTED);
496 }
497
498 static jvmtiError GetClassSignature(jvmtiEnv* env,
499 jclass klass,
500 char** signature_ptr,
501 char** generic_ptr) {
502 return ERR(NOT_IMPLEMENTED);
503 }
504
505 static jvmtiError GetClassStatus(jvmtiEnv* env, jclass klass, jint* status_ptr) {
506 return ERR(NOT_IMPLEMENTED);
507 }
508
509 static jvmtiError GetSourceFileName(jvmtiEnv* env, jclass klass, char** source_name_ptr) {
510 return ERR(NOT_IMPLEMENTED);
511 }
512
513 static jvmtiError GetClassModifiers(jvmtiEnv* env, jclass klass, jint* modifiers_ptr) {
514 return ERR(NOT_IMPLEMENTED);
515 }
516
517 static jvmtiError GetClassMethods(jvmtiEnv* env,
518 jclass klass,
519 jint* method_count_ptr,
520 jmethodID** methods_ptr) {
521 return ERR(NOT_IMPLEMENTED);
522 }
523
524 static jvmtiError GetClassFields(jvmtiEnv* env,
525 jclass klass,
526 jint* field_count_ptr,
527 jfieldID** fields_ptr) {
528 return ERR(NOT_IMPLEMENTED);
529 }
530
531 static jvmtiError GetImplementedInterfaces(jvmtiEnv* env,
532 jclass klass,
533 jint* interface_count_ptr,
534 jclass** interfaces_ptr) {
535 return ERR(NOT_IMPLEMENTED);
536 }
537
538 static jvmtiError GetClassVersionNumbers(jvmtiEnv* env,
539 jclass klass,
540 jint* minor_version_ptr,
541 jint* major_version_ptr) {
542 return ERR(NOT_IMPLEMENTED);
543 }
544
545 static jvmtiError GetConstantPool(jvmtiEnv* env,
546 jclass klass,
547 jint* constant_pool_count_ptr,
548 jint* constant_pool_byte_count_ptr,
549 unsigned char** constant_pool_bytes_ptr) {
550 return ERR(NOT_IMPLEMENTED);
551 }
552
553 static jvmtiError IsInterface(jvmtiEnv* env, jclass klass, jboolean* is_interface_ptr) {
554 return ERR(NOT_IMPLEMENTED);
555 }
556
557 static jvmtiError IsArrayClass(jvmtiEnv* env,
558 jclass klass,
559 jboolean* is_array_class_ptr) {
560 return ERR(NOT_IMPLEMENTED);
561 }
562
563 static jvmtiError IsModifiableClass(jvmtiEnv* env,
564 jclass klass,
565 jboolean* is_modifiable_class_ptr) {
566 return ERR(NOT_IMPLEMENTED);
567 }
568
569 static jvmtiError GetClassLoader(jvmtiEnv* env, jclass klass, jobject* classloader_ptr) {
570 return ERR(NOT_IMPLEMENTED);
571 }
572
573 static jvmtiError GetSourceDebugExtension(jvmtiEnv* env,
574 jclass klass,
575 char** source_debug_extension_ptr) {
576 return ERR(NOT_IMPLEMENTED);
577 }
578
579 static jvmtiError RetransformClasses(jvmtiEnv* env, jint class_count, const jclass* classes) {
580 return ERR(NOT_IMPLEMENTED);
581 }
582
583 static jvmtiError RedefineClasses(jvmtiEnv* env,
584 jint class_count,
585 const jvmtiClassDefinition* class_definitions) {
586 return ERR(NOT_IMPLEMENTED);
587 }
588
589 static jvmtiError GetObjectSize(jvmtiEnv* env, jobject object, jlong* size_ptr) {
590 return ERR(NOT_IMPLEMENTED);
591 }
592
593 static jvmtiError GetObjectHashCode(jvmtiEnv* env, jobject object, jint* hash_code_ptr) {
594 return ERR(NOT_IMPLEMENTED);
595 }
596
597 static jvmtiError GetObjectMonitorUsage(jvmtiEnv* env,
598 jobject object,
599 jvmtiMonitorUsage* info_ptr) {
600 return ERR(NOT_IMPLEMENTED);
601 }
602
603 static jvmtiError GetFieldName(jvmtiEnv* env,
604 jclass klass,
605 jfieldID field,
606 char** name_ptr,
607 char** signature_ptr,
608 char** generic_ptr) {
609 return ERR(NOT_IMPLEMENTED);
610 }
611
612 static jvmtiError GetFieldDeclaringClass(jvmtiEnv* env,
613 jclass klass,
614 jfieldID field,
615 jclass* declaring_class_ptr) {
616 return ERR(NOT_IMPLEMENTED);
617 }
618
619 static jvmtiError GetFieldModifiers(jvmtiEnv* env,
620 jclass klass,
621 jfieldID field,
622 jint* modifiers_ptr) {
623 return ERR(NOT_IMPLEMENTED);
624 }
625
626 static jvmtiError IsFieldSynthetic(jvmtiEnv* env,
627 jclass klass,
628 jfieldID field,
629 jboolean* is_synthetic_ptr) {
630 return ERR(NOT_IMPLEMENTED);
631 }
632
633 static jvmtiError GetMethodName(jvmtiEnv* env,
634 jmethodID method,
635 char** name_ptr,
636 char** signature_ptr,
637 char** generic_ptr) {
638 return ERR(NOT_IMPLEMENTED);
639 }
640
641 static jvmtiError GetMethodDeclaringClass(jvmtiEnv* env,
642 jmethodID method,
643 jclass* declaring_class_ptr) {
644 return ERR(NOT_IMPLEMENTED);
645 }
646
647 static jvmtiError GetMethodModifiers(jvmtiEnv* env,
648 jmethodID method,
649 jint* modifiers_ptr) {
650 return ERR(NOT_IMPLEMENTED);
651 }
652
653 static jvmtiError GetMaxLocals(jvmtiEnv* env,
654 jmethodID method,
655 jint* max_ptr) {
656 return ERR(NOT_IMPLEMENTED);
657 }
658
659 static jvmtiError GetArgumentsSize(jvmtiEnv* env,
660 jmethodID method,
661 jint* size_ptr) {
662 return ERR(NOT_IMPLEMENTED);
663 }
664
665 static jvmtiError GetLineNumberTable(jvmtiEnv* env,
666 jmethodID method,
667 jint* entry_count_ptr,
668 jvmtiLineNumberEntry** table_ptr) {
669 return ERR(NOT_IMPLEMENTED);
670 }
671
672 static jvmtiError GetMethodLocation(jvmtiEnv* env,
673 jmethodID method,
674 jlocation* start_location_ptr,
675 jlocation* end_location_ptr) {
676 return ERR(NOT_IMPLEMENTED);
677 }
678
679 static jvmtiError GetLocalVariableTable(jvmtiEnv* env,
680 jmethodID method,
681 jint* entry_count_ptr,
682 jvmtiLocalVariableEntry** table_ptr) {
683 return ERR(NOT_IMPLEMENTED);
684 }
685
686 static jvmtiError GetBytecodes(jvmtiEnv* env,
687 jmethodID method,
688 jint* bytecode_count_ptr,
689 unsigned char** bytecodes_ptr) {
690 return ERR(NOT_IMPLEMENTED);
691 }
692
693 static jvmtiError IsMethodNative(jvmtiEnv* env, jmethodID method, jboolean* is_native_ptr) {
694 return ERR(NOT_IMPLEMENTED);
695 }
696
697 static jvmtiError IsMethodSynthetic(jvmtiEnv* env, jmethodID method, jboolean* is_synthetic_ptr) {
698 return ERR(NOT_IMPLEMENTED);
699 }
700
701 static jvmtiError IsMethodObsolete(jvmtiEnv* env, jmethodID method, jboolean* is_obsolete_ptr) {
702 return ERR(NOT_IMPLEMENTED);
703 }
704
705 static jvmtiError SetNativeMethodPrefix(jvmtiEnv* env, const char* prefix) {
706 return ERR(NOT_IMPLEMENTED);
707 }
708
709 static jvmtiError SetNativeMethodPrefixes(jvmtiEnv* env, jint prefix_count, char** prefixes) {
710 return ERR(NOT_IMPLEMENTED);
711 }
712
713 static jvmtiError CreateRawMonitor(jvmtiEnv* env, const char* name, jrawMonitorID* monitor_ptr) {
714 return ERR(NOT_IMPLEMENTED);
715 }
716
717 static jvmtiError DestroyRawMonitor(jvmtiEnv* env, jrawMonitorID monitor) {
718 return ERR(NOT_IMPLEMENTED);
719 }
720
721 static jvmtiError RawMonitorEnter(jvmtiEnv* env, jrawMonitorID monitor) {
722 return ERR(NOT_IMPLEMENTED);
723 }
724
725 static jvmtiError RawMonitorExit(jvmtiEnv* env, jrawMonitorID monitor) {
726 return ERR(NOT_IMPLEMENTED);
727 }
728
729 static jvmtiError RawMonitorWait(jvmtiEnv* env, jrawMonitorID monitor, jlong millis) {
730 return ERR(NOT_IMPLEMENTED);
731 }
732
733 static jvmtiError RawMonitorNotify(jvmtiEnv* env, jrawMonitorID monitor) {
734 return ERR(NOT_IMPLEMENTED);
735 }
736
737 static jvmtiError RawMonitorNotifyAll(jvmtiEnv* env, jrawMonitorID monitor) {
738 return ERR(NOT_IMPLEMENTED);
739 }
740
741 static jvmtiError SetJNIFunctionTable(jvmtiEnv* env, const jniNativeInterface* function_table) {
742 return ERR(NOT_IMPLEMENTED);
743 }
744
745 static jvmtiError GetJNIFunctionTable(jvmtiEnv* env, jniNativeInterface** function_table) {
746 return ERR(NOT_IMPLEMENTED);
747 }
748
Andreas Gampe77708d92016-10-07 11:48:21 -0700749 // TODO: This will require locking, so that an agent can't remove callbacks when we're dispatching
750 // an event.
Alex Light49948e92016-08-11 15:35:28 -0700751 static jvmtiError SetEventCallbacks(jvmtiEnv* env,
752 const jvmtiEventCallbacks* callbacks,
753 jint size_of_callbacks) {
Andreas Gampe77708d92016-10-07 11:48:21 -0700754 if (env == nullptr) {
755 return ERR(NULL_POINTER);
756 }
757 if (size_of_callbacks < 0) {
758 return ERR(ILLEGAL_ARGUMENT);
759 }
760
761 if (callbacks == nullptr) {
762 ArtJvmTiEnv::AsArtJvmTiEnv(env)->event_callbacks.reset();
763 return ERR(NONE);
764 }
765
766 std::unique_ptr<jvmtiEventCallbacks> tmp(new jvmtiEventCallbacks());
767 memset(tmp.get(), 0, sizeof(jvmtiEventCallbacks));
768 size_t copy_size = std::min(sizeof(jvmtiEventCallbacks),
769 static_cast<size_t>(size_of_callbacks));
770 copy_size = art::RoundDown(copy_size, sizeof(void*));
771 memcpy(tmp.get(), callbacks, copy_size);
772
773 ArtJvmTiEnv::AsArtJvmTiEnv(env)->event_callbacks = std::move(tmp);
774
775 return ERR(NONE);
Alex Light49948e92016-08-11 15:35:28 -0700776 }
777
778 static jvmtiError SetEventNotificationMode(jvmtiEnv* env,
779 jvmtiEventMode mode,
780 jvmtiEvent event_type,
781 jthread event_thread,
782 ...) {
Andreas Gampe77708d92016-10-07 11:48:21 -0700783 art::Thread* art_thread = nullptr;
784 if (event_thread != nullptr) {
785 // TODO: Need non-aborting call here, to return JVMTI_ERROR_INVALID_THREAD.
786 art::ScopedObjectAccess soa(art::Thread::Current());
787 art::MutexLock mu(soa.Self(), *art::Locks::thread_list_lock_);
788 art_thread = art::Thread::FromManagedThread(soa, event_thread);
789
790 if (art_thread == nullptr || // The thread hasn't been started or is already dead.
791 art_thread->IsStillStarting()) {
792 // TODO: We may want to let the EventHandler know, so it could clean up masks, potentially.
793 return ERR(THREAD_NOT_ALIVE);
794 }
795 }
796
797 return gEventHandler.SetEvent(ArtJvmTiEnv::AsArtJvmTiEnv(env), art_thread, event_type, mode);
Alex Light49948e92016-08-11 15:35:28 -0700798 }
799
800 static jvmtiError GenerateEvents(jvmtiEnv* env, jvmtiEvent event_type) {
801 return ERR(NOT_IMPLEMENTED);
802 }
803
804 static jvmtiError GetExtensionFunctions(jvmtiEnv* env,
805 jint* extension_count_ptr,
806 jvmtiExtensionFunctionInfo** extensions) {
807 return ERR(NOT_IMPLEMENTED);
808 }
809
810 static jvmtiError GetExtensionEvents(jvmtiEnv* env,
811 jint* extension_count_ptr,
812 jvmtiExtensionEventInfo** extensions) {
813 return ERR(NOT_IMPLEMENTED);
814 }
815
816 static jvmtiError SetExtensionEventCallback(jvmtiEnv* env,
817 jint extension_event_index,
818 jvmtiExtensionEvent callback) {
819 return ERR(NOT_IMPLEMENTED);
820 }
821
822 static jvmtiError GetPotentialCapabilities(jvmtiEnv* env, jvmtiCapabilities* capabilities_ptr) {
823 return ERR(NOT_IMPLEMENTED);
824 }
825
826 static jvmtiError AddCapabilities(jvmtiEnv* env, const jvmtiCapabilities* capabilities_ptr) {
827 return ERR(NOT_IMPLEMENTED);
828 }
829
830 static jvmtiError RelinquishCapabilities(jvmtiEnv* env,
831 const jvmtiCapabilities* capabilities_ptr) {
832 return ERR(NOT_IMPLEMENTED);
833 }
834
835 static jvmtiError GetCapabilities(jvmtiEnv* env, jvmtiCapabilities* capabilities_ptr) {
836 return ERR(NOT_IMPLEMENTED);
837 }
838
839 static jvmtiError GetCurrentThreadCpuTimerInfo(jvmtiEnv* env, jvmtiTimerInfo* info_ptr) {
840 return ERR(NOT_IMPLEMENTED);
841 }
842
843 static jvmtiError GetCurrentThreadCpuTime(jvmtiEnv* env, jlong* nanos_ptr) {
844 return ERR(NOT_IMPLEMENTED);
845 }
846
847 static jvmtiError GetThreadCpuTimerInfo(jvmtiEnv* env, jvmtiTimerInfo* info_ptr) {
848 return ERR(NOT_IMPLEMENTED);
849 }
850
851 static jvmtiError GetThreadCpuTime(jvmtiEnv* env, jthread thread, jlong* nanos_ptr) {
852 return ERR(NOT_IMPLEMENTED);
853 }
854
855 static jvmtiError GetTimerInfo(jvmtiEnv* env, jvmtiTimerInfo* info_ptr) {
856 return ERR(NOT_IMPLEMENTED);
857 }
858
859 static jvmtiError GetTime(jvmtiEnv* env, jlong* nanos_ptr) {
860 return ERR(NOT_IMPLEMENTED);
861 }
862
863 static jvmtiError GetAvailableProcessors(jvmtiEnv* env, jint* processor_count_ptr) {
864 return ERR(NOT_IMPLEMENTED);
865 }
866
867 static jvmtiError AddToBootstrapClassLoaderSearch(jvmtiEnv* env, const char* segment) {
868 return ERR(NOT_IMPLEMENTED);
869 }
870
871 static jvmtiError AddToSystemClassLoaderSearch(jvmtiEnv* env, const char* segment) {
872 return ERR(NOT_IMPLEMENTED);
873 }
874
875 static jvmtiError GetSystemProperties(jvmtiEnv* env, jint* count_ptr, char*** property_ptr) {
876 return ERR(NOT_IMPLEMENTED);
877 }
878
879 static jvmtiError GetSystemProperty(jvmtiEnv* env, const char* property, char** value_ptr) {
880 return ERR(NOT_IMPLEMENTED);
881 }
882
883 static jvmtiError SetSystemProperty(jvmtiEnv* env, const char* property, const char* value) {
884 return ERR(NOT_IMPLEMENTED);
885 }
886
887 static jvmtiError GetPhase(jvmtiEnv* env, jvmtiPhase* phase_ptr) {
888 return ERR(NOT_IMPLEMENTED);
889 }
890
891 static jvmtiError DisposeEnvironment(jvmtiEnv* env) {
892 if (!IsValidEnv(env)) {
893 return ERR(INVALID_ENVIRONMENT);
894 }
895 delete env;
896 return OK;
897 }
898
899 static jvmtiError SetEnvironmentLocalStorage(jvmtiEnv* env, const void* data) {
900 if (!IsValidEnv(env)) {
901 return ERR(INVALID_ENVIRONMENT);
902 }
903 reinterpret_cast<ArtJvmTiEnv*>(env)->local_data = const_cast<void*>(data);
904 return OK;
905 }
906
907 static jvmtiError GetEnvironmentLocalStorage(jvmtiEnv* env, void** data_ptr) {
908 if (!IsValidEnv(env)) {
909 return ERR(INVALID_ENVIRONMENT);
910 }
911 *data_ptr = reinterpret_cast<ArtJvmTiEnv*>(env)->local_data;
912 return OK;
913 }
914
915 static jvmtiError GetVersionNumber(jvmtiEnv* env, jint* version_ptr) {
916 if (!IsValidEnv(env)) {
917 return ERR(INVALID_ENVIRONMENT);
918 }
919 *version_ptr = JVMTI_VERSION;
920 return OK;
921 }
922
923 static jvmtiError GetErrorName(jvmtiEnv* env, jvmtiError error, char** name_ptr) {
924 if (!IsValidEnv(env)) {
925 return ERR(INVALID_ENVIRONMENT);
926 }
927 if (name_ptr == nullptr) {
928 return ERR(NULL_POINTER);
929 }
930 switch (error) {
931#define ERROR_CASE(e) case (JVMTI_ERROR_ ## e) : do { \
932 *name_ptr = const_cast<char*>("JVMTI_ERROR_"#e); \
933 return OK; \
934 } while (false)
935 ERROR_CASE(NONE);
936 ERROR_CASE(INVALID_THREAD);
937 ERROR_CASE(INVALID_THREAD_GROUP);
938 ERROR_CASE(INVALID_PRIORITY);
939 ERROR_CASE(THREAD_NOT_SUSPENDED);
940 ERROR_CASE(THREAD_NOT_ALIVE);
941 ERROR_CASE(INVALID_OBJECT);
942 ERROR_CASE(INVALID_CLASS);
943 ERROR_CASE(CLASS_NOT_PREPARED);
944 ERROR_CASE(INVALID_METHODID);
945 ERROR_CASE(INVALID_LOCATION);
946 ERROR_CASE(INVALID_FIELDID);
947 ERROR_CASE(NO_MORE_FRAMES);
948 ERROR_CASE(OPAQUE_FRAME);
949 ERROR_CASE(TYPE_MISMATCH);
950 ERROR_CASE(INVALID_SLOT);
951 ERROR_CASE(DUPLICATE);
952 ERROR_CASE(NOT_FOUND);
953 ERROR_CASE(INVALID_MONITOR);
954 ERROR_CASE(NOT_MONITOR_OWNER);
955 ERROR_CASE(INTERRUPT);
956 ERROR_CASE(INVALID_CLASS_FORMAT);
957 ERROR_CASE(CIRCULAR_CLASS_DEFINITION);
958 ERROR_CASE(FAILS_VERIFICATION);
959 ERROR_CASE(UNSUPPORTED_REDEFINITION_METHOD_ADDED);
960 ERROR_CASE(UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED);
961 ERROR_CASE(INVALID_TYPESTATE);
962 ERROR_CASE(UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED);
963 ERROR_CASE(UNSUPPORTED_REDEFINITION_METHOD_DELETED);
964 ERROR_CASE(UNSUPPORTED_VERSION);
965 ERROR_CASE(NAMES_DONT_MATCH);
966 ERROR_CASE(UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED);
967 ERROR_CASE(UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED);
968 ERROR_CASE(UNMODIFIABLE_CLASS);
969 ERROR_CASE(NOT_AVAILABLE);
970 ERROR_CASE(MUST_POSSESS_CAPABILITY);
971 ERROR_CASE(NULL_POINTER);
972 ERROR_CASE(ABSENT_INFORMATION);
973 ERROR_CASE(INVALID_EVENT_TYPE);
974 ERROR_CASE(ILLEGAL_ARGUMENT);
975 ERROR_CASE(NATIVE_METHOD);
976 ERROR_CASE(CLASS_LOADER_UNSUPPORTED);
977 ERROR_CASE(OUT_OF_MEMORY);
978 ERROR_CASE(ACCESS_DENIED);
979 ERROR_CASE(WRONG_PHASE);
980 ERROR_CASE(INTERNAL);
981 ERROR_CASE(UNATTACHED_THREAD);
982 ERROR_CASE(INVALID_ENVIRONMENT);
983#undef ERROR_CASE
984 default: {
985 *name_ptr = const_cast<char*>("JVMTI_ERROR_UNKNOWN");
986 return ERR(ILLEGAL_ARGUMENT);
987 }
988 }
989 }
990
991 static jvmtiError SetVerboseFlag(jvmtiEnv* env, jvmtiVerboseFlag flag, jboolean value) {
992 return ERR(NOT_IMPLEMENTED);
993 }
994
995 static jvmtiError GetJLocationFormat(jvmtiEnv* env, jvmtiJlocationFormat* format_ptr) {
996 return ERR(NOT_IMPLEMENTED);
997 }
Alex Light9c20a142016-08-23 15:05:12 -0700998
999 // TODO Remove this once events are working.
1000 static jvmtiError RetransformClassWithHook(jvmtiEnv* env,
1001 jclass klass,
1002 jvmtiEventClassFileLoadHook hook) {
1003 std::vector<jclass> classes;
1004 classes.push_back(klass);
1005 return RetransformClassesWithHook(reinterpret_cast<ArtJvmTiEnv*>(env), classes, hook);
1006 }
1007
1008 // TODO This will be called by the event handler for the art::ti Event Load Event
1009 static jvmtiError RetransformClassesWithHook(ArtJvmTiEnv* env,
1010 const std::vector<jclass>& classes,
1011 jvmtiEventClassFileLoadHook hook) {
1012 if (!IsValidEnv(env)) {
1013 return ERR(INVALID_ENVIRONMENT);
1014 }
1015 for (jclass klass : classes) {
1016 JNIEnv* jni_env = nullptr;
1017 jobject loader = nullptr;
1018 std::string name;
1019 jobject protection_domain = nullptr;
1020 jint data_len = 0;
1021 unsigned char* dex_data = nullptr;
1022 jvmtiError ret = OK;
1023 std::string location;
1024 if ((ret = GetTransformationData(env,
1025 klass,
1026 /*out*/&location,
1027 /*out*/&jni_env,
1028 /*out*/&loader,
1029 /*out*/&name,
1030 /*out*/&protection_domain,
1031 /*out*/&data_len,
1032 /*out*/&dex_data)) != OK) {
1033 // TODO Do something more here? Maybe give log statements?
1034 return ret;
1035 }
1036 jint new_data_len = 0;
1037 unsigned char* new_dex_data = nullptr;
1038 hook(env,
1039 jni_env,
1040 klass,
1041 loader,
1042 name.c_str(),
1043 protection_domain,
1044 data_len,
1045 dex_data,
1046 /*out*/&new_data_len,
1047 /*out*/&new_dex_data);
1048 // Check if anything actually changed.
1049 if ((new_data_len != 0 || new_dex_data != nullptr) && new_dex_data != dex_data) {
1050 MoveTransformedFileIntoRuntime(klass, std::move(location), new_data_len, new_dex_data);
1051 env->Deallocate(new_dex_data);
1052 }
1053 // Deallocate the old dex data.
1054 env->Deallocate(dex_data);
1055 }
1056 return OK;
1057 }
Alex Light49948e92016-08-11 15:35:28 -07001058};
1059
1060static bool IsJvmtiVersion(jint version) {
1061 return version == JVMTI_VERSION_1 ||
1062 version == JVMTI_VERSION_1_0 ||
1063 version == JVMTI_VERSION_1_1 ||
1064 version == JVMTI_VERSION_1_2 ||
1065 version == JVMTI_VERSION;
1066}
1067
1068// Creates a jvmtiEnv and returns it with the art::ti::Env that is associated with it. new_art_ti
1069// is a pointer to the uninitialized memory for an art::ti::Env.
1070static void CreateArtJvmTiEnv(art::JavaVMExt* vm, /*out*/void** new_jvmtiEnv) {
1071 struct ArtJvmTiEnv* env = new ArtJvmTiEnv(vm);
1072 *new_jvmtiEnv = env;
Andreas Gampe77708d92016-10-07 11:48:21 -07001073
1074 gEventHandler.RegisterArtJvmTiEnv(env);
Alex Light49948e92016-08-11 15:35:28 -07001075}
1076
1077// A hook that the runtime uses to allow plugins to handle GetEnv calls. It returns true and
1078// places the return value in 'env' if this library can handle the GetEnv request. Otherwise
1079// returns false and does not modify the 'env' pointer.
1080static jint GetEnvHandler(art::JavaVMExt* vm, /*out*/void** env, jint version) {
1081 if (IsJvmtiVersion(version)) {
1082 CreateArtJvmTiEnv(vm, env);
1083 return JNI_OK;
1084 } else {
1085 printf("version 0x%x is not valid!", version);
1086 return JNI_EVERSION;
1087 }
1088}
1089
1090// The plugin initialization function. This adds the jvmti environment.
1091extern "C" bool ArtPlugin_Initialize() {
Andreas Gampee08a2be2016-10-06 13:13:30 -07001092 art::Runtime* runtime = art::Runtime::Current();
1093 runtime->GetJavaVM()->AddEnvironmentHook(GetEnvHandler);
1094 runtime->AddSystemWeakHolder(&gObjectTagTable);
Alex Light49948e92016-08-11 15:35:28 -07001095 return true;
1096}
1097
1098// The actual struct holding all of the entrypoints into the jvmti interface.
1099const jvmtiInterface_1 gJvmtiInterface = {
Alex Light9c20a142016-08-23 15:05:12 -07001100 // SPECIAL FUNCTION: RetransformClassWithHook Is normally reserved1
1101 // TODO Remove once we have events working.
1102 reinterpret_cast<void*>(JvmtiFunctions::RetransformClassWithHook),
1103 // nullptr, // reserved1
Alex Light49948e92016-08-11 15:35:28 -07001104 JvmtiFunctions::SetEventNotificationMode,
1105 nullptr, // reserved3
1106 JvmtiFunctions::GetAllThreads,
1107 JvmtiFunctions::SuspendThread,
1108 JvmtiFunctions::ResumeThread,
1109 JvmtiFunctions::StopThread,
1110 JvmtiFunctions::InterruptThread,
1111 JvmtiFunctions::GetThreadInfo,
1112 JvmtiFunctions::GetOwnedMonitorInfo, // 10
1113 JvmtiFunctions::GetCurrentContendedMonitor,
1114 JvmtiFunctions::RunAgentThread,
1115 JvmtiFunctions::GetTopThreadGroups,
1116 JvmtiFunctions::GetThreadGroupInfo,
1117 JvmtiFunctions::GetThreadGroupChildren,
1118 JvmtiFunctions::GetFrameCount,
1119 JvmtiFunctions::GetThreadState,
1120 JvmtiFunctions::GetCurrentThread,
1121 JvmtiFunctions::GetFrameLocation,
1122 JvmtiFunctions::NotifyFramePop, // 20
1123 JvmtiFunctions::GetLocalObject,
1124 JvmtiFunctions::GetLocalInt,
1125 JvmtiFunctions::GetLocalLong,
1126 JvmtiFunctions::GetLocalFloat,
1127 JvmtiFunctions::GetLocalDouble,
1128 JvmtiFunctions::SetLocalObject,
1129 JvmtiFunctions::SetLocalInt,
1130 JvmtiFunctions::SetLocalLong,
1131 JvmtiFunctions::SetLocalFloat,
1132 JvmtiFunctions::SetLocalDouble, // 30
1133 JvmtiFunctions::CreateRawMonitor,
1134 JvmtiFunctions::DestroyRawMonitor,
1135 JvmtiFunctions::RawMonitorEnter,
1136 JvmtiFunctions::RawMonitorExit,
1137 JvmtiFunctions::RawMonitorWait,
1138 JvmtiFunctions::RawMonitorNotify,
1139 JvmtiFunctions::RawMonitorNotifyAll,
1140 JvmtiFunctions::SetBreakpoint,
1141 JvmtiFunctions::ClearBreakpoint,
1142 nullptr, // reserved40
1143 JvmtiFunctions::SetFieldAccessWatch,
1144 JvmtiFunctions::ClearFieldAccessWatch,
1145 JvmtiFunctions::SetFieldModificationWatch,
1146 JvmtiFunctions::ClearFieldModificationWatch,
1147 JvmtiFunctions::IsModifiableClass,
1148 JvmtiFunctions::Allocate,
1149 JvmtiFunctions::Deallocate,
1150 JvmtiFunctions::GetClassSignature,
1151 JvmtiFunctions::GetClassStatus,
1152 JvmtiFunctions::GetSourceFileName, // 50
1153 JvmtiFunctions::GetClassModifiers,
1154 JvmtiFunctions::GetClassMethods,
1155 JvmtiFunctions::GetClassFields,
1156 JvmtiFunctions::GetImplementedInterfaces,
1157 JvmtiFunctions::IsInterface,
1158 JvmtiFunctions::IsArrayClass,
1159 JvmtiFunctions::GetClassLoader,
1160 JvmtiFunctions::GetObjectHashCode,
1161 JvmtiFunctions::GetObjectMonitorUsage,
1162 JvmtiFunctions::GetFieldName, // 60
1163 JvmtiFunctions::GetFieldDeclaringClass,
1164 JvmtiFunctions::GetFieldModifiers,
1165 JvmtiFunctions::IsFieldSynthetic,
1166 JvmtiFunctions::GetMethodName,
1167 JvmtiFunctions::GetMethodDeclaringClass,
1168 JvmtiFunctions::GetMethodModifiers,
1169 nullptr, // reserved67
1170 JvmtiFunctions::GetMaxLocals,
1171 JvmtiFunctions::GetArgumentsSize,
1172 JvmtiFunctions::GetLineNumberTable, // 70
1173 JvmtiFunctions::GetMethodLocation,
1174 JvmtiFunctions::GetLocalVariableTable,
1175 JvmtiFunctions::SetNativeMethodPrefix,
1176 JvmtiFunctions::SetNativeMethodPrefixes,
1177 JvmtiFunctions::GetBytecodes,
1178 JvmtiFunctions::IsMethodNative,
1179 JvmtiFunctions::IsMethodSynthetic,
1180 JvmtiFunctions::GetLoadedClasses,
1181 JvmtiFunctions::GetClassLoaderClasses,
1182 JvmtiFunctions::PopFrame, // 80
1183 JvmtiFunctions::ForceEarlyReturnObject,
1184 JvmtiFunctions::ForceEarlyReturnInt,
1185 JvmtiFunctions::ForceEarlyReturnLong,
1186 JvmtiFunctions::ForceEarlyReturnFloat,
1187 JvmtiFunctions::ForceEarlyReturnDouble,
1188 JvmtiFunctions::ForceEarlyReturnVoid,
1189 JvmtiFunctions::RedefineClasses,
1190 JvmtiFunctions::GetVersionNumber,
1191 JvmtiFunctions::GetCapabilities,
1192 JvmtiFunctions::GetSourceDebugExtension, // 90
1193 JvmtiFunctions::IsMethodObsolete,
1194 JvmtiFunctions::SuspendThreadList,
1195 JvmtiFunctions::ResumeThreadList,
1196 nullptr, // reserved94
1197 nullptr, // reserved95
1198 nullptr, // reserved96
1199 nullptr, // reserved97
1200 nullptr, // reserved98
1201 nullptr, // reserved99
1202 JvmtiFunctions::GetAllStackTraces, // 100
1203 JvmtiFunctions::GetThreadListStackTraces,
1204 JvmtiFunctions::GetThreadLocalStorage,
1205 JvmtiFunctions::SetThreadLocalStorage,
1206 JvmtiFunctions::GetStackTrace,
1207 nullptr, // reserved105
1208 JvmtiFunctions::GetTag,
1209 JvmtiFunctions::SetTag,
1210 JvmtiFunctions::ForceGarbageCollection,
1211 JvmtiFunctions::IterateOverObjectsReachableFromObject,
1212 JvmtiFunctions::IterateOverReachableObjects, // 110
1213 JvmtiFunctions::IterateOverHeap,
1214 JvmtiFunctions::IterateOverInstancesOfClass,
1215 nullptr, // reserved113
1216 JvmtiFunctions::GetObjectsWithTags,
1217 JvmtiFunctions::FollowReferences,
1218 JvmtiFunctions::IterateThroughHeap,
1219 nullptr, // reserved117
1220 nullptr, // reserved118
1221 nullptr, // reserved119
1222 JvmtiFunctions::SetJNIFunctionTable, // 120
1223 JvmtiFunctions::GetJNIFunctionTable,
1224 JvmtiFunctions::SetEventCallbacks,
1225 JvmtiFunctions::GenerateEvents,
1226 JvmtiFunctions::GetExtensionFunctions,
1227 JvmtiFunctions::GetExtensionEvents,
1228 JvmtiFunctions::SetExtensionEventCallback,
1229 JvmtiFunctions::DisposeEnvironment,
1230 JvmtiFunctions::GetErrorName,
1231 JvmtiFunctions::GetJLocationFormat,
1232 JvmtiFunctions::GetSystemProperties, // 130
1233 JvmtiFunctions::GetSystemProperty,
1234 JvmtiFunctions::SetSystemProperty,
1235 JvmtiFunctions::GetPhase,
1236 JvmtiFunctions::GetCurrentThreadCpuTimerInfo,
1237 JvmtiFunctions::GetCurrentThreadCpuTime,
1238 JvmtiFunctions::GetThreadCpuTimerInfo,
1239 JvmtiFunctions::GetThreadCpuTime,
1240 JvmtiFunctions::GetTimerInfo,
1241 JvmtiFunctions::GetTime,
1242 JvmtiFunctions::GetPotentialCapabilities, // 140
1243 nullptr, // reserved141
1244 JvmtiFunctions::AddCapabilities,
1245 JvmtiFunctions::RelinquishCapabilities,
1246 JvmtiFunctions::GetAvailableProcessors,
1247 JvmtiFunctions::GetClassVersionNumbers,
1248 JvmtiFunctions::GetConstantPool,
1249 JvmtiFunctions::GetEnvironmentLocalStorage,
1250 JvmtiFunctions::SetEnvironmentLocalStorage,
1251 JvmtiFunctions::AddToBootstrapClassLoaderSearch,
1252 JvmtiFunctions::SetVerboseFlag, // 150
1253 JvmtiFunctions::AddToSystemClassLoaderSearch,
1254 JvmtiFunctions::RetransformClasses,
1255 JvmtiFunctions::GetOwnedMonitorStackDepthInfo,
1256 JvmtiFunctions::GetObjectSize,
1257 JvmtiFunctions::GetLocalInstance,
1258};
1259
1260}; // namespace openjdkjvmti