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