< prev index next >

src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/LocalVariableInstruction.java

Print this page


   1 /*
   2  * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
   3  */
   4 /*
   5  * Licensed to the Apache Software Foundation (ASF) under one or more
   6  * contributor license agreements.  See the NOTICE file distributed with
   7  * this work for additional information regarding copyright ownership.
   8  * The ASF licenses this file to You under the Apache License, Version 2.0
   9  * (the "License"); you may not use this file except in compliance with
  10  * the License.  You may obtain a copy of the License at
  11  *
  12  *      http://www.apache.org/licenses/LICENSE-2.0
  13  *
  14  * Unless required by applicable law or agreed to in writing, software
  15  * distributed under the License is distributed on an "AS IS" BASIS,
  16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17  * See the License for the specific language governing permissions and
  18  * limitations under the License.
  19  */
  20 package com.sun.org.apache.bcel.internal.generic;
  21 
  22 import java.io.DataOutputStream;
  23 import java.io.IOException;
  24 
  25 import com.sun.org.apache.bcel.internal.Const;
  26 import com.sun.org.apache.bcel.internal.util.ByteSequence;
  27 
  28 /**
  29  * Abstract super class for instructions dealing with local variables.
  30  *
  31  * @version $Id$
  32  * @LastModified: Jun 2019
  33  */
  34 public abstract class LocalVariableInstruction extends Instruction implements TypedInstruction,
  35         IndexedInstruction {
  36 
  37     private int n = -1; // index of referenced variable
  38     private short c_tag = -1; // compact version, such as ILOAD_0
  39     private short canon_tag = -1; // canonical tag such as ILOAD
  40 
  41 
  42     private boolean wide() {
  43         return n > Const.MAX_BYTE;
  44     }
  45 
  46 
  47     /**
  48      * Empty constructor needed for Instruction.readInstruction.
  49      * Not to be used otherwise.
  50      * tag and length are defined in readInstruction and initFromFile, respectively.
  51      */
  52     LocalVariableInstruction(final short canon_tag, final short c_tag) {


   1 /*
   2  * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
   3  */
   4 /*
   5  * Licensed to the Apache Software Foundation (ASF) under one or more
   6  * contributor license agreements.  See the NOTICE file distributed with
   7  * this work for additional information regarding copyright ownership.
   8  * The ASF licenses this file to You under the Apache License, Version 2.0
   9  * (the "License"); you may not use this file except in compliance with
  10  * the License.  You may obtain a copy of the License at
  11  *
  12  *      http://www.apache.org/licenses/LICENSE-2.0
  13  *
  14  * Unless required by applicable law or agreed to in writing, software
  15  * distributed under the License is distributed on an "AS IS" BASIS,
  16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17  * See the License for the specific language governing permissions and
  18  * limitations under the License.
  19  */
  20 package com.sun.org.apache.bcel.internal.generic;
  21 
  22 import java.io.DataOutputStream;
  23 import java.io.IOException;
  24 
  25 import com.sun.org.apache.bcel.internal.Const;
  26 import com.sun.org.apache.bcel.internal.util.ByteSequence;
  27 
  28 /**
  29  * Abstract super class for instructions dealing with local variables.
  30  *
  31  * @LastModified: Jan 2020

  32  */
  33 public abstract class LocalVariableInstruction extends Instruction implements TypedInstruction,
  34         IndexedInstruction {
  35 
  36     private int n = -1; // index of referenced variable
  37     private short c_tag = -1; // compact version, such as ILOAD_0
  38     private short canon_tag = -1; // canonical tag such as ILOAD
  39 
  40 
  41     private boolean wide() {
  42         return n > Const.MAX_BYTE;
  43     }
  44 
  45 
  46     /**
  47      * Empty constructor needed for Instruction.readInstruction.
  48      * Not to be used otherwise.
  49      * tag and length are defined in readInstruction and initFromFile, respectively.
  50      */
  51     LocalVariableInstruction(final short canon_tag, final short c_tag) {


< prev index next >