src/share/vm/classfile/classFileParser.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File classload.08 Sdiff src/share/vm/classfile

src/share/vm/classfile/classFileParser.cpp

Print this page


   1 /*
   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.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 #include "precompiled.hpp"
  25 #include "classfile/classFileParser.hpp"
  26 #include "classfile/classFileStream.hpp"
  27 #include "classfile/classLoader.hpp"
  28 #include "classfile/classLoaderData.inline.hpp"
  29 #include "classfile/defaultMethods.hpp"
  30 #include "classfile/javaClasses.inline.hpp"
  31 #include "classfile/symbolTable.hpp"
  32 #include "classfile/systemDictionary.hpp"
  33 #include "classfile/verificationType.hpp"
  34 #include "classfile/verifier.hpp"
  35 #include "classfile/vmSymbols.hpp"
  36 #include "gc/shared/gcLocker.hpp"

  37 #include "memory/allocation.hpp"
  38 #include "memory/metadataFactory.hpp"
  39 #include "memory/oopFactory.hpp"
  40 #include "memory/resourceArea.hpp"
  41 #include "memory/universe.inline.hpp"
  42 #include "oops/annotations.hpp"
  43 #include "oops/fieldStreams.hpp"
  44 #include "oops/instanceKlass.hpp"
  45 #include "oops/instanceMirrorKlass.hpp"
  46 #include "oops/klass.inline.hpp"
  47 #include "oops/klassVtable.hpp"
  48 #include "oops/metadata.hpp"
  49 #include "oops/method.hpp"
  50 #include "oops/oop.inline.hpp"
  51 #include "oops/symbol.hpp"
  52 #include "prims/jvm.h"
  53 #include "prims/jvmtiExport.hpp"
  54 #include "prims/jvmtiThreadState.hpp"
  55 #include "runtime/javaCalls.hpp"
  56 #include "runtime/perfData.hpp"


5330                                  _loader_data->class_loader(),
5331                                  _protection_domain,
5332                                  CHECK);
5333 
5334   assert(_all_mirandas != NULL, "invariant");
5335 
5336   // Generate any default methods - default methods are interface methods
5337   // that have a default implementation.  This is new with Lambda project.
5338   if (_has_default_methods ) {
5339     DefaultMethods::generate_default_methods(ik,
5340                                              _all_mirandas,
5341                                              CHECK);
5342   }
5343 
5344   // Update the loader_data graph.
5345   record_defined_class_dependencies(ik, CHECK);
5346 
5347   ClassLoadingService::notify_class_loaded(ik, false /* not shared class */);
5348 
5349   if (!is_internal()) {
5350     if (TraceClassLoading) {
5351       ResourceMark rm;
5352       // print in a single call to reduce interleaving of output
5353       if (_stream->source() != NULL) {
5354         tty->print("[Loaded %s from %s]\n",
5355                    ik->external_name(),
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     }
5375 
5376     if (log_is_enabled(Info, classresolve))  {
5377       ResourceMark rm;
5378       // print out the superclass.
5379       const char * from = ik->external_name();
5380       if (ik->java_super() != NULL) {
5381         log_info(classresolve)("%s %s (super)",
5382                    from,
5383                    ik->java_super()->external_name());
5384       }
5385       // print out each of the interface classes referred to by this class.
5386       const Array<Klass*>* const local_interfaces = ik->local_interfaces();
5387       if (local_interfaces != NULL) {
5388         const int length = local_interfaces->length();
5389         for (int i = 0; i < length; i++) {
5390           const Klass* const k = local_interfaces->at(i);
5391           const char * to = k->external_name();
5392           log_info(classresolve)("%s %s (interface)", from, to);
5393         }


   1 /*
   2  * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 #include "precompiled.hpp"
  25 #include "classfile/classFileParser.hpp"
  26 #include "classfile/classFileStream.hpp"
  27 #include "classfile/classLoader.hpp"
  28 #include "classfile/classLoaderData.inline.hpp"
  29 #include "classfile/defaultMethods.hpp"
  30 #include "classfile/javaClasses.inline.hpp"
  31 #include "classfile/symbolTable.hpp"
  32 #include "classfile/systemDictionary.hpp"
  33 #include "classfile/verificationType.hpp"
  34 #include "classfile/verifier.hpp"
  35 #include "classfile/vmSymbols.hpp"
  36 #include "gc/shared/gcLocker.hpp"
  37 #include "logging/log.hpp"
  38 #include "memory/allocation.hpp"
  39 #include "memory/metadataFactory.hpp"
  40 #include "memory/oopFactory.hpp"
  41 #include "memory/resourceArea.hpp"
  42 #include "memory/universe.inline.hpp"
  43 #include "oops/annotations.hpp"
  44 #include "oops/fieldStreams.hpp"
  45 #include "oops/instanceKlass.hpp"
  46 #include "oops/instanceMirrorKlass.hpp"
  47 #include "oops/klass.inline.hpp"
  48 #include "oops/klassVtable.hpp"
  49 #include "oops/metadata.hpp"
  50 #include "oops/method.hpp"
  51 #include "oops/oop.inline.hpp"
  52 #include "oops/symbol.hpp"
  53 #include "prims/jvm.h"
  54 #include "prims/jvmtiExport.hpp"
  55 #include "prims/jvmtiThreadState.hpp"
  56 #include "runtime/javaCalls.hpp"
  57 #include "runtime/perfData.hpp"


5331                                  _loader_data->class_loader(),
5332                                  _protection_domain,
5333                                  CHECK);
5334 
5335   assert(_all_mirandas != NULL, "invariant");
5336 
5337   // Generate any default methods - default methods are interface methods
5338   // that have a default implementation.  This is new with Lambda project.
5339   if (_has_default_methods ) {
5340     DefaultMethods::generate_default_methods(ik,
5341                                              _all_mirandas,
5342                                              CHECK);
5343   }
5344 
5345   // Update the loader_data graph.
5346   record_defined_class_dependencies(ik, CHECK);
5347 
5348   ClassLoadingService::notify_class_loaded(ik, false /* not shared class */);
5349 
5350   if (!is_internal()) {
5351     if (log_is_enabled(Info, classload)) {
5352       ik->print_loading_log(LogLevel::Info, _loader_data, _stream);





















5353     }
5354     if (log_is_enabled(Debug, classload)) {
5355       ik->print_loading_log(LogLevel::Debug, _loader_data, _stream);
5356     }
5357 
5358     if (log_is_enabled(Info, classresolve))  {
5359       ResourceMark rm;
5360       // print out the superclass.
5361       const char * from = ik->external_name();
5362       if (ik->java_super() != NULL) {
5363         log_info(classresolve)("%s %s (super)",
5364                    from,
5365                    ik->java_super()->external_name());
5366       }
5367       // print out each of the interface classes referred to by this class.
5368       const Array<Klass*>* const local_interfaces = ik->local_interfaces();
5369       if (local_interfaces != NULL) {
5370         const int length = local_interfaces->length();
5371         for (int i = 0; i < length; i++) {
5372           const Klass* const k = local_interfaces->at(i);
5373           const char * to = k->external_name();
5374           log_info(classresolve)("%s %s (interface)", from, to);
5375         }


src/share/vm/classfile/classFileParser.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File