< prev index next >

src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.cpp

Print this page
rev 58565 : 8238358: Implementation of JEP 371: Hidden Classes
Reviewed-by: duke
Contributed-by: mandy.chung@oracle.com, lois.foltan@oracle.com, david.holmes@oracle.com, harold.seigel@oracle.com, serguei.spitsyn@oracle.com, alex.buckley@oracle.com, jamsheed.c.m@oracle.com
   1 /*
   2  * Copyright (c) 2011, 2019, 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  *


 123   if (super == NULL) {
 124     return;
 125   }
 126   if (IS_EVENT_KLASS(super)) {
 127     tag_as_jdk_jfr_event_sub(klass);
 128   }
 129 }
 130 
 131 void JfrTraceId::assign(const ModuleEntry* module) {
 132   assert(module != NULL, "invariant");
 133   module->set_trace_id(next_module_id());
 134 }
 135 
 136 void JfrTraceId::assign(const PackageEntry* package) {
 137   assert(package != NULL, "invariant");
 138   package->set_trace_id(next_package_id());
 139 }
 140 
 141 void JfrTraceId::assign(const ClassLoaderData* cld) {
 142   assert(cld != NULL, "invariant");
 143   if (cld->is_unsafe_anonymous()) {
 144     cld->set_trace_id(0);
 145     return;
 146   }
 147   cld->set_trace_id(next_class_loader_data_id());
 148 }
 149 
 150 traceid JfrTraceId::assign_thread_id() {
 151   return next_thread_id();
 152 }
 153 
 154 // used by CDS / APPCDS as part of "remove_unshareable_info"
 155 void JfrTraceId::remove(const Klass* k) {
 156   assert(k != NULL, "invariant");
 157   // Mask off and store the event flags.
 158   // This mechanism will retain the event specific flags
 159   // in the archive, allowing for event flag restoration
 160   // when renewing the traceid on klass revival.
 161   k->set_trace_id(EVENT_KLASS_MASK(k));
 162 }
 163 


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


 123   if (super == NULL) {
 124     return;
 125   }
 126   if (IS_EVENT_KLASS(super)) {
 127     tag_as_jdk_jfr_event_sub(klass);
 128   }
 129 }
 130 
 131 void JfrTraceId::assign(const ModuleEntry* module) {
 132   assert(module != NULL, "invariant");
 133   module->set_trace_id(next_module_id());
 134 }
 135 
 136 void JfrTraceId::assign(const PackageEntry* package) {
 137   assert(package != NULL, "invariant");
 138   package->set_trace_id(next_package_id());
 139 }
 140 
 141 void JfrTraceId::assign(const ClassLoaderData* cld) {
 142   assert(cld != NULL, "invariant");
 143   if (cld->has_class_mirror_holder()) {
 144     cld->set_trace_id(0);
 145     return;
 146   }
 147   cld->set_trace_id(next_class_loader_data_id());
 148 }
 149 
 150 traceid JfrTraceId::assign_thread_id() {
 151   return next_thread_id();
 152 }
 153 
 154 // used by CDS / APPCDS as part of "remove_unshareable_info"
 155 void JfrTraceId::remove(const Klass* k) {
 156   assert(k != NULL, "invariant");
 157   // Mask off and store the event flags.
 158   // This mechanism will retain the event specific flags
 159   // in the archive, allowing for event flag restoration
 160   // when renewing the traceid on klass revival.
 161   k->set_trace_id(EVENT_KLASS_MASK(k));
 162 }
 163 


< prev index next >