1947 public: |
1947 public: |
1948 virtual bool is_live(Method* m) = 0; |
1948 virtual bool is_live(Method* m) = 0; |
1949 }; |
1949 }; |
1950 |
1950 |
1951 |
1951 |
|
1952 #if INCLUDE_JVMCI |
|
1953 // Encapsulates an encoded speculation reason. These are linked together in |
|
1954 // a list that is atomically appended to during deoptimization. Entries are |
|
1955 // never removed from the list. |
|
1956 // @see jdk.vm.ci.hotspot.HotSpotSpeculationLog.HotSpotSpeculationEncoding |
|
1957 class FailedSpeculation: public CHeapObj<mtCompiler> { |
|
1958 private: |
|
1959 // The length of HotSpotSpeculationEncoding.toByteArray(). The data itself |
|
1960 // is an array embedded at the end of this object. |
|
1961 int _data_len; |
|
1962 |
|
1963 // Next entry in a linked list. |
|
1964 FailedSpeculation* _next; |
|
1965 |
|
1966 FailedSpeculation(address data, int data_len); |
|
1967 |
|
1968 FailedSpeculation** next_adr() { return &_next; } |
|
1969 |
|
1970 // Placement new operator for inlining the speculation data into |
|
1971 // the FailedSpeculation object. |
|
1972 void* operator new(size_t size, size_t fs_size) throw(); |
|
1973 |
|
1974 public: |
|
1975 char* data() { return (char*)(((address) this) + sizeof(FailedSpeculation)); } |
|
1976 int data_len() const { return _data_len; } |
|
1977 FailedSpeculation* next() const { return _next; } |
|
1978 |
|
1979 // Atomically appends a speculation from nm to the list whose head is at (*failed_speculations_address). |
|
1980 // Returns false if the FailedSpeculation object could not be allocated. |
|
1981 static bool add_failed_speculation(nmethod* nm, FailedSpeculation** failed_speculations_address, address speculation, int speculation_len); |
|
1982 |
|
1983 // Frees all entries in the linked list whose head is at (*failed_speculations_address). |
|
1984 static void free_failed_speculations(FailedSpeculation** failed_speculations_address); |
|
1985 }; |
|
1986 #endif |
|
1987 |
1952 class MethodData : public Metadata { |
1988 class MethodData : public Metadata { |
1953 friend class VMStructs; |
1989 friend class VMStructs; |
1954 friend class JVMCIVMStructs; |
1990 friend class JVMCIVMStructs; |
1955 private: |
1991 private: |
1956 friend class ProfileData; |
1992 friend class ProfileData; |
2028 enum WouldProfile {unknown, no_profile, profile}; |
2064 enum WouldProfile {unknown, no_profile, profile}; |
2029 WouldProfile _would_profile; |
2065 WouldProfile _would_profile; |
2030 |
2066 |
2031 #if INCLUDE_JVMCI |
2067 #if INCLUDE_JVMCI |
2032 // Support for HotSpotMethodData.setCompiledIRSize(int) |
2068 // Support for HotSpotMethodData.setCompiledIRSize(int) |
2033 int _jvmci_ir_size; |
2069 int _jvmci_ir_size; |
|
2070 FailedSpeculation* _failed_speculations; |
2034 #endif |
2071 #endif |
2035 |
2072 |
2036 // Size of _data array in bytes. (Excludes header and extra_data fields.) |
2073 // Size of _data array in bytes. (Excludes header and extra_data fields.) |
2037 int _data_size; |
2074 int _data_size; |
2038 |
2075 |
2188 _backedge_counter_start = backedge_count(); |
2225 _backedge_counter_start = backedge_count(); |
2189 } |
2226 } |
2190 |
2227 |
2191 InvocationCounter* invocation_counter() { return &_invocation_counter; } |
2228 InvocationCounter* invocation_counter() { return &_invocation_counter; } |
2192 InvocationCounter* backedge_counter() { return &_backedge_counter; } |
2229 InvocationCounter* backedge_counter() { return &_backedge_counter; } |
|
2230 |
|
2231 #if INCLUDE_JVMCI |
|
2232 FailedSpeculation** get_failed_speculations_address() { |
|
2233 return &_failed_speculations; |
|
2234 } |
|
2235 #endif |
2193 |
2236 |
2194 #if INCLUDE_RTM_OPT |
2237 #if INCLUDE_RTM_OPT |
2195 int rtm_state() const { |
2238 int rtm_state() const { |
2196 return _rtm_state; |
2239 return _rtm_state; |
2197 } |
2240 } |