当前位置: 首页>>代码示例>>C++>>正文


C++ CompilerThread类代码示例

本文整理汇总了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);
    }
  }
}
开发者ID:gaoxiaojun,项目名称:dync,代码行数:13,代码来源:idealGraphPrinter.cpp

示例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);
}
开发者ID:Gilgamash099,项目名称:miniCode,代码行数:13,代码来源:CompilerThread.cpp

示例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();
    }
开发者ID:4T-Shirt,项目名称:OpenJDK-Research,代码行数:44,代码来源:fprofiler.cpp

示例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);
}
开发者ID:Gilgamash099,项目名称:miniCode,代码行数:20,代码来源:CompilerThread.cpp

示例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");
开发者ID:ihaolin,项目名称:build-your-jdk7,代码行数:67,代码来源:vmError.cpp

示例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()) {
开发者ID:netroby,项目名称:jdk9-dev,代码行数:67,代码来源:vmError.cpp

示例7: NMethodMarker

 NMethodMarker(nmethod* nm) {
   _thread = CompilerThread::current();
   _thread->set_scanned_nmethod(nm);
 }
开发者ID:sxhao,项目名称:codenameone-avian,代码行数:4,代码来源:sweeper.cpp

示例8:

 ~NMethodMarker() {
   _thread->set_scanned_nmethod(NULL);
 }
开发者ID:sxhao,项目名称:codenameone-avian,代码行数:3,代码来源:sweeper.cpp


注:本文中的CompilerThread类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。