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