@@ -236,7 +236,7 @@ CompileTaskWrapper::~CompileTaskWrapper() {
236236#if INCLUDE_JVMCI
237237 if (CompileBroker::compiler (task->comp_level ())->is_jvmci ()) {
238238 if (!task->has_waiter ()) {
239- // The waiting thread timed out and thus did not free the task.
239+ // The waiting thread timed out and thus did not delete the task.
240240 free_task = true ;
241241 }
242242 task->set_blocking_jvmci_compile_state (nullptr );
@@ -249,15 +249,15 @@ CompileTaskWrapper::~CompileTaskWrapper() {
249249 }
250250 }
251251 if (free_task) {
252- // The task can only be freed once the task lock is released.
253- CompileTask::free ( task) ;
252+ // The task can only be deleted once the task lock is released.
253+ delete task;
254254 }
255255 } else {
256256 task->mark_complete ();
257257
258- // By convention, the compiling thread is responsible for
259- // recycling a non-blocking CompileTask.
260- CompileTask::free ( task) ;
258+ // By convention, the compiling thread is responsible for deleting
259+ // a non-blocking CompileTask.
260+ delete task;
261261 }
262262}
263263
@@ -360,12 +360,12 @@ void CompileQueue::add(CompileTask* task) {
360360}
361361
362362/* *
363- * Empties compilation queue by putting all compilation tasks onto
364- * a freelist. Furthermore, the method wakes up all threads that are
365- * waiting on a compilation task to finish. This can happen if background
363+ * Empties compilation queue by deleting all compilation tasks.
364+ * Furthermore, the method wakes up all threads that are waiting
365+ * on a compilation task to finish. This can happen if background
366366 * compilation is disabled.
367367 */
368- void CompileQueue::free_all () {
368+ void CompileQueue::delete_all () {
369369 MutexLocker mu (MethodCompileQueue_lock);
370370 CompileTask* next = _first;
371371
@@ -385,11 +385,10 @@ void CompileQueue::free_all() {
385385 }
386386 }
387387 if (!found_waiter) {
388- // If no one was waiting for this task, we need to free it ourselves. In this case, the task
389- // is also certainly unlocked, because, again, there is no waiter.
390- // Otherwise, by convention, it's the waiters responsibility to free the task.
391- // Put the task back on the freelist.
392- CompileTask::free (current);
388+ // If no one was waiting for this task, we need to delete it ourselves.
389+ // In this case, the task is also certainly unlocked, because, again, there is no waiter.
390+ // Otherwise, by convention, it's the waiters responsibility to delete the task.
391+ delete current;
393392 }
394393 }
395394 _first = nullptr ;
@@ -1627,10 +1626,8 @@ CompileTask* CompileBroker::create_compile_task(CompileQueue* queue,
16271626 int hot_count,
16281627 CompileTask::CompileReason compile_reason,
16291628 bool blocking) {
1630- CompileTask* new_task = CompileTask::allocate ();
1631- new_task->initialize (compile_id, method, osr_bci, comp_level,
1632- hot_count, compile_reason,
1633- blocking);
1629+ CompileTask* new_task = new CompileTask (compile_id, method, osr_bci, comp_level,
1630+ hot_count, compile_reason, blocking);
16341631 queue->add (new_task);
16351632 return new_task;
16361633}
@@ -1651,7 +1648,7 @@ static const int JVMCI_COMPILATION_PROGRESS_WAIT_ATTEMPTS = 10;
16511648 * JVMCI_COMPILATION_PROGRESS_WAIT_TIMESLICE *
16521649 * JVMCI_COMPILATION_PROGRESS_WAIT_ATTEMPTS.
16531650 *
1654- * @return true if this thread needs to free/recycle the task
1651+ * @return true if this thread needs to delete the task
16551652 */
16561653bool CompileBroker::wait_for_jvmci_completion (JVMCICompiler* jvmci, CompileTask* task, JavaThread* thread) {
16571654 assert (UseJVMCICompiler, " sanity" );
@@ -1734,19 +1731,19 @@ void CompileBroker::wait_for_completion(CompileTask* task) {
17341731
17351732 if (free_task) {
17361733 if (is_compilation_disabled_forever ()) {
1737- CompileTask::free ( task) ;
1734+ delete task;
17381735 return ;
17391736 }
17401737
17411738 // It is harmless to check this status without the lock, because
1742- // completion is a stable property (until the task object is recycled ).
1739+ // completion is a stable property (until the task object is deleted ).
17431740 assert (task->is_complete (), " Compilation should have completed" );
17441741
1745- // By convention, the waiter is responsible for recycling a
1742+ // By convention, the waiter is responsible for deleting a
17461743 // blocking CompileTask. Since there is only one waiter ever
17471744 // waiting on a CompileTask, we know that no one else will
1748- // be using this CompileTask; we can free it.
1749- CompileTask::free ( task) ;
1745+ // be using this CompileTask; we can delete it.
1746+ delete task;
17501747 }
17511748}
17521749
@@ -1827,11 +1824,11 @@ void CompileBroker::shutdown_compiler_runtime(AbstractCompiler* comp, CompilerTh
18271824
18281825 // Delete all queued compilation tasks to make compiler threads exit faster.
18291826 if (_c1_compile_queue != nullptr ) {
1830- _c1_compile_queue->free_all ();
1827+ _c1_compile_queue->delete_all ();
18311828 }
18321829
18331830 if (_c2_compile_queue != nullptr ) {
1834- _c2_compile_queue->free_all ();
1831+ _c2_compile_queue->delete_all ();
18351832 }
18361833
18371834 // Set flags so that we continue execution with using interpreter only.
0 commit comments