langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java
changeset 8031 d5fe2c1cecfc
parent 7681 1f0819a3341f
child 8032 e1aa25ccdabb
equal deleted inserted replaced
7848:884a6d60b235 8031:d5fe2c1cecfc
     1 /*
     1 /*
     2  * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
  1910             if (v.start_pc != Character.MAX_VALUE) {
  1910             if (v.start_pc != Character.MAX_VALUE) {
  1911                 char length = (char)(curPc() - v.start_pc);
  1911                 char length = (char)(curPc() - v.start_pc);
  1912                 if (length < Character.MAX_VALUE) {
  1912                 if (length < Character.MAX_VALUE) {
  1913                     v.length = length;
  1913                     v.length = length;
  1914                     putVar(v);
  1914                     putVar(v);
  1915                     fillLocalVarPosition(v);
       
  1916                 }
  1915                 }
  1917             }
  1916             }
  1918         }
  1917         }
  1919         state.defined.excl(adr);
  1918         state.defined.excl(adr);
  1920     }
       
  1921 
       
  1922     private void fillLocalVarPosition(LocalVar lv) {
       
  1923         if (lv == null || lv.sym == null
       
  1924                 || lv.sym.typeAnnotations == null)
       
  1925             return;
       
  1926         for (Attribute.TypeCompound ta : lv.sym.typeAnnotations) {
       
  1927             TypeAnnotationPosition p = ta.position;
       
  1928             while (p != null) {
       
  1929                 p.lvarOffset = new int[] { (int)lv.start_pc };
       
  1930                 p.lvarLength = new int[] { (int)lv.length };
       
  1931                 p.lvarIndex = new int[] { (int)lv.reg };
       
  1932                 p.isValidOffset = true;
       
  1933                 p = p.wildcard_position;
       
  1934             }
       
  1935         }
       
  1936     }
  1919     }
  1937 
  1920 
  1938     /** Put a live variable range into the buffer to be output to the
  1921     /** Put a live variable range into the buffer to be output to the
  1939      *  class file.
  1922      *  class file.
  1940      */
  1923      */