src/hotspot/share/oops/klass.cpp
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 617,626 ****
--- 617,639 ----
// Unless overridden, jvmti_class_status has no flags set.
jint Klass::jvmti_class_status() const {
return 0;
}
+ // Tell the GC to keep this klass alive
+ void Klass::ensure_klass_alive(oop o) {
+ // A klass that was previously considered dead can be looked up in the
+ // CLD/SD, and its _java_mirror or _class_loader can be stored in a root
+ // or a reachable object making it alive again.
+ // The SATB part of G1 needs to get notified about this
+ // potential resurrection, otherwise the marking might not find the object.
+ #if INCLUDE_ALL_GCS
+ if (UseG1GC && o != NULL) {
+ G1SATBCardTableModRefBS::enqueue(o);
+ }
+ #endif
+ }
// Printing
void Klass::print_on(outputStream* st) const {
ResourceMark rm;