src/share/vm/ci/ciMethodData.hpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
hotspot Cdiff src/share/vm/ci/ciMethodData.hpp
src/share/vm/ci/ciMethodData.hpp
Print this page
rev 5774 : 8031752: Failed speculative optimizations should be reattempted when root of compilation is different
Summary: support for speculative traps that keep track of the root of the compilation in which a trap occurs.
Reviewed-by:
rev 5775 : imported patch spectrap-chris
*** 29,38 ****
--- 29,39 ----
#include "ci/ciKlass.hpp"
#include "ci/ciObject.hpp"
#include "ci/ciUtilities.hpp"
#include "oops/methodData.hpp"
#include "oops/oop.inline.hpp"
+ #include "runtime/deoptimization.hpp"
class ciBitData;
class ciCounterData;
class ciJumpData;
class ciReceiverTypeData;
*** 42,51 ****
--- 43,53 ----
class ciMultiBranchData;
class ciArgInfoData;
class ciCallTypeData;
class ciVirtualCallTypeData;
class ciParametersTypeData;
+ class ciSpeculativeTrapData;;
typedef ProfileData ciProfileData;
class ciBitData : public BitData {
public:
*** 171,181 ****
bool return_maybe_null() const {
return ret()->maybe_null();
}
#ifndef PRODUCT
! void print_data_on(outputStream* st) const;
#endif
};
class ciReceiverTypeData : public ReceiverTypeData {
public:
--- 173,183 ----
bool return_maybe_null() const {
return ret()->maybe_null();
}
#ifndef PRODUCT
! void print_data_on(outputStream* st, const char* extra) const;
#endif
};
class ciReceiverTypeData : public ReceiverTypeData {
public:
*** 198,208 ****
virtual void translate_from(const ProfileData* data) {
translate_receiver_data_from(data);
}
void translate_receiver_data_from(const ProfileData* data);
#ifndef PRODUCT
! void print_data_on(outputStream* st) const;
void print_receiver_data_on(outputStream* st) const;
#endif
};
class ciVirtualCallData : public VirtualCallData {
--- 200,210 ----
virtual void translate_from(const ProfileData* data) {
translate_receiver_data_from(data);
}
void translate_receiver_data_from(const ProfileData* data);
#ifndef PRODUCT
! void print_data_on(outputStream* st, const char* extra) const;
void print_receiver_data_on(outputStream* st) const;
#endif
};
class ciVirtualCallData : public VirtualCallData {
*** 223,233 ****
// Copy & translate from oop based VirtualCallData
virtual void translate_from(const ProfileData* data) {
rtd_super()->translate_receiver_data_from(data);
}
#ifndef PRODUCT
! void print_data_on(outputStream* st) const;
#endif
};
class ciVirtualCallTypeData : public VirtualCallTypeData {
private:
--- 225,235 ----
// Copy & translate from oop based VirtualCallData
virtual void translate_from(const ProfileData* data) {
rtd_super()->translate_receiver_data_from(data);
}
#ifndef PRODUCT
! void print_data_on(outputStream* st, const char* extra) const;
#endif
};
class ciVirtualCallTypeData : public VirtualCallTypeData {
private:
*** 285,295 ****
bool return_maybe_null() const {
return ret()->maybe_null();
}
#ifndef PRODUCT
! void print_data_on(outputStream* st) const;
#endif
};
class ciRetData : public RetData {
--- 287,297 ----
bool return_maybe_null() const {
return ret()->maybe_null();
}
#ifndef PRODUCT
! void print_data_on(outputStream* st, const char* extra) const;
#endif
};
class ciRetData : public RetData {
*** 334,344 ****
bool parameter_maybe_null(int i) const {
return parameters()->maybe_null(i);
}
#ifndef PRODUCT
! void print_data_on(outputStream* st) const;
#endif
};
// ciMethodData
//
--- 336,365 ----
bool parameter_maybe_null(int i) const {
return parameters()->maybe_null(i);
}
#ifndef PRODUCT
! void print_data_on(outputStream* st, const char* extra) const;
! #endif
! };
!
! class ciSpeculativeTrapData : public SpeculativeTrapData {
! public:
! ciSpeculativeTrapData(DataLayout* layout) : SpeculativeTrapData(layout) {}
!
! virtual void translate_from(const ProfileData* data);
!
! ciMethod* method() const {
! return (ciMethod*)intptr_at(method_offset);
! }
!
! void set_method(ciMethod* m) {
! set_intptr_at(method_offset, (intptr_t)m);
! }
!
! #ifndef PRODUCT
! void print_data_on(outputStream* st, const char* extra) const;
#endif
};
// ciMethodData
//
*** 434,443 ****
--- 455,474 ----
// What is the index of the first data entry?
int first_di() { return 0; }
ciArgInfoData *arg_info() const;
+ address data_base() const {
+ return (address) _data;
+ }
+ DataLayout* limit_data_position() const {
+ return (DataLayout*)((address)data_base() + _data_size);
+ }
+
+ void load_extra_data();
+ ciProfileData* bci_to_extra_data(int bci, ciMethod* m, bool& two_free_slots);
+
public:
bool is_method_data() const { return true; }
bool is_empty() { return _state == empty_state; }
bool is_mature() { return _state == mature_state; }
*** 473,485 ****
// Walk through the data in order.
ciProfileData* first_data() { return data_at(first_di()); }
ciProfileData* next_data(ciProfileData* current);
bool is_valid(ciProfileData* current) { return current != NULL; }
! // Get the data at an arbitrary bci, or NULL if there is none.
! ciProfileData* bci_to_data(int bci);
! ciProfileData* bci_to_extra_data(int bci, bool create_if_missing);
uint overflow_trap_count() const {
return _orig.overflow_trap_count();
}
uint overflow_recompile_count() const {
--- 504,518 ----
// Walk through the data in order.
ciProfileData* first_data() { return data_at(first_di()); }
ciProfileData* next_data(ciProfileData* current);
bool is_valid(ciProfileData* current) { return current != NULL; }
! DataLayout* extra_data_base() const { return limit_data_position(); }
!
! // Get the data at an arbitrary bci, or NULL if there is none. If m
! // is not NULL look for a SpeculativeTrapData if any first.
! ciProfileData* bci_to_data(int bci, ciMethod* m = NULL);
uint overflow_trap_count() const {
return _orig.overflow_trap_count();
}
uint overflow_recompile_count() const {
*** 494,509 ****
uint trap_reason_limit() const { return _orig.trap_reason_limit(); }
uint trap_count_limit() const { return _orig.trap_count_limit(); }
// Helpful query functions that decode trap_state.
int has_trap_at(ciProfileData* data, int reason);
! int has_trap_at(int bci, int reason) {
! return has_trap_at(bci_to_data(bci), reason);
}
int trap_recompiled_at(ciProfileData* data);
! int trap_recompiled_at(int bci) {
! return trap_recompiled_at(bci_to_data(bci));
}
void clear_escape_info();
bool has_escape_info();
void update_escape_info();
--- 527,543 ----
uint trap_reason_limit() const { return _orig.trap_reason_limit(); }
uint trap_count_limit() const { return _orig.trap_count_limit(); }
// Helpful query functions that decode trap_state.
int has_trap_at(ciProfileData* data, int reason);
! int has_trap_at(int bci, ciMethod* m, int reason) {
! assert((m != NULL) == Deoptimization::reason_is_speculate(reason), "inconsistent method/reason");
! return has_trap_at(bci_to_data(bci, m), reason);
}
int trap_recompiled_at(ciProfileData* data);
! int trap_recompiled_at(int bci, ciMethod* m) {
! return trap_recompiled_at(bci_to_data(bci, m));
}
void clear_escape_info();
bool has_escape_info();
void update_escape_info();
src/share/vm/ci/ciMethodData.hpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File