From 58973855f5412fcda7c1d0c111492f9d2fc7f53d Mon Sep 17 00:00:00 2001 From: jochen Date: Sat, 19 Sep 1998 08:27:29 +0000 Subject: [PATCH] copyright, getSlot git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@21 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/decompiler/LocalInfo.java | 35 +++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/jode/jode/decompiler/LocalInfo.java b/jode/jode/decompiler/LocalInfo.java index 98daf04..d7b5b9f 100644 --- a/jode/jode/decompiler/LocalInfo.java +++ b/jode/jode/decompiler/LocalInfo.java @@ -1,3 +1,22 @@ +/* + * LocalInfo (c) 1998 Jochen Hoenicke + * + * You may distribute under the terms of the GNU General Public License. + * + * IN NO EVENT SHALL JOCHEN HOENICKE BE LIABLE TO ANY PARTY FOR DIRECT, + * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF + * THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF JOCHEN HOENICKE + * HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * JOCHEN HOENICKE SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" + * BASIS, AND JOCHEN HOENICKE HAS NO OBLIGATION TO PROVIDE MAINTENANCE, + * SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * $Id$ + */ + package jode; import sun.tools.java.*; @@ -5,12 +24,12 @@ import sun.tools.java.*; * The LocalInfo represents a local variable of a method. * The problem is that two different local variables may use the same * slot. The current strategie is to make the range of a local variable - * as small as possible. + * as small as possible.

* * There may be more than one LocalInfo for a single local variable, * because the algorithm begins with totally disjunct variables and * then unifies locals. One of the local is then a shadow object which - * calls the member functions of the other local. + * calls the member functions of the other local.

*/ public class LocalInfo { private static int serialnr = 0; @@ -19,6 +38,10 @@ public class LocalInfo { private Type type; private LocalInfo shadow; + /* The current implementation may use very much stack. This + * should be changed someday. + */ + /** * Create a new local info. The name will be an identifier * of the form local_x__yyy, where x is the slot number and @@ -70,6 +93,14 @@ public class LocalInfo { return name; } + /** + * Get the slot of this local. + */ + public Identifier getSlot() { + /* The slot does not change when shadowing */ + return slot; + } + /** * Set the name of this local. */