mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 01:54:47 +02:00
8222086: CodeCache::UnloadingScope needs to preserve and restore previous IsUnloadingBehavior
Reviewed-by: eosterlund
This commit is contained in:
parent
8dfa6d1acc
commit
cc871f0459
2 changed files with 3 additions and 1 deletions
|
@ -780,13 +780,14 @@ void CodeCache::increment_unloading_cycle() {
|
||||||
CodeCache::UnloadingScope::UnloadingScope(BoolObjectClosure* is_alive)
|
CodeCache::UnloadingScope::UnloadingScope(BoolObjectClosure* is_alive)
|
||||||
: _is_unloading_behaviour(is_alive)
|
: _is_unloading_behaviour(is_alive)
|
||||||
{
|
{
|
||||||
|
_saved_behaviour = IsUnloadingBehaviour::current();
|
||||||
IsUnloadingBehaviour::set_current(&_is_unloading_behaviour);
|
IsUnloadingBehaviour::set_current(&_is_unloading_behaviour);
|
||||||
increment_unloading_cycle();
|
increment_unloading_cycle();
|
||||||
DependencyContext::cleaning_start();
|
DependencyContext::cleaning_start();
|
||||||
}
|
}
|
||||||
|
|
||||||
CodeCache::UnloadingScope::~UnloadingScope() {
|
CodeCache::UnloadingScope::~UnloadingScope() {
|
||||||
IsUnloadingBehaviour::set_current(NULL);
|
IsUnloadingBehaviour::set_current(_saved_behaviour);
|
||||||
DependencyContext::cleaning_end();
|
DependencyContext::cleaning_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -170,6 +170,7 @@ class CodeCache : AllStatic {
|
||||||
// "unloading_occurred" controls whether metadata should be cleaned because of class unloading.
|
// "unloading_occurred" controls whether metadata should be cleaned because of class unloading.
|
||||||
class UnloadingScope: StackObj {
|
class UnloadingScope: StackObj {
|
||||||
ClosureIsUnloadingBehaviour _is_unloading_behaviour;
|
ClosureIsUnloadingBehaviour _is_unloading_behaviour;
|
||||||
|
IsUnloadingBehaviour* _saved_behaviour;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UnloadingScope(BoolObjectClosure* is_alive);
|
UnloadingScope(BoolObjectClosure* is_alive);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue