Tue, 18 Nov 2008 14:52:33 -0800
6771742: Remove duplicate files from G1 merge
Summary: Remove duplicate files and add includeDB_gc_g1 file in windows Makefile
Reviewed-by: jcoomes, ysr
1.1 --- a/make/windows/projectfiles/common/Makefile Fri Nov 14 14:23:05 2008 -0800 1.2 +++ b/make/windows/projectfiles/common/Makefile Tue Nov 18 14:52:33 2008 -0800 1.3 @@ -56,7 +56,8 @@ 1.4 $(HOTSPOTWORKSPACE)/src/share/vm/gc_implementation/includeDB_gc_shared \ 1.5 $(HOTSPOTWORKSPACE)/src/share/vm/gc_implementation/includeDB_gc_parNew \ 1.6 $(HOTSPOTWORKSPACE)/src/share/vm/gc_implementation/includeDB_gc_parallelScavenge \ 1.7 - $(HOTSPOTWORKSPACE)/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep 1.8 + $(HOTSPOTWORKSPACE)/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep \ 1.9 + $(HOTSPOTWORKSPACE)/src/share/vm/gc_implementation/includeDB_gc_g1 1.10 1.11 1.12 IncludeDBs_kernel =$(IncludeDBs_base) \
2.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentGCThread.cpp Fri Nov 14 14:23:05 2008 -0800 2.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 2.3 @@ -1,314 +0,0 @@ 2.4 -/* 2.5 - * Copyright 2001-2005 Sun Microsystems, Inc. All Rights Reserved. 2.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 2.7 - * 2.8 - * This code is free software; you can redistribute it and/or modify it 2.9 - * under the terms of the GNU General Public License version 2 only, as 2.10 - * published by the Free Software Foundation. 2.11 - * 2.12 - * This code is distributed in the hope that it will be useful, but WITHOUT 2.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 2.14 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 2.15 - * version 2 for more details (a copy is included in the LICENSE file that 2.16 - * accompanied this code). 2.17 - * 2.18 - * You should have received a copy of the GNU General Public License version 2.19 - * 2 along with this work; if not, write to the Free Software Foundation, 2.20 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2.21 - * 2.22 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 2.23 - * CA 95054 USA or visit www.sun.com if you need additional information or 2.24 - * have any questions. 2.25 - * 2.26 - */ 2.27 - 2.28 -// CopyrightVersion 1.2 2.29 - 2.30 -# include "incls/_precompiled.incl" 2.31 -# include "incls/_concurrentGCThread.cpp.incl" 2.32 - 2.33 -bool ConcurrentGCThread::_should_terminate = false; 2.34 -bool ConcurrentGCThread::_has_terminated = false; 2.35 -int ConcurrentGCThread::_CGC_flag = CGC_nil; 2.36 - 2.37 -SuspendibleThreadSet ConcurrentGCThread::_sts; 2.38 - 2.39 -ConcurrentGCThread::ConcurrentGCThread() { 2.40 - _sts.initialize(); 2.41 -}; 2.42 - 2.43 -void ConcurrentGCThread::stopWorldAndDo(VoidClosure* op) { 2.44 - MutexLockerEx x(Heap_lock, 2.45 - Mutex::_no_safepoint_check_flag); 2.46 - // warning("CGC: about to try stopping world"); 2.47 - SafepointSynchronize::begin(); 2.48 - // warning("CGC: successfully stopped world"); 2.49 - op->do_void(); 2.50 - SafepointSynchronize::end(); 2.51 - // warning("CGC: successfully restarted world"); 2.52 -} 2.53 - 2.54 -void ConcurrentGCThread::safepoint_synchronize() { 2.55 - _sts.suspend_all(); 2.56 -} 2.57 - 2.58 -void ConcurrentGCThread::safepoint_desynchronize() { 2.59 - _sts.resume_all(); 2.60 -} 2.61 - 2.62 -void ConcurrentGCThread::create_and_start() { 2.63 - if (os::create_thread(this, os::cgc_thread)) { 2.64 - // XXX: need to set this to low priority 2.65 - // unless "agressive mode" set; priority 2.66 - // should be just less than that of VMThread. 2.67 - os::set_priority(this, NearMaxPriority); 2.68 - if (!_should_terminate && !DisableStartThread) { 2.69 - os::start_thread(this); 2.70 - } 2.71 - } 2.72 -} 2.73 - 2.74 -void ConcurrentGCThread::initialize_in_thread() { 2.75 - this->record_stack_base_and_size(); 2.76 - this->initialize_thread_local_storage(); 2.77 - this->set_active_handles(JNIHandleBlock::allocate_block()); 2.78 - // From this time Thread::current() should be working. 2.79 - assert(this == Thread::current(), "just checking"); 2.80 -} 2.81 - 2.82 -void ConcurrentGCThread::wait_for_universe_init() { 2.83 - MutexLockerEx x(CGC_lock, Mutex::_no_safepoint_check_flag); 2.84 - while (!is_init_completed() && !_should_terminate) { 2.85 - CGC_lock->wait(Mutex::_no_safepoint_check_flag, 200); 2.86 - } 2.87 -} 2.88 - 2.89 -void ConcurrentGCThread::terminate() { 2.90 - // Signal that it is terminated 2.91 - { 2.92 - MutexLockerEx mu(Terminator_lock, 2.93 - Mutex::_no_safepoint_check_flag); 2.94 - _has_terminated = true; 2.95 - Terminator_lock->notify(); 2.96 - } 2.97 - 2.98 - // Thread destructor usually does this.. 2.99 - ThreadLocalStorage::set_thread(NULL); 2.100 -} 2.101 - 2.102 - 2.103 -void SuspendibleThreadSet::initialize_work() { 2.104 - MutexLocker x(STS_init_lock); 2.105 - if (!_initialized) { 2.106 - _m = new Monitor(Mutex::leaf, 2.107 - "SuspendibleThreadSetLock", true); 2.108 - _async = 0; 2.109 - _async_stop = false; 2.110 - _async_stopped = 0; 2.111 - _initialized = true; 2.112 - } 2.113 -} 2.114 - 2.115 -void SuspendibleThreadSet::join() { 2.116 - initialize(); 2.117 - MutexLockerEx x(_m, Mutex::_no_safepoint_check_flag); 2.118 - while (_async_stop) _m->wait(Mutex::_no_safepoint_check_flag); 2.119 - _async++; 2.120 - assert(_async > 0, "Huh."); 2.121 -} 2.122 - 2.123 -void SuspendibleThreadSet::leave() { 2.124 - assert(_initialized, "Must be initialized."); 2.125 - MutexLockerEx x(_m, Mutex::_no_safepoint_check_flag); 2.126 - _async--; 2.127 - assert(_async >= 0, "Huh."); 2.128 - if (_async_stop) _m->notify_all(); 2.129 -} 2.130 - 2.131 -void SuspendibleThreadSet::yield(const char* id) { 2.132 - assert(_initialized, "Must be initialized."); 2.133 - if (_async_stop) { 2.134 - MutexLockerEx x(_m, Mutex::_no_safepoint_check_flag); 2.135 - if (_async_stop) { 2.136 - _async_stopped++; 2.137 - assert(_async_stopped > 0, "Huh."); 2.138 - if (_async_stopped == _async) { 2.139 - if (ConcGCYieldTimeout > 0) { 2.140 - double now = os::elapsedTime(); 2.141 - guarantee((now - _suspend_all_start) * 1000.0 < 2.142 - (double)ConcGCYieldTimeout, 2.143 - "Long delay; whodunit?"); 2.144 - } 2.145 - } 2.146 - _m->notify_all(); 2.147 - while (_async_stop) _m->wait(Mutex::_no_safepoint_check_flag); 2.148 - _async_stopped--; 2.149 - assert(_async >= 0, "Huh"); 2.150 - _m->notify_all(); 2.151 - } 2.152 - } 2.153 -} 2.154 - 2.155 -void SuspendibleThreadSet::suspend_all() { 2.156 - initialize(); // If necessary. 2.157 - if (ConcGCYieldTimeout > 0) { 2.158 - _suspend_all_start = os::elapsedTime(); 2.159 - } 2.160 - MutexLockerEx x(_m, Mutex::_no_safepoint_check_flag); 2.161 - assert(!_async_stop, "Only one at a time."); 2.162 - _async_stop = true; 2.163 - while (_async_stopped < _async) _m->wait(Mutex::_no_safepoint_check_flag); 2.164 -} 2.165 - 2.166 -void SuspendibleThreadSet::resume_all() { 2.167 - assert(_initialized, "Must be initialized."); 2.168 - MutexLockerEx x(_m, Mutex::_no_safepoint_check_flag); 2.169 - assert(_async_stopped == _async, "Huh."); 2.170 - _async_stop = false; 2.171 - _m->notify_all(); 2.172 -} 2.173 - 2.174 -static void _sltLoop(JavaThread* thread, TRAPS) { 2.175 - SurrogateLockerThread* slt = (SurrogateLockerThread*)thread; 2.176 - slt->loop(); 2.177 -} 2.178 - 2.179 -SurrogateLockerThread::SurrogateLockerThread() : 2.180 - JavaThread(&_sltLoop), 2.181 - _monitor(Mutex::nonleaf, "SLTMonitor"), 2.182 - _buffer(empty) 2.183 -{} 2.184 - 2.185 -SurrogateLockerThread* SurrogateLockerThread::make(TRAPS) { 2.186 - klassOop k = 2.187 - SystemDictionary::resolve_or_fail(vmSymbolHandles::java_lang_Thread(), 2.188 - true, CHECK_NULL); 2.189 - instanceKlassHandle klass (THREAD, k); 2.190 - instanceHandle thread_oop = klass->allocate_instance_handle(CHECK_NULL); 2.191 - 2.192 - const char thread_name[] = "Surrogate Locker Thread (CMS)"; 2.193 - Handle string = java_lang_String::create_from_str(thread_name, CHECK_NULL); 2.194 - 2.195 - // Initialize thread_oop to put it into the system threadGroup 2.196 - Handle thread_group (THREAD, Universe::system_thread_group()); 2.197 - JavaValue result(T_VOID); 2.198 - JavaCalls::call_special(&result, thread_oop, 2.199 - klass, 2.200 - vmSymbolHandles::object_initializer_name(), 2.201 - vmSymbolHandles::threadgroup_string_void_signature(), 2.202 - thread_group, 2.203 - string, 2.204 - CHECK_NULL); 2.205 - 2.206 - SurrogateLockerThread* res; 2.207 - { 2.208 - MutexLocker mu(Threads_lock); 2.209 - res = new SurrogateLockerThread(); 2.210 - 2.211 - // At this point it may be possible that no osthread was created for the 2.212 - // JavaThread due to lack of memory. We would have to throw an exception 2.213 - // in that case. However, since this must work and we do not allow 2.214 - // exceptions anyway, check and abort if this fails. 2.215 - if (res == NULL || res->osthread() == NULL) { 2.216 - vm_exit_during_initialization("java.lang.OutOfMemoryError", 2.217 - "unable to create new native thread"); 2.218 - } 2.219 - java_lang_Thread::set_thread(thread_oop(), res); 2.220 - java_lang_Thread::set_priority(thread_oop(), NearMaxPriority); 2.221 - java_lang_Thread::set_daemon(thread_oop()); 2.222 - 2.223 - res->set_threadObj(thread_oop()); 2.224 - Threads::add(res); 2.225 - Thread::start(res); 2.226 - } 2.227 - os::yield(); // This seems to help with initial start-up of SLT 2.228 - return res; 2.229 -} 2.230 - 2.231 -void SurrogateLockerThread::manipulatePLL(SLT_msg_type msg) { 2.232 - MutexLockerEx x(&_monitor, Mutex::_no_safepoint_check_flag); 2.233 - assert(_buffer == empty, "Should be empty"); 2.234 - assert(msg != empty, "empty message"); 2.235 - _buffer = msg; 2.236 - while (_buffer != empty) { 2.237 - _monitor.notify(); 2.238 - _monitor.wait(Mutex::_no_safepoint_check_flag); 2.239 - } 2.240 -} 2.241 - 2.242 -// ======= Surrogate Locker Thread ============= 2.243 - 2.244 -void SurrogateLockerThread::loop() { 2.245 - BasicLock pll_basic_lock; 2.246 - SLT_msg_type msg; 2.247 - debug_only(unsigned int owned = 0;) 2.248 - 2.249 - while (/* !isTerminated() */ 1) { 2.250 - { 2.251 - MutexLocker x(&_monitor); 2.252 - // Since we are a JavaThread, we can't be here at a safepoint. 2.253 - assert(!SafepointSynchronize::is_at_safepoint(), 2.254 - "SLT is a JavaThread"); 2.255 - // wait for msg buffer to become non-empty 2.256 - while (_buffer == empty) { 2.257 - _monitor.notify(); 2.258 - _monitor.wait(); 2.259 - } 2.260 - msg = _buffer; 2.261 - } 2.262 - switch(msg) { 2.263 - case acquirePLL: { 2.264 - instanceRefKlass::acquire_pending_list_lock(&pll_basic_lock); 2.265 - debug_only(owned++;) 2.266 - break; 2.267 - } 2.268 - case releaseAndNotifyPLL: { 2.269 - assert(owned > 0, "Don't have PLL"); 2.270 - instanceRefKlass::release_and_notify_pending_list_lock(&pll_basic_lock); 2.271 - debug_only(owned--;) 2.272 - break; 2.273 - } 2.274 - case empty: 2.275 - default: { 2.276 - guarantee(false,"Unexpected message in _buffer"); 2.277 - break; 2.278 - } 2.279 - } 2.280 - { 2.281 - MutexLocker x(&_monitor); 2.282 - // Since we are a JavaThread, we can't be here at a safepoint. 2.283 - assert(!SafepointSynchronize::is_at_safepoint(), 2.284 - "SLT is a JavaThread"); 2.285 - _buffer = empty; 2.286 - _monitor.notify(); 2.287 - } 2.288 - } 2.289 - assert(!_monitor.owned_by_self(), "Should unlock before exit."); 2.290 -} 2.291 - 2.292 - 2.293 -// ===== STS Access From Outside CGCT ===== 2.294 - 2.295 -void ConcurrentGCThread::stsYield(const char* id) { 2.296 - assert( Thread::current()->is_ConcurrentGC_thread(), 2.297 - "only a conc GC thread can call this" ); 2.298 - _sts.yield(id); 2.299 -} 2.300 - 2.301 -bool ConcurrentGCThread::stsShouldYield() { 2.302 - assert( Thread::current()->is_ConcurrentGC_thread(), 2.303 - "only a conc GC thread can call this" ); 2.304 - return _sts.should_yield(); 2.305 -} 2.306 - 2.307 -void ConcurrentGCThread::stsJoin() { 2.308 - assert( Thread::current()->is_ConcurrentGC_thread(), 2.309 - "only a conc GC thread can call this" ); 2.310 - _sts.join(); 2.311 -} 2.312 - 2.313 -void ConcurrentGCThread::stsLeave() { 2.314 - assert( Thread::current()->is_ConcurrentGC_thread(), 2.315 - "only a conc GC thread can call this" ); 2.316 - _sts.leave(); 2.317 -}
3.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentGCThread.hpp Fri Nov 14 14:23:05 2008 -0800 3.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 3.3 @@ -1,167 +0,0 @@ 3.4 -/* 3.5 - * Copyright 2001-2005 Sun Microsystems, Inc. All Rights Reserved. 3.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3.7 - * 3.8 - * This code is free software; you can redistribute it and/or modify it 3.9 - * under the terms of the GNU General Public License version 2 only, as 3.10 - * published by the Free Software Foundation. 3.11 - * 3.12 - * This code is distributed in the hope that it will be useful, but WITHOUT 3.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 3.14 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 3.15 - * version 2 for more details (a copy is included in the LICENSE file that 3.16 - * accompanied this code). 3.17 - * 3.18 - * You should have received a copy of the GNU General Public License version 3.19 - * 2 along with this work; if not, write to the Free Software Foundation, 3.20 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 3.21 - * 3.22 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 3.23 - * CA 95054 USA or visit www.sun.com if you need additional information or 3.24 - * have any questions. 3.25 - * 3.26 - */ 3.27 - 3.28 -class VoidClosure; 3.29 - 3.30 -// A SuspendibleThreadSet is (obviously) a set of threads that can be 3.31 -// suspended. A thread can join and later leave the set, and periodically 3.32 -// yield. If some thread (not in the set) requests, via suspend_all, that 3.33 -// the threads be suspended, then the requesting thread is blocked until 3.34 -// all the threads in the set have yielded or left the set. (Threads may 3.35 -// not enter the set when an attempted suspension is in progress.) The 3.36 -// suspending thread later calls resume_all, allowing the suspended threads 3.37 -// to continue. 3.38 - 3.39 -class SuspendibleThreadSet { 3.40 - Monitor* _m; 3.41 - int _async; 3.42 - bool _async_stop; 3.43 - int _async_stopped; 3.44 - bool _initialized; 3.45 - double _suspend_all_start; 3.46 - 3.47 - void initialize_work(); 3.48 - 3.49 - public: 3.50 - SuspendibleThreadSet() : _initialized(false) {} 3.51 - 3.52 - // Add the current thread to the set. May block if a suspension 3.53 - // is in progress. 3.54 - void join(); 3.55 - // Removes the current thread from the set. 3.56 - void leave(); 3.57 - // Returns "true" iff an suspension is in progress. 3.58 - bool should_yield() { return _async_stop; } 3.59 - // Suspends the current thread if a suspension is in progress (for 3.60 - // the duration of the suspension.) 3.61 - void yield(const char* id); 3.62 - // Return when all threads in the set are suspended. 3.63 - void suspend_all(); 3.64 - // Allow suspended threads to resume. 3.65 - void resume_all(); 3.66 - // Redundant initializations okay. 3.67 - void initialize() { 3.68 - // Double-check dirty read idiom. 3.69 - if (!_initialized) initialize_work(); 3.70 - } 3.71 -}; 3.72 - 3.73 - 3.74 -class ConcurrentGCThread: public NamedThread { 3.75 - friend class VMStructs; 3.76 - 3.77 -protected: 3.78 - static bool _should_terminate; 3.79 - static bool _has_terminated; 3.80 - 3.81 - enum CGC_flag_type { 3.82 - CGC_nil = 0x0, 3.83 - CGC_dont_suspend = 0x1, 3.84 - CGC_CGC_safepoint = 0x2, 3.85 - CGC_VM_safepoint = 0x4 3.86 - }; 3.87 - 3.88 - static int _CGC_flag; 3.89 - 3.90 - static bool CGC_flag_is_set(int b) { return (_CGC_flag & b) != 0; } 3.91 - static int set_CGC_flag(int b) { return _CGC_flag |= b; } 3.92 - static int reset_CGC_flag(int b) { return _CGC_flag &= ~b; } 3.93 - 3.94 - void stopWorldAndDo(VoidClosure* op); 3.95 - 3.96 - // All instances share this one set. 3.97 - static SuspendibleThreadSet _sts; 3.98 - 3.99 - // Create and start the thread (setting it's priority high.) 3.100 - void create_and_start(); 3.101 - 3.102 - // Do initialization steps in the thread: record stack base and size, 3.103 - // init thread local storage, set JNI handle block. 3.104 - void initialize_in_thread(); 3.105 - 3.106 - // Wait until Universe::is_fully_initialized(); 3.107 - void wait_for_universe_init(); 3.108 - 3.109 - // Record that the current thread is terminating, and will do more 3.110 - // concurrent work. 3.111 - void terminate(); 3.112 - 3.113 -public: 3.114 - // Constructor 3.115 - 3.116 - ConcurrentGCThread(); 3.117 - ~ConcurrentGCThread() {} // Exists to call NamedThread destructor. 3.118 - 3.119 - // Tester 3.120 - bool is_ConcurrentGC_thread() const { return true; } 3.121 - 3.122 - static void safepoint_synchronize(); 3.123 - static void safepoint_desynchronize(); 3.124 - 3.125 - // All overridings should probably do _sts::yield, but we allow 3.126 - // overriding for distinguished debugging messages. Default is to do 3.127 - // nothing. 3.128 - virtual void yield() {} 3.129 - 3.130 - bool should_yield() { return _sts.should_yield(); } 3.131 - 3.132 - // they are prefixed by sts since there are already yield() and 3.133 - // should_yield() (non-static) methods in this class and it was an 3.134 - // easy way to differentiate them. 3.135 - static void stsYield(const char* id); 3.136 - static bool stsShouldYield(); 3.137 - static void stsJoin(); 3.138 - static void stsLeave(); 3.139 - 3.140 -}; 3.141 - 3.142 -// The SurrogateLockerThread is used by concurrent GC threads for 3.143 -// manipulating Java monitors, in particular, currently for 3.144 -// manipulating the pending_list_lock. XXX 3.145 -class SurrogateLockerThread: public JavaThread { 3.146 - friend class VMStructs; 3.147 - public: 3.148 - enum SLT_msg_type { 3.149 - empty = 0, // no message 3.150 - acquirePLL, // acquire pending list lock 3.151 - releaseAndNotifyPLL // notify and release pending list lock 3.152 - }; 3.153 - private: 3.154 - // the following are shared with the CMSThread 3.155 - SLT_msg_type _buffer; // communication buffer 3.156 - Monitor _monitor; // monitor controlling buffer 3.157 - BasicLock _basicLock; // used for PLL locking 3.158 - 3.159 - public: 3.160 - static SurrogateLockerThread* make(TRAPS); 3.161 - 3.162 - SurrogateLockerThread(); 3.163 - 3.164 - bool is_hidden_from_external_view() const { return true; } 3.165 - 3.166 - void loop(); // main method 3.167 - 3.168 - void manipulatePLL(SLT_msg_type msg); 3.169 - 3.170 -};