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_LoadDoubleConst: ldc2_w 018 */ 019 public class LoadDoubleConst extends PseudoBytecode { 020 private static final int bsize = 10; 021 private final long dbits; 022 023 public LoadDoubleConst(long bits) { 024 this.dbits = bits; 025 } 026 027 @Override 028 public byte[] getBytes() { 029 byte[] codes = initBytes(bsize, PSEUDO_LoadDoubleConst); 030 long2bytes(codes, 2, dbits); 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 "LoadDouble 0x" + Long.toHexString(dbits) + " : " + Double.longBitsToDouble(dbits); 047 } 048 } 049