< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahEvacOOMHandler.hpp

Print this page
rev 59438 : 8245823: Shenandoah: inline/optimize ShenandoahEvacOOMScope

*** 1,7 **** /* ! * Copyright (c) 2018, 2019, Red Hat, Inc. 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) 2018, 2020, Red Hat, Inc. 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.
*** 25,34 **** --- 25,35 ---- #ifndef SHARE_GC_SHENANDOAH_SHENANDOAHEVACOOMHANDLER_HPP #define SHARE_GC_SHENANDOAH_SHENANDOAHEVACOOMHANDLER_HPP #include "gc/shenandoah/shenandoahPadding.hpp" #include "memory/allocation.hpp" + #include "runtime/thread.hpp" #include "utilities/globalDefinitions.hpp" /** * Provides safe handling of out-of-memory situations during evacuation. *
*** 96,124 **** * * When this returns true, it is safe to continue with normal evacuation. * When this method returns false, evacuation must not be entered, and caller * may safely continue with a simple resolve (if Java thread). */ ! void enter_evacuation(); /** * Leave evacuation path. */ ! void leave_evacuation(); /** * Signal out-of-memory during evacuation. It will prevent any other threads * from entering the evacuation path, then wait until all threads have left the * evacuation path, and then return. It is then safe to continue with a simple resolve. */ void handle_out_of_memory_during_evacuation(); void clear(); }; class ShenandoahEvacOOMScope : public StackObj { public: ! ShenandoahEvacOOMScope(); ! ~ShenandoahEvacOOMScope(); }; #endif // SHARE_GC_SHENANDOAH_SHENANDOAHEVACOOMHANDLER_HPP --- 97,138 ---- * * When this returns true, it is safe to continue with normal evacuation. * When this method returns false, evacuation must not be entered, and caller * may safely continue with a simple resolve (if Java thread). */ ! inline void enter_evacuation(Thread* t); /** * Leave evacuation path. */ ! inline void leave_evacuation(Thread* t); /** * Signal out-of-memory during evacuation. It will prevent any other threads * from entering the evacuation path, then wait until all threads have left the * evacuation path, and then return. It is then safe to continue with a simple resolve. */ void handle_out_of_memory_during_evacuation(); void clear(); + + private: + // Register/Unregister thread to evacuation OOM protocol + void register_thread_to_protocol(Thread* t); + void unregister_thread_to_protocol(Thread* t); }; + class ShenandoahHeap; + class ShenandoahEvacOOMScope : public StackObj { + private: + ShenandoahHeap* const _heap; + Thread* const _thread; public: ! inline ShenandoahEvacOOMScope(); ! inline ShenandoahEvacOOMScope(Thread* t); ! inline ShenandoahEvacOOMScope(ShenandoahHeap* heap); ! inline ShenandoahEvacOOMScope(ShenandoahHeap* heap, Thread* t); ! inline ~ShenandoahEvacOOMScope(); }; #endif // SHARE_GC_SHENANDOAH_SHENANDOAHEVACOOMHANDLER_HPP
< prev index next >