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 3e9ab3b

Browse filesBrowse files
author
hborders
committed
Stubbed out native methods.
1 parent 2826fca commit 3e9ab3b
Copy full SHA for 3e9ab3b

1 file changed

+36-123Lines changed: 36 additions & 123 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/Pointer.java‎

Copy file name to clipboardExpand all lines: JavaInJava/src/com/sun/max/unsafe/Pointer.java
+36-123Lines changed: 36 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -262,26 +262,15 @@ public final Pointer unsignedShiftedRight(int nBits) {
262262
return asAddress().unsignedShiftedRight(nBits).asPointer();
263263
}
264264

265-
@UNSAFE
266-
@FOLD
267-
private static boolean risc() {
268-
return Platform.platform().isa.category == ISA.Category.RISC;
269-
}
270-
271265
public byte readByte(int offset) {
272266
return readByte(Offset.fromInt(offset));
273267
}
274268

275269
public abstract byte readByte(Offset offset);
276270

277-
private native byte builtinGetByte(int displacement, int index);
278-
279271
@INLINE
280272
public final byte getByte(int displacement, int index) {
281-
if (risc()) {
282-
return readByte(Offset.fromInt(index).plus(displacement));
283-
}
284-
return builtinGetByte(displacement, index);
273+
throw new UnsupportedOperationException("later");
285274
}
286275

