1 /* 2 * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 25 package jdk.internal.vm.compiler.word; 26 27 /** 28 * Lowest-level memory access of native C memory. 29 * <p> 30 * Do not use these methods to access Java objects. These methods access the raw memory without any 31 * null checks, read- or write barriers. Even when the VM uses compressed pointers, then readObject 32 * and writeObject methods access uncompressed pointers. 33 * 34 * @since 1.0 35 */ 36 public interface Pointer extends UnsignedWord, PointerBase { 37 38 /** 39 * Unsafe conversion of this Pointer to a Java language object. No correctness checks or type 40 * checks are performed. The caller must ensure that the Pointer contains a valid Java object 41 * that can i.e., processed by the garbage collector. 42 * 43 * @return this Pointer cast to Object. 44 * 45 * @since 1.0 46 */ 47 Object toObject(); 48 49 /** 50 * Unsafe conversion of this Pointer to a Java language object. No correctness checks or type 51 * checks are performed. The caller must ensure that the Pointer contains a valid Java object 52 * that can i.e., processed by the garbage collector and the Pointer does not contain 0. 53 * 54 * @return this Pointer cast to non-null Object. 55 * 56 * @since 1.0 57 */ 58 Object toObjectNonNull(); 59 60 /** 61 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 62 * bytes. 63 * <p> 64 * The offset is always treated as a {@link SignedWord} value. However, the static type is 65 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 66 * knows that the highest-order bit of the unsigned value is never used). 67 * 68 * @param offset the signed offset for the memory access 69 * @param locationIdentity the identity of the read 70 * @return the result of the memory access 71 * 72 * @since 1.0 73 */ 74 byte readByte(WordBase offset, LocationIdentity locationIdentity); 75 76 /** 77 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 78 * bytes. 79 * <p> 80 * The offset is always treated as a {@link SignedWord} value. However, the static type is 81 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 82 * knows that the highest-order bit of the unsigned value is never used). 83 * 84 * @param offset the signed offset for the memory access 85 * @param locationIdentity the identity of the read 86 * @return the result of the memory access 87 * 88 * @since 1.0 89 */ 90 char readChar(WordBase offset, LocationIdentity locationIdentity); 91 92 /** 93 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 94 * bytes. 95 * <p> 96 * The offset is always treated as a {@link SignedWord} value. However, the static type is 97 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 98 * knows that the highest-order bit of the unsigned value is never used). 99 * 100 * @param offset the signed offset for the memory access 101 * @param locationIdentity the identity of the read 102 * @return the result of the memory access 103 * 104 * @since 1.0 105 */ 106 short readShort(WordBase offset, LocationIdentity locationIdentity); 107 108 /** 109 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 110 * bytes. 111 * <p> 112 * The offset is always treated as a {@link SignedWord} value. However, the static type is 113 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 114 * knows that the highest-order bit of the unsigned value is never used). 115 * 116 * @param offset the signed offset for the memory access 117 * @param locationIdentity the identity of the read 118 * @return the result of the memory access 119 * 120 * @since 1.0 121 */ 122 int readInt(WordBase offset, LocationIdentity locationIdentity); 123 124 /** 125 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 126 * bytes. 127 * <p> 128 * The offset is always treated as a {@link SignedWord} value. However, the static type is 129 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 130 * knows that the highest-order bit of the unsigned value is never used). 131 * 132 * @param offset the signed offset for the memory access 133 * @param locationIdentity the identity of the read 134 * @return the result of the memory access 135 * 136 * @since 1.0 137 */ 138 long readLong(WordBase offset, LocationIdentity locationIdentity); 139 140 /** 141 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 142 * bytes. 143 * <p> 144 * The offset is always treated as a {@link SignedWord} value. However, the static type is 145 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 146 * knows that the highest-order bit of the unsigned value is never used). 147 * 148 * @param offset the signed offset for the memory access 149 * @param locationIdentity the identity of the read 150 * @return the result of the memory access 151 * 152 * @since 1.0 153 */ 154 float readFloat(WordBase offset, LocationIdentity locationIdentity); 155 156 /** 157 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 158 * bytes. 159 * <p> 160 * The offset is always treated as a {@link SignedWord} value. However, the static type is 161 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 162 * knows that the highest-order bit of the unsigned value is never used). 163 * 164 * @param offset the signed offset for the memory access 165 * @param locationIdentity the identity of the read 166 * @return the result of the memory access 167 * 168 * @since 1.0 169 */ 170 double readDouble(WordBase offset, LocationIdentity locationIdentity); 171 172 /** 173 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 174 * bytes. 175 * <p> 176 * The offset is always treated as a {@link SignedWord} value. However, the static type is 177 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 178 * knows that the highest-order bit of the unsigned value is never used). 179 * 180 * @param offset the signed offset for the memory access 181 * @param locationIdentity the identity of the read 182 * @return the result of the memory access 183 * 184 * @since 1.0 185 */ 186 <T extends WordBase> T readWord(WordBase offset, LocationIdentity locationIdentity); 187 188 /** 189 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 190 * bytes. 191 * <p> 192 * The offset is always treated as a {@link SignedWord} value. However, the static type is 193 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 194 * knows that the highest-order bit of the unsigned value is never used). 195 * 196 * @param offset the signed offset for the memory access 197 * @param locationIdentity the identity of the read 198 * @return the result of the memory access 199 * 200 * @since 1.0 201 */ 202 Object readObject(WordBase offset, LocationIdentity locationIdentity); 203 204 /** 205 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 206 * bytes. 207 * 208 * @param offset the signed offset for the memory access 209 * @param locationIdentity the identity of the read 210 * @return the result of the memory access 211 * 212 * @since 1.0 213 */ 214 byte readByte(int offset, LocationIdentity locationIdentity); 215 216 /** 217 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 218 * bytes. 219 * 220 * @param offset the signed offset for the memory access 221 * @param locationIdentity the identity of the read 222 * @return the result of the memory access 223 * 224 * @since 1.0 225 */ 226 char readChar(int offset, LocationIdentity locationIdentity); 227 228 /** 229 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 230 * bytes. 231 * 232 * @param offset the signed offset for the memory access 233 * @param locationIdentity the identity of the read 234 * @return the result of the memory access 235 * 236 * @since 1.0 237 */ 238 short readShort(int offset, LocationIdentity locationIdentity); 239 240 /** 241 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 242 * bytes. 243 * 244 * @param offset the signed offset for the memory access 245 * @param locationIdentity the identity of the read 246 * @return the result of the memory access 247 * 248 * @since 1.0 249 */ 250 int readInt(int offset, LocationIdentity locationIdentity); 251 252 /** 253 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 254 * bytes. 255 * 256 * @param offset the signed offset for the memory access 257 * @param locationIdentity the identity of the read 258 * @return the result of the memory access 259 * 260 * @since 1.0 261 */ 262 long readLong(int offset, LocationIdentity locationIdentity); 263 264 /** 265 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 266 * bytes. 267 * 268 * @param offset the signed offset for the memory access 269 * @param locationIdentity the identity of the read 270 * @return the result of the memory access 271 * 272 * @since 1.0 273 */ 274 float readFloat(int offset, LocationIdentity locationIdentity); 275 276 /** 277 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 278 * bytes. 279 * 280 * @param offset the signed offset for the memory access 281 * @param locationIdentity the identity of the read 282 * @return the result of the memory access 283 * 284 * @since 1.0 285 */ 286 double readDouble(int offset, LocationIdentity locationIdentity); 287 288 /** 289 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 290 * bytes. 291 * 292 * @param offset the signed offset for the memory access 293 * @param locationIdentity the identity of the read 294 * @return the result of the memory access 295 * 296 * @since 1.0 297 */ 298 <T extends WordBase> T readWord(int offset, LocationIdentity locationIdentity); 299 300 /** 301 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 302 * bytes. 303 * 304 * @param offset the signed offset for the memory access 305 * @param locationIdentity the identity of the read 306 * @return the result of the memory access 307 * 308 * @since 1.0 309 */ 310 Object readObject(int offset, LocationIdentity locationIdentity); 311 312 /** 313 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 314 * bytes. 315 * <p> 316 * The offset is always treated as a {@link SignedWord} value. However, the static type is 317 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 318 * knows that the highest-order bit of the unsigned value is never used). 319 * 320 * @param offset the signed offset for the memory access 321 * @param locationIdentity the identity of the write 322 * @param val the value to be written to memory 323 * 324 * @since 1.0 325 */ 326 void writeByte(WordBase offset, byte val, LocationIdentity locationIdentity); 327 328 /** 329 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 330 * bytes. 331 * <p> 332 * The offset is always treated as a {@link SignedWord} value. However, the static type is 333 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 334 * knows that the highest-order bit of the unsigned value is never used). 335 * 336 * @param offset the signed offset for the memory access 337 * @param locationIdentity the identity of the write 338 * @param val the value to be written to memory 339 * 340 * @since 1.0 341 */ 342 void writeChar(WordBase offset, char val, LocationIdentity locationIdentity); 343 344 /** 345 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 346 * bytes. 347 * <p> 348 * The offset is always treated as a {@link SignedWord} value. However, the static type is 349 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 350 * knows that the highest-order bit of the unsigned value is never used). 351 * 352 * @param offset the signed offset for the memory access 353 * @param locationIdentity the identity of the write 354 * @param val the value to be written to memory 355 * 356 * @since 1.0 357 */ 358 void writeShort(WordBase offset, short val, LocationIdentity locationIdentity); 359 360 /** 361 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 362 * bytes. 363 * <p> 364 * The offset is always treated as a {@link SignedWord} value. However, the static type is 365 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 366 * knows that the highest-order bit of the unsigned value is never used). 367 * 368 * @param offset the signed offset for the memory access 369 * @param locationIdentity the identity of the write 370 * @param val the value to be written to memory 371 * 372 * @since 1.0 373 */ 374 void writeInt(WordBase offset, int val, LocationIdentity locationIdentity); 375 376 /** 377 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 378 * bytes. 379 * <p> 380 * The offset is always treated as a {@link SignedWord} value. However, the static type is 381 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 382 * knows that the highest-order bit of the unsigned value is never used). 383 * 384 * @param offset the signed offset for the memory access 385 * @param locationIdentity the identity of the write 386 * @param val the value to be written to memory 387 * 388 * @since 1.0 389 */ 390 void writeLong(WordBase offset, long val, LocationIdentity locationIdentity); 391 392 /** 393 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 394 * bytes. 395 * <p> 396 * The offset is always treated as a {@link SignedWord} value. However, the static type is 397 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 398 * knows that the highest-order bit of the unsigned value is never used). 399 * 400 * @param offset the signed offset for the memory access 401 * @param locationIdentity the identity of the write 402 * @param val the value to be written to memory 403 * 404 * @since 1.0 405 */ 406 void writeFloat(WordBase offset, float val, LocationIdentity locationIdentity); 407 408 /** 409 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 410 * bytes. 411 * <p> 412 * The offset is always treated as a {@link SignedWord} value. However, the static type is 413 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 414 * knows that the highest-order bit of the unsigned value is never used). 415 * 416 * @param offset the signed offset for the memory access 417 * @param locationIdentity the identity of the write 418 * @param val the value to be written to memory 419 * 420 * @since 1.0 421 */ 422 void writeDouble(WordBase offset, double val, LocationIdentity locationIdentity); 423 424 /** 425 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 426 * bytes. 427 * <p> 428 * The offset is always treated as a {@link SignedWord} value. However, the static type is 429 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 430 * knows that the highest-order bit of the unsigned value is never used). 431 * 432 * @param offset the signed offset for the memory access 433 * @param locationIdentity the identity of the write 434 * @param val the value to be written to memory 435 * 436 * @since 1.0 437 */ 438 void writeWord(WordBase offset, WordBase val, LocationIdentity locationIdentity); 439 440 /** 441 * Initializes the memory at address {@code (this + offset)}. Both the base address and offset 442 * are in bytes. The memory must be uninitialized or zero prior to this operation. 443 * <p> 444 * The offset is always treated as a {@link SignedWord} value. However, the static type is 445 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 446 * knows that the highest-order bit of the unsigned value is never used). 447 * 448 * @param offset the signed offset for the memory access 449 * @param locationIdentity the identity of the write 450 * @param val the value to be written to memory 451 * 452 * @since 1.0 453 */ 454 void initializeLong(WordBase offset, long val, LocationIdentity locationIdentity); 455 456 /** 457 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 458 * bytes. 459 * <p> 460 * The offset is always treated as a {@link SignedWord} value. However, the static type is 461 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 462 * knows that the highest-order bit of the unsigned value is never used). 463 * 464 * @param offset the signed offset for the memory access 465 * @param locationIdentity the identity of the write 466 * @param val the value to be written to memory 467 * 468 * @since 1.0 469 */ 470 void writeObject(WordBase offset, Object val, LocationIdentity locationIdentity); 471 472 /** 473 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 474 * bytes. 475 * 476 * @param offset the signed offset for the memory access 477 * @param locationIdentity the identity of the write 478 * @param val the value to be written to memory 479 * 480 * @since 1.0 481 */ 482 void writeByte(int offset, byte val, LocationIdentity locationIdentity); 483 484 /** 485 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 486 * bytes. 487 * 488 * @param offset the signed offset for the memory access 489 * @param locationIdentity the identity of the write 490 * @param val the value to be written to memory 491 * 492 * @since 1.0 493 */ 494 void writeChar(int offset, char val, LocationIdentity locationIdentity); 495 496 /** 497 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 498 * bytes. 499 * 500 * @param offset the signed offset for the memory access 501 * @param locationIdentity the identity of the write 502 * @param val the value to be written to memory 503 * 504 * @since 1.0 505 */ 506 void writeShort(int offset, short val, LocationIdentity locationIdentity); 507 508 /** 509 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 510 * bytes. 511 * 512 * @param offset the signed offset for the memory access 513 * @param locationIdentity the identity of the write 514 * @param val the value to be written to memory 515 * 516 * @since 1.0 517 */ 518 void writeInt(int offset, int val, LocationIdentity locationIdentity); 519 520 /** 521 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 522 * bytes. 523 * 524 * @param offset the signed offset for the memory access 525 * @param locationIdentity the identity of the write 526 * @param val the value to be written to memory 527 * 528 * @since 1.0 529 */ 530 void writeLong(int offset, long val, LocationIdentity locationIdentity); 531 532 /** 533 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 534 * bytes. 535 * 536 * @param offset the signed offset for the memory access 537 * @param locationIdentity the identity of the write 538 * @param val the value to be written to memory 539 * 540 * @since 1.0 541 */ 542 void writeFloat(int offset, float val, LocationIdentity locationIdentity); 543 544 /** 545 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 546 * bytes. 547 * 548 * @param offset the signed offset for the memory access 549 * @param locationIdentity the identity of the write 550 * @param val the value to be written to memory 551 * 552 * @since 1.0 553 */ 554 void writeDouble(int offset, double val, LocationIdentity locationIdentity); 555 556 /** 557 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 558 * bytes. 559 * 560 * @param offset the signed offset for the memory access 561 * @param locationIdentity the identity of the write 562 * @param val the value to be written to memory 563 * 564 * @since 1.0 565 */ 566 void writeWord(int offset, WordBase val, LocationIdentity locationIdentity); 567 568 /** 569 * Initializes the memory at address {@code (this + offset)}. Both the base address and offset 570 * are in bytes. The memory must be uninitialized or zero prior to this operation. 571 * 572 * @param offset the signed offset for the memory access 573 * @param locationIdentity the identity of the write 574 * @param val the value to be written to memory 575 * 576 * @since 1.0 577 */ 578 void initializeLong(int offset, long val, LocationIdentity locationIdentity); 579 580 /** 581 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 582 * bytes. 583 * 584 * @param offset the signed offset for the memory access 585 * @param locationIdentity the identity of the write 586 * @param val the value to be written to memory 587 * 588 * @since 1.0 589 */ 590 void writeObject(int offset, Object val, LocationIdentity locationIdentity); 591 592 /** 593 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 594 * bytes. 595 * <p> 596 * The offset is always treated as a {@link SignedWord} value. However, the static type is 597 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 598 * knows that the highest-order bit of the unsigned value is never used). 599 * 600 * @param offset the signed offset for the memory access 601 * @return the result of the memory access 602 * 603 * @since 1.0 604 */ 605 byte readByte(WordBase offset); 606 607 /** 608 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 609 * bytes. 610 * <p> 611 * The offset is always treated as a {@link SignedWord} value. However, the static type is 612 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 613 * knows that the highest-order bit of the unsigned value is never used). 614 * 615 * @param offset the signed offset for the memory access 616 * @return the result of the memory access 617 * 618 * @since 1.0 619 */ 620 char readChar(WordBase offset); 621 622 /** 623 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 624 * bytes. 625 * <p> 626 * The offset is always treated as a {@link SignedWord} value. However, the static type is 627 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 628 * knows that the highest-order bit of the unsigned value is never used). 629 * 630 * @param offset the signed offset for the memory access 631 * @return the result of the memory access 632 * 633 * @since 1.0 634 */ 635 short readShort(WordBase offset); 636 637 /** 638 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 639 * bytes. 640 * <p> 641 * The offset is always treated as a {@link SignedWord} value. However, the static type is 642 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 643 * knows that the highest-order bit of the unsigned value is never used). 644 * 645 * @param offset the signed offset for the memory access 646 * @return the result of the memory access 647 * 648 * @since 1.0 649 */ 650 int readInt(WordBase offset); 651 652 /** 653 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 654 * bytes. 655 * <p> 656 * The offset is always treated as a {@link SignedWord} value. However, the static type is 657 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 658 * knows that the highest-order bit of the unsigned value is never used). 659 * 660 * @param offset the signed offset for the memory access 661 * @return the result of the memory access 662 * 663 * @since 1.0 664 */ 665 long readLong(WordBase offset); 666 667 /** 668 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 669 * bytes. 670 * <p> 671 * The offset is always treated as a {@link SignedWord} value. However, the static type is 672 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 673 * knows that the highest-order bit of the unsigned value is never used). 674 * 675 * @param offset the signed offset for the memory access 676 * @return the result of the memory access 677 * 678 * @since 1.0 679 */ 680 float readFloat(WordBase offset); 681 682 /** 683 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 684 * bytes. 685 * <p> 686 * The offset is always treated as a {@link SignedWord} value. However, the static type is 687 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 688 * knows that the highest-order bit of the unsigned value is never used). 689 * 690 * @param offset the signed offset for the memory access 691 * @return the result of the memory access 692 * 693 * @since 1.0 694 */ 695 double readDouble(WordBase offset); 696 697 /** 698 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 699 * bytes. 700 * <p> 701 * The offset is always treated as a {@link SignedWord} value. However, the static type is 702 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 703 * knows that the highest-order bit of the unsigned value is never used). 704 * 705 * @param offset the signed offset for the memory access 706 * @return the result of the memory access 707 * 708 * @since 1.0 709 */ 710 <T extends WordBase> T readWord(WordBase offset); 711 712 /** 713 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 714 * bytes. 715 * <p> 716 * The offset is always treated as a {@link SignedWord} value. However, the static type is 717 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 718 * knows that the highest-order bit of the unsigned value is never used). 719 * 720 * @param offset the signed offset for the memory access 721 * @return the result of the memory access 722 * 723 * @since 1.0 724 */ 725 Object readObject(WordBase offset); 726 727 /** 728 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 729 * bytes. 730 * 731 * @param offset the signed offset for the memory access 732 * @return the result of the memory access 733 * 734 * @since 1.0 735 */ 736 byte readByte(int offset); 737 738 /** 739 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 740 * bytes. 741 * 742 * @param offset the signed offset for the memory access 743 * @return the result of the memory access 744 * 745 * @since 1.0 746 */ 747 char readChar(int offset); 748 749 /** 750 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 751 * bytes. 752 * 753 * @param offset the signed offset for the memory access 754 * @return the result of the memory access 755 * 756 * @since 1.0 757 */ 758 short readShort(int offset); 759 760 /** 761 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 762 * bytes. 763 * 764 * @param offset the signed offset for the memory access 765 * @return the result of the memory access 766 * 767 * @since 1.0 768 */ 769 int readInt(int offset); 770 771 /** 772 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 773 * bytes. 774 * 775 * @param offset the signed offset for the memory access 776 * @return the result of the memory access 777 * 778 * @since 1.0 779 */ 780 long readLong(int offset); 781 782 /** 783 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 784 * bytes. 785 * 786 * @param offset the signed offset for the memory access 787 * @return the result of the memory access 788 * 789 * @since 1.0 790 */ 791 float readFloat(int offset); 792 793 /** 794 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 795 * bytes. 796 * 797 * @param offset the signed offset for the memory access 798 * @return the result of the memory access 799 * 800 * @since 1.0 801 */ 802 double readDouble(int offset); 803 804 /** 805 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 806 * bytes. 807 * 808 * @param offset the signed offset for the memory access 809 * @return the result of the memory access 810 * 811 * @since 1.0 812 */ 813 <T extends WordBase> T readWord(int offset); 814 815 /** 816 * Reads the memory at address {@code (this + offset)}. Both the base address and offset are in 817 * bytes. 818 * 819 * @param offset the signed offset for the memory access 820 * @return the result of the memory access 821 * 822 * @since 1.0 823 */ 824 Object readObject(int offset); 825 826 /** 827 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 828 * bytes. 829 * <p> 830 * The offset is always treated as a {@link SignedWord} value. However, the static type is 831 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 832 * knows that the highest-order bit of the unsigned value is never used). 833 * 834 * @param offset the signed offset for the memory access 835 * @param val the value to be written to memory 836 * 837 * @since 1.0 838 */ 839 void writeByte(WordBase offset, byte val); 840 841 /** 842 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 843 * bytes. 844 * <p> 845 * The offset is always treated as a {@link SignedWord} value. However, the static type is 846 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 847 * knows that the highest-order bit of the unsigned value is never used). 848 * 849 * @param offset the signed offset for the memory access 850 * @param val the value to be written to memory 851 * 852 * @since 1.0 853 */ 854 void writeChar(WordBase offset, char val); 855 856 /** 857 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 858 * bytes. 859 * <p> 860 * The offset is always treated as a {@link SignedWord} value. However, the static type is 861 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 862 * knows that the highest-order bit of the unsigned value is never used). 863 * 864 * @param offset the signed offset for the memory access 865 * @param val the value to be written to memory 866 * 867 * @since 1.0 868 */ 869 void writeShort(WordBase offset, short val); 870 871 /** 872 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 873 * bytes. 874 * <p> 875 * The offset is always treated as a {@link SignedWord} value. However, the static type is 876 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 877 * knows that the highest-order bit of the unsigned value is never used). 878 * 879 * @param offset the signed offset for the memory access 880 * @param val the value to be written to memory 881 * 882 * @since 1.0 883 */ 884 void writeInt(WordBase offset, int val); 885 886 /** 887 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 888 * bytes. 889 * <p> 890 * The offset is always treated as a {@link SignedWord} value. However, the static type is 891 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 892 * knows that the highest-order bit of the unsigned value is never used). 893 * 894 * @param offset the signed offset for the memory access 895 * @param val the value to be written to memory 896 * 897 * @since 1.0 898 */ 899 void writeLong(WordBase offset, long val); 900 901 /** 902 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 903 * bytes. 904 * <p> 905 * The offset is always treated as a {@link SignedWord} value. However, the static type is 906 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 907 * knows that the highest-order bit of the unsigned value is never used). 908 * 909 * @param offset the signed offset for the memory access 910 * @param val the value to be written to memory 911 * 912 * @since 1.0 913 */ 914 void writeFloat(WordBase offset, float val); 915 916 /** 917 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 918 * bytes. 919 * <p> 920 * The offset is always treated as a {@link SignedWord} value. However, the static type is 921 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 922 * knows that the highest-order bit of the unsigned value is never used). 923 * 924 * @param offset the signed offset for the memory access 925 * @param val the value to be written to memory 926 * 927 * @since 1.0 928 */ 929 void writeDouble(WordBase offset, double val); 930 931 /** 932 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 933 * bytes. 934 * <p> 935 * The offset is always treated as a {@link SignedWord} value. However, the static type is 936 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 937 * knows that the highest-order bit of the unsigned value is never used). 938 * 939 * @param offset the signed offset for the memory access 940 * @param val the value to be written to memory 941 * 942 * @since 1.0 943 */ 944 void writeWord(WordBase offset, WordBase val); 945 946 /** 947 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 948 * bytes. 949 * <p> 950 * The offset is always treated as a {@link SignedWord} value. However, the static type is 951 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 952 * knows that the highest-order bit of the unsigned value is never used). 953 * 954 * @param offset the signed offset for the memory access 955 * @param val the value to be written to memory 956 * 957 * @since 1.0 958 */ 959 void writeObject(WordBase offset, Object val); 960 961 /** 962 * Atomically exchanges memory at address {@code (this + offset)}. Both the base address and 963 * offset are in bytes. 964 * <p> 965 * The offset is always treated as a {@link SignedWord} value. However, the static type is 966 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 967 * knows that the highest-order bit of the unsigned value is never used). 968 * 969 * @param offset the signed offset for the memory access 970 * @param expectedValue the expected value of the atomic exchange 971 * @param newValue the new value of the atomic exchange 972 * @param locationIdentity the identity of the memory location 973 * @return The value after the atomic exchange 974 * 975 * @since 1.0 976 */ 977 int compareAndSwapInt(WordBase offset, int expectedValue, int newValue, LocationIdentity locationIdentity); 978 979 /** 980 * Atomically exchanges memory at address {@code (this + offset)}. Both the base address and 981 * offset are in bytes. 982 * <p> 983 * The offset is always treated as a {@link SignedWord} value. However, the static type is 984 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 985 * knows that the highest-order bit of the unsigned value is never used). 986 * 987 * @param offset the signed offset for the memory access 988 * @param expectedValue the expected value of the atomic exchange 989 * @param newValue the new value of the atomic exchange 990 * @param locationIdentity the identity of the memory location 991 * @return The value after the atomic exchange 992 * 993 * @since 1.0 994 */ 995 long compareAndSwapLong(WordBase offset, long expectedValue, long newValue, LocationIdentity locationIdentity); 996 997 /** 998 * Atomically exchanges memory at address {@code (this + offset)}. Both the base address and 999 * offset are in bytes. 1000 * <p> 1001 * The offset is always treated as a {@link SignedWord} value. However, the static type is 1002 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 1003 * knows that the highest-order bit of the unsigned value is never used). 1004 * 1005 * @param offset the signed offset for the memory access 1006 * @param expectedValue the expected value of the atomic exchange 1007 * @param newValue the new value of the atomic exchange 1008 * @param locationIdentity the identity of the memory location 1009 * @return The value after the atomic exchange 1010 * 1011 * @since 1.0 1012 */ 1013 <T extends WordBase> T compareAndSwapWord(WordBase offset, T expectedValue, T newValue, LocationIdentity locationIdentity); 1014 1015 /** 1016 * Atomically exchanges memory at address {@code (this + offset)}. Both the base address and 1017 * offset are in bytes. 1018 * <p> 1019 * The offset is always treated as a {@link SignedWord} value. However, the static type is 1020 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 1021 * knows that the highest-order bit of the unsigned value is never used). 1022 * 1023 * @param offset the signed offset for the memory access 1024 * @param expectedValue the expected value of the atomic exchange 1025 * @param newValue the new value of the atomic exchange 1026 * @param locationIdentity the identity of the memory location 1027 * @return The value after the atomic exchange 1028 * 1029 * @since 1.0 1030 */ 1031 Object compareAndSwapObject(WordBase offset, Object expectedValue, Object newValue, LocationIdentity locationIdentity); 1032 1033 /** 1034 * Atomically exchanges memory at address {@code (this + offset)}. Both the base address and 1035 * offset are in bytes. 1036 * <p> 1037 * The offset is always treated as a {@link SignedWord} value. However, the static type is 1038 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 1039 * knows that the highest-order bit of the unsigned value is never used). 1040 * 1041 * @param offset the signed offset for the memory access 1042 * @param expectedValue the expected value of the atomic exchange 1043 * @param newValue the new value of the atomic exchange 1044 * @param locationIdentity the identity of the memory location 1045 * @return {@code true} if successful. False return indicates that the actual value was not 1046 * equal to the expected value. 1047 * 1048 * @since 1.0 1049 */ 1050 boolean logicCompareAndSwapInt(WordBase offset, int expectedValue, int newValue, LocationIdentity locationIdentity); 1051 1052 /** 1053 * Atomically exchanges memory at address {@code (this + offset)}. Both the base address and 1054 * offset are in bytes. 1055 * <p> 1056 * The offset is always treated as a {@link SignedWord} value. However, the static type is 1057 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 1058 * knows that the highest-order bit of the unsigned value is never used). 1059 * 1060 * @param offset the signed offset for the memory access 1061 * @param expectedValue the expected value of the atomic exchange 1062 * @param newValue the new value of the atomic exchange 1063 * @param locationIdentity the identity of the memory location 1064 * @return {@code true} if successful. False return indicates that the actual value was not 1065 * equal to the expected value. 1066 * 1067 * @since 1.0 1068 */ 1069 boolean logicCompareAndSwapLong(WordBase offset, long expectedValue, long newValue, LocationIdentity locationIdentity); 1070 1071 /** 1072 * Atomically exchanges memory at address {@code (this + offset)}. Both the base address and 1073 * offset are in bytes. 1074 * <p> 1075 * The offset is always treated as a {@link SignedWord} value. However, the static type is 1076 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 1077 * knows that the highest-order bit of the unsigned value is never used). 1078 * 1079 * @param offset the signed offset for the memory access 1080 * @param expectedValue the expected value of the atomic exchange 1081 * @param newValue the new value of the atomic exchange 1082 * @param locationIdentity the identity of the memory location 1083 * @return {@code true} if successful. False return indicates that the actual value was not 1084 * equal to the expected value. 1085 * 1086 * @since 1.0 1087 */ 1088 boolean logicCompareAndSwapWord(WordBase offset, WordBase expectedValue, WordBase newValue, LocationIdentity locationIdentity); 1089 1090 /** 1091 * Atomically exchanges memory at address {@code (this + offset)}. Both the base address and 1092 * offset are in bytes. 1093 * <p> 1094 * The offset is always treated as a {@link SignedWord} value. However, the static type is 1095 * {@link WordBase} to avoid the frequent casts of {@link UnsignedWord} values (where the caller 1096 * knows that the highest-order bit of the unsigned value is never used). 1097 * 1098 * @param offset the signed offset for the memory access 1099 * @param expectedValue the expected value of the atomic exchange 1100 * @param newValue the new value of the atomic exchange 1101 * @param locationIdentity the identity of the memory location 1102 * @return {@code true} if successful. False return indicates that the actual value was not 1103 * equal to the expected value. 1104 * 1105 * @since 1.0 1106 */ 1107 boolean logicCompareAndSwapObject(WordBase offset, Object expectedValue, Object newValue, LocationIdentity locationIdentity); 1108 1109 /** 1110 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 1111 * bytes. 1112 * 1113 * @param offset the signed offset for the memory access 1114 * @param val the value to be written to memory 1115 * 1116 * @since 1.0 1117 */ 1118 void writeByte(int offset, byte val); 1119 1120 /** 1121 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 1122 * bytes. 1123 * 1124 * @param offset the signed offset for the memory access 1125 * @param val the value to be written to memory 1126 * 1127 * @since 1.0 1128 */ 1129 void writeChar(int offset, char val); 1130 1131 /** 1132 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 1133 * bytes. 1134 * 1135 * @param offset the signed offset for the memory access 1136 * @param val the value to be written to memory 1137 * 1138 * @since 1.0 1139 */ 1140 void writeShort(int offset, short val); 1141 1142 /** 1143 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 1144 * bytes. 1145 * 1146 * @param offset the signed offset for the memory access 1147 * @param val the value to be written to memory 1148 * 1149 * @since 1.0 1150 */ 1151 void writeInt(int offset, int val); 1152 1153 /** 1154 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 1155 * bytes. 1156 * 1157 * @param offset the signed offset for the memory access 1158 * @param val the value to be written to memory 1159 * 1160 * @since 1.0 1161 */ 1162 void writeLong(int offset, long val); 1163 1164 /** 1165 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 1166 * bytes. 1167 * 1168 * @param offset the signed offset for the memory access 1169 * @param val the value to be written to memory 1170 * 1171 * @since 1.0 1172 */ 1173 void writeFloat(int offset, float val); 1174 1175 /** 1176 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 1177 * bytes. 1178 * 1179 * @param offset the signed offset for the memory access 1180 * @param val the value to be written to memory 1181 * 1182 * @since 1.0 1183 */ 1184 void writeDouble(int offset, double val); 1185 1186 /** 1187 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 1188 * bytes. 1189 * 1190 * @param offset the signed offset for the memory access 1191 * @param val the value to be written to memory 1192 * 1193 * @since 1.0 1194 */ 1195 void writeWord(int offset, WordBase val); 1196 1197 /** 1198 * Writes the memory at address {@code (this + offset)}. Both the base address and offset are in 1199 * bytes. 1200 * 1201 * @param offset the signed offset for the memory access 1202 * @param val the value to be written to memory 1203 * 1204 * @since 1.0 1205 */ 1206 void writeObject(int offset, Object val); 1207 1208 /** 1209 * Atomically exchanges memory at address {@code (this + offset)}. Both the base address and 1210 * offset are in bytes. 1211 * 1212 * @param offset the signed offset for the memory access 1213 * @param expectedValue the expected value of the atomic exchange 1214 * @param newValue the new value of the atomic exchange 1215 * @param locationIdentity the identity of the memory location 1216 * @return The value after the atomic exchange 1217 * 1218 * @since 1.0 1219 */ 1220 int compareAndSwapInt(int offset, int expectedValue, int newValue, LocationIdentity locationIdentity); 1221 1222 /** 1223 * Atomically exchanges memory at address {@code (this + offset)}. Both the base address and 1224 * offset are in bytes. 1225 * 1226 * @param offset the signed offset for the memory access 1227 * @param expectedValue the expected value of the atomic exchange 1228 * @param newValue the new value of the atomic exchange 1229 * @param locationIdentity the identity of the memory location 1230 * @return The value after the atomic exchange 1231 * 1232 * @since 1.0 1233 */ 1234 long compareAndSwapLong(int offset, long expectedValue, long newValue, LocationIdentity locationIdentity); 1235 1236 /** 1237 * Atomically exchanges memory at address {@code (this + offset)}. Both the base address and 1238 * offset are in bytes. 1239 * 1240 * @param offset the signed offset for the memory access 1241 * @param expectedValue the expected value of the atomic exchange 1242 * @param newValue the new value of the atomic exchange 1243 * @param locationIdentity the identity of the memory location 1244 * @return The value after the atomic exchange 1245 * 1246 * @since 1.0 1247 */ 1248 <T extends WordBase> T compareAndSwapWord(int offset, T expectedValue, T newValue, LocationIdentity locationIdentity); 1249 1250 /** 1251 * Atomically exchanges memory at address {@code (this + offset)}. Both the base address and 1252 * offset are in bytes. 1253 * 1254 * @param offset the signed offset for the memory access 1255 * @param expectedValue the expected value of the atomic exchange 1256 * @param newValue the new value of the atomic exchange 1257 * @param locationIdentity the identity of the memory location 1258 * @return The value after the atomic exchange 1259 * 1260 * @since 1.0 1261 */ 1262 Object compareAndSwapObject(int offset, Object expectedValue, Object newValue, LocationIdentity locationIdentity); 1263 1264 /** 1265 * Atomically exchanges memory at address {@code (this + offset)}. Both the base address and 1266 * offset are in bytes. 1267 * 1268 * @param offset the signed offset for the memory access 1269 * @param expectedValue the expected value of the atomic exchange 1270 * @param newValue the new value of the atomic exchange 1271 * @param locationIdentity the identity of the memory location 1272 * @return {@code true} if successful. False return indicates that the actual value was not 1273 * equal to the expected value. 1274 * 1275 * @since 1.0 1276 */ 1277 boolean logicCompareAndSwapInt(int offset, int expectedValue, int newValue, LocationIdentity locationIdentity); 1278 1279 /** 1280 * Atomically exchanges memory at address {@code (this + offset)}. Both the base address and 1281 * offset are in bytes. 1282 * 1283 * @param offset the signed offset for the memory access 1284 * @param expectedValue the expected value of the atomic exchange 1285 * @param newValue the new value of the atomic exchange 1286 * @param locationIdentity the identity of the memory location 1287 * @return {@code true} if successful. False return indicates that the actual value was not 1288 * equal to the expected value. 1289 * 1290 * @since 1.0 1291 */ 1292 boolean logicCompareAndSwapLong(int offset, long expectedValue, long newValue, LocationIdentity locationIdentity); 1293 1294 /** 1295 * Atomically exchanges memory at address {@code (this + offset)}. Both the base address and 1296 * offset are in bytes. 1297 * 1298 * @param offset the signed offset for the memory access 1299 * @param expectedValue the expected value of the atomic exchange 1300 * @param newValue the new value of the atomic exchange 1301 * @param locationIdentity the identity of the memory location 1302 * @return {@code true} if successful. False return indicates that the actual value was not 1303 * equal to the expected value. 1304 * 1305 * @since 1.0 1306 */ 1307 boolean logicCompareAndSwapWord(int offset, WordBase expectedValue, WordBase newValue, LocationIdentity locationIdentity); 1308 1309 /** 1310 * Atomically exchanges memory at address {@code (this + offset)}. Both the base address and 1311 * offset are in bytes. 1312 * 1313 * @param offset the signed offset for the memory access 1314 * @param expectedValue the expected value of the atomic exchange 1315 * @param newValue the new value of the atomic exchange 1316 * @param locationIdentity the identity of the memory location 1317 * @return {@code true} if successful. False return indicates that the actual value was not 1318 * equal to the expected value. 1319 * 1320 * @since 1.0 1321 */ 1322 boolean logicCompareAndSwapObject(int offset, Object expectedValue, Object newValue, LocationIdentity locationIdentity); 1323 1324 // Math functions that are defined in Unsigned, but known to preserve the 1325 // pointer-characteristics. 1326 // It is therefore safe that they return a static type of Pointer instead of Unsigned. 1327 1328 /** 1329 * Returns a Pointer whose value is {@code (this + val)}. 1330 * 1331 * @param val value to be added to this Pointer. 1332 * @return {@code this + val} 1333 * 1334 * @since 1.0 1335 */ 1336 @Override 1337 Pointer add(UnsignedWord val); 1338 1339 /** 1340 * Returns a Pointer whose value is {@code (this + val)}. 1341 * 1342 * @param val value to be added to this Pointer. 1343 * @return {@code this + val} 1344 * 1345 * @since 1.0 1346 */ 1347 @Override 1348 Pointer add(int val); 1349 1350 /** 1351 * Returns a Pointer whose value is {@code (this - val)}. 1352 * 1353 * @param val value to be subtracted from this Pointer. 1354 * @return {@code this - val} 1355 * 1356 * @since 1.0 1357 */ 1358 @Override 1359 Pointer subtract(UnsignedWord val); 1360 1361 /** 1362 * Returns a Pointer whose value is {@code (this - val)}. 1363 * 1364 * @param val value to be subtracted from this Pointer. 1365 * @return {@code this - val} 1366 * 1367 * @since 1.0 1368 */ 1369 @Override 1370 Pointer subtract(int val); 1371 1372 /** 1373 * Returns a Pointer whose value is {@code (this & val)}. 1374 * 1375 * @param val value to be AND'ed with this Pointer. 1376 * @return {@code this & val} 1377 * 1378 * @since 1.0 1379 */ 1380 @Override 1381 Pointer and(UnsignedWord val); 1382 1383 /** 1384 * Returns a Pointer whose value is {@code (this & val)}. 1385 * 1386 * @param val value to be AND'ed with this Pointer. 1387 * @return {@code this & val} 1388 * 1389 * @since 1.0 1390 */ 1391 @Override 1392 Pointer and(int val); 1393 1394 /** 1395 * Returns a Pointer whose value is {@code (this | val)}. 1396 * 1397 * @param val value to be OR'ed with this Pointer. 1398 * @return {@code this | val} 1399 * 1400 * @since 1.0 1401 */ 1402 @Override 1403 Pointer or(UnsignedWord val); 1404 1405 /** 1406 * Returns a Pointer whose value is {@code (this | val)}. 1407 * 1408 * @param val value to be OR'ed with this Pointer. 1409 * @return {@code this | val} 1410 * 1411 * @since 1.0 1412 */ 1413 @Override 1414 Pointer or(int val); 1415 }