Mercurial > hg > truffle
comparison src/share/vm/runtime/os.cpp @ 17474:6fa574bfd32a
Merge
author | chegar |
---|---|
date | Thu, 03 Oct 2013 19:13:12 +0100 |
parents | 9b4ce069642e 179cd89fb279 |
children | 89152779163c ecf3678d5736 f040cf9fc9c0 |
comparison
equal
deleted
inserted
replaced
17473:9b4ce069642e | 17474:6fa574bfd32a |
---|---|
312 } | 312 } |
313 } | 313 } |
314 } | 314 } |
315 } | 315 } |
316 | 316 |
317 void os::init_before_ergo() { | |
318 // We need to initialize large page support here because ergonomics takes some | |
319 // decisions depending on large page support and the calculated large page size. | |
320 large_page_init(); | |
321 } | |
317 | 322 |
318 void os::signal_init() { | 323 void os::signal_init() { |
319 if (!ReduceSignalUsage) { | 324 if (!ReduceSignalUsage) { |
320 // Setup JavaThread for processing signals | 325 // Setup JavaThread for processing signals |
321 EXCEPTION_MARK; | 326 EXCEPTION_MARK; |
452 * executable if agent_lib->is_static_lib() == true or in the shared library | 457 * executable if agent_lib->is_static_lib() == true or in the shared library |
453 * referenced by 'handle'. | 458 * referenced by 'handle'. |
454 */ | 459 */ |
455 void* os::find_agent_function(AgentLibrary *agent_lib, bool check_lib, | 460 void* os::find_agent_function(AgentLibrary *agent_lib, bool check_lib, |
456 const char *syms[], size_t syms_len) { | 461 const char *syms[], size_t syms_len) { |
462 assert(agent_lib != NULL, "sanity check"); | |
457 const char *lib_name; | 463 const char *lib_name; |
458 void *handle = agent_lib->os_lib(); | 464 void *handle = agent_lib->os_lib(); |
459 void *entryName = NULL; | 465 void *entryName = NULL; |
460 char *agent_function_name; | 466 char *agent_function_name; |
461 size_t i; | 467 size_t i; |
482 size_t syms_len) { | 488 size_t syms_len) { |
483 void *ret; | 489 void *ret; |
484 void *proc_handle; | 490 void *proc_handle; |
485 void *save_handle; | 491 void *save_handle; |
486 | 492 |
493 assert(agent_lib != NULL, "sanity check"); | |
487 if (agent_lib->name() == NULL) { | 494 if (agent_lib->name() == NULL) { |
488 return false; | 495 return false; |
489 } | 496 } |
490 proc_handle = get_default_process_handle(); | 497 proc_handle = get_default_process_handle(); |
491 // Check for Agent_OnLoad/Attach_lib_name function | 498 // Check for Agent_OnLoad/Attach_lib_name function |
492 save_handle = agent_lib->os_lib(); | 499 save_handle = agent_lib->os_lib(); |
493 // We want to look in this process' symbol table. | 500 // We want to look in this process' symbol table. |
494 agent_lib->set_os_lib(proc_handle); | 501 agent_lib->set_os_lib(proc_handle); |
495 ret = find_agent_function(agent_lib, true, syms, syms_len); | 502 ret = find_agent_function(agent_lib, true, syms, syms_len); |
496 agent_lib->set_os_lib(save_handle); | |
497 if (ret != NULL) { | 503 if (ret != NULL) { |
498 // Found an entry point like Agent_OnLoad_lib_name so we have a static agent | 504 // Found an entry point like Agent_OnLoad_lib_name so we have a static agent |
499 agent_lib->set_os_lib(proc_handle); | |
500 agent_lib->set_valid(); | 505 agent_lib->set_valid(); |
501 agent_lib->set_static_lib(true); | 506 agent_lib->set_static_lib(true); |
502 return true; | 507 return true; |
503 } | 508 } |
509 agent_lib->set_os_lib(save_handle); | |
504 return false; | 510 return false; |
505 } | 511 } |
506 | 512 |
507 // --------------------- heap allocation utilities --------------------- | 513 // --------------------- heap allocation utilities --------------------- |
508 | 514 |