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 * load a long constant on the stack 018 */ 019 public class LoadLongConst extends PseudoBytecode { 020 private static final int bsize = 10; 021 private final long lbits; 022 023 public LoadLongConst(long bits) { 024 this.lbits = bits; 025 } 026 027 @Override 028 public byte[] getBytes() { 029 byte[] codes = initBytes(bsize, PSEUDO_LoadLongConst); 030 long2bytes(codes, 2, lbits); 031 return codes; 032 } 033 034 @Override 035 public int getSize() { 036 return bsize; 037 } 038 039 @Override 040 public int stackChanges() { 041 return 2; 042 } 043 044 @Override 045 public String toString() { 046 return "LoadLong " + lbits; 047 } 048 }