1172 endAttr(alenIdx); |
1172 endAttr(alenIdx); |
1173 acount++; |
1173 acount++; |
1174 } |
1174 } |
1175 |
1175 |
1176 // counter for number of generic local variables |
1176 // counter for number of generic local variables |
1177 int nGenericVars = 0; |
1177 if (code.varDebugInfo && code.varBufferSize > 0) { |
1178 |
1178 int nGenericVars = 0; |
1179 if (code.varBufferSize > 0) { |
|
1180 int alenIdx = writeAttr(names.LocalVariableTable); |
1179 int alenIdx = writeAttr(names.LocalVariableTable); |
1181 databuf.appendChar(code.getLVTSize()); |
1180 databuf.appendChar(code.getLVTSize()); |
1182 for (int i=0; i<code.varBufferSize; i++) { |
1181 for (int i=0; i<code.varBufferSize; i++) { |
1183 Code.LocalVar var = code.varBuffer[i]; |
1182 Code.LocalVar var = code.varBuffer[i]; |
1184 |
1183 |
1193 VarSymbol sym = var.sym; |
1192 VarSymbol sym = var.sym; |
1194 databuf.appendChar(pool.put(sym.name)); |
1193 databuf.appendChar(pool.put(sym.name)); |
1195 Type vartype = sym.erasure(types); |
1194 Type vartype = sym.erasure(types); |
1196 databuf.appendChar(pool.put(typeSig(vartype))); |
1195 databuf.appendChar(pool.put(typeSig(vartype))); |
1197 databuf.appendChar(var.reg); |
1196 databuf.appendChar(var.reg); |
1198 if (needsLocalVariableTypeEntry(var.sym.type)) |
1197 if (needsLocalVariableTypeEntry(var.sym.type)) { |
1199 nGenericVars++; |
1198 nGenericVars++; |
|
1199 } |
1200 } |
1200 } |
1201 } |
1201 } |
1202 endAttr(alenIdx); |
1202 endAttr(alenIdx); |
1203 acount++; |
1203 acount++; |
1204 } |
1204 |
1205 |
1205 if (nGenericVars > 0) { |
1206 if (nGenericVars > 0) { |
1206 alenIdx = writeAttr(names.LocalVariableTypeTable); |
1207 int alenIdx = writeAttr(names.LocalVariableTypeTable); |
1207 databuf.appendChar(nGenericVars); |
1208 databuf.appendChar(nGenericVars); |
1208 int count = 0; |
1209 int count = 0; |
1209 |
1210 |
1210 for (int i=0; i<code.varBufferSize; i++) { |
1211 for (int i=0; i<code.varBufferSize; i++) { |
1211 Code.LocalVar var = code.varBuffer[i]; |
1212 Code.LocalVar var = code.varBuffer[i]; |
1212 VarSymbol sym = var.sym; |
1213 VarSymbol sym = var.sym; |
1213 if (!needsLocalVariableTypeEntry(sym.type)) |
1214 if (!needsLocalVariableTypeEntry(sym.type)) |
1214 continue; |
1215 continue; |
1215 for (Code.LocalVar.Range r : var.aliveRanges) { |
1216 for (Code.LocalVar.Range r : var.aliveRanges) { |
1216 // write variable info |
1217 // write variable info |
1217 databuf.appendChar(r.start_pc); |
1218 databuf.appendChar(r.start_pc); |
1218 databuf.appendChar(r.length); |
1219 databuf.appendChar(r.length); |
1219 databuf.appendChar(pool.put(sym.name)); |
1220 databuf.appendChar(pool.put(sym.name)); |
1220 databuf.appendChar(pool.put(typeSig(sym.type))); |
1221 databuf.appendChar(pool.put(typeSig(sym.type))); |
1221 databuf.appendChar(var.reg); |
1222 databuf.appendChar(var.reg); |
1222 count++; |
1223 count++; |
1223 } |
1224 } |
1224 } |
1225 } |
1225 Assert.check(count == nGenericVars); |
1226 Assert.check(count == nGenericVars); |
1226 endAttr(alenIdx); |
1227 endAttr(alenIdx); |
1227 acount++; |
1228 acount++; |
1228 } |
1229 } |
1229 } |
1230 |
1230 |
1231 if (code.stackMapBufferSize > 0) { |
1231 if (code.stackMapBufferSize > 0) { |
1232 if (debugstackmap) System.out.println("Stack map for " + code.meth); |
1232 if (debugstackmap) System.out.println("Stack map for " + code.meth); |
1233 int alenIdx = writeAttr(code.stackMap.getAttributeName(names)); |
1233 int alenIdx = writeAttr(code.stackMap.getAttributeName(names)); |