本文整理汇总了C++中CompilerThread类的典型用法代码示例。如果您正苦于以下问题:C++ CompilerThread类的具体用法?C++ CompilerThread怎么用?C++ CompilerThread使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CompilerThread类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: clean_up
void IdealGraphPrinter::clean_up() {
JavaThread *p;
for (p = Threads::first(); p; p = p->next()) {
if (p->is_Compiler_thread()) {
CompilerThread *c = (CompilerThread *)p;
IdealGraphPrinter *printer = c->ideal_graph_printer();
if (printer) {
delete printer;
}
c->set_ideal_graph_printer(NULL);
}
}
}
示例2: CompilerThread_ResultReciever
void CompilerThread_ResultReciever(void*data, int result)
{
CompilerThread* thread = (CompilerThread*)data;
thread->lastResult = result;
CompilerThread_OutputPacket* packet = new CompilerThread_OutputPacket();
packet->organizer = thread->getOrganizer();
packet->type = COMPILERPACKET_RESULT;
packet->string = "";
packet->value = result;
runCallbackInMainThread(&CompilerThread_MainThreadReciever, packet, false);
}
示例3: NEW_C_HEAP_ARRAY
void FlatProfiler::record_thread_ticks() {
int maxthreads, suspendedthreadcount;
JavaThread** threadsList;
bool interval_expired = false;
if (ProfileIntervals &&
(FlatProfiler::received_ticks >= interval_ticks_previous + ProfileIntervalsTicks)) {
interval_expired = true;
interval_ticks_previous = FlatProfiler::received_ticks;
}
// Try not to wait for the Threads_lock
if (Threads_lock->try_lock()) {
{ // Threads_lock scope
maxthreads = Threads::number_of_threads();
threadsList = NEW_C_HEAP_ARRAY(JavaThread *, maxthreads, mtInternal);
suspendedthreadcount = 0;
for (JavaThread* tp = Threads::first(); tp != NULL; tp = tp->next()) {
if (tp->is_Compiler_thread()) {
// Only record ticks for active compiler threads
CompilerThread* cthread = (CompilerThread*)tp;
if (cthread->task() != NULL) {
// The compiler is active. If we need to access any of the fields
// of the compiler task we should suspend the CompilerThread first.
FlatProfiler::compiler_ticks += 1;
continue;
}
}
// First externally suspend all threads by marking each for
// external suspension - so it will stop at its next transition
// Then do a safepoint
ThreadProfiler* pp = tp->get_thread_profiler();
if (pp != NULL && pp->engaged) {
MutexLockerEx ml(tp->SR_lock(), Mutex::_no_safepoint_check_flag);
if (!tp->is_external_suspend() && !tp->is_exiting()) {
tp->set_external_suspend();
threadsList[suspendedthreadcount++] = tp;
}
}
}
Threads_lock->unlock();
}
示例4: CompilerThread_ErrorReciever
void CompilerThread_ErrorReciever(void*data, const char*error)
{
CompilerThread* thread = (CompilerThread*)data;
const String& currentFile = thread->getCurrentFile();
if(currentFile.length()>0)
{
String fullPath = (String)ProjLoad_getSavedProjectsFolder() + '/' + thread->getOrganizer()->projData->getFolderName();
fullPath += (String)"/bin/build/" + currentFile + ".output";
FileTools::appendStringToFile(fullPath, (String)"stderr: " + error);
}
CompilerThread_OutputPacket* packet = new CompilerThread_OutputPacket();
packet->organizer = thread->getOrganizer();
packet->type = COMPILERPACKET_ERROR;
packet->string = error;
packet->value = 0;
runCallbackInMainThread(&CompilerThread_MainThreadReciever, packet, false);
}
示例5: if
//.........这里部分代码省略.........
STEP(130, "(printing Java stack)" )
if (_verbose && _thread && _thread->is_Java_thread()) {
print_stack_trace(st, (JavaThread*)_thread, buf, sizeof(buf));
}
STEP(135, "(printing target Java thread stack)" )
// printing Java thread stack trace if it is involved in GC crash
if (_verbose && _thread && (_thread->is_Named_thread())) {
JavaThread* jt = ((NamedThread *)_thread)->processed_thread();
if (jt != NULL) {
st->print_cr("JavaThread " PTR_FORMAT " (nid = " UINTX_FORMAT ") was being processed", jt, jt->osthread()->thread_id());
print_stack_trace(st, jt, buf, sizeof(buf), true);
}
}
STEP(140, "(printing VM operation)" )
if (_verbose && _thread && _thread->is_VM_thread()) {
VMThread* t = (VMThread*)_thread;
VM_Operation* op = t->vm_operation();
if (op) {
op->print_on_error(st);
st->cr();
st->cr();
}
}
STEP(150, "(printing current compile task)" )
if (_verbose && _thread && _thread->is_Compiler_thread()) {
CompilerThread* t = (CompilerThread*)_thread;
if (t->task()) {
st->cr();
st->print_cr("Current CompileTask:");
t->task()->print_line_on_error(st, buf, sizeof(buf));
st->cr();
}
}
STEP(160, "(printing process)" )
if (_verbose) {
st->cr();
st->print_cr("--------------- P R O C E S S ---------------");
st->cr();
}
STEP(170, "(printing all threads)" )
// all threads
if (_verbose && _thread) {
Threads::print_on_error(st, _thread, buf, sizeof(buf));
st->cr();
}
STEP(175, "(printing VM state)" )
if (_verbose) {
// Safepoint state
st->print("VM state:");
if (SafepointSynchronize::is_synchronizing()) st->print("synchronizing");
else if (SafepointSynchronize::is_at_safepoint()) st->print("at safepoint");
示例6: if
//.........这里部分代码省略.........
STEP("printing date and time")
if (_verbose) {
os::print_date_and_time(st, buf, sizeof(buf));
}
STEP("printing thread")
if (_verbose) {
st->cr();
st->print_cr("--------------- T H R E A D ---------------");
st->cr();
}
STEP("printing current thread")
// current thread
if (_verbose) {
if (_thread) {
st->print("Current thread (" PTR_FORMAT "): ", p2i(_thread));
_thread->print_on_error(st, buf, sizeof(buf));
st->cr();
} else {
st->print_cr("Current thread is native thread");
}
st->cr();
}
STEP("printing current compile task")
if (_verbose && _thread && _thread->is_Compiler_thread()) {
CompilerThread* t = (CompilerThread*)_thread;
if (t->task()) {
st->cr();
st->print_cr("Current CompileTask:");
t->task()->print_line_on_error(st, buf, sizeof(buf));
st->cr();
}
}
STEP("printing stack bounds")
if (_verbose) {
st->print("Stack: ");
address stack_top;
size_t stack_size;
if (_thread) {
stack_top = _thread->stack_base();
stack_size = _thread->stack_size();
} else {
stack_top = os::current_stack_base();
stack_size = os::current_stack_size();
}
address stack_bottom = stack_top - stack_size;
st->print("[" PTR_FORMAT "," PTR_FORMAT "]", p2i(stack_bottom), p2i(stack_top));
frame fr = _context ? os::fetch_frame_from_context(_context)
: os::current_frame();
if (fr.sp()) {
示例7: NMethodMarker
NMethodMarker(nmethod* nm) {
_thread = CompilerThread::current();
_thread->set_scanned_nmethod(nm);
}
示例8:
~NMethodMarker() {
_thread->set_scanned_nmethod(NULL);
}