001    /*
002     *  This file is part of the Jikes RVM project (http://jikesrvm.org).
003     *
004     *  This file is licensed to You under the Eclipse Public License (EPL);
005     *  You may not use this file except in compliance with the License. You
006     *  may obtain a copy of the License at
007     *
008     *      http://www.opensource.org/licenses/eclipse-1.0.php
009     *
010     *  See the COPYRIGHT.txt file distributed with this work for information
011     *  regarding copyright ownership.
012     */
013    package org.jikesrvm.osr.bytecodes;
014    
015    
016    /**
017     * BC_LongStore: {@code lstore}, {@code lstore_<n>}
018     */
019    
020    public class LongStore extends PseudoBytecode {
021      private int bsize;
022      private byte[] codes;
023      private int lnum;
024    
025      public LongStore(int local) {
026        this.lnum = local;
027        if (local <= 255) {
028          bsize = 2;
029          codes = makeOUcode(JBC_lstore, local);
030        } else {
031          bsize = 4;
032          codes = makeWOUUcode(JBC_lstore, local);
033        }
034      }
035    
036      @Override
037      public byte[] getBytes() {
038        return codes;
039      }
040    
041      @Override
042      public int getSize() {
043        return bsize;
044      }
045    
046      @Override
047      public int stackChanges() {
048        return -2;
049      }
050    
051      @Override
052      public String toString() {
053        return "lstore " + lnum;
054      }
055    }