110 } 111 112 public StackValueCollection getExpressions() { 113 if (getScope() == null) 114 return new StackValueCollection(); 115 List scvList = getScope().getExpressions(); 116 if (scvList == null) 117 return new StackValueCollection(); 118 119 // scvList is the list of ScopeValues describing the JVM stack state. 120 // There is one scv_list entry for every JVM stack state in use. 121 int length = scvList.size(); 122 StackValueCollection result = new StackValueCollection(length); 123 for( int i = 0; i < length; i++ ) 124 result.add( createStackValue((ScopeValue) scvList.get(i)) ); 125 126 return result; 127 } 128 129 /** Returns List<MonitorInfo> */ 130 public List getMonitors() { 131 List monitors = getScope().getMonitors(); 132 if (monitors == null) { 133 return new ArrayList(); 134 } 135 List result = new ArrayList(monitors.size()); 136 for (int i = 0; i < monitors.size(); i++) { 137 MonitorValue mv = (MonitorValue) monitors.get(i); 138 ScopeValue ov = mv.owner(); 139 StackValue ownerSV = createStackValue(ov); // it is an oop 140 if (ov.isObject()) { // The owner object was scalar replaced 141 Assert.that(mv.eliminated() && ownerSV.objIsScalarReplaced(), "monitor should be eliminated for scalar replaced object"); 142 // Put klass for scalar replaced object. 143 ScopeValue kv = ((ObjectValue)ov).getKlass(); 144 Assert.that(kv.isConstantOop(), "klass should be oop constant for scalar replaced object"); 145 OopHandle k = ((ConstantOopReadValue)kv).getValue(); 146 result.add(new MonitorInfo(k, resolveMonitorLock(mv.basicLock()), mv.eliminated(), true)); 147 } else { 148 result.add(new MonitorInfo(ownerSV.getObject(), resolveMonitorLock(mv.basicLock()), mv.eliminated(), false)); 149 } 150 } 151 return result; 152 } 153 154 public int getBCI() { 155 int raw = getRawBCI(); | 110 } 111 112 public StackValueCollection getExpressions() { 113 if (getScope() == null) 114 return new StackValueCollection(); 115 List scvList = getScope().getExpressions(); 116 if (scvList == null) 117 return new StackValueCollection(); 118 119 // scvList is the list of ScopeValues describing the JVM stack state. 120 // There is one scv_list entry for every JVM stack state in use. 121 int length = scvList.size(); 122 StackValueCollection result = new StackValueCollection(length); 123 for( int i = 0; i < length; i++ ) 124 result.add( createStackValue((ScopeValue) scvList.get(i)) ); 125 126 return result; 127 } 128 129 /** Returns List<MonitorInfo> */ 130 public List<MonitorInfo> getMonitors() { 131 List monitors = getScope().getMonitors(); 132 if (monitors == null) { 133 return new ArrayList<>(); 134 } 135 List<MonitorInfo> result = new ArrayList<>(monitors.size()); 136 for (int i = 0; i < monitors.size(); i++) { 137 MonitorValue mv = (MonitorValue) monitors.get(i); 138 ScopeValue ov = mv.owner(); 139 StackValue ownerSV = createStackValue(ov); // it is an oop 140 if (ov.isObject()) { // The owner object was scalar replaced 141 Assert.that(mv.eliminated() && ownerSV.objIsScalarReplaced(), "monitor should be eliminated for scalar replaced object"); 142 // Put klass for scalar replaced object. 143 ScopeValue kv = ((ObjectValue)ov).getKlass(); 144 Assert.that(kv.isConstantOop(), "klass should be oop constant for scalar replaced object"); 145 OopHandle k = ((ConstantOopReadValue)kv).getValue(); 146 result.add(new MonitorInfo(k, resolveMonitorLock(mv.basicLock()), mv.eliminated(), true)); 147 } else { 148 result.add(new MonitorInfo(ownerSV.getObject(), resolveMonitorLock(mv.basicLock()), mv.eliminated(), false)); 149 } 150 } 151 return result; 152 } 153 154 public int getBCI() { 155 int raw = getRawBCI(); |