Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8143151

[JVMCI] assertion for allocation of "too many" CompileTasks must take JVMCI into account

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 9
    • hotspot
    • 9
    • b96

      Normally -Xcomp implies -Xbatch. However when a JVMCI compiler is in use, the CompileBroker has special logic to prevent blocking compilations from causing a deadlock between JVMCI compiler threads and other threads. Until they are themselves compiled, JVMCI compilers are slower than native compilers. This means the compilation queue can back up quickly and require more CompileTasks to be created. There's an assertion that the number of CompileTasks allocated never exceeds 10000 (see code below from compileTask.cpp). This assertion needs to be modified if a JVMCI compiler is in use.

      CompileTask* CompileTask::allocate() {
        MutexLocker locker(CompileTaskAlloc_lock);
        CompileTask* task = NULL;

        if (_task_free_list != NULL) {
          task = _task_free_list;
          _task_free_list = task->next();
          task->set_next(NULL);
        } else {
          task = new CompileTask();
          DEBUG_ONLY(_num_allocated_tasks++;)
          assert (WhiteBoxAPI || _num_allocated_tasks < 10000, "Leaking compilation tasks?");
          task->set_next(NULL);
          task->set_is_free(true);
        }
        assert(task->is_free(), "Task must be free.");
        task->set_is_free(false);
        return task;
      }

            dnsimon Douglas Simon
            dnsimon Douglas Simon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: