src/share/vm/classfile/classLoader.hpp

Print this page


   1 /*
   2  * Copyright (c) 1997, 2009, 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 






  25 // The VM class loader.
  26 #include <sys/stat.h>
  27 
  28 
  29 // Meta-index (optional, to be able to skip opening boot classpath jar files)
  30 class MetaIndex: public CHeapObj {
  31  private:
  32   char** _meta_package_names;
  33   int    _num_meta_package_names;
  34  public:
  35   MetaIndex(char** meta_package_names, int num_meta_package_names);
  36   ~MetaIndex();
  37   bool may_contain(const char* class_name);
  38 };
  39 
  40 
  41 // Class path entry (directory or zip file)
  42 
  43 class ClassPathEntry: public CHeapObj {
  44  private:


 439       if (_prev_active_event >= 0) {
 440         _timers[_prev_active_event].start();
 441       }
 442 
 443       if (_recursion_counters != NULL && --(_recursion_counters[_event_type]) > 0) return;
 444 
 445       // increment the counters only on the leaf call
 446       _t.stop();
 447       _timep->inc(_t.ticks());
 448       if (_selftimep != NULL) {
 449         _selftimep->inc(selftime);
 450       }
 451       // add all class loading related event selftime to the accumulated time counter
 452       ClassLoader::perf_accumulated_time()->inc(selftime);
 453 
 454       // reset the timer
 455       _timers[_event_type].reset();
 456     }
 457 };
 458 


   1 /*
   2  * Copyright (c) 1997, 2010, 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 
  25 #ifndef SHARE_VM_CLASSFILE_CLASSLOADER_HPP
  26 #define SHARE_VM_CLASSFILE_CLASSLOADER_HPP
  27 
  28 #include "classfile/classFileParser.hpp"
  29 #include "runtime/perfData.hpp"
  30 
  31 // The VM class loader.
  32 #include <sys/stat.h>
  33 
  34 
  35 // Meta-index (optional, to be able to skip opening boot classpath jar files)
  36 class MetaIndex: public CHeapObj {
  37  private:
  38   char** _meta_package_names;
  39   int    _num_meta_package_names;
  40  public:
  41   MetaIndex(char** meta_package_names, int num_meta_package_names);
  42   ~MetaIndex();
  43   bool may_contain(const char* class_name);
  44 };
  45 
  46 
  47 // Class path entry (directory or zip file)
  48 
  49 class ClassPathEntry: public CHeapObj {
  50  private:


 445       if (_prev_active_event >= 0) {
 446         _timers[_prev_active_event].start();
 447       }
 448 
 449       if (_recursion_counters != NULL && --(_recursion_counters[_event_type]) > 0) return;
 450 
 451       // increment the counters only on the leaf call
 452       _t.stop();
 453       _timep->inc(_t.ticks());
 454       if (_selftimep != NULL) {
 455         _selftimep->inc(selftime);
 456       }
 457       // add all class loading related event selftime to the accumulated time counter
 458       ClassLoader::perf_accumulated_time()->inc(selftime);
 459 
 460       // reset the timer
 461       _timers[_event_type].reset();
 462     }
 463 };
 464 
 465 
 466 #endif // SHARE_VM_CLASSFILE_CLASSLOADER_HPP