blob: 50402a04a9191e76d0c6766cf78a8417cf6d4ee7 [file] [log] [blame]
Andreas Gampe3c252f02016-10-27 18:25:17 -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
32#include "ti_method.h"
33
Andreas Gampe49fc60e2017-08-24 13:19:59 -070034#include <type_traits>
35
Andreas Gampe3c252f02016-10-27 18:25:17 -070036#include "art_jvmti.h"
37#include "art_method-inl.h"
38#include "base/enums.h"
Alex Lightbebd7bd2017-07-25 14:05:52 -070039#include "base/mutex-inl.h"
Andreas Gampe27dfa052017-02-16 15:04:36 -080040#include "dex_file_annotations.h"
Andreas Gampee2abbc62017-09-15 11:59:26 -070041#include "dex_file_types.h"
Alex Lightd78ddec2017-04-18 15:20:38 -070042#include "events-inl.h"
Alex Light0a5ec3d2017-07-25 16:50:26 -070043#include "jit/jit.h"
Andreas Gampe13b27842016-11-07 16:48:23 -080044#include "jni_internal.h"
Alex Lightbebd7bd2017-07-25 14:05:52 -070045#include "mirror/class-inl.h"
46#include "mirror/class_loader.h"
47#include "mirror/object-inl.h"
Andreas Gampe27dfa052017-02-16 15:04:36 -080048#include "mirror/object_array-inl.h"
Andreas Gampe36bcd4f2016-10-28 18:07:18 -070049#include "modifiers.h"
Steven Morelande431e272017-07-18 16:53:49 -070050#include "nativehelper/ScopedLocalRef.h"
Alex Lightd78ddec2017-04-18 15:20:38 -070051#include "runtime_callbacks.h"
Andreas Gampe3c252f02016-10-27 18:25:17 -070052#include "scoped_thread_state_change-inl.h"
Alex Lightbebd7bd2017-07-25 14:05:52 -070053#include "stack.h"
Andreas Gampeb486a982017-06-01 13:45:54 -070054#include "thread-current-inl.h"
Alex Lightd78ddec2017-04-18 15:20:38 -070055#include "thread_list.h"
Alex Lighte814f9d2017-07-31 16:14:39 -070056#include "ti_stack.h"
Alex Lightbebd7bd2017-07-25 14:05:52 -070057#include "ti_thread.h"
Alex Light0af8cde2017-04-20 13:35:05 -070058#include "ti_phase.h"
Andreas Gampe3c252f02016-10-27 18:25:17 -070059
60namespace openjdkjvmti {
61
Alex Lightd78ddec2017-04-18 15:20:38 -070062struct TiMethodCallback : public art::MethodCallback {
63 void RegisterNativeMethod(art::ArtMethod* method,
64 const void* cur_method,
65 /*out*/void** new_method)
66 OVERRIDE REQUIRES_SHARED(art::Locks::mutator_lock_) {
67 if (event_handler->IsEventEnabledAnywhere(ArtJvmtiEvent::kNativeMethodBind)) {
68 art::Thread* thread = art::Thread::Current();
Alex Light0af8cde2017-04-20 13:35:05 -070069 art::JNIEnvExt* jnienv = thread->GetJniEnv();
Alex Lightd78ddec2017-04-18 15:20:38 -070070 ScopedLocalRef<jthread> thread_jni(
Alex Light0af8cde2017-04-20 13:35:05 -070071 jnienv, PhaseUtil::IsLivePhase() ? jnienv->AddLocalReference<jthread>(thread->GetPeer())
72 : nullptr);
Alex Lightd78ddec2017-04-18 15:20:38 -070073 art::ScopedThreadSuspension sts(thread, art::ThreadState::kNative);
74 event_handler->DispatchEvent<ArtJvmtiEvent::kNativeMethodBind>(
75 thread,
Alex Light0af8cde2017-04-20 13:35:05 -070076 static_cast<JNIEnv*>(jnienv),
Alex Lightd78ddec2017-04-18 15:20:38 -070077 thread_jni.get(),
78 art::jni::EncodeArtMethod(method),
79 const_cast<void*>(cur_method),
80 new_method);
81 }
82 }
83
84 EventHandler* event_handler = nullptr;
85};
86
87TiMethodCallback gMethodCallback;
88
Alex Light21611932017-09-26 13:07:39 -070089// TODO We should make this much more selective in the future so we only return true when we
90// actually care about the method (i.e. had locals changed, have breakpoints, etc.). For now though
91// we can just assume that we care we are loaded at all.
92//
93// Even if we don't keep track of this at the method level we might want to keep track of it at the
94// level of enabled capabilities.
95struct TiMethodInspectionCallback : public art::MethodInspectionCallback {
96 bool IsMethodBeingInspected(art::ArtMethod* method ATTRIBUTE_UNUSED)
97 OVERRIDE REQUIRES_SHARED(art::Locks::mutator_lock_) {
98 return true;
99 }
100};
101
102TiMethodInspectionCallback gMethodInspectionCallback;
103
Alex Lightd78ddec2017-04-18 15:20:38 -0700104void MethodUtil::Register(EventHandler* handler) {
105 gMethodCallback.event_handler = handler;
106 art::ScopedThreadStateChange stsc(art::Thread::Current(),
107 art::ThreadState::kWaitingForDebuggerToAttach);
108 art::ScopedSuspendAll ssa("Add method callback");
Alex Light21611932017-09-26 13:07:39 -0700109 art::RuntimeCallbacks* callbacks = art::Runtime::Current()->GetRuntimeCallbacks();
110 callbacks->AddMethodCallback(&gMethodCallback);
111 callbacks->AddMethodInspectionCallback(&gMethodInspectionCallback);
Alex Lightd78ddec2017-04-18 15:20:38 -0700112}
113
114void MethodUtil::Unregister() {
115 art::ScopedThreadStateChange stsc(art::Thread::Current(),
116 art::ThreadState::kWaitingForDebuggerToAttach);
117 art::ScopedSuspendAll ssa("Remove method callback");
Alex Light21611932017-09-26 13:07:39 -0700118 art::RuntimeCallbacks* callbacks = art::Runtime::Current()->GetRuntimeCallbacks();
119 callbacks->RemoveMethodCallback(&gMethodCallback);
120 callbacks->AddMethodInspectionCallback(&gMethodInspectionCallback);
Alex Lightd78ddec2017-04-18 15:20:38 -0700121}
122
Alex Light4c174282017-07-05 10:18:18 -0700123jvmtiError MethodUtil::GetBytecodes(jvmtiEnv* env,
124 jmethodID method,
125 jint* size_ptr,
126 unsigned char** bytecode_ptr) {
127 if (method == nullptr) {
128 return ERR(INVALID_METHODID);
129 }
130 art::ArtMethod* art_method = art::jni::DecodeArtMethod(method);
131
132 if (art_method->IsNative()) {
133 return ERR(NATIVE_METHOD);
134 }
135
136 if (size_ptr == nullptr || bytecode_ptr == nullptr) {
137 return ERR(NULL_POINTER);
138 }
139
140 art::ScopedObjectAccess soa(art::Thread::Current());
141 const art::DexFile::CodeItem* code_item = art_method->GetCodeItem();
142 if (code_item == nullptr) {
143 *size_ptr = 0;
144 *bytecode_ptr = nullptr;
145 return OK;
146 }
147 // 2 bytes per instruction for dex code.
148 *size_ptr = code_item->insns_size_in_code_units_ * 2;
149 jvmtiError err = env->Allocate(*size_ptr, bytecode_ptr);
150 if (err != OK) {
151 return err;
152 }
153 memcpy(*bytecode_ptr, code_item->insns_, *size_ptr);
154 return OK;
155}
156
Andreas Gampef71832e2017-01-09 11:38:04 -0800157jvmtiError MethodUtil::GetArgumentsSize(jvmtiEnv* env ATTRIBUTE_UNUSED,
158 jmethodID method,
159 jint* size_ptr) {
160 if (method == nullptr) {
161 return ERR(INVALID_METHODID);
162 }
163 art::ArtMethod* art_method = art::jni::DecodeArtMethod(method);
164
165 if (art_method->IsNative()) {
166 return ERR(NATIVE_METHOD);
167 }
168
169 if (size_ptr == nullptr) {
170 return ERR(NULL_POINTER);
171 }
172
173 art::ScopedObjectAccess soa(art::Thread::Current());
174 if (art_method->IsProxyMethod() || art_method->IsAbstract()) {
Andreas Gampee1f79b62017-04-12 21:11:28 -0700175 // Use the shorty.
176 art::ArtMethod* base_method = art_method->GetInterfaceMethodIfProxy(art::kRuntimePointerSize);
177 size_t arg_count = art::ArtMethod::NumArgRegisters(base_method->GetShorty());
178 if (!base_method->IsStatic()) {
179 arg_count++;
180 }
181 *size_ptr = static_cast<jint>(arg_count);
Andreas Gampef71832e2017-01-09 11:38:04 -0800182 return ERR(NONE);
183 }
184
185 DCHECK_NE(art_method->GetCodeItemOffset(), 0u);
186 *size_ptr = art_method->GetCodeItem()->ins_size_;
187
188 return ERR(NONE);
189}
190
Alex Lightce68cc62017-07-26 10:30:38 -0700191jvmtiError MethodUtil::GetLocalVariableTable(jvmtiEnv* env,
192 jmethodID method,
193 jint* entry_count_ptr,
194 jvmtiLocalVariableEntry** table_ptr) {
195 if (method == nullptr) {
196 return ERR(INVALID_METHODID);
197 }
198 art::ArtMethod* art_method = art::jni::DecodeArtMethod(method);
199
200 if (art_method->IsNative()) {
201 return ERR(NATIVE_METHOD);
202 }
203
204 if (entry_count_ptr == nullptr || table_ptr == nullptr) {
205 return ERR(NULL_POINTER);
206 }
207
208 art::ScopedObjectAccess soa(art::Thread::Current());
209 const art::DexFile* dex_file = art_method->GetDexFile();
210 const art::DexFile::CodeItem* code_item = art_method->GetCodeItem();
211 // TODO code_item == nullptr means that the method is abstract (or native, but we check that
212 // earlier). We should check what is returned by the RI in this situation since it's not clear
213 // what the appropriate return value is from the spec.
214 if (dex_file == nullptr || code_item == nullptr) {
215 return ERR(ABSENT_INFORMATION);
216 }
217
218 struct LocalVariableContext {
219 explicit LocalVariableContext(jvmtiEnv* jenv) : env_(jenv), variables_(), err_(OK) {}
220
221 static void Callback(void* raw_ctx, const art::DexFile::LocalInfo& entry) {
222 reinterpret_cast<LocalVariableContext*>(raw_ctx)->Insert(entry);
223 }
224
225 void Insert(const art::DexFile::LocalInfo& entry) {
226 if (err_ != OK) {
227 return;
228 }
229 JvmtiUniquePtr<char[]> name_str = CopyString(env_, entry.name_, &err_);
230 if (err_ != OK) {
231 return;
232 }
233 JvmtiUniquePtr<char[]> sig_str = CopyString(env_, entry.descriptor_, &err_);
234 if (err_ != OK) {
235 return;
236 }
237 JvmtiUniquePtr<char[]> generic_sig_str = CopyString(env_, entry.signature_, &err_);
238 if (err_ != OK) {
239 return;
240 }
241 variables_.push_back({
242 .start_location = static_cast<jlocation>(entry.start_address_),
243 .length = static_cast<jint>(entry.end_address_ - entry.start_address_),
244 .name = name_str.release(),
245 .signature = sig_str.release(),
246 .generic_signature = generic_sig_str.release(),
247 .slot = entry.reg_,
248 });
249 }
250
251 jvmtiError Release(jint* out_entry_count_ptr, jvmtiLocalVariableEntry** out_table_ptr) {
252 jlong table_size = sizeof(jvmtiLocalVariableEntry) * variables_.size();
253 if (err_ != OK ||
254 (err_ = env_->Allocate(table_size,
255 reinterpret_cast<unsigned char**>(out_table_ptr))) != OK) {
256 Cleanup();
257 return err_;
258 } else {
259 *out_entry_count_ptr = variables_.size();
260 memcpy(*out_table_ptr, variables_.data(), table_size);
261 return OK;
262 }
263 }
264
265 void Cleanup() {
266 for (jvmtiLocalVariableEntry& e : variables_) {
267 env_->Deallocate(reinterpret_cast<unsigned char*>(e.name));
268 env_->Deallocate(reinterpret_cast<unsigned char*>(e.signature));
269 env_->Deallocate(reinterpret_cast<unsigned char*>(e.generic_signature));
270 }
271 }
272
273 jvmtiEnv* env_;
274 std::vector<jvmtiLocalVariableEntry> variables_;
275 jvmtiError err_;
276 };
277
278 LocalVariableContext context(env);
279 if (!dex_file->DecodeDebugLocalInfo(code_item,
280 art_method->IsStatic(),
281 art_method->GetDexMethodIndex(),
282 LocalVariableContext::Callback,
283 &context)) {
284 // Something went wrong with decoding the debug information. It might as well not be there.
285 return ERR(ABSENT_INFORMATION);
286 } else {
287 return context.Release(entry_count_ptr, table_ptr);
288 }
289}
290
Andreas Gampef71832e2017-01-09 11:38:04 -0800291jvmtiError MethodUtil::GetMaxLocals(jvmtiEnv* env ATTRIBUTE_UNUSED,
292 jmethodID method,
293 jint* max_ptr) {
294 if (method == nullptr) {
295 return ERR(INVALID_METHODID);
296 }
297 art::ArtMethod* art_method = art::jni::DecodeArtMethod(method);
298
299 if (art_method->IsNative()) {
300 return ERR(NATIVE_METHOD);
301 }
302
303 if (max_ptr == nullptr) {
304 return ERR(NULL_POINTER);
305 }
306
307 art::ScopedObjectAccess soa(art::Thread::Current());
308 if (art_method->IsProxyMethod() || art_method->IsAbstract()) {
309 // This isn't specified as an error case, so return 0.
310 *max_ptr = 0;
311 return ERR(NONE);
312 }
313
314 DCHECK_NE(art_method->GetCodeItemOffset(), 0u);
315 *max_ptr = art_method->GetCodeItem()->registers_size_;
316
317 return ERR(NONE);
318}
319
Andreas Gampe3c252f02016-10-27 18:25:17 -0700320jvmtiError MethodUtil::GetMethodName(jvmtiEnv* env,
321 jmethodID method,
322 char** name_ptr,
323 char** signature_ptr,
324 char** generic_ptr) {
325 art::ScopedObjectAccess soa(art::Thread::Current());
Andreas Gampe13b27842016-11-07 16:48:23 -0800326 art::ArtMethod* art_method = art::jni::DecodeArtMethod(method);
Andreas Gampe3c252f02016-10-27 18:25:17 -0700327 art_method = art_method->GetInterfaceMethodIfProxy(art::kRuntimePointerSize);
328
Andreas Gampe54711412017-02-21 12:41:43 -0800329 JvmtiUniquePtr<char[]> name_copy;
Andreas Gampe3c252f02016-10-27 18:25:17 -0700330 if (name_ptr != nullptr) {
331 const char* method_name = art_method->GetName();
332 if (method_name == nullptr) {
333 method_name = "<error>";
334 }
Andreas Gampe54711412017-02-21 12:41:43 -0800335 jvmtiError ret;
336 name_copy = CopyString(env, method_name, &ret);
337 if (name_copy == nullptr) {
Andreas Gampe3c252f02016-10-27 18:25:17 -0700338 return ret;
339 }
Andreas Gampe54711412017-02-21 12:41:43 -0800340 *name_ptr = name_copy.get();
Andreas Gampe3c252f02016-10-27 18:25:17 -0700341 }
342
Andreas Gampe54711412017-02-21 12:41:43 -0800343 JvmtiUniquePtr<char[]> signature_copy;
Andreas Gampe3c252f02016-10-27 18:25:17 -0700344 if (signature_ptr != nullptr) {
345 const art::Signature sig = art_method->GetSignature();
346 std::string str = sig.ToString();
Andreas Gampe54711412017-02-21 12:41:43 -0800347 jvmtiError ret;
348 signature_copy = CopyString(env, str.c_str(), &ret);
349 if (signature_copy == nullptr) {
Andreas Gampe3c252f02016-10-27 18:25:17 -0700350 return ret;
351 }
Andreas Gampe54711412017-02-21 12:41:43 -0800352 *signature_ptr = signature_copy.get();
Andreas Gampe3c252f02016-10-27 18:25:17 -0700353 }
354
Andreas Gampe862bdd82016-11-18 13:31:13 -0800355 if (generic_ptr != nullptr) {
356 *generic_ptr = nullptr;
Andreas Gampe27dfa052017-02-16 15:04:36 -0800357 if (!art_method->GetDeclaringClass()->IsProxyClass()) {
358 art::mirror::ObjectArray<art::mirror::String>* str_array =
359 art::annotations::GetSignatureAnnotationForMethod(art_method);
360 if (str_array != nullptr) {
361 std::ostringstream oss;
362 for (int32_t i = 0; i != str_array->GetLength(); ++i) {
363 oss << str_array->Get(i)->ToModifiedUtf8();
364 }
365 std::string output_string = oss.str();
Andreas Gampe54711412017-02-21 12:41:43 -0800366 jvmtiError ret;
367 JvmtiUniquePtr<char[]> generic_copy = CopyString(env, output_string.c_str(), &ret);
368 if (generic_copy == nullptr) {
Andreas Gampe27dfa052017-02-16 15:04:36 -0800369 return ret;
370 }
Andreas Gampe54711412017-02-21 12:41:43 -0800371 *generic_ptr = generic_copy.release();
Andreas Gampe27dfa052017-02-16 15:04:36 -0800372 } else if (soa.Self()->IsExceptionPending()) {
373 // TODO: Should we report an error here?
374 soa.Self()->ClearException();
375 }
376 }
Andreas Gampe862bdd82016-11-18 13:31:13 -0800377 }
Andreas Gampe3c252f02016-10-27 18:25:17 -0700378
379 // Everything is fine, release the buffers.
380 name_copy.release();
381 signature_copy.release();
382
383 return ERR(NONE);
384}
385
Andreas Gampe368a2082016-10-28 17:33:13 -0700386jvmtiError MethodUtil::GetMethodDeclaringClass(jvmtiEnv* env ATTRIBUTE_UNUSED,
387 jmethodID method,
388 jclass* declaring_class_ptr) {
389 if (declaring_class_ptr == nullptr) {
390 return ERR(NULL_POINTER);
391 }
392
Andreas Gampe13b27842016-11-07 16:48:23 -0800393 art::ArtMethod* art_method = art::jni::DecodeArtMethod(method);
Andreas Gampe368a2082016-10-28 17:33:13 -0700394 // Note: No GetInterfaceMethodIfProxy, we want to actual class.
395
Andreas Gampe13b27842016-11-07 16:48:23 -0800396 art::ScopedObjectAccess soa(art::Thread::Current());
Andreas Gampe368a2082016-10-28 17:33:13 -0700397 art::mirror::Class* klass = art_method->GetDeclaringClass();
398 *declaring_class_ptr = soa.AddLocalReference<jclass>(klass);
399
400 return ERR(NONE);
401}
402
Andreas Gampef71832e2017-01-09 11:38:04 -0800403jvmtiError MethodUtil::GetMethodLocation(jvmtiEnv* env ATTRIBUTE_UNUSED,
404 jmethodID method,
405 jlocation* start_location_ptr,
406 jlocation* end_location_ptr) {
407 if (method == nullptr) {
408 return ERR(INVALID_METHODID);
409 }
410 art::ArtMethod* art_method = art::jni::DecodeArtMethod(method);
411
412 if (art_method->IsNative()) {
413 return ERR(NATIVE_METHOD);
414 }
415
416 if (start_location_ptr == nullptr || end_location_ptr == nullptr) {
417 return ERR(NULL_POINTER);
418 }
419
420 art::ScopedObjectAccess soa(art::Thread::Current());
421 if (art_method->IsProxyMethod() || art_method->IsAbstract()) {
Andreas Gampee1f79b62017-04-12 21:11:28 -0700422 // This isn't specified as an error case, so return -1/-1 as the RI does.
423 *start_location_ptr = -1;
424 *end_location_ptr = -1;
Andreas Gampef71832e2017-01-09 11:38:04 -0800425 return ERR(NONE);
426 }
427
428 DCHECK_NE(art_method->GetCodeItemOffset(), 0u);
429 *start_location_ptr = 0;
430 *end_location_ptr = art_method->GetCodeItem()->insns_size_in_code_units_ - 1;
431
432 return ERR(NONE);
433}
434
Andreas Gampe36bcd4f2016-10-28 18:07:18 -0700435jvmtiError MethodUtil::GetMethodModifiers(jvmtiEnv* env ATTRIBUTE_UNUSED,
436 jmethodID method,
437 jint* modifiers_ptr) {
438 if (modifiers_ptr == nullptr) {
439 return ERR(NULL_POINTER);
440 }
441
Andreas Gampe13b27842016-11-07 16:48:23 -0800442 art::ArtMethod* art_method = art::jni::DecodeArtMethod(method);
Andreas Gampe36bcd4f2016-10-28 18:07:18 -0700443 uint32_t modifiers = art_method->GetAccessFlags();
444
445 // Note: Keep this code in sync with Executable.fixMethodFlags.
446 if ((modifiers & art::kAccAbstract) != 0) {
447 modifiers &= ~art::kAccNative;
448 }
449 modifiers &= ~art::kAccSynchronized;
450 if ((modifiers & art::kAccDeclaredSynchronized) != 0) {
451 modifiers |= art::kAccSynchronized;
452 }
453 modifiers &= art::kAccJavaFlagsMask;
454
455 *modifiers_ptr = modifiers;
456 return ERR(NONE);
457}
458
Andreas Gampeda3e5612016-12-13 19:00:53 -0800459using LineNumberContext = std::vector<jvmtiLineNumberEntry>;
460
461static bool CollectLineNumbers(void* void_context, const art::DexFile::PositionInfo& entry) {
462 LineNumberContext* context = reinterpret_cast<LineNumberContext*>(void_context);
463 jvmtiLineNumberEntry jvmti_entry = { static_cast<jlocation>(entry.address_),
464 static_cast<jint>(entry.line_) };
465 context->push_back(jvmti_entry);
466 return false; // Collect all, no early exit.
467}
468
469jvmtiError MethodUtil::GetLineNumberTable(jvmtiEnv* env,
470 jmethodID method,
471 jint* entry_count_ptr,
472 jvmtiLineNumberEntry** table_ptr) {
473 if (method == nullptr) {
474 return ERR(NULL_POINTER);
475 }
476 art::ArtMethod* art_method = art::jni::DecodeArtMethod(method);
477 DCHECK(!art_method->IsRuntimeMethod());
478
479 const art::DexFile::CodeItem* code_item;
480 const art::DexFile* dex_file;
481 {
482 art::ScopedObjectAccess soa(art::Thread::Current());
483
484 if (art_method->IsProxyMethod()) {
485 return ERR(ABSENT_INFORMATION);
486 }
487 if (art_method->IsNative()) {
488 return ERR(NATIVE_METHOD);
489 }
490 if (entry_count_ptr == nullptr || table_ptr == nullptr) {
491 return ERR(NULL_POINTER);
492 }
493
494 code_item = art_method->GetCodeItem();
495 dex_file = art_method->GetDexFile();
496 DCHECK(code_item != nullptr) << art_method->PrettyMethod() << " " << dex_file->GetLocation();
497 }
498
499 LineNumberContext context;
500 bool success = dex_file->DecodeDebugPositionInfo(code_item, CollectLineNumbers, &context);
501 if (!success) {
502 return ERR(ABSENT_INFORMATION);
503 }
504
505 unsigned char* data;
506 jlong mem_size = context.size() * sizeof(jvmtiLineNumberEntry);
507 jvmtiError alloc_error = env->Allocate(mem_size, &data);
508 if (alloc_error != ERR(NONE)) {
509 return alloc_error;
510 }
511 *table_ptr = reinterpret_cast<jvmtiLineNumberEntry*>(data);
512 memcpy(*table_ptr, context.data(), mem_size);
513 *entry_count_ptr = static_cast<jint>(context.size());
514
515 return ERR(NONE);
516}
517
Andreas Gampefdeef522017-01-09 14:40:25 -0800518template <typename T>
519static jvmtiError IsMethodT(jvmtiEnv* env ATTRIBUTE_UNUSED,
520 jmethodID method,
521 T test,
522 jboolean* is_t_ptr) {
523 if (method == nullptr) {
524 return ERR(INVALID_METHODID);
525 }
526 if (is_t_ptr == nullptr) {
527 return ERR(NULL_POINTER);
528 }
529
530 art::ArtMethod* art_method = art::jni::DecodeArtMethod(method);
531 *is_t_ptr = test(art_method) ? JNI_TRUE : JNI_FALSE;
532
533 return ERR(NONE);
534}
535
536jvmtiError MethodUtil::IsMethodNative(jvmtiEnv* env, jmethodID m, jboolean* is_native_ptr) {
537 auto test = [](art::ArtMethod* method) {
538 return method->IsNative();
539 };
540 return IsMethodT(env, m, test, is_native_ptr);
541}
542
543jvmtiError MethodUtil::IsMethodObsolete(jvmtiEnv* env, jmethodID m, jboolean* is_obsolete_ptr) {
544 auto test = [](art::ArtMethod* method) {
545 return method->IsObsolete();
546 };
547 return IsMethodT(env, m, test, is_obsolete_ptr);
548}
549
550jvmtiError MethodUtil::IsMethodSynthetic(jvmtiEnv* env, jmethodID m, jboolean* is_synthetic_ptr) {
551 auto test = [](art::ArtMethod* method) {
552 return method->IsSynthetic();
553 };
554 return IsMethodT(env, m, test, is_synthetic_ptr);
555}
556
Alex Lightbebd7bd2017-07-25 14:05:52 -0700557class CommonLocalVariableClosure : public art::Closure {
558 public:
559 CommonLocalVariableClosure(art::Thread* caller,
560 jint depth,
561 jint slot)
562 : result_(ERR(INTERNAL)), caller_(caller), depth_(depth), slot_(slot) {}
563
564 void Run(art::Thread* self) OVERRIDE REQUIRES(art::Locks::mutator_lock_) {
565 art::Locks::mutator_lock_->AssertSharedHeld(art::Thread::Current());
566 std::unique_ptr<art::Context> context(art::Context::Create());
567 FindFrameAtDepthVisitor visitor(self, context.get(), depth_);
568 visitor.WalkStack();
569 if (!visitor.FoundFrame()) {
570 // Must have been a bad depth.
571 result_ = ERR(NO_MORE_FRAMES);
572 return;
573 }
574 art::ArtMethod* method = visitor.GetMethod();
Alex Light3dea2122017-10-11 15:56:48 +0000575 // Native and 'art' proxy methods don't have registers.
576 if (method->IsNative() || method->IsProxyMethod()) {
577 // TODO It might be useful to fake up support for get at least on proxy frames.
Alex Lightbebd7bd2017-07-25 14:05:52 -0700578 result_ = ERR(OPAQUE_FRAME);
579 return;
580 } else if (method->GetCodeItem()->registers_size_ <= slot_) {
581 result_ = ERR(INVALID_SLOT);
582 return;
583 }
Alex Light0a5ec3d2017-07-25 16:50:26 -0700584 bool needs_instrument = !visitor.IsShadowFrame();
Alex Lightbebd7bd2017-07-25 14:05:52 -0700585 uint32_t pc = visitor.GetDexPc(/*abort_on_failure*/ false);
Andreas Gampee2abbc62017-09-15 11:59:26 -0700586 if (pc == art::dex::kDexNoIndex) {
Alex Lightbebd7bd2017-07-25 14:05:52 -0700587 // Cannot figure out current PC.
588 result_ = ERR(OPAQUE_FRAME);
589 return;
590 }
591 std::string descriptor;
592 art::Primitive::Type slot_type = art::Primitive::kPrimVoid;
593 jvmtiError err = GetSlotType(method, pc, &descriptor, &slot_type);
594 if (err != OK) {
595 result_ = err;
596 return;
597 }
598
599 err = GetTypeError(method, slot_type, descriptor);
600 if (err != OK) {
601 result_ = err;
602 return;
603 }
604 result_ = Execute(method, visitor);
Alex Light0a5ec3d2017-07-25 16:50:26 -0700605 if (needs_instrument) {
606 art::Runtime::Current()->GetInstrumentation()->InstrumentThreadStack(self);
607 }
Alex Lightbebd7bd2017-07-25 14:05:52 -0700608 }
609
610 jvmtiError GetResult() const {
611 return result_;
612 }
613
614 protected:
615 virtual jvmtiError Execute(art::ArtMethod* method, art::StackVisitor& visitor)
616 REQUIRES(art::Locks::mutator_lock_) = 0;
617 virtual jvmtiError GetTypeError(art::ArtMethod* method,
618 art::Primitive::Type type,
619 const std::string& descriptor)
620 REQUIRES(art::Locks::mutator_lock_) = 0;
621
622 jvmtiError GetSlotType(art::ArtMethod* method,
623 uint32_t dex_pc,
624 /*out*/std::string* descriptor,
625 /*out*/art::Primitive::Type* type)
626 REQUIRES(art::Locks::mutator_lock_) {
627 const art::DexFile* dex_file = method->GetDexFile();
628 const art::DexFile::CodeItem* code_item = method->GetCodeItem();
629 if (dex_file == nullptr || code_item == nullptr) {
630 return ERR(OPAQUE_FRAME);
631 }
632
633 struct GetLocalVariableInfoContext {
634 explicit GetLocalVariableInfoContext(jint slot,
635 uint32_t pc,
636 std::string* out_descriptor,
637 art::Primitive::Type* out_type)
638 : found_(false), jslot_(slot), pc_(pc), descriptor_(out_descriptor), type_(out_type) {
639 *descriptor_ = "";
640 *type_ = art::Primitive::kPrimVoid;
641 }
642
643 static void Callback(void* raw_ctx, const art::DexFile::LocalInfo& entry) {
644 reinterpret_cast<GetLocalVariableInfoContext*>(raw_ctx)->Handle(entry);
645 }
646
647 void Handle(const art::DexFile::LocalInfo& entry) {
648 if (found_) {
649 return;
650 } else if (entry.start_address_ <= pc_ &&
651 entry.end_address_ > pc_ &&
652 entry.reg_ == jslot_) {
653 found_ = true;
654 *type_ = art::Primitive::GetType(entry.descriptor_[0]);
655 *descriptor_ = entry.descriptor_;
656 }
657 return;
658 }
659
660 bool found_;
661 jint jslot_;
662 uint32_t pc_;
663 std::string* descriptor_;
664 art::Primitive::Type* type_;
665 };
666
667 GetLocalVariableInfoContext context(slot_, dex_pc, descriptor, type);
668 if (!dex_file->DecodeDebugLocalInfo(code_item,
669 method->IsStatic(),
670 method->GetDexMethodIndex(),
671 GetLocalVariableInfoContext::Callback,
672 &context) || !context.found_) {
673 // Something went wrong with decoding the debug information. It might as well not be there.
674 return ERR(INVALID_SLOT);
675 } else {
676 return OK;
677 }
678 }
679
680 jvmtiError result_;
681 art::Thread* caller_;
682 jint depth_;
683 jint slot_;
684};
685
686class GetLocalVariableClosure : public CommonLocalVariableClosure {
687 public:
688 GetLocalVariableClosure(art::Thread* caller,
689 jint depth,
690 jint slot,
691 art::Primitive::Type type,
692 jvalue* val)
693 : CommonLocalVariableClosure(caller, depth, slot), type_(type), val_(val) {}
694
695 protected:
696 jvmtiError GetTypeError(art::ArtMethod* method ATTRIBUTE_UNUSED,
697 art::Primitive::Type slot_type,
698 const std::string& descriptor ATTRIBUTE_UNUSED)
699 OVERRIDE REQUIRES(art::Locks::mutator_lock_) {
700 switch (slot_type) {
701 case art::Primitive::kPrimByte:
702 case art::Primitive::kPrimChar:
703 case art::Primitive::kPrimInt:
704 case art::Primitive::kPrimShort:
705 case art::Primitive::kPrimBoolean:
706 return type_ == art::Primitive::kPrimInt ? OK : ERR(TYPE_MISMATCH);
707 case art::Primitive::kPrimLong:
708 case art::Primitive::kPrimFloat:
709 case art::Primitive::kPrimDouble:
710 case art::Primitive::kPrimNot:
711 return type_ == slot_type ? OK : ERR(TYPE_MISMATCH);
712 case art::Primitive::kPrimVoid:
713 LOG(FATAL) << "Unexpected primitive type " << slot_type;
714 UNREACHABLE();
715 }
716 }
717
718 jvmtiError Execute(art::ArtMethod* method, art::StackVisitor& visitor)
719 OVERRIDE REQUIRES(art::Locks::mutator_lock_) {
720 switch (type_) {
721 case art::Primitive::kPrimNot: {
722 uint32_t ptr_val;
723 if (!visitor.GetVReg(method,
724 static_cast<uint16_t>(slot_),
725 art::kReferenceVReg,
726 &ptr_val)) {
727 return ERR(OPAQUE_FRAME);
728 }
729 art::ObjPtr<art::mirror::Object> obj(reinterpret_cast<art::mirror::Object*>(ptr_val));
730 val_->l = obj.IsNull() ? nullptr : caller_->GetJniEnv()->AddLocalReference<jobject>(obj);
731 break;
732 }
733 case art::Primitive::kPrimInt:
734 case art::Primitive::kPrimFloat: {
735 if (!visitor.GetVReg(method,
736 static_cast<uint16_t>(slot_),
737 type_ == art::Primitive::kPrimFloat ? art::kFloatVReg : art::kIntVReg,
738 reinterpret_cast<uint32_t*>(&val_->i))) {
739 return ERR(OPAQUE_FRAME);
740 }
741 break;
742 }
743 case art::Primitive::kPrimDouble:
744 case art::Primitive::kPrimLong: {
745 auto lo_type = type_ == art::Primitive::kPrimLong ? art::kLongLoVReg : art::kDoubleLoVReg;
746 auto high_type = type_ == art::Primitive::kPrimLong ? art::kLongHiVReg : art::kDoubleHiVReg;
747 if (!visitor.GetVRegPair(method,
748 static_cast<uint16_t>(slot_),
749 lo_type,
750 high_type,
751 reinterpret_cast<uint64_t*>(&val_->j))) {
752 return ERR(OPAQUE_FRAME);
753 }
754 break;
755 }
756 default: {
757 LOG(FATAL) << "unexpected register type " << type_;
758 UNREACHABLE();
759 }
760 }
761 return OK;
762 }
763
764 private:
765 art::Primitive::Type type_;
766 jvalue* val_;
767};
768
769jvmtiError MethodUtil::GetLocalVariableGeneric(jvmtiEnv* env ATTRIBUTE_UNUSED,
770 jthread thread,
771 jint depth,
772 jint slot,
773 art::Primitive::Type type,
774 jvalue* val) {
775 if (depth < 0) {
776 return ERR(ILLEGAL_ARGUMENT);
777 }
778 art::Thread* self = art::Thread::Current();
Alex Light0a5ec3d2017-07-25 16:50:26 -0700779 // Suspend JIT since it can get confused if we deoptimize methods getting jitted.
780 art::jit::ScopedJitSuspend suspend_jit;
Alex Lightbebd7bd2017-07-25 14:05:52 -0700781 art::ScopedObjectAccess soa(self);
Alex Light3ae82532017-07-26 13:59:07 -0700782 art::MutexLock mu(self, *art::Locks::thread_list_lock_);
Alex Light7ddc23d2017-09-22 15:33:41 -0700783 art::Thread* target = nullptr;
784 jvmtiError err = ERR(INTERNAL);
785 if (!ThreadUtil::GetAliveNativeThread(thread, soa, &target, &err)) {
786 return err;
Alex Lightbebd7bd2017-07-25 14:05:52 -0700787 }
788 GetLocalVariableClosure c(self, depth, slot, type, val);
Alex Lightbebd7bd2017-07-25 14:05:52 -0700789 if (!target->RequestSynchronousCheckpoint(&c)) {
790 return ERR(THREAD_NOT_ALIVE);
791 } else {
792 return c.GetResult();
793 }
794}
795
796class SetLocalVariableClosure : public CommonLocalVariableClosure {
797 public:
798 SetLocalVariableClosure(art::Thread* caller,
799 jint depth,
800 jint slot,
801 art::Primitive::Type type,
802 jvalue val)
803 : CommonLocalVariableClosure(caller, depth, slot), type_(type), val_(val) {}
804
805 protected:
806 jvmtiError GetTypeError(art::ArtMethod* method,
807 art::Primitive::Type slot_type,
808 const std::string& descriptor)
809 OVERRIDE REQUIRES(art::Locks::mutator_lock_) {
810 switch (slot_type) {
811 case art::Primitive::kPrimNot: {
812 if (type_ != art::Primitive::kPrimNot) {
813 return ERR(TYPE_MISMATCH);
814 } else if (val_.l == nullptr) {
815 return OK;
816 } else {
817 art::ClassLinker* cl = art::Runtime::Current()->GetClassLinker();
818 art::ObjPtr<art::mirror::Class> set_class =
819 caller_->DecodeJObject(val_.l)->GetClass();
820 art::ObjPtr<art::mirror::ClassLoader> loader =
821 method->GetDeclaringClass()->GetClassLoader();
822 art::ObjPtr<art::mirror::Class> slot_class =
823 cl->LookupClass(caller_, descriptor.c_str(), loader);
824 DCHECK(!slot_class.IsNull());
825 return slot_class->IsAssignableFrom(set_class) ? OK : ERR(TYPE_MISMATCH);
826 }
827 }
828 case art::Primitive::kPrimByte:
829 case art::Primitive::kPrimChar:
830 case art::Primitive::kPrimInt:
831 case art::Primitive::kPrimShort:
832 case art::Primitive::kPrimBoolean:
833 return type_ == art::Primitive::kPrimInt ? OK : ERR(TYPE_MISMATCH);
834 case art::Primitive::kPrimLong:
835 case art::Primitive::kPrimFloat:
836 case art::Primitive::kPrimDouble:
837 return type_ == slot_type ? OK : ERR(TYPE_MISMATCH);
838 case art::Primitive::kPrimVoid:
839 LOG(FATAL) << "Unexpected primitive type " << slot_type;
840 UNREACHABLE();
841 }
842 }
843
844 jvmtiError Execute(art::ArtMethod* method, art::StackVisitor& visitor)
845 OVERRIDE REQUIRES(art::Locks::mutator_lock_) {
846 switch (type_) {
847 case art::Primitive::kPrimNot: {
848 uint32_t ptr_val;
849 art::ObjPtr<art::mirror::Object> obj(caller_->DecodeJObject(val_.l));
850 ptr_val = static_cast<uint32_t>(reinterpret_cast<uintptr_t>(obj.Ptr()));
851 if (!visitor.SetVReg(method,
852 static_cast<uint16_t>(slot_),
853 ptr_val,
854 art::kReferenceVReg)) {
855 return ERR(OPAQUE_FRAME);
856 }
857 break;
858 }
859 case art::Primitive::kPrimInt:
860 case art::Primitive::kPrimFloat: {
861 if (!visitor.SetVReg(method,
862 static_cast<uint16_t>(slot_),
863 static_cast<uint32_t>(val_.i),
864 type_ == art::Primitive::kPrimFloat ? art::kFloatVReg
865 : art::kIntVReg)) {
866 return ERR(OPAQUE_FRAME);
867 }
868 break;
869 }
870 case art::Primitive::kPrimDouble:
871 case art::Primitive::kPrimLong: {
872 auto lo_type = type_ == art::Primitive::kPrimLong ? art::kLongLoVReg : art::kDoubleLoVReg;
873 auto high_type = type_ == art::Primitive::kPrimLong ? art::kLongHiVReg : art::kDoubleHiVReg;
874 if (!visitor.SetVRegPair(method,
875 static_cast<uint16_t>(slot_),
876 static_cast<uint64_t>(val_.j),
877 lo_type,
878 high_type)) {
879 return ERR(OPAQUE_FRAME);
880 }
881 break;
882 }
883 default: {
884 LOG(FATAL) << "unexpected register type " << type_;
885 UNREACHABLE();
886 }
887 }
888 return OK;
889 }
890
891 private:
892 art::Primitive::Type type_;
893 jvalue val_;
894};
895
896jvmtiError MethodUtil::SetLocalVariableGeneric(jvmtiEnv* env ATTRIBUTE_UNUSED,
897 jthread thread,
898 jint depth,
899 jint slot,
900 art::Primitive::Type type,
901 jvalue val) {
902 if (depth < 0) {
903 return ERR(ILLEGAL_ARGUMENT);
904 }
905 art::Thread* self = art::Thread::Current();
Alex Light0a5ec3d2017-07-25 16:50:26 -0700906 // Suspend JIT since it can get confused if we deoptimize methods getting jitted.
907 art::jit::ScopedJitSuspend suspend_jit;
Alex Lightbebd7bd2017-07-25 14:05:52 -0700908 art::ScopedObjectAccess soa(self);
Alex Light3ae82532017-07-26 13:59:07 -0700909 art::MutexLock mu(self, *art::Locks::thread_list_lock_);
Alex Light7ddc23d2017-09-22 15:33:41 -0700910 art::Thread* target = nullptr;
911 jvmtiError err = ERR(INTERNAL);
912 if (!ThreadUtil::GetAliveNativeThread(thread, soa, &target, &err)) {
913 return err;
Alex Lightbebd7bd2017-07-25 14:05:52 -0700914 }
915 SetLocalVariableClosure c(self, depth, slot, type, val);
Alex Lightbebd7bd2017-07-25 14:05:52 -0700916 if (!target->RequestSynchronousCheckpoint(&c)) {
917 return ERR(THREAD_NOT_ALIVE);
918 } else {
919 return c.GetResult();
920 }
921}
922
923class GetLocalInstanceClosure : public art::Closure {
924 public:
925 GetLocalInstanceClosure(art::Thread* caller, jint depth, jobject* val)
926 : result_(ERR(INTERNAL)),
927 caller_(caller),
928 depth_(depth),
929 val_(val) {}
930
931 void Run(art::Thread* self) OVERRIDE REQUIRES(art::Locks::mutator_lock_) {
932 art::Locks::mutator_lock_->AssertSharedHeld(art::Thread::Current());
933 std::unique_ptr<art::Context> context(art::Context::Create());
934 FindFrameAtDepthVisitor visitor(self, context.get(), depth_);
935 visitor.WalkStack();
936 if (!visitor.FoundFrame()) {
937 // Must have been a bad depth.
938 result_ = ERR(NO_MORE_FRAMES);
939 return;
940 }
Alex Lightbebd7bd2017-07-25 14:05:52 -0700941 result_ = OK;
942 art::ObjPtr<art::mirror::Object> obj = visitor.GetThisObject();
943 *val_ = obj.IsNull() ? nullptr : caller_->GetJniEnv()->AddLocalReference<jobject>(obj);
944 }
945
946 jvmtiError GetResult() const {
947 return result_;
948 }
949
950 private:
951 jvmtiError result_;
952 art::Thread* caller_;
953 jint depth_;
954 jobject* val_;
955};
956
957jvmtiError MethodUtil::GetLocalInstance(jvmtiEnv* env ATTRIBUTE_UNUSED,
958 jthread thread,
959 jint depth,
960 jobject* data) {
961 if (depth < 0) {
962 return ERR(ILLEGAL_ARGUMENT);
963 }
964 art::Thread* self = art::Thread::Current();
965 art::ScopedObjectAccess soa(self);
Alex Light3ae82532017-07-26 13:59:07 -0700966 art::MutexLock mu(self, *art::Locks::thread_list_lock_);
Alex Light7ddc23d2017-09-22 15:33:41 -0700967 art::Thread* target = nullptr;
968 jvmtiError err = ERR(INTERNAL);
969 if (!ThreadUtil::GetAliveNativeThread(thread, soa, &target, &err)) {
970 return err;
Alex Lightbebd7bd2017-07-25 14:05:52 -0700971 }
972 GetLocalInstanceClosure c(self, depth, data);
Alex Lightbebd7bd2017-07-25 14:05:52 -0700973 if (!target->RequestSynchronousCheckpoint(&c)) {
974 return ERR(THREAD_NOT_ALIVE);
975 } else {
976 return c.GetResult();
977 }
978}
979
980#define FOR_JVMTI_JVALUE_TYPES(fn) \
981 fn(jint, art::Primitive::kPrimInt, i) \
982 fn(jlong, art::Primitive::kPrimLong, j) \
983 fn(jfloat, art::Primitive::kPrimFloat, f) \
984 fn(jdouble, art::Primitive::kPrimDouble, d) \
985 fn(jobject, art::Primitive::kPrimNot, l)
986
987namespace impl {
988
989template<typename T> void WriteJvalue(T, jvalue*);
990template<typename T> void ReadJvalue(jvalue, T*);
991template<typename T> art::Primitive::Type GetJNIType();
992
993#define JNI_TYPE_CHAR(type, prim, id) \
994template<> art::Primitive::Type GetJNIType<type>() { \
995 return prim; \
996}
997
998FOR_JVMTI_JVALUE_TYPES(JNI_TYPE_CHAR);
999
1000#undef JNI_TYPE_CHAR
1001
Andreas Gampe49fc60e2017-08-24 13:19:59 -07001002#define RW_JVALUE(srctype, prim, id) \
1003 template<> void ReadJvalue<srctype>(jvalue in, std::add_pointer<srctype>::type out) { \
Alex Lightbebd7bd2017-07-25 14:05:52 -07001004 *out = in.id; \
1005 } \
Andreas Gampe49fc60e2017-08-24 13:19:59 -07001006 template<> void WriteJvalue<srctype>(srctype in, jvalue* out) { \
Alex Lightbebd7bd2017-07-25 14:05:52 -07001007 out->id = in; \
1008 }
1009
1010FOR_JVMTI_JVALUE_TYPES(RW_JVALUE);
1011
1012#undef RW_JVALUE
1013
1014} // namespace impl
1015
1016template<typename T>
1017jvmtiError MethodUtil::SetLocalVariable(jvmtiEnv* env,
1018 jthread thread,
1019 jint depth,
1020 jint slot,
1021 T data) {
1022 jvalue v = {.j = 0};
1023 art::Primitive::Type type = impl::GetJNIType<T>();
1024 impl::WriteJvalue(data, &v);
1025 return SetLocalVariableGeneric(env, thread, depth, slot, type, v);
1026}
1027
1028template<typename T>
1029jvmtiError MethodUtil::GetLocalVariable(jvmtiEnv* env,
1030 jthread thread,
1031 jint depth,
1032 jint slot,
1033 T* data) {
1034 if (data == nullptr) {
1035 return ERR(NULL_POINTER);
1036 }
1037 jvalue v = {.j = 0};
1038 art::Primitive::Type type = impl::GetJNIType<T>();
1039 jvmtiError err = GetLocalVariableGeneric(env, thread, depth, slot, type, &v);
1040 if (err != OK) {
1041 return err;
1042 } else {
1043 impl::ReadJvalue(v, data);
1044 return OK;
1045 }
1046}
1047
Andreas Gampe49fc60e2017-08-24 13:19:59 -07001048#define GET_SET_LV(srctype, prim, id) \
1049 template jvmtiError MethodUtil::GetLocalVariable<srctype>(jvmtiEnv*, \
1050 jthread, \
1051 jint, \
1052 jint, \
1053 std::add_pointer<srctype>::type); \
1054 template jvmtiError MethodUtil::SetLocalVariable<srctype>(jvmtiEnv*, \
1055 jthread, \
1056 jint, \
1057 jint, \
1058 srctype);
Alex Lightbebd7bd2017-07-25 14:05:52 -07001059
1060FOR_JVMTI_JVALUE_TYPES(GET_SET_LV);
1061
1062#undef GET_SET_LV
1063
1064#undef FOR_JVMTI_JVALUE_TYPES
1065
Andreas Gampe3c252f02016-10-27 18:25:17 -07001066} // namespace openjdkjvmti