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