diff 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
line wrap: on
line diff
--- a/src/share/vm/runtime/os.cpp	Sat Sep 14 20:40:34 2013 +0100
+++ b/src/share/vm/runtime/os.cpp	Thu Oct 03 19:13:12 2013 +0100
@@ -314,6 +314,11 @@
   }
 }
 
+void os::init_before_ergo() {
+  // We need to initialize large page support here because ergonomics takes some
+  // decisions depending on large page support and the calculated large page size.
+  large_page_init();
+}
 
 void os::signal_init() {
   if (!ReduceSignalUsage) {
@@ -454,6 +459,7 @@
  */
 void* os::find_agent_function(AgentLibrary *agent_lib, bool check_lib,
                               const char *syms[], size_t syms_len) {
+  assert(agent_lib != NULL, "sanity check");
   const char *lib_name;
   void *handle = agent_lib->os_lib();
   void *entryName = NULL;
@@ -484,6 +490,7 @@
   void *proc_handle;
   void *save_handle;
 
+  assert(agent_lib != NULL, "sanity check");
   if (agent_lib->name() == NULL) {
     return false;
   }
@@ -493,14 +500,13 @@
   // We want to look in this process' symbol table.
   agent_lib->set_os_lib(proc_handle);
   ret = find_agent_function(agent_lib, true, syms, syms_len);
-  agent_lib->set_os_lib(save_handle);
   if (ret != NULL) {
     // Found an entry point like Agent_OnLoad_lib_name so we have a static agent
-    agent_lib->set_os_lib(proc_handle);
     agent_lib->set_valid();
     agent_lib->set_static_lib(true);
     return true;
   }
+  agent_lib->set_os_lib(save_handle);
   return false;
 }