hotspot/src/share/vm/classfile/classFileParser.cpp
changeset 35917 463d67f86eaa
parent 35911 80dd27ae501c
child 35941 be5a3f551026
equal deleted inserted replaced
35912:679f5181ef91 35917:463d67f86eaa
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    32 #include "classfile/systemDictionary.hpp"
    32 #include "classfile/systemDictionary.hpp"
    33 #include "classfile/verificationType.hpp"
    33 #include "classfile/verificationType.hpp"
    34 #include "classfile/verifier.hpp"
    34 #include "classfile/verifier.hpp"
    35 #include "classfile/vmSymbols.hpp"
    35 #include "classfile/vmSymbols.hpp"
    36 #include "gc/shared/gcLocker.hpp"
    36 #include "gc/shared/gcLocker.hpp"
       
    37 #include "logging/log.hpp"
    37 #include "memory/allocation.hpp"
    38 #include "memory/allocation.hpp"
    38 #include "memory/metadataFactory.hpp"
    39 #include "memory/metadataFactory.hpp"
    39 #include "memory/oopFactory.hpp"
    40 #include "memory/oopFactory.hpp"
    40 #include "memory/resourceArea.hpp"
    41 #include "memory/resourceArea.hpp"
    41 #include "memory/universe.inline.hpp"
    42 #include "memory/universe.inline.hpp"
  5345   record_defined_class_dependencies(ik, CHECK);
  5346   record_defined_class_dependencies(ik, CHECK);
  5346 
  5347 
  5347   ClassLoadingService::notify_class_loaded(ik, false /* not shared class */);
  5348   ClassLoadingService::notify_class_loaded(ik, false /* not shared class */);
  5348 
  5349 
  5349   if (!is_internal()) {
  5350   if (!is_internal()) {
  5350     if (TraceClassLoading) {
  5351     if (log_is_enabled(Info, classload)) {
  5351       ResourceMark rm;
  5352       ik->print_loading_log(LogLevel::Info, _loader_data, _stream);
  5352       // print in a single call to reduce interleaving of output
  5353     }
  5353       if (_stream->source() != NULL) {
  5354     // No 'else' here as logging levels are not mutually exclusive
  5354         tty->print("[Loaded %s from %s]\n",
  5355     if (log_is_enabled(Debug, classload)) {
  5355                    ik->external_name(),
  5356       ik->print_loading_log(LogLevel::Debug, _loader_data, _stream);
  5356                    _stream->source());
       
  5357       } else if (_loader_data->class_loader() == NULL) {
       
  5358         const Klass* const caller =
       
  5359           THREAD->is_Java_thread()
       
  5360                 ? ((JavaThread*)THREAD)->security_get_caller_class(1)
       
  5361                 : NULL;
       
  5362         // caller can be NULL, for example, during a JVMTI VM_Init hook
       
  5363         if (caller != NULL) {
       
  5364           tty->print("[Loaded %s by instance of %s]\n",
       
  5365                      ik->external_name(),
       
  5366                      caller->external_name());
       
  5367         } else {
       
  5368           tty->print("[Loaded %s]\n", ik->external_name());
       
  5369         }
       
  5370       } else {
       
  5371         tty->print("[Loaded %s from %s]\n", ik->external_name(),
       
  5372                    _loader_data->class_loader()->klass()->external_name());
       
  5373       }
       
  5374     }
  5357     }
  5375 
  5358 
  5376     if (log_is_enabled(Info, classresolve))  {
  5359     if (log_is_enabled(Info, classresolve))  {
  5377       ResourceMark rm;
  5360       ResourceMark rm;
  5378       // print out the superclass.
  5361       // print out the superclass.