8171960: Event-based tracing needs separate flag representation for Method
Reviewed-by: hseigel, gtriantafill, dholmes
--- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java Tue Jan 17 08:53:42 2017 +0100
+++ b/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java Tue Jan 17 16:18:03 2017 +0100
@@ -479,7 +479,6 @@
public final int methodCompiledEntryOffset = getFieldOffset("Method::_from_compiled_entry", Integer.class, "address");
public final int methodCodeOffset = getFieldOffset("Method::_code", Integer.class, isJDK8 ? "nmethod*" : "CompiledMethod*");
- public final int methodFlagsJfrTowrite = getConstant("Method::_jfr_towrite", Integer.class);
public final int methodFlagsCallerSensitive = getConstant("Method::_caller_sensitive", Integer.class);
public final int methodFlagsForceInline = getConstant("Method::_force_inline", Integer.class);
public final int methodFlagsDontInline = getConstant("Method::_dont_inline", Integer.class);
--- a/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp Tue Jan 17 08:53:42 2017 +0100
+++ b/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp Tue Jan 17 16:18:03 2017 +0100
@@ -535,7 +535,6 @@
\
declare_constant(markOopDesc::no_hash) \
\
- declare_constant(Method::_jfr_towrite) \
declare_constant(Method::_caller_sensitive) \
declare_constant(Method::_force_inline) \
declare_constant(Method::_dont_inline) \
--- a/hotspot/src/share/vm/oops/method.cpp Tue Jan 17 08:53:42 2017 +0100
+++ b/hotspot/src/share/vm/oops/method.cpp Tue Jan 17 16:18:03 2017 +0100
@@ -85,7 +85,6 @@
set_constMethod(xconst);
set_access_flags(access_flags);
set_intrinsic_id(vmIntrinsics::_none);
- set_jfr_towrite(false);
set_force_inline(false);
set_hidden(false);
set_dont_inline(false);
--- a/hotspot/src/share/vm/oops/method.hpp Tue Jan 17 08:53:42 2017 +0100
+++ b/hotspot/src/share/vm/oops/method.hpp Tue Jan 17 16:18:03 2017 +0100
@@ -75,18 +75,19 @@
// Flags
enum Flags {
- _jfr_towrite = 1 << 0,
- _caller_sensitive = 1 << 1,
- _force_inline = 1 << 2,
- _dont_inline = 1 << 3,
- _hidden = 1 << 4,
- _has_injected_profile = 1 << 5,
- _running_emcp = 1 << 6,
- _intrinsic_candidate = 1 << 7,
- _reserved_stack_access = 1 << 8
+ _caller_sensitive = 1 << 0,
+ _force_inline = 1 << 1,
+ _dont_inline = 1 << 2,
+ _hidden = 1 << 3,
+ _has_injected_profile = 1 << 4,
+ _running_emcp = 1 << 5,
+ _intrinsic_candidate = 1 << 6,
+ _reserved_stack_access = 1 << 7
};
mutable u2 _flags;
+ TRACE_DEFINE_FLAG;
+
#ifndef PRODUCT
int _compiled_invocation_count; // Number of nmethod invocations so far (for perf. debugging)
#endif
@@ -833,13 +834,6 @@
void init_intrinsic_id(); // updates from _none if a match
static vmSymbols::SID klass_id_for_intrinsics(const Klass* holder);
- bool jfr_towrite() const {
- return (_flags & _jfr_towrite) != 0;
- }
- void set_jfr_towrite(bool x) const {
- _flags = x ? (_flags | _jfr_towrite) : (_flags & ~_jfr_towrite);
- }
-
bool caller_sensitive() {
return (_flags & _caller_sensitive) != 0;
}
@@ -890,6 +884,8 @@
_flags = x ? (_flags | _reserved_stack_access) : (_flags & ~_reserved_stack_access);
}
+ TRACE_DEFINE_FLAG_ACCESSOR;
+
ConstMethod::MethodType method_type() const {
return _constMethod->method_type();
}
--- a/hotspot/src/share/vm/runtime/vmStructs.cpp Tue Jan 17 08:53:42 2017 +0100
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp Tue Jan 17 16:18:03 2017 +0100
@@ -2453,7 +2453,6 @@
/* ConstMethod anon-enum */ \
/********************************/ \
\
- declare_constant(Method::_jfr_towrite) \
declare_constant(Method::_caller_sensitive) \
declare_constant(Method::_force_inline) \
declare_constant(Method::_dont_inline) \
--- a/hotspot/src/share/vm/trace/traceMacros.hpp Tue Jan 17 08:53:42 2017 +0100
+++ b/hotspot/src/share/vm/trace/traceMacros.hpp Tue Jan 17 16:18:03 2017 +0100
@@ -55,6 +55,8 @@
#define TRACE_DEFINE_THREAD_ID_SIZE typedef int ___IGNORED_hs_trace_type6
#define TRACE_DEFINE_THREAD_DATA_WRITER_OFFSET typedef int ___IGNORED_hs_trace_type7
#define TRACE_THREAD_DATA_WRITER_OFFSET in_ByteSize(0); ShouldNotReachHere()
+#define TRACE_DEFINE_FLAG typedef int ___IGNORED_hs_trace_type8
+#define TRACE_DEFINE_FLAG_ACCESSOR typedef int ___IGNORED_hs_trace_type9
#define TRACE_TEMPLATES(template)
#define TRACE_INTRINSICS(do_intrinsic, do_class, do_name, do_signature, do_alias)