comparison agent/src/share/classes/sun/jvm/hotspot/compiler/OopMapValue.java @ 19646:c5f6a7397eb1

SA fixes: add GraalEnv to VMTypes, remove references to value_value from agent sources
author Gilles Duboscq <gilles.m.duboscq@oracle.com>
date Fri, 20 Feb 2015 14:24:16 +0100
parents c18cbe5936b8
children
comparison
equal deleted inserted replaced
19645:10a1fc5e3209 19646:c5f6a7397eb1
47 static int REGISTER_MASK_IN_PLACE; 47 static int REGISTER_MASK_IN_PLACE;
48 48
49 // Types of OopValues 49 // Types of OopValues
50 static int UNUSED_VALUE; 50 static int UNUSED_VALUE;
51 static int OOP_VALUE; 51 static int OOP_VALUE;
52 static int VALUE_VALUE;
53 static int NARROWOOP_VALUE; 52 static int NARROWOOP_VALUE;
54 static int CALLEE_SAVED_VALUE; 53 static int CALLEE_SAVED_VALUE;
55 static int DERIVED_OOP_VALUE; 54 static int DERIVED_OOP_VALUE;
56 55
57 static { 56 static {
71 TYPE_MASK_IN_PLACE = db.lookupIntConstant("OopMapValue::type_mask_in_place").intValue(); 70 TYPE_MASK_IN_PLACE = db.lookupIntConstant("OopMapValue::type_mask_in_place").intValue();
72 REGISTER_MASK = db.lookupIntConstant("OopMapValue::register_mask").intValue(); 71 REGISTER_MASK = db.lookupIntConstant("OopMapValue::register_mask").intValue();
73 REGISTER_MASK_IN_PLACE = db.lookupIntConstant("OopMapValue::register_mask_in_place").intValue(); 72 REGISTER_MASK_IN_PLACE = db.lookupIntConstant("OopMapValue::register_mask_in_place").intValue();
74 UNUSED_VALUE = db.lookupIntConstant("OopMapValue::unused_value").intValue(); 73 UNUSED_VALUE = db.lookupIntConstant("OopMapValue::unused_value").intValue();
75 OOP_VALUE = db.lookupIntConstant("OopMapValue::oop_value").intValue(); 74 OOP_VALUE = db.lookupIntConstant("OopMapValue::oop_value").intValue();
76 VALUE_VALUE = db.lookupIntConstant("OopMapValue::value_value").intValue();
77 NARROWOOP_VALUE = db.lookupIntConstant("OopMapValue::narrowoop_value").intValue(); 75 NARROWOOP_VALUE = db.lookupIntConstant("OopMapValue::narrowoop_value").intValue();
78 CALLEE_SAVED_VALUE = db.lookupIntConstant("OopMapValue::callee_saved_value").intValue(); 76 CALLEE_SAVED_VALUE = db.lookupIntConstant("OopMapValue::callee_saved_value").intValue();
79 DERIVED_OOP_VALUE = db.lookupIntConstant("OopMapValue::derived_oop_value").intValue(); 77 DERIVED_OOP_VALUE = db.lookupIntConstant("OopMapValue::derived_oop_value").intValue();
80 } 78 }
81 79
82 public static abstract class OopTypes { 80 public static abstract class OopTypes {
83 public static final OopTypes UNUSED_VALUE = new OopTypes() { int getValue() { return OopMapValue.UNUSED_VALUE; }}; 81 public static final OopTypes UNUSED_VALUE = new OopTypes() { int getValue() { return OopMapValue.UNUSED_VALUE; }};
84 public static final OopTypes OOP_VALUE = new OopTypes() { int getValue() { return OopMapValue.OOP_VALUE; }}; 82 public static final OopTypes OOP_VALUE = new OopTypes() { int getValue() { return OopMapValue.OOP_VALUE; }};
85 public static final OopTypes VALUE_VALUE = new OopTypes() { int getValue() { return OopMapValue.VALUE_VALUE; }};
86 public static final OopTypes NARROWOOP_VALUE = new OopTypes() { int getValue() { return OopMapValue.NARROWOOP_VALUE; }}; 83 public static final OopTypes NARROWOOP_VALUE = new OopTypes() { int getValue() { return OopMapValue.NARROWOOP_VALUE; }};
87 public static final OopTypes CALLEE_SAVED_VALUE = new OopTypes() { int getValue() { return OopMapValue.CALLEE_SAVED_VALUE; }}; 84 public static final OopTypes CALLEE_SAVED_VALUE = new OopTypes() { int getValue() { return OopMapValue.CALLEE_SAVED_VALUE; }};
88 public static final OopTypes DERIVED_OOP_VALUE = new OopTypes() { int getValue() { return OopMapValue.DERIVED_OOP_VALUE; }}; 85 public static final OopTypes DERIVED_OOP_VALUE = new OopTypes() { int getValue() { return OopMapValue.DERIVED_OOP_VALUE; }};
89 86
90 abstract int getValue(); 87 abstract int getValue();
103 } 100 }
104 } 101 }
105 102
106 // Querying 103 // Querying
107 public boolean isOop() { return (getValue() & TYPE_MASK_IN_PLACE) == OOP_VALUE; } 104 public boolean isOop() { return (getValue() & TYPE_MASK_IN_PLACE) == OOP_VALUE; }
108 public boolean isValue() { return (getValue() & TYPE_MASK_IN_PLACE) == VALUE_VALUE; }
109 public boolean isNarrowOop() { return (getValue() & TYPE_MASK_IN_PLACE) == NARROWOOP_VALUE; } 105 public boolean isNarrowOop() { return (getValue() & TYPE_MASK_IN_PLACE) == NARROWOOP_VALUE; }
110 public boolean isCalleeSaved() { return (getValue() & TYPE_MASK_IN_PLACE) == CALLEE_SAVED_VALUE; } 106 public boolean isCalleeSaved() { return (getValue() & TYPE_MASK_IN_PLACE) == CALLEE_SAVED_VALUE; }
111 public boolean isDerivedOop() { return (getValue() & TYPE_MASK_IN_PLACE) == DERIVED_OOP_VALUE; } 107 public boolean isDerivedOop() { return (getValue() & TYPE_MASK_IN_PLACE) == DERIVED_OOP_VALUE; }
112 108
113 public VMReg getReg() { return new VMReg((getValue() & REGISTER_MASK_IN_PLACE) >> REGISTER_SHIFT); } 109 public VMReg getReg() { return new VMReg((getValue() & REGISTER_MASK_IN_PLACE) >> REGISTER_SHIFT); }
115 111
116 public OopTypes getType() { 112 public OopTypes getType() {
117 int which = (getValue() & TYPE_MASK_IN_PLACE); 113 int which = (getValue() & TYPE_MASK_IN_PLACE);
118 if (which == UNUSED_VALUE) return OopTypes.UNUSED_VALUE; 114 if (which == UNUSED_VALUE) return OopTypes.UNUSED_VALUE;
119 else if (which == OOP_VALUE) return OopTypes.OOP_VALUE; 115 else if (which == OOP_VALUE) return OopTypes.OOP_VALUE;
120 else if (which == VALUE_VALUE) return OopTypes.VALUE_VALUE;
121 else if (which == NARROWOOP_VALUE) return OopTypes.NARROWOOP_VALUE; 116 else if (which == NARROWOOP_VALUE) return OopTypes.NARROWOOP_VALUE;
122 else if (which == CALLEE_SAVED_VALUE) return OopTypes.CALLEE_SAVED_VALUE; 117 else if (which == CALLEE_SAVED_VALUE) return OopTypes.CALLEE_SAVED_VALUE;
123 else if (which == DERIVED_OOP_VALUE) return OopTypes.DERIVED_OOP_VALUE; 118 else if (which == DERIVED_OOP_VALUE) return OopTypes.DERIVED_OOP_VALUE;
124 else throw new InternalError("unknown which " + which + " (TYPE_MASK_IN_PLACE = " + TYPE_MASK_IN_PLACE + ")"); 119 else throw new InternalError("unknown which " + which + " (TYPE_MASK_IN_PLACE = " + TYPE_MASK_IN_PLACE + ")");
125 } 120 }