8143226: Minor updates to Event Based tracing

Reviewed-by: jbachorik, egahlin
This commit is contained in:
Markus Grönlund 2016-03-01 23:46:09 +01:00
parent 12d9b13eee
commit 0e44e963d2
34 changed files with 211 additions and 321 deletions

View file

@ -43,6 +43,9 @@
#if INCLUDE_ALL_GCS
#include "gc/g1/heapRegion.hpp"
#endif // INCLUDE_ALL_GCS
#ifdef TRACE_HAVE_INTRINSICS
#include "trace/traceMacros.hpp"
#endif
#ifdef ASSERT
#define __ gen()->lir(__FILE__, __LINE__)->
@ -3067,42 +3070,7 @@ void LIRGenerator::do_RuntimeCall(address routine, Intrinsic* x) {
__ move(reg, result);
}
#ifdef TRACE_HAVE_INTRINSICS
void LIRGenerator::do_ThreadIDIntrinsic(Intrinsic* x) {
LIR_Opr thread = getThreadPointer();
LIR_Opr osthread = new_pointer_register();
__ move(new LIR_Address(thread, in_bytes(JavaThread::osthread_offset()), osthread->type()), osthread);
size_t thread_id_size = OSThread::thread_id_size();
if (thread_id_size == (size_t) BytesPerLong) {
LIR_Opr id = new_register(T_LONG);
__ move(new LIR_Address(osthread, in_bytes(OSThread::thread_id_offset()), T_LONG), id);
__ convert(Bytecodes::_l2i, id, rlock_result(x));
} else if (thread_id_size == (size_t) BytesPerInt) {
__ move(new LIR_Address(osthread, in_bytes(OSThread::thread_id_offset()), T_INT), rlock_result(x));
} else {
ShouldNotReachHere();
}
}
void LIRGenerator::do_ClassIDIntrinsic(Intrinsic* x) {
CodeEmitInfo* info = state_for(x);
CodeEmitInfo* info2 = new CodeEmitInfo(info); // Clone for the second null check
BasicType klass_pointer_type = NOT_LP64(T_INT) LP64_ONLY(T_LONG);
assert(info != NULL, "must have info");
LIRItem arg(x->argument_at(1), this);
arg.load_item();
LIR_Opr klass = new_pointer_register();
__ move(new LIR_Address(arg.result(), java_lang_Class::klass_offset_in_bytes(), klass_pointer_type), klass, info);
LIR_Opr id = new_register(T_LONG);
ByteSize offset = TRACE_ID_OFFSET;
LIR_Address* trace_id_addr = new LIR_Address(klass, in_bytes(offset), T_LONG);
__ move(trace_id_addr, id);
__ logical_or(id, LIR_OprFact::longConst(0x01l), id);
__ store(id, trace_id_addr);
__ logical_and(id, LIR_OprFact::longConst(~0x3l), id);
__ move(id, rlock_result(x));
}
#endif
void LIRGenerator::do_Intrinsic(Intrinsic* x) {
switch (x->id()) {
@ -3115,8 +3083,6 @@ void LIRGenerator::do_Intrinsic(Intrinsic* x) {
}
#ifdef TRACE_HAVE_INTRINSICS
case vmIntrinsics::_threadID: do_ThreadIDIntrinsic(x); break;
case vmIntrinsics::_classID: do_ClassIDIntrinsic(x); break;
case vmIntrinsics::_counterTime:
do_RuntimeCall(CAST_FROM_FN_PTR(address, TRACE_TIME_METHOD), x);
break;