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 */ 013package org.vmmagic.unboxed; 014 015/* machine-generated DO NOT EDIT */ 016 017import org.jikesrvm.VM; 018import org.vmmagic.pragma.Interruptible; 019import org.vmmagic.pragma.Uninterruptible; 020import org.vmmagic.pragma.RawStorage; 021 022@RawStorage(lengthInWords = true, length = 1) 023@Uninterruptible 024abstract class ArchitecturalWord { 025 026 protected final int value; 027 //protected final long value; 028 029 ArchitecturalWord() { 030 this.value = 0; 031 } 032 ArchitecturalWord(int value, boolean zeroExtend) { 033 this.value = value; 034 //this.value = (zeroExtend) ? ((long)value) & 0x00000000ffffffffL : value; 035 } 036 037 ArchitecturalWord(long value) { 038 VM.sysFail("Detected use of long constructor for 32-bit word!"); 039 this.value = (int)value; 040 //this.value = value; 041 } 042 043 @Override 044 @Interruptible 045 public String toString() { 046 return ""+value; 047 } 048 049 @Override 050 public int hashCode() { 051 return (int)value; 052 } 053 054 @Override 055 public boolean equals(Object that) { 056 if (that instanceof ArchitecturalWord) { 057 return value == ((ArchitecturalWord)that).value; 058 } else { 059 return false; 060 } 061 } 062}