Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f67fcce

Browse filesBrowse files
author
hborders
committed
Removed hosted-only code.
1 parent 664b38a commit f67fcce
Copy full SHA for f67fcce

1 file changed

+1-20Lines changed: 1 addition & 20 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎JavaInJava/src/com/sun/max/unsafe/Offset.java‎

Copy file name to clipboardExpand all lines: JavaInJava/src/com/sun/max/unsafe/Offset.java
+1-20Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
*/
2121
package com.sun.max.unsafe;
2222

23-
import static com.sun.max.vm.MaxineVM.*;
24-
2523
import com.sun.max.annotate.*;
2624
import com.sun.max.lang.*;
2725
import 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

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.