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