blob: ac8d5e12d1260bc4c079dc2d5156b3aef56801a5 [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);
315 gObjectTagTable.Remove(obj.Ptr(), /* tag* */ nullptr);
316 if (tag != 0) {
317 gObjectTagTable.Add(obj.Ptr(), tag);
318 }
319
320 return ERR(NONE);
Alex Light49948e92016-08-11 15:35:28 -0700321 }
322
323 static jvmtiError GetObjectsWithTags(jvmtiEnv* env,
324 jint tag_count,
325 const jlong* tags,
326 jint* count_ptr,
327 jobject** object_result_ptr,
328 jlong** tag_result_ptr) {
329 return ERR(NOT_IMPLEMENTED);
330 }
331
332 static jvmtiError ForceGarbageCollection(jvmtiEnv* env) {
333 return ERR(NOT_IMPLEMENTED);
334 }
335
336 static jvmtiError IterateOverObjectsReachableFromObject(
337 jvmtiEnv* env,
338 jobject object,
339 jvmtiObjectReferenceCallback object_reference_callback,
340 const void* user_data) {
341 return ERR(NOT_IMPLEMENTED);
342 }
343
344 static jvmtiError IterateOverReachableObjects(jvmtiEnv* env,
345 jvmtiHeapRootCallback heap_root_callback,
346 jvmtiStackReferenceCallback stack_ref_callback,
347 jvmtiObjectReferenceCallback object_ref_callback,
348 const void* user_data) {
349 return ERR(NOT_IMPLEMENTED);
350 }
351
352 static jvmtiError IterateOverHeap(jvmtiEnv* env,
353 jvmtiHeapObjectFilter object_filter,
354 jvmtiHeapObjectCallback heap_object_callback,
355 const void* user_data) {
356 return ERR(NOT_IMPLEMENTED);
357 }
358
359 static jvmtiError IterateOverInstancesOfClass(jvmtiEnv* env,
360 jclass klass,
361 jvmtiHeapObjectFilter object_filter,
362 jvmtiHeapObjectCallback heap_object_callback,
363 const void* user_data) {
364 return ERR(NOT_IMPLEMENTED);
365 }
366
367 static jvmtiError GetLocalObject(jvmtiEnv* env,
368 jthread thread,
369 jint depth,
370 jint slot,
371 jobject* value_ptr) {
372 return ERR(NOT_IMPLEMENTED);
373 }
374
375 static jvmtiError GetLocalInstance(jvmtiEnv* env,
376 jthread thread,
377 jint depth,
378 jobject* value_ptr) {
379 return ERR(NOT_IMPLEMENTED);
380 }
381
382 static jvmtiError GetLocalInt(jvmtiEnv* env,
383 jthread thread,
384 jint depth,
385 jint slot,
386 jint* value_ptr) {
387 return ERR(NOT_IMPLEMENTED);
388 }
389
390 static jvmtiError GetLocalLong(jvmtiEnv* env,
391 jthread thread,
392 jint depth,
393 jint slot,
394 jlong* value_ptr) {
395 return ERR(NOT_IMPLEMENTED);
396 }
397
398 static jvmtiError GetLocalFloat(jvmtiEnv* env,
399 jthread thread,
400 jint depth,
401 jint slot,
402 jfloat* value_ptr) {
403 return ERR(NOT_IMPLEMENTED);
404 }
405
406 static jvmtiError GetLocalDouble(jvmtiEnv* env,
407 jthread thread,
408 jint depth,
409 jint slot,
410 jdouble* value_ptr) {
411 return ERR(NOT_IMPLEMENTED);
412 }
413
414 static jvmtiError SetLocalObject(jvmtiEnv* env,
415 jthread thread,
416 jint depth,
417 jint slot,
418 jobject value) {
419 return ERR(NOT_IMPLEMENTED);
420 }
421
422 static jvmtiError SetLocalInt(jvmtiEnv* env,
423 jthread thread,
424 jint depth,
425 jint slot,
426 jint value) {
427 return ERR(NOT_IMPLEMENTED);
428 }
429
430 static jvmtiError SetLocalLong(jvmtiEnv* env,
431 jthread thread,
432 jint depth,
433 jint slot,
434 jlong value) {
435 return ERR(NOT_IMPLEMENTED);
436 }
437
438 static jvmtiError SetLocalFloat(jvmtiEnv* env,
439 jthread thread,
440 jint depth,
441 jint slot,
442 jfloat value) {
443 return ERR(NOT_IMPLEMENTED);
444 }
445
446 static jvmtiError SetLocalDouble(jvmtiEnv* env,
447 jthread thread,
448 jint depth,
449 jint slot,
450 jdouble value) {
451 return ERR(NOT_IMPLEMENTED);
452 }
453
454 static jvmtiError SetBreakpoint(jvmtiEnv* env, jmethodID method, jlocation location) {
455 return ERR(NOT_IMPLEMENTED);
456 }
457
458 static jvmtiError ClearBreakpoint(jvmtiEnv* env, jmethodID method, jlocation location) {
459 return ERR(NOT_IMPLEMENTED);
460 }
461
462 static jvmtiError SetFieldAccessWatch(jvmtiEnv* env, jclass klass, jfieldID field) {
463 return ERR(NOT_IMPLEMENTED);
464 }
465
466 static jvmtiError ClearFieldAccessWatch(jvmtiEnv* env, jclass klass, jfieldID field) {
467 return ERR(NOT_IMPLEMENTED);
468 }
469
470 static jvmtiError SetFieldModificationWatch(jvmtiEnv* env, jclass klass, jfieldID field) {
471 return ERR(NOT_IMPLEMENTED);
472 }
473
474 static jvmtiError ClearFieldModificationWatch(jvmtiEnv* env, jclass klass, jfieldID field) {
475 return ERR(NOT_IMPLEMENTED);
476 }
477
478 static jvmtiError GetLoadedClasses(jvmtiEnv* env, jint* class_count_ptr, jclass** classes_ptr) {
Andreas Gampeaa8b60c2016-10-12 12:51:25 -0700479 HeapUtil heap_util(&gObjectTagTable);
480 return heap_util.GetLoadedClasses(env, class_count_ptr, classes_ptr);
Alex Light49948e92016-08-11 15:35:28 -0700481 }
482
483 static jvmtiError GetClassLoaderClasses(jvmtiEnv* env,
484 jobject initiating_loader,
485 jint* class_count_ptr,
486 jclass** classes_ptr) {
487 return ERR(NOT_IMPLEMENTED);
488 }
489
490 static jvmtiError GetClassSignature(jvmtiEnv* env,
491 jclass klass,
492 char** signature_ptr,
493 char** generic_ptr) {
494 return ERR(NOT_IMPLEMENTED);
495 }
496
497 static jvmtiError GetClassStatus(jvmtiEnv* env, jclass klass, jint* status_ptr) {
498 return ERR(NOT_IMPLEMENTED);
499 }
500
501 static jvmtiError GetSourceFileName(jvmtiEnv* env, jclass klass, char** source_name_ptr) {
502 return ERR(NOT_IMPLEMENTED);
503 }
504
505 static jvmtiError GetClassModifiers(jvmtiEnv* env, jclass klass, jint* modifiers_ptr) {
506 return ERR(NOT_IMPLEMENTED);
507 }
508
509 static jvmtiError GetClassMethods(jvmtiEnv* env,
510 jclass klass,
511 jint* method_count_ptr,
512 jmethodID** methods_ptr) {
513 return ERR(NOT_IMPLEMENTED);
514 }
515
516 static jvmtiError GetClassFields(jvmtiEnv* env,
517 jclass klass,
518 jint* field_count_ptr,
519 jfieldID** fields_ptr) {
520 return ERR(NOT_IMPLEMENTED);
521 }
522
523 static jvmtiError GetImplementedInterfaces(jvmtiEnv* env,
524 jclass klass,
525 jint* interface_count_ptr,
526 jclass** interfaces_ptr) {
527 return ERR(NOT_IMPLEMENTED);
528 }
529
530 static jvmtiError GetClassVersionNumbers(jvmtiEnv* env,
531 jclass klass,
532 jint* minor_version_ptr,
533 jint* major_version_ptr) {
534 return ERR(NOT_IMPLEMENTED);
535 }
536
537 static jvmtiError GetConstantPool(jvmtiEnv* env,
538 jclass klass,
539 jint* constant_pool_count_ptr,
540 jint* constant_pool_byte_count_ptr,
541 unsigned char** constant_pool_bytes_ptr) {
542 return ERR(NOT_IMPLEMENTED);
543 }
544
545 static jvmtiError IsInterface(jvmtiEnv* env, jclass klass, jboolean* is_interface_ptr) {
546 return ERR(NOT_IMPLEMENTED);
547 }
548
549 static jvmtiError IsArrayClass(jvmtiEnv* env,
550 jclass klass,
551 jboolean* is_array_class_ptr) {
552 return ERR(NOT_IMPLEMENTED);
553 }
554
555 static jvmtiError IsModifiableClass(jvmtiEnv* env,
556 jclass klass,
557 jboolean* is_modifiable_class_ptr) {
558 return ERR(NOT_IMPLEMENTED);
559 }
560
561 static jvmtiError GetClassLoader(jvmtiEnv* env, jclass klass, jobject* classloader_ptr) {
562 return ERR(NOT_IMPLEMENTED);
563 }
564
565 static jvmtiError GetSourceDebugExtension(jvmtiEnv* env,
566 jclass klass,
567 char** source_debug_extension_ptr) {
568 return ERR(NOT_IMPLEMENTED);
569 }
570
571 static jvmtiError RetransformClasses(jvmtiEnv* env, jint class_count, const jclass* classes) {
572 return ERR(NOT_IMPLEMENTED);
573 }
574
575 static jvmtiError RedefineClasses(jvmtiEnv* env,
576 jint class_count,
577 const jvmtiClassDefinition* class_definitions) {
578 return ERR(NOT_IMPLEMENTED);
579 }
580
581 static jvmtiError GetObjectSize(jvmtiEnv* env, jobject object, jlong* size_ptr) {
582 return ERR(NOT_IMPLEMENTED);
583 }
584
585 static jvmtiError GetObjectHashCode(jvmtiEnv* env, jobject object, jint* hash_code_ptr) {
586 return ERR(NOT_IMPLEMENTED);
587 }
588
589 static jvmtiError GetObjectMonitorUsage(jvmtiEnv* env,
590 jobject object,
591 jvmtiMonitorUsage* info_ptr) {
592 return ERR(NOT_IMPLEMENTED);
593 }
594
595 static jvmtiError GetFieldName(jvmtiEnv* env,
596 jclass klass,
597 jfieldID field,
598 char** name_ptr,
599 char** signature_ptr,
600 char** generic_ptr) {
601 return ERR(NOT_IMPLEMENTED);
602 }
603
604 static jvmtiError GetFieldDeclaringClass(jvmtiEnv* env,
605 jclass klass,
606 jfieldID field,
607 jclass* declaring_class_ptr) {
608 return ERR(NOT_IMPLEMENTED);
609 }
610
611 static jvmtiError GetFieldModifiers(jvmtiEnv* env,
612 jclass klass,
613 jfieldID field,
614 jint* modifiers_ptr) {
615 return ERR(NOT_IMPLEMENTED);
616 }
617
618 static jvmtiError IsFieldSynthetic(jvmtiEnv* env,
619 jclass klass,
620 jfieldID field,
621 jboolean* is_synthetic_ptr) {
622 return ERR(NOT_IMPLEMENTED);
623 }
624
625 static jvmtiError GetMethodName(jvmtiEnv* env,
626 jmethodID method,
627 char** name_ptr,
628 char** signature_ptr,
629 char** generic_ptr) {
630 return ERR(NOT_IMPLEMENTED);
631 }
632
633 static jvmtiError GetMethodDeclaringClass(jvmtiEnv* env,
634 jmethodID method,
635 jclass* declaring_class_ptr) {
636 return ERR(NOT_IMPLEMENTED);
637 }
638
639 static jvmtiError GetMethodModifiers(jvmtiEnv* env,
640 jmethodID method,
641 jint* modifiers_ptr) {
642 return ERR(NOT_IMPLEMENTED);
643 }
644
645 static jvmtiError GetMaxLocals(jvmtiEnv* env,
646 jmethodID method,
647 jint* max_ptr) {
648 return ERR(NOT_IMPLEMENTED);
649 }
650
651 static jvmtiError GetArgumentsSize(jvmtiEnv* env,
652 jmethodID method,
653 jint* size_ptr) {
654 return ERR(NOT_IMPLEMENTED);
655 }
656
657 static jvmtiError GetLineNumberTable(jvmtiEnv* env,
658 jmethodID method,
659 jint* entry_count_ptr,
660 jvmtiLineNumberEntry** table_ptr) {
661 return ERR(NOT_IMPLEMENTED);
662 }
663
664 static jvmtiError GetMethodLocation(jvmtiEnv* env,
665 jmethodID method,
666 jlocation* start_location_ptr,
667 jlocation* end_location_ptr) {
668 return ERR(NOT_IMPLEMENTED);
669 }
670
671 static jvmtiError GetLocalVariableTable(jvmtiEnv* env,
672 jmethodID method,
673 jint* entry_count_ptr,
674 jvmtiLocalVariableEntry** table_ptr) {
675 return ERR(NOT_IMPLEMENTED);
676 }
677
678 static jvmtiError GetBytecodes(jvmtiEnv* env,
679 jmethodID method,
680 jint* bytecode_count_ptr,
681 unsigned char** bytecodes_ptr) {
682 return ERR(NOT_IMPLEMENTED);
683 }
684
685 static jvmtiError IsMethodNative(jvmtiEnv* env, jmethodID method, jboolean* is_native_ptr) {
686 return ERR(NOT_IMPLEMENTED);
687 }
688
689 static jvmtiError IsMethodSynthetic(jvmtiEnv* env, jmethodID method, jboolean* is_synthetic_ptr) {
690 return ERR(NOT_IMPLEMENTED);
691 }
692
693 static jvmtiError IsMethodObsolete(jvmtiEnv* env, jmethodID method, jboolean* is_obsolete_ptr) {
694 return ERR(NOT_IMPLEMENTED);
695 }
696
697 static jvmtiError SetNativeMethodPrefix(jvmtiEnv* env, const char* prefix) {
698 return ERR(NOT_IMPLEMENTED);
699 }
700
701 static jvmtiError SetNativeMethodPrefixes(jvmtiEnv* env, jint prefix_count, char** prefixes) {
702 return ERR(NOT_IMPLEMENTED);
703 }
704
705 static jvmtiError CreateRawMonitor(jvmtiEnv* env, const char* name, jrawMonitorID* monitor_ptr) {
706 return ERR(NOT_IMPLEMENTED);
707 }
708
709 static jvmtiError DestroyRawMonitor(jvmtiEnv* env, jrawMonitorID monitor) {
710 return ERR(NOT_IMPLEMENTED);
711 }
712
713 static jvmtiError RawMonitorEnter(jvmtiEnv* env, jrawMonitorID monitor) {
714 return ERR(NOT_IMPLEMENTED);
715 }
716
717 static jvmtiError RawMonitorExit(jvmtiEnv* env, jrawMonitorID monitor) {
718 return ERR(NOT_IMPLEMENTED);
719 }
720
721 static jvmtiError RawMonitorWait(jvmtiEnv* env, jrawMonitorID monitor, jlong millis) {
722 return ERR(NOT_IMPLEMENTED);
723 }
724
725 static jvmtiError RawMonitorNotify(jvmtiEnv* env, jrawMonitorID monitor) {
726 return ERR(NOT_IMPLEMENTED);
727 }
728
729 static jvmtiError RawMonitorNotifyAll(jvmtiEnv* env, jrawMonitorID monitor) {
730 return ERR(NOT_IMPLEMENTED);
731 }
732
733 static jvmtiError SetJNIFunctionTable(jvmtiEnv* env, const jniNativeInterface* function_table) {
734 return ERR(NOT_IMPLEMENTED);
735 }
736
737 static jvmtiError GetJNIFunctionTable(jvmtiEnv* env, jniNativeInterface** function_table) {
738 return ERR(NOT_IMPLEMENTED);
739 }
740
Andreas Gampe77708d92016-10-07 11:48:21 -0700741 // TODO: This will require locking, so that an agent can't remove callbacks when we're dispatching
742 // an event.
Alex Light49948e92016-08-11 15:35:28 -0700743 static jvmtiError SetEventCallbacks(jvmtiEnv* env,
744 const jvmtiEventCallbacks* callbacks,
745 jint size_of_callbacks) {
Andreas Gampe77708d92016-10-07 11:48:21 -0700746 if (env == nullptr) {
747 return ERR(NULL_POINTER);
748 }
749 if (size_of_callbacks < 0) {
750 return ERR(ILLEGAL_ARGUMENT);
751 }
752
753 if (callbacks == nullptr) {
754 ArtJvmTiEnv::AsArtJvmTiEnv(env)->event_callbacks.reset();
755 return ERR(NONE);
756 }
757
758 std::unique_ptr<jvmtiEventCallbacks> tmp(new jvmtiEventCallbacks());
759 memset(tmp.get(), 0, sizeof(jvmtiEventCallbacks));
760 size_t copy_size = std::min(sizeof(jvmtiEventCallbacks),
761 static_cast<size_t>(size_of_callbacks));
762 copy_size = art::RoundDown(copy_size, sizeof(void*));
763 memcpy(tmp.get(), callbacks, copy_size);
764
765 ArtJvmTiEnv::AsArtJvmTiEnv(env)->event_callbacks = std::move(tmp);
766
767 return ERR(NONE);
Alex Light49948e92016-08-11 15:35:28 -0700768 }
769
770 static jvmtiError SetEventNotificationMode(jvmtiEnv* env,
771 jvmtiEventMode mode,
772 jvmtiEvent event_type,
773 jthread event_thread,
774 ...) {
Andreas Gampe77708d92016-10-07 11:48:21 -0700775 art::Thread* art_thread = nullptr;
776 if (event_thread != nullptr) {
777 // TODO: Need non-aborting call here, to return JVMTI_ERROR_INVALID_THREAD.
778 art::ScopedObjectAccess soa(art::Thread::Current());
779 art::MutexLock mu(soa.Self(), *art::Locks::thread_list_lock_);
780 art_thread = art::Thread::FromManagedThread(soa, event_thread);
781
782 if (art_thread == nullptr || // The thread hasn't been started or is already dead.
783 art_thread->IsStillStarting()) {
784 // TODO: We may want to let the EventHandler know, so it could clean up masks, potentially.
785 return ERR(THREAD_NOT_ALIVE);
786 }
787 }
788
789 return gEventHandler.SetEvent(ArtJvmTiEnv::AsArtJvmTiEnv(env), art_thread, event_type, mode);
Alex Light49948e92016-08-11 15:35:28 -0700790 }
791
792 static jvmtiError GenerateEvents(jvmtiEnv* env, jvmtiEvent event_type) {
793 return ERR(NOT_IMPLEMENTED);
794 }
795
796 static jvmtiError GetExtensionFunctions(jvmtiEnv* env,
797 jint* extension_count_ptr,
798 jvmtiExtensionFunctionInfo** extensions) {
799 return ERR(NOT_IMPLEMENTED);
800 }
801
802 static jvmtiError GetExtensionEvents(jvmtiEnv* env,
803 jint* extension_count_ptr,
804 jvmtiExtensionEventInfo** extensions) {
805 return ERR(NOT_IMPLEMENTED);
806 }
807
808 static jvmtiError SetExtensionEventCallback(jvmtiEnv* env,
809 jint extension_event_index,
810 jvmtiExtensionEvent callback) {
811 return ERR(NOT_IMPLEMENTED);
812 }
813
814 static jvmtiError GetPotentialCapabilities(jvmtiEnv* env, jvmtiCapabilities* capabilities_ptr) {
815 return ERR(NOT_IMPLEMENTED);
816 }
817
818 static jvmtiError AddCapabilities(jvmtiEnv* env, const jvmtiCapabilities* capabilities_ptr) {
819 return ERR(NOT_IMPLEMENTED);
820 }
821
822 static jvmtiError RelinquishCapabilities(jvmtiEnv* env,
823 const jvmtiCapabilities* capabilities_ptr) {
824 return ERR(NOT_IMPLEMENTED);
825 }
826
827 static jvmtiError GetCapabilities(jvmtiEnv* env, jvmtiCapabilities* capabilities_ptr) {
828 return ERR(NOT_IMPLEMENTED);
829 }
830
831 static jvmtiError GetCurrentThreadCpuTimerInfo(jvmtiEnv* env, jvmtiTimerInfo* info_ptr) {
832 return ERR(NOT_IMPLEMENTED);
833 }
834
835 static jvmtiError GetCurrentThreadCpuTime(jvmtiEnv* env, jlong* nanos_ptr) {
836 return ERR(NOT_IMPLEMENTED);
837 }
838
839 static jvmtiError GetThreadCpuTimerInfo(jvmtiEnv* env, jvmtiTimerInfo* info_ptr) {
840 return ERR(NOT_IMPLEMENTED);
841 }
842
843 static jvmtiError GetThreadCpuTime(jvmtiEnv* env, jthread thread, jlong* nanos_ptr) {
844 return ERR(NOT_IMPLEMENTED);
845 }
846
847 static jvmtiError GetTimerInfo(jvmtiEnv* env, jvmtiTimerInfo* info_ptr) {
848 return ERR(NOT_IMPLEMENTED);
849 }
850
851 static jvmtiError GetTime(jvmtiEnv* env, jlong* nanos_ptr) {
852 return ERR(NOT_IMPLEMENTED);
853 }
854
855 static jvmtiError GetAvailableProcessors(jvmtiEnv* env, jint* processor_count_ptr) {
856 return ERR(NOT_IMPLEMENTED);
857 }
858
859 static jvmtiError AddToBootstrapClassLoaderSearch(jvmtiEnv* env, const char* segment) {
860 return ERR(NOT_IMPLEMENTED);
861 }
862
863 static jvmtiError AddToSystemClassLoaderSearch(jvmtiEnv* env, const char* segment) {
864 return ERR(NOT_IMPLEMENTED);
865 }
866
867 static jvmtiError GetSystemProperties(jvmtiEnv* env, jint* count_ptr, char*** property_ptr) {
868 return ERR(NOT_IMPLEMENTED);
869 }
870
871 static jvmtiError GetSystemProperty(jvmtiEnv* env, const char* property, char** value_ptr) {
872 return ERR(NOT_IMPLEMENTED);
873 }
874
875 static jvmtiError SetSystemProperty(jvmtiEnv* env, const char* property, const char* value) {
876 return ERR(NOT_IMPLEMENTED);
877 }
878
879 static jvmtiError GetPhase(jvmtiEnv* env, jvmtiPhase* phase_ptr) {
880 return ERR(NOT_IMPLEMENTED);
881 }
882
883 static jvmtiError DisposeEnvironment(jvmtiEnv* env) {
884 if (!IsValidEnv(env)) {
885 return ERR(INVALID_ENVIRONMENT);
886 }
887 delete env;
888 return OK;
889 }
890
891 static jvmtiError SetEnvironmentLocalStorage(jvmtiEnv* env, const void* data) {
892 if (!IsValidEnv(env)) {
893 return ERR(INVALID_ENVIRONMENT);
894 }
895 reinterpret_cast<ArtJvmTiEnv*>(env)->local_data = const_cast<void*>(data);
896 return OK;
897 }
898
899 static jvmtiError GetEnvironmentLocalStorage(jvmtiEnv* env, void** data_ptr) {
900 if (!IsValidEnv(env)) {
901 return ERR(INVALID_ENVIRONMENT);
902 }
903 *data_ptr = reinterpret_cast<ArtJvmTiEnv*>(env)->local_data;
904 return OK;
905 }
906
907 static jvmtiError GetVersionNumber(jvmtiEnv* env, jint* version_ptr) {
908 if (!IsValidEnv(env)) {
909 return ERR(INVALID_ENVIRONMENT);
910 }
911 *version_ptr = JVMTI_VERSION;
912 return OK;
913 }
914
915 static jvmtiError GetErrorName(jvmtiEnv* env, jvmtiError error, char** name_ptr) {
916 if (!IsValidEnv(env)) {
917 return ERR(INVALID_ENVIRONMENT);
918 }
919 if (name_ptr == nullptr) {
920 return ERR(NULL_POINTER);
921 }
922 switch (error) {
923#define ERROR_CASE(e) case (JVMTI_ERROR_ ## e) : do { \
924 *name_ptr = const_cast<char*>("JVMTI_ERROR_"#e); \
925 return OK; \
926 } while (false)
927 ERROR_CASE(NONE);
928 ERROR_CASE(INVALID_THREAD);
929 ERROR_CASE(INVALID_THREAD_GROUP);
930 ERROR_CASE(INVALID_PRIORITY);
931 ERROR_CASE(THREAD_NOT_SUSPENDED);
932 ERROR_CASE(THREAD_NOT_ALIVE);
933 ERROR_CASE(INVALID_OBJECT);
934 ERROR_CASE(INVALID_CLASS);
935 ERROR_CASE(CLASS_NOT_PREPARED);
936 ERROR_CASE(INVALID_METHODID);
937 ERROR_CASE(INVALID_LOCATION);
938 ERROR_CASE(INVALID_FIELDID);
939 ERROR_CASE(NO_MORE_FRAMES);
940 ERROR_CASE(OPAQUE_FRAME);
941 ERROR_CASE(TYPE_MISMATCH);
942 ERROR_CASE(INVALID_SLOT);
943 ERROR_CASE(DUPLICATE);
944 ERROR_CASE(NOT_FOUND);
945 ERROR_CASE(INVALID_MONITOR);
946 ERROR_CASE(NOT_MONITOR_OWNER);
947 ERROR_CASE(INTERRUPT);
948 ERROR_CASE(INVALID_CLASS_FORMAT);
949 ERROR_CASE(CIRCULAR_CLASS_DEFINITION);
950 ERROR_CASE(FAILS_VERIFICATION);
951 ERROR_CASE(UNSUPPORTED_REDEFINITION_METHOD_ADDED);
952 ERROR_CASE(UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED);
953 ERROR_CASE(INVALID_TYPESTATE);
954 ERROR_CASE(UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED);
955 ERROR_CASE(UNSUPPORTED_REDEFINITION_METHOD_DELETED);
956 ERROR_CASE(UNSUPPORTED_VERSION);
957 ERROR_CASE(NAMES_DONT_MATCH);
958 ERROR_CASE(UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED);
959 ERROR_CASE(UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED);
960 ERROR_CASE(UNMODIFIABLE_CLASS);
961 ERROR_CASE(NOT_AVAILABLE);
962 ERROR_CASE(MUST_POSSESS_CAPABILITY);
963 ERROR_CASE(NULL_POINTER);
964 ERROR_CASE(ABSENT_INFORMATION);
965 ERROR_CASE(INVALID_EVENT_TYPE);
966 ERROR_CASE(ILLEGAL_ARGUMENT);
967 ERROR_CASE(NATIVE_METHOD);
968 ERROR_CASE(CLASS_LOADER_UNSUPPORTED);
969 ERROR_CASE(OUT_OF_MEMORY);
970 ERROR_CASE(ACCESS_DENIED);
971 ERROR_CASE(WRONG_PHASE);
972 ERROR_CASE(INTERNAL);
973 ERROR_CASE(UNATTACHED_THREAD);
974 ERROR_CASE(INVALID_ENVIRONMENT);
975#undef ERROR_CASE
976 default: {
977 *name_ptr = const_cast<char*>("JVMTI_ERROR_UNKNOWN");
978 return ERR(ILLEGAL_ARGUMENT);
979 }
980 }
981 }
982
983 static jvmtiError SetVerboseFlag(jvmtiEnv* env, jvmtiVerboseFlag flag, jboolean value) {
984 return ERR(NOT_IMPLEMENTED);
985 }
986
987 static jvmtiError GetJLocationFormat(jvmtiEnv* env, jvmtiJlocationFormat* format_ptr) {
988 return ERR(NOT_IMPLEMENTED);
989 }
Alex Light9c20a142016-08-23 15:05:12 -0700990
991 // TODO Remove this once events are working.
992 static jvmtiError RetransformClassWithHook(jvmtiEnv* env,
993 jclass klass,
994 jvmtiEventClassFileLoadHook hook) {
995 std::vector<jclass> classes;
996 classes.push_back(klass);
997 return RetransformClassesWithHook(reinterpret_cast<ArtJvmTiEnv*>(env), classes, hook);
998 }
999
1000 // TODO This will be called by the event handler for the art::ti Event Load Event
1001 static jvmtiError RetransformClassesWithHook(ArtJvmTiEnv* env,
1002 const std::vector<jclass>& classes,
1003 jvmtiEventClassFileLoadHook hook) {
1004 if (!IsValidEnv(env)) {
1005 return ERR(INVALID_ENVIRONMENT);
1006 }
1007 for (jclass klass : classes) {
1008 JNIEnv* jni_env = nullptr;
1009 jobject loader = nullptr;
1010 std::string name;
1011 jobject protection_domain = nullptr;
1012 jint data_len = 0;
1013 unsigned char* dex_data = nullptr;
1014 jvmtiError ret = OK;
1015 std::string location;
1016 if ((ret = GetTransformationData(env,
1017 klass,
1018 /*out*/&location,
1019 /*out*/&jni_env,
1020 /*out*/&loader,
1021 /*out*/&name,
1022 /*out*/&protection_domain,
1023 /*out*/&data_len,
1024 /*out*/&dex_data)) != OK) {
1025 // TODO Do something more here? Maybe give log statements?
1026 return ret;
1027 }
1028 jint new_data_len = 0;
1029 unsigned char* new_dex_data = nullptr;
1030 hook(env,
1031 jni_env,
1032 klass,
1033 loader,
1034 name.c_str(),
1035 protection_domain,
1036 data_len,
1037 dex_data,
1038 /*out*/&new_data_len,
1039 /*out*/&new_dex_data);
1040 // Check if anything actually changed.
1041 if ((new_data_len != 0 || new_dex_data != nullptr) && new_dex_data != dex_data) {
1042 MoveTransformedFileIntoRuntime(klass, std::move(location), new_data_len, new_dex_data);
1043 env->Deallocate(new_dex_data);
1044 }
1045 // Deallocate the old dex data.
1046 env->Deallocate(dex_data);
1047 }
1048 return OK;
1049 }
Alex Light49948e92016-08-11 15:35:28 -07001050};
1051
1052static bool IsJvmtiVersion(jint version) {
1053 return version == JVMTI_VERSION_1 ||
1054 version == JVMTI_VERSION_1_0 ||
1055 version == JVMTI_VERSION_1_1 ||
1056 version == JVMTI_VERSION_1_2 ||
1057 version == JVMTI_VERSION;
1058}
1059
1060// Creates a jvmtiEnv and returns it with the art::ti::Env that is associated with it. new_art_ti
1061// is a pointer to the uninitialized memory for an art::ti::Env.
1062static void CreateArtJvmTiEnv(art::JavaVMExt* vm, /*out*/void** new_jvmtiEnv) {
1063 struct ArtJvmTiEnv* env = new ArtJvmTiEnv(vm);
1064 *new_jvmtiEnv = env;
Andreas Gampe77708d92016-10-07 11:48:21 -07001065
1066 gEventHandler.RegisterArtJvmTiEnv(env);
Alex Light49948e92016-08-11 15:35:28 -07001067}
1068
1069// A hook that the runtime uses to allow plugins to handle GetEnv calls. It returns true and
1070// places the return value in 'env' if this library can handle the GetEnv request. Otherwise
1071// returns false and does not modify the 'env' pointer.
1072static jint GetEnvHandler(art::JavaVMExt* vm, /*out*/void** env, jint version) {
1073 if (IsJvmtiVersion(version)) {
1074 CreateArtJvmTiEnv(vm, env);
1075 return JNI_OK;
1076 } else {
1077 printf("version 0x%x is not valid!", version);
1078 return JNI_EVERSION;
1079 }
1080}
1081
1082// The plugin initialization function. This adds the jvmti environment.
1083extern "C" bool ArtPlugin_Initialize() {
Andreas Gampee08a2be2016-10-06 13:13:30 -07001084 art::Runtime* runtime = art::Runtime::Current();
1085 runtime->GetJavaVM()->AddEnvironmentHook(GetEnvHandler);
1086 runtime->AddSystemWeakHolder(&gObjectTagTable);
Alex Light49948e92016-08-11 15:35:28 -07001087 return true;
1088}
1089
1090// The actual struct holding all of the entrypoints into the jvmti interface.
1091const jvmtiInterface_1 gJvmtiInterface = {
Alex Light9c20a142016-08-23 15:05:12 -07001092 // SPECIAL FUNCTION: RetransformClassWithHook Is normally reserved1
1093 // TODO Remove once we have events working.
1094 reinterpret_cast<void*>(JvmtiFunctions::RetransformClassWithHook),
1095 // nullptr, // reserved1
Alex Light49948e92016-08-11 15:35:28 -07001096 JvmtiFunctions::SetEventNotificationMode,
1097 nullptr, // reserved3
1098 JvmtiFunctions::GetAllThreads,
1099 JvmtiFunctions::SuspendThread,
1100 JvmtiFunctions::ResumeThread,
1101 JvmtiFunctions::StopThread,
1102 JvmtiFunctions::InterruptThread,
1103 JvmtiFunctions::GetThreadInfo,
1104 JvmtiFunctions::GetOwnedMonitorInfo, // 10
1105 JvmtiFunctions::GetCurrentContendedMonitor,
1106 JvmtiFunctions::RunAgentThread,
1107 JvmtiFunctions::GetTopThreadGroups,
1108 JvmtiFunctions::GetThreadGroupInfo,
1109 JvmtiFunctions::GetThreadGroupChildren,
1110 JvmtiFunctions::GetFrameCount,
1111 JvmtiFunctions::GetThreadState,
1112 JvmtiFunctions::GetCurrentThread,
1113 JvmtiFunctions::GetFrameLocation,
1114 JvmtiFunctions::NotifyFramePop, // 20
1115 JvmtiFunctions::GetLocalObject,
1116 JvmtiFunctions::GetLocalInt,
1117 JvmtiFunctions::GetLocalLong,
1118 JvmtiFunctions::GetLocalFloat,
1119 JvmtiFunctions::GetLocalDouble,
1120 JvmtiFunctions::SetLocalObject,
1121 JvmtiFunctions::SetLocalInt,
1122 JvmtiFunctions::SetLocalLong,
1123 JvmtiFunctions::SetLocalFloat,
1124 JvmtiFunctions::SetLocalDouble, // 30
1125 JvmtiFunctions::CreateRawMonitor,
1126 JvmtiFunctions::DestroyRawMonitor,
1127 JvmtiFunctions::RawMonitorEnter,
1128 JvmtiFunctions::RawMonitorExit,
1129 JvmtiFunctions::RawMonitorWait,
1130 JvmtiFunctions::RawMonitorNotify,
1131 JvmtiFunctions::RawMonitorNotifyAll,
1132 JvmtiFunctions::SetBreakpoint,
1133 JvmtiFunctions::ClearBreakpoint,
1134 nullptr, // reserved40
1135 JvmtiFunctions::SetFieldAccessWatch,
1136 JvmtiFunctions::ClearFieldAccessWatch,
1137 JvmtiFunctions::SetFieldModificationWatch,
1138 JvmtiFunctions::ClearFieldModificationWatch,
1139 JvmtiFunctions::IsModifiableClass,
1140 JvmtiFunctions::Allocate,
1141 JvmtiFunctions::Deallocate,
1142 JvmtiFunctions::GetClassSignature,
1143 JvmtiFunctions::GetClassStatus,
1144 JvmtiFunctions::GetSourceFileName, // 50
1145 JvmtiFunctions::GetClassModifiers,
1146 JvmtiFunctions::GetClassMethods,
1147 JvmtiFunctions::GetClassFields,
1148 JvmtiFunctions::GetImplementedInterfaces,
1149 JvmtiFunctions::IsInterface,
1150 JvmtiFunctions::IsArrayClass,
1151 JvmtiFunctions::GetClassLoader,
1152 JvmtiFunctions::GetObjectHashCode,
1153 JvmtiFunctions::GetObjectMonitorUsage,
1154 JvmtiFunctions::GetFieldName, // 60
1155 JvmtiFunctions::GetFieldDeclaringClass,
1156 JvmtiFunctions::GetFieldModifiers,
1157 JvmtiFunctions::IsFieldSynthetic,
1158 JvmtiFunctions::GetMethodName,
1159 JvmtiFunctions::GetMethodDeclaringClass,
1160 JvmtiFunctions::GetMethodModifiers,
1161 nullptr, // reserved67
1162 JvmtiFunctions::GetMaxLocals,
1163 JvmtiFunctions::GetArgumentsSize,
1164 JvmtiFunctions::GetLineNumberTable, // 70
1165 JvmtiFunctions::GetMethodLocation,
1166 JvmtiFunctions::GetLocalVariableTable,
1167 JvmtiFunctions::SetNativeMethodPrefix,
1168 JvmtiFunctions::SetNativeMethodPrefixes,
1169 JvmtiFunctions::GetBytecodes,
1170 JvmtiFunctions::IsMethodNative,
1171 JvmtiFunctions::IsMethodSynthetic,
1172 JvmtiFunctions::GetLoadedClasses,
1173 JvmtiFunctions::GetClassLoaderClasses,
1174 JvmtiFunctions::PopFrame, // 80
1175 JvmtiFunctions::ForceEarlyReturnObject,
1176 JvmtiFunctions::ForceEarlyReturnInt,
1177 JvmtiFunctions::ForceEarlyReturnLong,
1178 JvmtiFunctions::ForceEarlyReturnFloat,
1179 JvmtiFunctions::ForceEarlyReturnDouble,
1180 JvmtiFunctions::ForceEarlyReturnVoid,
1181 JvmtiFunctions::RedefineClasses,
1182 JvmtiFunctions::GetVersionNumber,
1183 JvmtiFunctions::GetCapabilities,
1184 JvmtiFunctions::GetSourceDebugExtension, // 90
1185 JvmtiFunctions::IsMethodObsolete,
1186 JvmtiFunctions::SuspendThreadList,
1187 JvmtiFunctions::ResumeThreadList,
1188 nullptr, // reserved94
1189 nullptr, // reserved95
1190 nullptr, // reserved96
1191 nullptr, // reserved97
1192 nullptr, // reserved98
1193 nullptr, // reserved99
1194 JvmtiFunctions::GetAllStackTraces, // 100
1195 JvmtiFunctions::GetThreadListStackTraces,
1196 JvmtiFunctions::GetThreadLocalStorage,
1197 JvmtiFunctions::SetThreadLocalStorage,
1198 JvmtiFunctions::GetStackTrace,
1199 nullptr, // reserved105
1200 JvmtiFunctions::GetTag,
1201 JvmtiFunctions::SetTag,
1202 JvmtiFunctions::ForceGarbageCollection,
1203 JvmtiFunctions::IterateOverObjectsReachableFromObject,
1204 JvmtiFunctions::IterateOverReachableObjects, // 110
1205 JvmtiFunctions::IterateOverHeap,
1206 JvmtiFunctions::IterateOverInstancesOfClass,
1207 nullptr, // reserved113
1208 JvmtiFunctions::GetObjectsWithTags,
1209 JvmtiFunctions::FollowReferences,
1210 JvmtiFunctions::IterateThroughHeap,
1211 nullptr, // reserved117
1212 nullptr, // reserved118
1213 nullptr, // reserved119
1214 JvmtiFunctions::SetJNIFunctionTable, // 120
1215 JvmtiFunctions::GetJNIFunctionTable,
1216 JvmtiFunctions::SetEventCallbacks,
1217 JvmtiFunctions::GenerateEvents,
1218 JvmtiFunctions::GetExtensionFunctions,
1219 JvmtiFunctions::GetExtensionEvents,
1220 JvmtiFunctions::SetExtensionEventCallback,
1221 JvmtiFunctions::DisposeEnvironment,
1222 JvmtiFunctions::GetErrorName,
1223 JvmtiFunctions::GetJLocationFormat,
1224 JvmtiFunctions::GetSystemProperties, // 130
1225 JvmtiFunctions::GetSystemProperty,
1226 JvmtiFunctions::SetSystemProperty,
1227 JvmtiFunctions::GetPhase,
1228 JvmtiFunctions::GetCurrentThreadCpuTimerInfo,
1229 JvmtiFunctions::GetCurrentThreadCpuTime,
1230 JvmtiFunctions::GetThreadCpuTimerInfo,
1231 JvmtiFunctions::GetThreadCpuTime,
1232 JvmtiFunctions::GetTimerInfo,
1233 JvmtiFunctions::GetTime,
1234 JvmtiFunctions::GetPotentialCapabilities, // 140
1235 nullptr, // reserved141
1236 JvmtiFunctions::AddCapabilities,
1237 JvmtiFunctions::RelinquishCapabilities,
1238 JvmtiFunctions::GetAvailableProcessors,
1239 JvmtiFunctions::GetClassVersionNumbers,
1240 JvmtiFunctions::GetConstantPool,
1241 JvmtiFunctions::GetEnvironmentLocalStorage,
1242 JvmtiFunctions::SetEnvironmentLocalStorage,
1243 JvmtiFunctions::AddToBootstrapClassLoaderSearch,
1244 JvmtiFunctions::SetVerboseFlag, // 150
1245 JvmtiFunctions::AddToSystemClassLoaderSearch,
1246 JvmtiFunctions::RetransformClasses,
1247 JvmtiFunctions::GetOwnedMonitorStackDepthInfo,
1248 JvmtiFunctions::GetObjectSize,
1249 JvmtiFunctions::GetLocalInstance,
1250};
1251
1252}; // namespace openjdkjvmti