comparison 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
comparison
equal deleted inserted replaced
1338:f5dd08ad65df 1339:09ac706c2623
817 return NULL; 817 return NULL;
818 } 818 }
819 _package_hash_table->copy_pkgnames(packages); 819 _package_hash_table->copy_pkgnames(packages);
820 } 820 }
821 // Allocate objArray and fill with java.lang.String 821 // Allocate objArray and fill with java.lang.String
822 objArrayOop r = oopFactory::new_objArray(SystemDictionary::string_klass(), 822 objArrayOop r = oopFactory::new_objArray(SystemDictionary::String_klass(),
823 nof_entries, CHECK_0); 823 nof_entries, CHECK_0);
824 objArrayHandle result(THREAD, r); 824 objArrayHandle result(THREAD, r);
825 for (int i = 0; i < nof_entries; i++) { 825 for (int i = 0; i < nof_entries; i++) {
826 Handle str = java_lang_String::create_from_str(packages[i], CHECK_0); 826 Handle str = java_lang_String::create_from_str(packages[i], CHECK_0);
827 result->obj_at_put(i, str()); 827 result->obj_at_put(i, str());
1247 } 1247 }
1248 vm_exit(0); 1248 vm_exit(0);
1249 } 1249 }
1250 1250
1251 int ClassLoader::_compile_the_world_counter = 0; 1251 int ClassLoader::_compile_the_world_counter = 0;
1252 static int _codecache_sweep_counter = 0;
1252 1253
1253 void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) { 1254 void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) {
1254 int len = (int)strlen(name); 1255 int len = (int)strlen(name);
1255 if (len > 6 && strcmp(".class", name + len - 6) == 0) { 1256 if (len > 6 && strcmp(".class", name + len - 6) == 0) {
1256 // We have a .class file 1257 // We have a .class file
1291 // Preload all classes to get around uncommon traps 1292 // Preload all classes to get around uncommon traps
1292 // Iterate over all methods in class 1293 // Iterate over all methods in class
1293 for (int n = 0; n < k->methods()->length(); n++) { 1294 for (int n = 0; n < k->methods()->length(); n++) {
1294 methodHandle m (THREAD, methodOop(k->methods()->obj_at(n))); 1295 methodHandle m (THREAD, methodOop(k->methods()->obj_at(n)));
1295 if (CompilationPolicy::canBeCompiled(m)) { 1296 if (CompilationPolicy::canBeCompiled(m)) {
1297
1298 if (++_codecache_sweep_counter == CompileTheWorldSafepointInterval) {
1299 // Give sweeper a chance to keep up with CTW
1300 VM_ForceSafepoint op;
1301 VMThread::execute(&op);
1302 _codecache_sweep_counter = 0;
1303 }
1296 // Force compilation 1304 // Force compilation
1297 CompileBroker::compile_method(m, InvocationEntryBci, 1305 CompileBroker::compile_method(m, InvocationEntryBci,
1298 methodHandle(), 0, "CTW", THREAD); 1306 methodHandle(), 0, "CTW", THREAD);
1299 if (HAS_PENDING_EXCEPTION) { 1307 if (HAS_PENDING_EXCEPTION) {
1300 CLEAR_PENDING_EXCEPTION; 1308 CLEAR_PENDING_EXCEPTION;