Top


定義場所(file name)

hotspot/src/share/vm/compiler/compileBroker.cpp

説明(description)

// ------------------------------------------------------------------
// CompileBroker::init_compiler_threads
//
// Initialize the compilation queue

名前(function name)

void CompileBroker::init_compiler_threads(int c1_compiler_count, int c2_compiler_count) {

本体部(body)

  {- -------------------------------------------
  (1) EXCEPTION_MARK (See: ExceptionMark)
      ---------------------------------------- -}

      EXCEPTION_MARK;

  {- -------------------------------------------
  (1) (assert)
      ---------------------------------------- -}

    #if !defined(ZERO) && !defined(SHARK)
      assert(c2_compiler_count > 0 || c1_compiler_count > 0, "No compilers?");
    #endif // !ZERO && !SHARK

  {- -------------------------------------------
  (1) CompileQueue オブジェクトを生成し, フィールドに格納.
      ---------------------------------------- -}

      if (c2_compiler_count > 0) {
        _c2_method_queue  = new CompileQueue("C2MethodQueue",  MethodCompileQueue_lock);
      }
      if (c1_compiler_count > 0) {
        _c1_method_queue  = new CompileQueue("C1MethodQueue",  MethodCompileQueue_lock);
      }

  {- -------------------------------------------
  (1) (変数宣言など)
      ---------------------------------------- -}

      int compiler_count = c1_compiler_count + c2_compiler_count;

  {- -------------------------------------------
  (1) 
      ---------------------------------------- -}

      _method_threads =
        new (ResourceObj::C_HEAP) GrowableArray<CompilerThread*>(compiler_count, true);

  {- -------------------------------------------
  (1) (変数宣言など)
      ---------------------------------------- -}

      char name_buffer[256];

  {- -------------------------------------------
  (1) CompileBroker::make_compiler_thread() を呼んで, 
      CompilerThread を必要な数だけ生成する.
      ---------------------------------------- -}

      for (int i = 0; i < c2_compiler_count; i++) {
        // Create a name for our thread.
        sprintf(name_buffer, "C2 CompilerThread%d", i);
        CompilerCounters* counters = new CompilerCounters("compilerThread", i, CHECK);
        CompilerThread* new_thread = make_compiler_thread(name_buffer, _c2_method_queue, counters, CHECK);
        _method_threads->append(new_thread);
      }

      for (int i = c2_compiler_count; i < compiler_count; i++) {
        // Create a name for our thread.
        sprintf(name_buffer, "C1 CompilerThread%d", i);
        CompilerCounters* counters = new CompilerCounters("compilerThread", i, CHECK);
        CompilerThread* new_thread = make_compiler_thread(name_buffer, _c1_method_queue, counters, CHECK);
        _method_threads->append(new_thread);
      }

  {- -------------------------------------------
  (1) (プロファイル情報取得用の初期化処理) ("sun.ci.threads") (See: PerfTraceTime)
      ---------------------------------------- -}

      if (UsePerfData) {
        PerfDataManager::create_constant(SUN_CI, "threads", PerfData::U_Bytes,
                                         compiler_count, CHECK);
      }
    }

This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.