Mercurial > hg > truffle
comparison graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMethodDataAccessor.java @ 14706:579a2a124c95
add HotSpotMethodDataAccessor.Tag enum and dummy entries to PROFILE_DATA_ACCESSORS for new profile types
author | twisti |
---|---|
date | Thu, 20 Mar 2014 13:41:32 -0700 |
parents | f9d908fb3492 |
children | f3a5036cc13c |
comparison
equal
deleted
inserted
replaced
14705:7986af88b782 | 14706:579a2a124c95 |
---|---|
20 * or visit www.oracle.com if you need additional information or have any | 20 * or visit www.oracle.com if you need additional information or have any |
21 * questions. | 21 * questions. |
22 */ | 22 */ |
23 package com.oracle.graal.hotspot.meta; | 23 package com.oracle.graal.hotspot.meta; |
24 | 24 |
25 import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; | |
26 | |
25 import com.oracle.graal.api.meta.*; | 27 import com.oracle.graal.api.meta.*; |
26 import com.oracle.graal.api.meta.ProfilingInfo.TriState; | 28 import com.oracle.graal.api.meta.ProfilingInfo.TriState; |
29 import com.oracle.graal.graph.*; | |
30 import com.oracle.graal.hotspot.*; | |
27 | 31 |
28 /** | 32 /** |
29 * Interface for accessor objects that encapsulate the logic for accessing the different kinds of | 33 * Interface for accessor objects that encapsulate the logic for accessing the different kinds of |
30 * data in a HotSpot methodDataOop. This interface is similar to the interface {@link ProfilingInfo} | 34 * data in a HotSpot methodDataOop. This interface is similar to the interface {@link ProfilingInfo} |
31 * , but most methods require a MethodDataObject and the exact position within the methodData. | 35 * , but most methods require a MethodDataObject and the exact position within the methodData. |
32 */ | 36 */ |
33 public interface HotSpotMethodDataAccessor { | 37 public interface HotSpotMethodDataAccessor { |
34 | 38 |
35 /** | 39 /** |
36 * Returns the tag stored in the LayoutData header. | 40 * {@code DataLayout} tag values. |
41 */ | |
42 enum Tag { | |
43 No(config().dataLayoutNoTag), | |
44 BitData(config().dataLayoutBitDataTag), | |
45 CounterData(config().dataLayoutCounterDataTag), | |
46 JumpData(config().dataLayoutJumpDataTag), | |
47 ReceiverTypeData(config().dataLayoutReceiverTypeDataTag), | |
48 VirtualCallData(config().dataLayoutVirtualCallDataTag), | |
49 RetData(config().dataLayoutRetDataTag), | |
50 BranchData(config().dataLayoutBranchDataTag), | |
51 MultiBranchData(config().dataLayoutMultiBranchDataTag), | |
52 ArgInfoData(config().dataLayoutArgInfoDataTag), | |
53 CallTypeData(config().dataLayoutCallTypeDataTag), | |
54 VirtualCallTypeData(config().dataLayoutVirtualCallTypeDataTag), | |
55 ParametersTypeData(config().dataLayoutParametersTypeDataTag), | |
56 SpeculativeTrapData(config().dataLayoutSpeculativeTrapDataTag); | |
57 | |
58 private final int value; | |
59 | |
60 private Tag(int value) { | |
61 this.value = value; | |
62 } | |
63 | |
64 public int getValue() { | |
65 return value; | |
66 } | |
67 | |
68 private static HotSpotVMConfig config() { | |
69 return runtime().getConfig(); | |
70 } | |
71 | |
72 public static Tag getEnum(int value) { | |
73 for (Tag e : values()) { | |
74 if (e.value == value) { | |
75 return e; | |
76 } | |
77 } | |
78 throw GraalInternalError.shouldNotReachHere("unknown enum value " + value); | |
79 } | |
80 } | |
81 | |
82 /** | |
83 * Returns the {@link Tag} stored in the LayoutData header. | |
37 * | 84 * |
38 * @return An integer >= 0 or -1 if not supported. | 85 * @return tag stored in the LayoutData header |
39 */ | 86 */ |
40 int getTag(); | 87 Tag getTag(); |
41 | 88 |
42 /** | 89 /** |
43 * Returns the BCI stored in the LayoutData header. | 90 * Returns the BCI stored in the LayoutData header. |
44 * | 91 * |
45 * @return An integer >= 0 and <= Short.MAX_VALUE, or -1 if not supported. | 92 * @return An integer >= 0 and <= Short.MAX_VALUE, or -1 if not supported. |