aboutsummaryrefslogtreecommitdiff
path: root/src/share/vm/c1/c1_Compilation.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/share/vm/c1/c1_Compilation.hpp')
-rw-r--r--src/share/vm/c1/c1_Compilation.hpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/share/vm/c1/c1_Compilation.hpp b/src/share/vm/c1/c1_Compilation.hpp
index 82c1699ea..a66db0891 100644
--- a/src/share/vm/c1/c1_Compilation.hpp
+++ b/src/share/vm/c1/c1_Compilation.hpp
@@ -69,6 +69,7 @@ class Compilation: public StackObj {
bool _has_exception_handlers;
bool _has_fpu_code;
bool _has_unsafe_access;
+ bool _would_profile;
bool _has_method_handle_invokes; // True if this method has MethodHandle invokes.
const char* _bailout_msg;
ExceptionInfoList* _exception_info_list;
@@ -143,6 +144,7 @@ class Compilation: public StackObj {
void set_has_exception_handlers(bool f) { _has_exception_handlers = f; }
void set_has_fpu_code(bool f) { _has_fpu_code = f; }
void set_has_unsafe_access(bool f) { _has_unsafe_access = f; }
+ void set_would_profile(bool f) { _would_profile = f; }
// Add a set of exception handlers covering the given PC offset
void add_exception_handlers_for_pco(int pco, XHandlers* exception_handlers);
// Statistics gathering
@@ -202,6 +204,30 @@ class Compilation: public StackObj {
void compile_only_this_scope(outputStream* st, IRScope* scope);
void exclude_this_method();
#endif // PRODUCT
+
+ bool is_profiling() {
+ return env()->comp_level() == CompLevel_full_profile ||
+ env()->comp_level() == CompLevel_limited_profile;
+ }
+ bool count_invocations() { return is_profiling(); }
+ bool count_backedges() { return is_profiling(); }
+
+ // Helpers for generation of profile information
+ bool profile_branches() {
+ return env()->comp_level() == CompLevel_full_profile &&
+ C1UpdateMethodData && C1ProfileBranches;
+ }
+ bool profile_calls() {
+ return env()->comp_level() == CompLevel_full_profile &&
+ C1UpdateMethodData && C1ProfileCalls;
+ }
+ bool profile_inlined_calls() {
+ return profile_calls() && C1ProfileInlinedCalls;
+ }
+ bool profile_checkcasts() {
+ return env()->comp_level() == CompLevel_full_profile &&
+ C1UpdateMethodData && C1ProfileCheckcasts;
+ }
};