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 c746770

Browse filesBrowse files
author
hborders
committed
Removed HOSTED methods.
Manually performed LOCAL_SUBSTITUTION swaps.
1 parent 55afaad commit c746770
Copy full SHA for c746770

1 file changed

+4-47Lines changed: 4 additions & 47 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/WordArray.java‎

Copy file name to clipboardExpand all lines: JavaInJava/src/com/sun/max/unsafe/WordArray.java
+4-47Lines changed: 4 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -47,73 +47,30 @@ public final class WordArray {
4747
private WordArray() {
4848
}
4949

50-
/**
51-
* Replaces all {@code null} entries in a given word array with the appropriately typed boxed zero value.
52-
*/
53-
@HOSTED_ONLY
54-
private static void replaceNullWithZero(Word[] array) {
55-
final Word zero = Word.zero();
56-
for (int i = 0; i != array.length; ++i) {
57-
if (array[i] == null) {
58-
array[i] = zero;
59-
}
60-
}
61-
}
62-
6350
public static void fill(Word[] array, Word value) {
6451
for (int i = 0; i < array.length; i++) {
6552
uncheckedSet(array, i, value);
6653
}
6754
}
6855

69-
// Substituted by uncheckedGet_()
70-
public static Word uncheckedGet(Word[] array, int index) {
71-
if (array[index] == null) {
72-
replaceNullWithZero(array);
73-
}
74-
return array[index];
75-
}
76-
77-
@LOCAL_SUBSTITUTION
7856
@INLINE
79-
private static Word uncheckedGet_(Word[] array, int index) {
57+
public static Word uncheckedGet(Word[] array, int index) {
8058
return ArrayAccess.getWord(array, index);
8159
}
8260

83-
// Substituted by get_()
84-
public static Word get(Word[] array, int index) {
85-
if (array[index] == null) {
86-
replaceNullWithZero(array);
87-
}
88-
return array[index];
89-
}
90-
91-
@LOCAL_SUBSTITUTION
9261
@INLINE
93-
private static Word get_(Word[] array, int index) {
62+
public static Word get(Word[] array, int index) {
9463
ArrayAccess.checkIndex(array, index);
9564
return ArrayAccess.getWord(array, index);
9665
}
9766

98-
// Substituted by uncheckedSet_()
99-
public static void uncheckedSet(Word[] array, int index, Word value) {
100-
array[index] = value;
101-
}
102-
103-
@LOCAL_SUBSTITUTION
10467
@INLINE
105-
private static void uncheckedSet_(Word[] array, int index, Word value) {
68+
public static void uncheckedSet(Word[] array, int index, Word value) {
10669
ArrayAccess.setWord(array, index, value);
10770
}
10871

109-
// Substituted by set_()
110-
public static void set(Word[] array, int index, Word value) {
111-
array[index] = value;
112-
}
113-
114-
@LOCAL_SUBSTITUTION
11572
@INLINE
116-
private static void set_(Word[] array, int index, Word value) {
73+
public static void set(Word[] array, int index, Word value) {
11774
ArrayAccess.checkIndex(array, index);
11875
ArrayAccess.setWord(array, index, value);
11976
}

0 commit comments

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