< prev index next >

src/share/vm/classfile/classLoader.cpp

Print this page

        

@@ -1403,11 +1403,11 @@
   }
 
   return NULL;
 }
 
-instanceKlassHandle ClassLoader::load_class(Symbol* name, bool search_append_only, TRAPS) {
+InstanceKlass* ClassLoader::load_class(Symbol* name, bool search_append_only, TRAPS) {
   assert(name != NULL, "invariant");
   assert(THREAD->is_Java_thread(), "must be a JavaThread");
 
   ResourceMark rm(THREAD);
   HandleMark hm(THREAD);

@@ -1510,11 +1510,11 @@
   stream->set_verify(context.should_verify(classpath_index));
 
   ClassLoaderData* loader_data = ClassLoaderData::the_null_class_loader_data();
   Handle protection_domain;
 
-  instanceKlassHandle result = KlassFactory::create_from_stream(stream,
+  InstanceKlass* result = KlassFactory::create_from_stream(stream,
                                                                 name,
                                                                 loader_data,
                                                                 protection_domain,
                                                                 NULL, // host_klass
                                                                 NULL, // cp_patches

@@ -1889,37 +1889,38 @@
       if (_compile_the_world_class_counter > CompileTheWorldStopAt) return;
 
       // Construct name without extension
       TempNewSymbol sym = SymbolTable::new_symbol(buffer, CHECK);
       // Use loader to load and initialize class
-      Klass* ik = SystemDictionary::resolve_or_null(sym, loader, Handle(), THREAD);
-      instanceKlassHandle k (THREAD, ik);
-      if (k.not_null() && !HAS_PENDING_EXCEPTION) {
+      Klass* k = SystemDictionary::resolve_or_null(sym, loader, Handle(), THREAD);
+      if (k != NULL && !HAS_PENDING_EXCEPTION) {
         k->initialize(THREAD);
       }
       bool exception_occurred = HAS_PENDING_EXCEPTION;
       clear_pending_exception_if_not_oom(CHECK);
-      if (CompileTheWorldPreloadClasses && k.not_null()) {
-        ConstantPool::preload_and_initialize_all_classes(k->constants(), THREAD);
+      if (CompileTheWorldPreloadClasses && k != NULL) {
+        InstanceKlass* ik = InstanceKlass::cast(k);
+        ConstantPool::preload_and_initialize_all_classes(ik->constants(), THREAD);
         if (HAS_PENDING_EXCEPTION) {
           // If something went wrong in preloading we just ignore it
           clear_pending_exception_if_not_oom(CHECK);
           tty->print_cr("Preloading failed for (%d) %s", _compile_the_world_class_counter, buffer);
         }
       }
 
       if (_compile_the_world_class_counter >= CompileTheWorldStartAt) {
-        if (k.is_null() || exception_occurred) {
+        if (k == NULL || exception_occurred) {
           // If something went wrong (e.g. ExceptionInInitializerError) we skip this class
           tty->print_cr("CompileTheWorld (%d) : Skipping %s", _compile_the_world_class_counter, buffer);
         } else {
           tty->print_cr("CompileTheWorld (%d) : %s", _compile_the_world_class_counter, buffer);
           // Preload all classes to get around uncommon traps
           // Iterate over all methods in class
           int comp_level = CompilationPolicy::policy()->initial_compile_level();
-          for (int n = 0; n < k->methods()->length(); n++) {
-            methodHandle m (THREAD, k->methods()->at(n));
+          InstanceKlass* ik = InstanceKlass::cast(k);
+          for (int n = 0; n < ik->methods()->length(); n++) {
+            methodHandle m (THREAD, ik->methods()->at(n));
             if (can_be_compiled(m, comp_level)) {
               if (++_codecache_sweep_counter == CompileTheWorldSafepointInterval) {
                 // Give sweeper a chance to keep up with CTW
                 VM_ForceSafepoint op;
                 VMThread::execute(&op);
< prev index next >