comparison src/share/vm/prims/jvmtiExport.cpp @ 1980:828eafbd85cc

6348631: remove the use of the HPI library from Hotspot Summary: move functions from hpi library to hotspot, communicate with licensees and open source community, check jdk for dependency, file CCC request Reviewed-by: coleenp, acorn, dsamersoff
author ikrylov
date Wed, 01 Dec 2010 18:26:32 -0500
parents f95d63e2154a
children 684faacebf20
comparison
equal deleted inserted replaced
1972:f95d63e2154a 1980:828eafbd85cc
2296 2296
2297 // If the path is absolute we attempt to load the library. Otherwise we try to 2297 // If the path is absolute we attempt to load the library. Otherwise we try to
2298 // load it from the standard dll directory. 2298 // load it from the standard dll directory.
2299 2299
2300 if (is_absolute_path) { 2300 if (is_absolute_path) {
2301 library = hpi::dll_load(agent, ebuf, sizeof ebuf); 2301 library = os::dll_load(agent, ebuf, sizeof ebuf);
2302 } else { 2302 } else {
2303 // Try to load the agent from the standard dll directory 2303 // Try to load the agent from the standard dll directory
2304 hpi::dll_build_name(buffer, sizeof(buffer), Arguments::get_dll_dir(), agent); 2304 os::dll_build_name(buffer, sizeof(buffer), Arguments::get_dll_dir(), agent);
2305 library = hpi::dll_load(buffer, ebuf, sizeof ebuf); 2305 library = os::dll_load(buffer, ebuf, sizeof ebuf);
2306 if (library == NULL) { 2306 if (library == NULL) {
2307 // not found - try local path 2307 // not found - try local path
2308 char ns[1] = {0}; 2308 char ns[1] = {0};
2309 hpi::dll_build_name(buffer, sizeof(buffer), ns, agent); 2309 os::dll_build_name(buffer, sizeof(buffer), ns, agent);
2310 library = hpi::dll_load(buffer, ebuf, sizeof ebuf); 2310 library = os::dll_load(buffer, ebuf, sizeof ebuf);
2311 } 2311 }
2312 } 2312 }
2313 2313
2314 // If the library was loaded then we attempt to invoke the Agent_OnAttach 2314 // If the library was loaded then we attempt to invoke the Agent_OnAttach
2315 // function 2315 // function
2318 // Lookup the Agent_OnAttach function 2318 // Lookup the Agent_OnAttach function
2319 OnAttachEntry_t on_attach_entry = NULL; 2319 OnAttachEntry_t on_attach_entry = NULL;
2320 const char *on_attach_symbols[] = AGENT_ONATTACH_SYMBOLS; 2320 const char *on_attach_symbols[] = AGENT_ONATTACH_SYMBOLS;
2321 for (uint symbol_index = 0; symbol_index < ARRAY_SIZE(on_attach_symbols); symbol_index++) { 2321 for (uint symbol_index = 0; symbol_index < ARRAY_SIZE(on_attach_symbols); symbol_index++) {
2322 on_attach_entry = 2322 on_attach_entry =
2323 CAST_TO_FN_PTR(OnAttachEntry_t, hpi::dll_lookup(library, on_attach_symbols[symbol_index])); 2323 CAST_TO_FN_PTR(OnAttachEntry_t, os::dll_lookup(library, on_attach_symbols[symbol_index]));
2324 if (on_attach_entry != NULL) break; 2324 if (on_attach_entry != NULL) break;
2325 } 2325 }
2326 2326
2327 if (on_attach_entry == NULL) { 2327 if (on_attach_entry == NULL) {
2328 // Agent_OnAttach missing - unload library 2328 // Agent_OnAttach missing - unload library
2329 hpi::dll_unload(library); 2329 os::dll_unload(library);
2330 } else { 2330 } else {
2331 // Invoke the Agent_OnAttach function 2331 // Invoke the Agent_OnAttach function
2332 JavaThread* THREAD = JavaThread::current(); 2332 JavaThread* THREAD = JavaThread::current();
2333 { 2333 {
2334 extern struct JavaVM_ main_vm; 2334 extern struct JavaVM_ main_vm;