comparison src/share/vm/prims/jvmtiEnv.cpp @ 6275:957c266d8bc5

Merge with http://hg.openjdk.java.net/hsx/hsx24/hotspot/
author Doug Simon <doug.simon@oracle.com>
date Tue, 21 Aug 2012 10:39:19 +0200
parents 0ebca2e35ca5 04ade88d9712
children e522a00b91aa
comparison
equal deleted inserted replaced
5891:fd8832ae511d 6275:957c266d8bc5
1 /* 1 /*
2 * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2003, 2012, 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.
1010 jvmtiError err = JVMTI_ERROR_NONE; 1010 jvmtiError err = JVMTI_ERROR_NONE;
1011 JavaThread* calling_thread = JavaThread::current(); 1011 JavaThread* calling_thread = JavaThread::current();
1012 1012
1013 // growable array of jvmti monitors info on the C-heap 1013 // growable array of jvmti monitors info on the C-heap
1014 GrowableArray<jvmtiMonitorStackDepthInfo*> *owned_monitors_list = 1014 GrowableArray<jvmtiMonitorStackDepthInfo*> *owned_monitors_list =
1015 new (ResourceObj::C_HEAP) GrowableArray<jvmtiMonitorStackDepthInfo*>(1, true); 1015 new (ResourceObj::C_HEAP, mtInternal) GrowableArray<jvmtiMonitorStackDepthInfo*>(1, true);
1016 1016
1017 uint32_t debug_bits = 0; 1017 uint32_t debug_bits = 0;
1018 if (is_thread_fully_suspended(java_thread, true, &debug_bits)) { 1018 if (is_thread_fully_suspended(java_thread, true, &debug_bits)) {
1019 err = get_owned_monitors(calling_thread, java_thread, owned_monitors_list); 1019 err = get_owned_monitors(calling_thread, java_thread, owned_monitors_list);
1020 } else { 1020 } else {
1055 jvmtiError err = JVMTI_ERROR_NONE; 1055 jvmtiError err = JVMTI_ERROR_NONE;
1056 JavaThread* calling_thread = JavaThread::current(); 1056 JavaThread* calling_thread = JavaThread::current();
1057 1057
1058 // growable array of jvmti monitors info on the C-heap 1058 // growable array of jvmti monitors info on the C-heap
1059 GrowableArray<jvmtiMonitorStackDepthInfo*> *owned_monitors_list = 1059 GrowableArray<jvmtiMonitorStackDepthInfo*> *owned_monitors_list =
1060 new (ResourceObj::C_HEAP) GrowableArray<jvmtiMonitorStackDepthInfo*>(1, true); 1060 new (ResourceObj::C_HEAP, mtInternal) GrowableArray<jvmtiMonitorStackDepthInfo*>(1, true);
1061 1061
1062 uint32_t debug_bits = 0; 1062 uint32_t debug_bits = 0;
1063 if (is_thread_fully_suspended(java_thread, true, &debug_bits)) { 1063 if (is_thread_fully_suspended(java_thread, true, &debug_bits)) {
1064 err = get_owned_monitors(calling_thread, java_thread, owned_monitors_list); 1064 err = get_owned_monitors(calling_thread, java_thread, owned_monitors_list);
1065 } else { 1065 } else {
2539 klassOop k = java_lang_Class::as_klassOop(k_mirror); 2539 klassOop k = java_lang_Class::as_klassOop(k_mirror);
2540 NULL_CHECK(k, JVMTI_ERROR_INVALID_CLASS); 2540 NULL_CHECK(k, JVMTI_ERROR_INVALID_CLASS);
2541 if (!Klass::cast(k)->oop_is_instance()) { 2541 if (!Klass::cast(k)->oop_is_instance()) {
2542 return JVMTI_ERROR_ABSENT_INFORMATION; 2542 return JVMTI_ERROR_ABSENT_INFORMATION;
2543 } 2543 }
2544 Symbol* sdeOop = instanceKlass::cast(k)->source_debug_extension(); 2544 char* sde = instanceKlass::cast(k)->source_debug_extension();
2545 NULL_CHECK(sdeOop, JVMTI_ERROR_ABSENT_INFORMATION); 2545 NULL_CHECK(sde, JVMTI_ERROR_ABSENT_INFORMATION);
2546 2546
2547 { 2547 {
2548 JavaThread* current_thread = JavaThread::current(); 2548 *source_debug_extension_ptr = (char *) jvmtiMalloc(strlen(sde)+1);
2549 ResourceMark rm(current_thread); 2549 strcpy(*source_debug_extension_ptr, sde);
2550 const char* sdecp = (const char*) sdeOop->as_C_string();
2551 *source_debug_extension_ptr = (char *) jvmtiMalloc(strlen(sdecp)+1);
2552 strcpy(*source_debug_extension_ptr, sdecp);
2553 } 2550 }
2554 } 2551 }
2555 2552
2556 return JVMTI_ERROR_NONE; 2553 return JVMTI_ERROR_NONE;
2557 } /* end GetSourceDebugExtension */ 2554 } /* end GetSourceDebugExtension */