comparison jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Mark.java @ 23393:1d4ce2d19e52

clean up and minimize JVMCI (JDK-8156835)
author Doug Simon <doug.simon@oracle.com>
date Thu, 12 May 2016 20:57:31 +0200
parents 9273bb6ba33e
children
comparison
equal deleted inserted replaced
23392:b3a816d3b844 23393:1d4ce2d19e52
23 package jdk.vm.ci.code.site; 23 package jdk.vm.ci.code.site;
24 24
25 import java.util.Objects; 25 import java.util.Objects;
26 26
27 /** 27 /**
28 * Represents a mark in the machine code that can be used by the runtime for its own purposes. A 28 * Associates arbitrary information with a position in machine code. For example, HotSpot specific
29 * mark can reference other marks. 29 * code in a compiler backend may use this to denote the position of a safepoint, exception handler
30 * entry point, verified entry point etc.
30 */ 31 */
31 public final class Mark extends Site { 32 public final class Mark extends Site {
32 33
34 /**
35 * An object denoting extra semantic information about the machine code position of this mark.
36 */
33 public final Object id; 37 public final Object id;
34 38
39 /**
40 * Creates a mark that associates {@code id} with the machine code position {@code pcOffset}.
41 *
42 * @param pcOffset
43 * @param id
44 */
35 public Mark(int pcOffset, Object id) { 45 public Mark(int pcOffset, Object id) {
36 super(pcOffset); 46 super(pcOffset);
37 this.id = id; 47 this.id = id;
38 } 48 }
39 49
40 @Override 50 @Override
41 public String toString() { 51 public String toString() {
42 if (id == null) { 52 if (id == null) {
43 return String.format("%d[<mar>]", pcOffset); 53 return String.format("%d[<mark>]", pcOffset);
44 } else if (id instanceof Integer) { 54 } else if (id instanceof Integer) {
45 return String.format("%d[<mark with id %s>]", pcOffset, Integer.toHexString((Integer) id)); 55 return String.format("%d[<mark with id %s>]", pcOffset, Integer.toHexString((Integer) id));
46 } else { 56 } else {
47 return String.format("%d[<mark with id %s>]", pcOffset, id.toString()); 57 return String.format("%d[<mark with id %s>]", pcOffset, id.toString());
48 } 58 }