520 // |
520 // |
521 // Initialize the Compilation object |
521 // Initialize the Compilation object |
522 void CompileBroker::compilation_init() { |
522 void CompileBroker::compilation_init() { |
523 _last_method_compiled[0] = '\0'; |
523 _last_method_compiled[0] = '\0'; |
524 |
524 |
|
525 #ifndef SHARK |
525 // Set the interface to the current compiler(s). |
526 // Set the interface to the current compiler(s). |
526 int c1_count = CompilationPolicy::policy()->compiler_count(CompLevel_simple); |
527 int c1_count = CompilationPolicy::policy()->compiler_count(CompLevel_simple); |
527 int c2_count = CompilationPolicy::policy()->compiler_count(CompLevel_full_optimization); |
528 int c2_count = CompilationPolicy::policy()->compiler_count(CompLevel_full_optimization); |
528 #ifdef COMPILER1 |
529 #ifdef COMPILER1 |
529 if (c1_count > 0) { |
530 if (c1_count > 0) { |
535 if (c2_count > 0) { |
536 if (c2_count > 0) { |
536 _compilers[1] = new C2Compiler(); |
537 _compilers[1] = new C2Compiler(); |
537 } |
538 } |
538 #endif // COMPILER2 |
539 #endif // COMPILER2 |
539 |
540 |
540 #ifdef SHARK |
541 #else // SHARK |
541 #if defined(COMPILER1) || defined(COMPILER2) |
542 int c1_count = 0; |
542 #error "Can't use COMPILER1 or COMPILER2 with shark" |
543 int c2_count = 1; |
543 #endif |
544 |
544 _compilers[0] = new SharkCompiler(); |
545 _compilers[1] = new SharkCompiler(); |
545 _compilers[1] = _compilers[0]; |
546 #endif // SHARK |
546 #endif |
|
547 |
547 |
548 // Initialize the CompileTask free list |
548 // Initialize the CompileTask free list |
549 _task_free_list = NULL; |
549 _task_free_list = NULL; |
550 |
550 |
551 // Start the CompilerThreads |
551 // Start the CompilerThreads |