@@ -236,7 +236,7 @@ CompileTaskWrapper::~CompileTaskWrapper() {
236
236
#if INCLUDE_JVMCI
237
237
if (CompileBroker::compiler (task->comp_level ())->is_jvmci ()) {
238
238
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.
240
240
free_task = true ;
241
241
}
242
242
task->set_blocking_jvmci_compile_state (nullptr );
@@ -249,15 +249,15 @@ CompileTaskWrapper::~CompileTaskWrapper() {
249
249
}
250
250
}
251
251
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;
254
254
}
255
255
} else {
256
256
task->mark_complete ();
257
257
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;
261
261
}
262
262
}
263
263
@@ -360,12 +360,12 @@ void CompileQueue::add(CompileTask* task) {
360
360
}
361
361
362
362
/* *
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
366
366
* compilation is disabled.
367
367
*/
368
- void CompileQueue::free_all () {
368
+ void CompileQueue::delete_all () {
369
369
MutexLocker mu (MethodCompileQueue_lock);
370
370
CompileTask* next = _first;
371
371
@@ -385,11 +385,10 @@ void CompileQueue::free_all() {
385
385
}
386
386
}
387
387
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;
393
392
}
394
393
}
395
394
_first = nullptr ;
@@ -1627,10 +1626,8 @@ CompileTask* CompileBroker::create_compile_task(CompileQueue* queue,
1627
1626
int hot_count,
1628
1627
CompileTask::CompileReason compile_reason,
1629
1628
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);
1634
1631
queue->add (new_task);
1635
1632
return new_task;
1636
1633
}
@@ -1651,7 +1648,7 @@ static const int JVMCI_COMPILATION_PROGRESS_WAIT_ATTEMPTS = 10;
1651
1648
* JVMCI_COMPILATION_PROGRESS_WAIT_TIMESLICE *
1652
1649
* JVMCI_COMPILATION_PROGRESS_WAIT_ATTEMPTS.
1653
1650
*
1654
- * @return true if this thread needs to free/recycle the task
1651
+ * @return true if this thread needs to delete the task
1655
1652
*/
1656
1653
bool CompileBroker::wait_for_jvmci_completion (JVMCICompiler* jvmci, CompileTask* task, JavaThread* thread) {
1657
1654
assert (UseJVMCICompiler, " sanity" );
@@ -1734,19 +1731,19 @@ void CompileBroker::wait_for_completion(CompileTask* task) {
1734
1731
1735
1732
if (free_task) {
1736
1733
if (is_compilation_disabled_forever ()) {
1737
- CompileTask::free ( task) ;
1734
+ delete task;
1738
1735
return ;
1739
1736
}
1740
1737
1741
1738
// 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 ).
1743
1740
assert (task->is_complete (), " Compilation should have completed" );
1744
1741
1745
- // By convention, the waiter is responsible for recycling a
1742
+ // By convention, the waiter is responsible for deleting a
1746
1743
// blocking CompileTask. Since there is only one waiter ever
1747
1744
// 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;
1750
1747
}
1751
1748
}
1752
1749
@@ -1827,11 +1824,11 @@ void CompileBroker::shutdown_compiler_runtime(AbstractCompiler* comp, CompilerTh
1827
1824
1828
1825
// Delete all queued compilation tasks to make compiler threads exit faster.
1829
1826
if (_c1_compile_queue != nullptr ) {
1830
- _c1_compile_queue->free_all ();
1827
+ _c1_compile_queue->delete_all ();
1831
1828
}
1832
1829
1833
1830
if (_c2_compile_queue != nullptr ) {
1834
- _c2_compile_queue->free_all ();
1831
+ _c2_compile_queue->delete_all ();
1835
1832
}
1836
1833
1837
1834
// Set flags so that we continue execution with using interpreter only.
0 commit comments