equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
264 JavaThread *java_thread = (JavaThread *)thread; |
264 JavaThread *java_thread = (JavaThread *)thread; |
265 oop threadObj = java_thread->threadObj(); |
265 oop threadObj = java_thread->threadObj(); |
266 if (threadObj == NULL) { |
266 if (threadObj == NULL) { |
267 return "NULL"; |
267 return "NULL"; |
268 } |
268 } |
269 typeArrayOop name = java_lang_Thread::name(threadObj); |
269 oop name = java_lang_Thread::name(threadObj); |
270 if (name == NULL) { |
270 if (name == NULL) { |
271 return "<NOT FILLED IN>"; |
271 return "<NOT FILLED IN>"; |
272 } |
272 } |
273 return UNICODE::as_utf8((jchar*) name->base(T_CHAR), name->length()); |
273 return java_lang_String::as_utf8_string(name); |
274 } |
274 } |
275 |
275 |
276 |
276 |
277 // return the name of the current thread |
277 // return the name of the current thread |
278 const char *JvmtiTrace::safe_get_current_thread_name() { |
278 const char *JvmtiTrace::safe_get_current_thread_name() { |