equal
deleted
inserted
replaced
36 private static int EXTERNAL_SUSPEND; |
36 private static int EXTERNAL_SUSPEND; |
37 private static int EXT_SUSPENDED; |
37 private static int EXT_SUSPENDED; |
38 private static int HAS_ASYNC_EXCEPTION; |
38 private static int HAS_ASYNC_EXCEPTION; |
39 |
39 |
40 private static AddressField activeHandlesField; |
40 private static AddressField activeHandlesField; |
41 private static AddressField highestLockField; |
|
42 private static AddressField currentPendingMonitorField; |
41 private static AddressField currentPendingMonitorField; |
43 private static AddressField currentWaitingMonitorField; |
42 private static AddressField currentWaitingMonitorField; |
44 |
43 |
45 static { |
44 static { |
46 VM.registerVMInitializedObserver(new Observer() { |
45 VM.registerVMInitializedObserver(new Observer() { |
58 EXT_SUSPENDED = db.lookupIntConstant("Thread::_ext_suspended").intValue(); |
57 EXT_SUSPENDED = db.lookupIntConstant("Thread::_ext_suspended").intValue(); |
59 HAS_ASYNC_EXCEPTION = db.lookupIntConstant("Thread::_has_async_exception").intValue(); |
58 HAS_ASYNC_EXCEPTION = db.lookupIntConstant("Thread::_has_async_exception").intValue(); |
60 |
59 |
61 tlabFieldOffset = type.getField("_tlab").getOffset(); |
60 tlabFieldOffset = type.getField("_tlab").getOffset(); |
62 activeHandlesField = type.getAddressField("_active_handles"); |
61 activeHandlesField = type.getAddressField("_active_handles"); |
63 highestLockField = type.getAddressField("_highest_lock"); |
|
64 currentPendingMonitorField = type.getAddressField("_current_pending_monitor"); |
62 currentPendingMonitorField = type.getAddressField("_current_pending_monitor"); |
65 currentWaitingMonitorField = type.getAddressField("_current_waiting_monitor"); |
63 currentWaitingMonitorField = type.getAddressField("_current_waiting_monitor"); |
66 } |
64 } |
67 |
65 |
68 public Thread(Address addr) { |
66 public Thread(Address addr) { |
119 public void oopsDo(AddressVisitor oopVisitor) { |
117 public void oopsDo(AddressVisitor oopVisitor) { |
120 // FIXME: Empty for now; will later traverse JNI handles and |
118 // FIXME: Empty for now; will later traverse JNI handles and |
121 // pending exception |
119 // pending exception |
122 } |
120 } |
123 |
121 |
124 public Address highestLock() { |
|
125 return highestLockField.getValue(addr); |
|
126 } |
|
127 |
|
128 public ObjectMonitor getCurrentPendingMonitor() { |
122 public ObjectMonitor getCurrentPendingMonitor() { |
129 Address monitorAddr = currentPendingMonitorField.getValue(addr); |
123 Address monitorAddr = currentPendingMonitorField.getValue(addr); |
130 if (monitorAddr == null) { |
124 if (monitorAddr == null) { |
131 return null; |
125 return null; |
132 } |
126 } |