diff src/share/vm/classfile/classLoader.cpp @ 1339:09ac706c2623

Merge
author asaha
date Wed, 24 Mar 2010 17:16:33 -0700
parents 99af867dfa05
children 1b41af477605 c18cbe5936b8
line wrap: on
line diff
--- a/src/share/vm/classfile/classLoader.cpp	Mon Mar 15 15:51:36 2010 -0400
+++ b/src/share/vm/classfile/classLoader.cpp	Wed Mar 24 17:16:33 2010 -0700
@@ -819,7 +819,7 @@
     _package_hash_table->copy_pkgnames(packages);
   }
   // Allocate objArray and fill with java.lang.String
-  objArrayOop r = oopFactory::new_objArray(SystemDictionary::string_klass(),
+  objArrayOop r = oopFactory::new_objArray(SystemDictionary::String_klass(),
                                            nof_entries, CHECK_0);
   objArrayHandle result(THREAD, r);
   for (int i = 0; i < nof_entries; i++) {
@@ -1249,6 +1249,7 @@
 }
 
 int ClassLoader::_compile_the_world_counter = 0;
+static int _codecache_sweep_counter = 0;
 
 void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) {
   int len = (int)strlen(name);
@@ -1293,6 +1294,13 @@
           for (int n = 0; n < k->methods()->length(); n++) {
             methodHandle m (THREAD, methodOop(k->methods()->obj_at(n)));
             if (CompilationPolicy::canBeCompiled(m)) {
+
+              if (++_codecache_sweep_counter == CompileTheWorldSafepointInterval) {
+                // Give sweeper a chance to keep up with CTW
+                VM_ForceSafepoint op;
+                VMThread::execute(&op);
+                _codecache_sweep_counter = 0;
+              }
               // Force compilation
               CompileBroker::compile_method(m, InvocationEntryBci,
                                             methodHandle(), 0, "CTW", THREAD);