< prev index next >

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/BasicLock.java

Print this page

26 
27 import java.util.*;
28 
29 import sun.jvm.hotspot.debugger.*;
30 import sun.jvm.hotspot.oops.*;
31 import sun.jvm.hotspot.types.*;
32 import sun.jvm.hotspot.utilities.Observable;
33 import sun.jvm.hotspot.utilities.Observer;
34 
35 public class BasicLock extends VMObject {
36   static {
37     VM.registerVMInitializedObserver(new Observer() {
38         public void update(Observable o, Object data) {
39           initialize(VM.getVM().getTypeDataBase());
40         }
41       });
42   }
43 
44   private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
45     Type type  = db.lookupType("BasicLock");
46     displacedHeaderField = type.getCIntegerField("_displaced_header");
47   }
48 
49   private static CIntegerField displacedHeaderField;
50 
51   public BasicLock(Address addr) {
52     super(addr);
53   }
54 
55   public Mark displacedHeader() {
56     return new Mark(addr.addOffsetTo(displacedHeaderField.getOffset()));
57   }
58 }

26 
27 import java.util.*;
28 
29 import sun.jvm.hotspot.debugger.*;
30 import sun.jvm.hotspot.oops.*;
31 import sun.jvm.hotspot.types.*;
32 import sun.jvm.hotspot.utilities.Observable;
33 import sun.jvm.hotspot.utilities.Observer;
34 
35 public class BasicLock extends VMObject {
36   static {
37     VM.registerVMInitializedObserver(new Observer() {
38         public void update(Observable o, Object data) {
39           initialize(VM.getVM().getTypeDataBase());
40         }
41       });
42   }
43 
44   private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
45     Type type  = db.lookupType("BasicLock");
46     displacedHeaderField = type.getCIntegerField("_metadata");
47   }
48 
49   private static CIntegerField displacedHeaderField;
50 
51   public BasicLock(Address addr) {
52     super(addr);
53   }
54 
55   public Mark displacedHeader() {
56     return new Mark(addr.addOffsetTo(displacedHeaderField.getOffset()));
57   }
58 }
< prev index next >