287276
@INLINE
@@ -325,14 +314,9 @@ public final short readShort(int offset) {
325314

326315
public abstract short readShort(Offset offset);
327316

328-
private native short builtinGetShort(int displacement, int index);
329-
330317
@INLINE
331318
public final short getShort(int displacement, int index) {
332-
if (risc()) {
333-
return readShort(Offset.fromInt(index).times(Shorts.SIZE).plus(displacement));
334-
}
335-
return builtinGetShort(displacement, index);
319+
throw new UnsupportedOperationException("later");
336320
}
337321

338322
@INLINE
@@ -351,14 +335,9 @@ public final char readChar(int offset) {
351335

352336
public abstract char readChar(Offset offset);
353337

354-
private native char builtinGetChar(int displacement, int index);
355-
356338
@INLINE
357339
public final char getChar(int displacement, int index) {
358-
if (risc()) {
359-
return readChar(Offset.fromInt(index).times(Chars.SIZE).plus(displacement));
360-
}
361-
return builtinGetChar(displacement, index);
340+
throw new UnsupportedOperationException("later");
362341
}
363342

364343
@INLINE
@@ -377,14 +356,9 @@ public final int readInt(int offset) {
377356

378357
public abstract int readInt(Offset offset);
379358

380-
private native int builtinGetInt(int displacement, int index);
381-
382359
@INLINE
383360
public final int getInt(int displacement, int index) {
384-
if (risc()) {
385-
return readInt(Offset.fromInt(index).times(Ints.SIZE).plus(displacement));
386-
}
387-
return builtinGetInt(displacement, index);
361+
throw new UnsupportedOperationException("later");
388362
}
389363

390364
@INLINE
@@ -403,14 +377,9 @@ public final float readFloat(int offset) {
403377

404378
public abstract float readFloat(Offset offset);
405379

406-
private native float builtinGetFloat(int displacement, int index);
407-
408380
@INLINE
409381
public final float getFloat(int displacement, int index) {
410-
if (risc()) {
411-
return readFloat(Offset.fromInt(index).times(FLOAT_SIZE).plus(displacement));
412-
}
413-
return builtinGetFloat(displacement, index);
382+
throw new UnsupportedOperationException("later");
414383
}
415384

416385
@INLINE
@@ -429,14 +398,9 @@ public final long readLong(int offset) {
429398

430399
public abstract long readLong(Offset offset);
431400

432-
private native long builtinGetLong(int displacement, int index);
433-
434401
@INLINE
435402
public final long getLong(int displacement, int index) {
436-
if (risc()) {
437-
return readLong(Offset.fromInt(index).times(Longs.SIZE).plus(displacement));
438-
}
439-
return builtinGetLong(displacement, index);
403+
throw new UnsupportedOperationException("later");
440404
}
441405

442406
@INLINE
@@ -455,14 +419,9 @@ public final double readDouble(int offset) {
455419

456420
public abstract double readDouble(Offset offset);
457421

458-
private native double builtinGetDouble(int displacement, int index);
459-
460422
@INLINE
461423
public final double getDouble(int displacement, int index) {
462-
if (risc()) {
463-
return readDouble(Offset.fromInt(index).times(DOUBLE_SIZE).plus(displacement));
464-
}
465-
return builtinGetDouble(displacement, index);
424+
throw new UnsupportedOperationException("later");
466425
}
467426

468427
@INLINE
@@ -481,14 +440,9 @@ public final Word readWord(int offset) {
481440

482441
public abstract Word readWord(Offset offset);
483442

484-
private native Word builtinGetWord(int displacement, int index);
485-
486443
@INLINE
487444
public final Word getWord(int displacement, int index) {
488-
if (risc()) {
489-
return readWord(Offset.fromInt(index).times(Word.size()).plus(displacement));
490-
}
491-
return builtinGetWord(displacement, index);
445+
throw new UnsupportedOperationException("later");
492446
}
493447

494448
@INLINE
@@ -507,14 +461,9 @@ public final Reference readReference(int offset) {
507461

508462
public abstract Reference readReference(Offset offset);
509463

510-
private native Reference builtinGetReference(int displacement, int index);
511-
512464
@INLINE
513465
public final Reference getReference(int displacement, int index) {
514-
if (risc()) {
515-
return readReference(Offset.fromInt(index).times(Word.size()).plus(displacement));
516-
}
517-
return builtinGetReference(displacement, index);
466+
throw new UnsupportedOperationException("later");
518467
}
519468

520469
@INLINE
@@ -533,15 +482,9 @@ public final void writeByte(int offset, byte value) {
533482

534483
public abstract void writeByte(Offset offset, byte value);
535484

536-
private native void builtinSetByte(int displacement, int index, byte value);
537-
538485
@INLINE
539486
public final void setByte(int displacement, int index, byte value) {
540-
if (risc()) {
541-
writeByte(Offset.fromInt(index).plus(displacement), value);
542-
} else {
543-
builtinSetByte(displacement, index, value);
544-
}
487+
throw new UnsupportedOperationException("later");
545488
}
546489

547490
@INLINE
@@ -585,15 +528,9 @@ public final void writeShort(int offset, short value) {
585528

586529
public abstract void writeShort(Offset offset, short value);
587530

588-
private native void builtinSetShort(int displacement, int index, short value);
589-
590531
@INLINE
591532
public final void setShort(int displacement, int index, short value) {
592-
if (risc()) {
593-
writeShort(Offset.fromInt(index).times(Shorts.SIZE).plus(displacement), value);
594-
} else {
595-
builtinSetShort(displacement, index, value);
596-
}
533+
throw new UnsupportedOperationException("later");
597534
}
598535

599536
@INLINE
@@ -637,15 +574,9 @@ public final void writeInt(int offset, int value) {
637574

638575
public abstract void writeInt(Offset offset, int value);
639576

640-
private native void builtinSetInt(int displacement, int index, int value);
641-
642577
@INLINE
643578
public final void setInt(int displacement, int index, int value) {
644-
if (risc()) {
645-
writeInt(Offset.fromInt(index).times(Ints.SIZE).plus(displacement), value);
646-
} else {
647-
builtinSetInt(displacement, index, value);
648-
}
579+
throw new UnsupportedOperationException("later");
649580
}
650581

651582
@INLINE
@@ -664,15 +595,9 @@ public final void writeFloat(int offset, float value) {
664595

665596
public abstract void writeFloat(Offset offset, float value);
666597

667-
private native void builtinSetFloat(int displacement, int index, float value);
668-
669598
@INLINE
670599
public final void setFloat(int displacement, int index, float value) {
671-
if (risc()) {
672-
writeFloat(Offset.fromInt(index).times(FLOAT_SIZE).plus(displacement), value);
673-
} else {
674-
builtinSetFloat(displacement, index, value);
675-
}
600+
throw new UnsupportedOperationException("later");
676601
}
677602

678603
@INLINE
@@ -691,15 +616,9 @@ public final void writeLong(int offset, long value) {
691616

692617
public abstract void writeLong(Offset offset, long value);
693618

694-
private native void builtinSetLong(int displacement, int index, long value);
695-
696619
@INLINE
697620
public final void setLong(int displacement, int index, long value) {
698-
if (risc()) {
699-
writeLong(Offset.fromInt(index).times(Longs.SIZE).plus(displacement), value);
700-
} else {
701-
builtinSetLong(displacement, index, value);
702-
}
621+
throw new UnsupportedOperationException("later");
703622
}
704623

705624
@INLINE
@@ -718,15 +637,9 @@ public final void writeDouble(int offset, double value) {
718637

719638
public abstract void writeDouble(Offset offset, double value);
720639

721-
private native void builtinSetDouble(int displacement, int index, double value);
722-
723640
@INLINE
724641
public final void setDouble(int displacement, int index, double value) {
725-
if (risc()) {
726-
writeDouble(Offset.fromInt(index).times(DOUBLE_SIZE).plus(displacement), value);
727-
} else {
728-
builtinSetDouble(displacement, index, value);
729-
}
642+
throw new UnsupportedOperationException("later");
730643
}
731644

732645
@INLINE
@@ -745,15 +658,9 @@ public final void writeWord(int offset, Word value) {
745658

746659
public abstract void writeWord(Offset offset, Word value);
747660

748-
private native void builtinSetWord(int displacement, int index, Word value);
749-
750661
@INLINE
751662
public final void setWord(int displacement, int index, Word value) {
752-
if (risc()) {
753-
writeWord(Offset.fromInt(index).times(Word.size()).plus(displacement), value);
754-
} else {
755-
builtinSetWord(displacement, index, value);
756-
}
663+
throw new UnsupportedOperationException("later");
757664
}
758665

759666
@INLINE
@@ -772,15 +679,9 @@ public final void writeReference(int offset, Reference value) {
772679

773680
public abstract void writeReference(Offset offset, Reference value);
774681

775-
private native void builtinSetReference(int displacement, int index, Reference value);
776-
777682
@INLINE
778683
public final void setReference(int displacement, int index, Reference value) {
779-
if (risc()) {
780-
writeReference(Offset.fromInt(index).times(Word.size()).plus(displacement), value);
781-
} else {
782-
builtinSetReference(displacement, index, value);
783-
}
684+
throw new UnsupportedOperationException("later");
784685
}
785686

786687
@INLINE
@@ -796,32 +697,44 @@ public final void setReference(Reference value) {
796697
/**
797698
* @see Accessor#compareAndSwapInt(Offset, int, int)
798699
*/
799-
public native int compareAndSwapInt(int offset, int expectedValue, int newValue);
700+
public int compareAndSwapInt(int offset, int expectedValue, int newValue) {
701+
throw new UnsupportedOperationException("later");
702+
}
800703

801704
/**
802705
* @see Accessor#compareAndSwapInt(Offset, int, int)
803706
*/
804-
public native int compareAndSwapInt(Offset offset, int expectedValue, int newValue);
707+
public int compareAndSwapInt(Offset offset, int expectedValue, int newValue) {
708+
throw new UnsupportedOperationException("later");
709+
}
805710

806711
/**
807712
* @see Accessor#compareAndSwapInt(Offset, int, int)
808713
*/
809-
public native Word compareAndSwapWord(int offset, Word expectedValue, Word newValue);
714+
public Word compareAndSwapWord(int offset, Word expectedValue, Word newValue) {
715+
throw new UnsupportedOperationException("later");
716+
}
810717

811718
/**
812719
* @see Accessor#compareAndSwapInt(Offset, int, int)
813720
*/
814-
public native Word compareAndSwapWord(Offset offset, Word expectedValue, Word newValue);
721+
public Word compareAndSwapWord(Offset offset, Word expectedValue, Word newValue) {
722+
throw new UnsupportedOperationException("later");
723+
}
815724

816725
/**
817726
* @see Accessor#compareAndSwapInt(Offset, int, int)
818727
*/
819-
public native Reference compareAndSwapReference(int offset, Reference expectedValue, Reference newValue);
728+
public Reference compareAndSwapReference(int offset, Reference expectedValue, Reference newValue) {
729+
throw new UnsupportedOperationException("later");
730+
}
820731

821732
/**
822733
* @see Accessor#compareAndSwapInt(Offset, int, int)
823734
*/
824-
public native Reference compareAndSwapReference(Offset offset, Reference expectedValue, Reference newValue);
735+
public Reference compareAndSwapReference(Offset offset, Reference expectedValue, Reference newValue) {
736+
throw new UnsupportedOperationException("later");
737+
}
825738

826739
/**
827740
* Sets a bit in the bit map whose base is denoted by the value of this pointer.
@@ -943,7 +856,7 @@ public final void copyElements(int displacement, int srcIndex, Object dst, int d
943856
break;
944857
}
945858
default:
946-
throw FatalError.unexpected("invalid type");
859+
throw new Error("invalid type");
947860
}
948861
}
949862
}

0 commit comments

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