langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java
changeset 18010 604faee85350
parent 17578 46ac954e4a84
child 18644 02f65c63159c
equal deleted inserted replaced
18009:f47ea7c9c3f4 18010:604faee85350
  1958         }
  1958         }
  1959         state.defined.excl(adr);
  1959         state.defined.excl(adr);
  1960     }
  1960     }
  1961 
  1961 
  1962     private void fillLocalVarPosition(LocalVar lv) {
  1962     private void fillLocalVarPosition(LocalVar lv) {
  1963         if (lv == null || lv.sym == null
  1963         if (lv == null || lv.sym == null || !lv.sym.hasTypeAnnotations())
  1964                 || lv.sym.annotations.isTypesEmpty())
       
  1965             return;
  1964             return;
  1966         for (Attribute.TypeCompound ta : lv.sym.getRawTypeAttributes()) {
  1965         for (Attribute.TypeCompound ta : lv.sym.getRawTypeAttributes()) {
  1967             TypeAnnotationPosition p = ta.position;
  1966             TypeAnnotationPosition p = ta.position;
  1968             p.lvarOffset = new int[] { (int)lv.start_pc };
  1967             p.lvarOffset = new int[] { (int)lv.start_pc };
  1969             p.lvarLength = new int[] { (int)lv.length };
  1968             p.lvarLength = new int[] { (int)lv.length };
  1977     // annotations on exception parameters.
  1976     // annotations on exception parameters.
  1978     public void fillExceptionParameterPositions() {
  1977     public void fillExceptionParameterPositions() {
  1979         for (int i = 0; i < varBufferSize; ++i) {
  1978         for (int i = 0; i < varBufferSize; ++i) {
  1980             LocalVar lv = varBuffer[i];
  1979             LocalVar lv = varBuffer[i];
  1981             if (lv == null || lv.sym == null
  1980             if (lv == null || lv.sym == null
  1982                     || lv.sym.annotations.isTypesEmpty()
  1981                     || !lv.sym.hasTypeAnnotations()
  1983                     || !lv.sym.isExceptionParameter())
  1982                     || !lv.sym.isExceptionParameter())
  1984                 continue;
  1983                 continue;
  1985 
  1984 
  1986             for (Attribute.TypeCompound ta : lv.sym.getRawTypeAttributes()) {
  1985             for (Attribute.TypeCompound ta : lv.sym.getRawTypeAttributes()) {
  1987                 TypeAnnotationPosition p = ta.position;
  1986                 TypeAnnotationPosition p = ta.position;
  2026         // Keep local variables if
  2025         // Keep local variables if
  2027         // 1) we need them for debug information
  2026         // 1) we need them for debug information
  2028         // 2) it is an exception type and it contains type annotations
  2027         // 2) it is an exception type and it contains type annotations
  2029         if (!varDebugInfo &&
  2028         if (!varDebugInfo &&
  2030                 (!var.sym.isExceptionParameter() ||
  2029                 (!var.sym.isExceptionParameter() ||
  2031                 var.sym.annotations.isTypesEmpty())) return;
  2030                 var.sym.hasTypeAnnotations())) return;
  2032         if ((var.sym.flags() & Flags.SYNTHETIC) != 0) return;
  2031         if ((var.sym.flags() & Flags.SYNTHETIC) != 0) return;
  2033         if (varBuffer == null)
  2032         if (varBuffer == null)
  2034             varBuffer = new LocalVar[20];
  2033             varBuffer = new LocalVar[20];
  2035         else
  2034         else
  2036             varBuffer = ArrayUtils.ensureCapacity(varBuffer, varBufferSize);
  2035             varBuffer = ArrayUtils.ensureCapacity(varBuffer, varBufferSize);