2020 */
2121package com .sun .max .unsafe ;
2222
23- import static com .sun .max .vm .MaxineVM .*;
24-
2523import com .sun .max .annotate .*;
2624import com .sun .max .lang .*;
2725import com .sun .max .program .*;
@@ -39,7 +37,7 @@ protected Offset() {
3937
4038 @ INLINE
4139 public static Offset zero () {
42- return isHosted () ? BoxedOffset . ZERO : fromInt (0 );
40+ return fromInt (0 );
4341 }
4442
4543 @ INLINE
@@ -49,9 +47,6 @@ public static Offset fromUnsignedInt(int value) {
4947
5048 @ INLINE
5149 public static Offset fromInt (int value ) {
52- if (isHosted ()) {
53- return BoxedOffset .from (value );
54- }
5550 if (Word .width () == 64 ) {
5651 final long n = value ;
5752 return UnsafeCast .asOffset (n );
@@ -61,9 +56,6 @@ public static Offset fromInt(int value) {
6156
6257 @ INLINE
6358 public static Offset fromLong (long value ) {
64- if (isHosted ()) {
65- return BoxedOffset .from (value );
66- }
6759 if (Word .width () == 64 ) {
6860 return UnsafeCast .asOffset (value );
6961 }
@@ -78,10 +70,6 @@ public String toString() {
7870
7971 @ INLINE
8072 public final int toInt () {
81- if (isHosted ()) {
82- final BoxedOffset box = (BoxedOffset ) this ;
83- return (int ) box .value ();
84- }
8573 if (Word .width () == 64 ) {
8674 final long n = UnsafeCast .asLong (this );
8775 return (int ) n ;
@@ -91,10 +79,6 @@ public final int toInt() {
9179
9280 @ INLINE
9381 public final long toLong () {
94- if (isHosted ()) {
95- final BoxedOffset box = (BoxedOffset ) this ;
96- return box .value ();
97- }
9882 if (Word .width () == 64 ) {
9983 return UnsafeCast .asLong (this );
10084 }
@@ -113,9 +97,6 @@ public final int compareTo(Offset other) {
11397
11498 @ INLINE
11599 public final boolean equals (int other ) {
116- if (isHosted ()) {
117- return toLong () == other ;
118- }
119100 return fromInt (other ) == this ;
120101 }
121102
0 commit comments