comparison hotspot/src/share/vm/runtime/objectMonitor.hpp @ 39702:ea7e9375bb93

8068592: Remove unused code in objectMonitor.hpp Reviewed-by: dholmes, redestad, gthornbr
author dcubed
date Thu, 07 Jul 2016 14:58:17 -0700
parents b7b2407bc7e5
children c871e0f8b02a
comparison
equal deleted inserted replaced
19:3738bf3b214d 20:0650c0d0dc90
1 /* 1 /*
2 * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 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 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
159 ObjectWaiter * volatile _cxq; // LL of recently-arrived threads blocked on entry. 159 ObjectWaiter * volatile _cxq; // LL of recently-arrived threads blocked on entry.
160 Thread * volatile _succ; // Heir presumptive thread - used for futile wakeup throttling 160 Thread * volatile _succ; // Heir presumptive thread - used for futile wakeup throttling
161 Thread * volatile _Responsible; 161 Thread * volatile _Responsible;
162 162
163 volatile int _Spinner; // for exit->spinner handoff optimization 163 volatile int _Spinner; // for exit->spinner handoff optimization
164 volatile int _SpinFreq; // Spin 1-out-of-N attempts: success rate
165 volatile int _SpinClock;
166 volatile intptr_t _SpinState; // MCS/CLH list of spinners
167 volatile int _SpinDuration; 164 volatile int _SpinDuration;
168 165
169 volatile jint _count; // reference count to prevent reclamation/deflation 166 volatile jint _count; // reference count to prevent reclamation/deflation
170 // at stop-the-world time. See deflate_idle_monitors(). 167 // at stop-the-world time. See deflate_idle_monitors().
171 // _count is approximately |_WaitSet| + |_EntryList| 168 // _count is approximately |_WaitSet| + |_EntryList|
236 static int count_offset_in_bytes() { return offset_of(ObjectMonitor, _count); } 233 static int count_offset_in_bytes() { return offset_of(ObjectMonitor, _count); }
237 static int recursions_offset_in_bytes() { return offset_of(ObjectMonitor, _recursions); } 234 static int recursions_offset_in_bytes() { return offset_of(ObjectMonitor, _recursions); }
238 static int cxq_offset_in_bytes() { return offset_of(ObjectMonitor, _cxq); } 235 static int cxq_offset_in_bytes() { return offset_of(ObjectMonitor, _cxq); }
239 static int succ_offset_in_bytes() { return offset_of(ObjectMonitor, _succ); } 236 static int succ_offset_in_bytes() { return offset_of(ObjectMonitor, _succ); }
240 static int EntryList_offset_in_bytes() { return offset_of(ObjectMonitor, _EntryList); } 237 static int EntryList_offset_in_bytes() { return offset_of(ObjectMonitor, _EntryList); }
241 static int FreeNext_offset_in_bytes() { return offset_of(ObjectMonitor, FreeNext); }
242 static int WaitSet_offset_in_bytes() { return offset_of(ObjectMonitor, _WaitSet); }
243 static int Responsible_offset_in_bytes() { return offset_of(ObjectMonitor, _Responsible); }
244 static int Spinner_offset_in_bytes() { return offset_of(ObjectMonitor, _Spinner); }
245 238
246 // ObjectMonitor references can be ORed with markOopDesc::monitor_value 239 // ObjectMonitor references can be ORed with markOopDesc::monitor_value
247 // as part of the ObjectMonitor tagging mechanism. When we combine an 240 // as part of the ObjectMonitor tagging mechanism. When we combine an
248 // ObjectMonitor reference with an offset, we need to remove the tag 241 // ObjectMonitor reference with an offset, we need to remove the tag
249 // value in order to generate the proper address. 242 // value in order to generate the proper address.
255 // to the ObjectMonitor reference manipulation code: 248 // to the ObjectMonitor reference manipulation code:
256 // 249 //
257 #define OM_OFFSET_NO_MONITOR_VALUE_TAG(f) \ 250 #define OM_OFFSET_NO_MONITOR_VALUE_TAG(f) \
258 ((ObjectMonitor::f ## _offset_in_bytes()) - markOopDesc::monitor_value) 251 ((ObjectMonitor::f ## _offset_in_bytes()) - markOopDesc::monitor_value)
259 252
260 // Eventually we'll make provisions for multiple callbacks, but
261 // now one will suffice.
262 static int (*SpinCallbackFunction)(intptr_t, int);
263 static intptr_t SpinCallbackArgument;
264
265 markOop header() const; 253 markOop header() const;
266 void set_header(markOop hdr); 254 void set_header(markOop hdr);
267 255
268 intptr_t is_busy() const { 256 intptr_t is_busy() const {
269 // TODO-FIXME: merge _count and _waiters. 257 // TODO-FIXME: merge _count and _waiters.
310 _succ = NULL; 298 _succ = NULL;
311 _EntryList = NULL; 299 _EntryList = NULL;
312 _cxq = NULL; 300 _cxq = NULL;
313 _WaitSet = NULL; 301 _WaitSet = NULL;
314 _recursions = 0; 302 _recursions = 0;
315 _SpinFreq = 0;
316 _SpinClock = 0;
317 } 303 }
318 304
319 public: 305 public:
320 306
321 void* object() const; 307 void* object() const;
351 void EnterI(TRAPS); 337 void EnterI(TRAPS);
352 void ReenterI(Thread * Self, ObjectWaiter * SelfNode); 338 void ReenterI(Thread * Self, ObjectWaiter * SelfNode);
353 void UnlinkAfterAcquire(Thread * Self, ObjectWaiter * SelfNode); 339 void UnlinkAfterAcquire(Thread * Self, ObjectWaiter * SelfNode);
354 int TryLock(Thread * Self); 340 int TryLock(Thread * Self);
355 int NotRunnable(Thread * Self, Thread * Owner); 341 int NotRunnable(Thread * Self, Thread * Owner);
356 int TrySpin_Fixed(Thread * Self); 342 int TrySpin(Thread * Self);
357 int TrySpin_VaryFrequency(Thread * Self);
358 int TrySpin_VaryDuration(Thread * Self);
359 void ExitEpilog(Thread * Self, ObjectWaiter * Wakee); 343 void ExitEpilog(Thread * Self, ObjectWaiter * Wakee);
360 bool ExitSuspendEquivalent(JavaThread * Self); 344 bool ExitSuspendEquivalent(JavaThread * Self);
361 void post_monitor_wait_event(EventJavaMonitorWait * event, 345 void post_monitor_wait_event(EventJavaMonitorWait * event,
362 jlong notifier_tid, 346 jlong notifier_tid,
363 jlong timeout, 347 jlong timeout,