1462 } 1463 method->set_not_compilable("excluded by CompileCommand", comp_level, !quietly); 1464 } 1465 1466 return false; 1467 } 1468 1469 /** 1470 * Generate serialized IDs for compilation requests. If certain debugging flags are used 1471 * and the ID is not within the specified range, the method is not compiled and 0 is returned. 1472 * The function also allows to generate separate compilation IDs for OSR compilations. 1473 */ 1474 int CompileBroker::assign_compile_id(const methodHandle& method, int osr_bci) { 1475 #ifdef ASSERT 1476 bool is_osr = (osr_bci != standard_entry_bci); 1477 int id; 1478 if (method->is_native()) { 1479 assert(!is_osr, "can't be osr"); 1480 // Adapters, native wrappers and method handle intrinsics 1481 // should be generated always. 1482 return Atomic::add(1, &_compilation_id); 1483 } else if (CICountOSR && is_osr) { 1484 id = Atomic::add(1, &_osr_compilation_id); 1485 if (CIStartOSR <= id && id < CIStopOSR) { 1486 return id; 1487 } 1488 } else { 1489 id = Atomic::add(1, &_compilation_id); 1490 if (CIStart <= id && id < CIStop) { 1491 return id; 1492 } 1493 } 1494 1495 // Method was not in the appropriate compilation range. 1496 method->set_not_compilable_quietly("Not in requested compile id range"); 1497 return 0; 1498 #else 1499 // CICountOSR is a develop flag and set to 'false' by default. In a product built, 1500 // only _compilation_id is incremented. 1501 return Atomic::add(1, &_compilation_id); 1502 #endif 1503 } 1504 1505 // ------------------------------------------------------------------ 1506 // CompileBroker::assign_compile_id_unlocked 1507 // 1508 // Public wrapper for assign_compile_id that acquires the needed locks 1509 uint CompileBroker::assign_compile_id_unlocked(Thread* thread, const methodHandle& method, int osr_bci) { 1510 MutexLocker locker(MethodCompileQueue_lock, thread); 1511 return assign_compile_id(method, osr_bci); 1512 } 1513 1514 // ------------------------------------------------------------------ 1515 // CompileBroker::create_compile_task 1516 // 1517 // Create a CompileTask object representing the current request for 1518 // compilation. Add this task to the queue. 1519 CompileTask* CompileBroker::create_compile_task(CompileQueue* queue, 1520 int compile_id, 1521 const methodHandle& method, | 1462 } 1463 method->set_not_compilable("excluded by CompileCommand", comp_level, !quietly); 1464 } 1465 1466 return false; 1467 } 1468 1469 /** 1470 * Generate serialized IDs for compilation requests. If certain debugging flags are used 1471 * and the ID is not within the specified range, the method is not compiled and 0 is returned. 1472 * The function also allows to generate separate compilation IDs for OSR compilations. 1473 */ 1474 int CompileBroker::assign_compile_id(const methodHandle& method, int osr_bci) { 1475 #ifdef ASSERT 1476 bool is_osr = (osr_bci != standard_entry_bci); 1477 int id; 1478 if (method->is_native()) { 1479 assert(!is_osr, "can't be osr"); 1480 // Adapters, native wrappers and method handle intrinsics 1481 // should be generated always. 1482 return Atomic::add(&_compilation_id, 1); 1483 } else if (CICountOSR && is_osr) { 1484 id = Atomic::add(&_osr_compilation_id, 1); 1485 if (CIStartOSR <= id && id < CIStopOSR) { 1486 return id; 1487 } 1488 } else { 1489 id = Atomic::add(&_compilation_id, 1); 1490 if (CIStart <= id && id < CIStop) { 1491 return id; 1492 } 1493 } 1494 1495 // Method was not in the appropriate compilation range. 1496 method->set_not_compilable_quietly("Not in requested compile id range"); 1497 return 0; 1498 #else 1499 // CICountOSR is a develop flag and set to 'false' by default. In a product built, 1500 // only _compilation_id is incremented. 1501 return Atomic::add(&_compilation_id, 1); 1502 #endif 1503 } 1504 1505 // ------------------------------------------------------------------ 1506 // CompileBroker::assign_compile_id_unlocked 1507 // 1508 // Public wrapper for assign_compile_id that acquires the needed locks 1509 uint CompileBroker::assign_compile_id_unlocked(Thread* thread, const methodHandle& method, int osr_bci) { 1510 MutexLocker locker(MethodCompileQueue_lock, thread); 1511 return assign_compile_id(method, osr_bci); 1512 } 1513 1514 // ------------------------------------------------------------------ 1515 // CompileBroker::create_compile_task 1516 // 1517 // Create a CompileTask object representing the current request for 1518 // compilation. Add this task to the queue. 1519 CompileTask* CompileBroker::create_compile_task(CompileQueue* queue, 1520 int compile_id, 1521 const methodHandle& method, |