Look at this code in `Freeze<ConfigT>::allocate_chunk`:
```
StackChunkAllocator allocator(klass, size_in_words, stack_size, current);
oop fast_oop = allocator.try_allocate_in_existing_tlab();
```
...it calls:
```
oop MemAllocator::try_allocate_in_existing_tlab() {
oop obj = NULL;
{
HeapWord* mem = allocate_inside_tlab_fast();
...
}
return obj;
}
HeapWord* MemAllocator::allocate_inside_tlab_fast() const {
return _thread->tlab().allocate(_word_size);
}
```
...without checking for `UseTLAB`. If you reach to `_thread->tlab()` when TLABs are disabled, then you would get into the uncomfortable territory of dealing with uninitialized TLABs, because it initialization is predicated on `UseTLAB` itself:
```
void Thread::initialize_tlab() {
if (UseTLAB) {
tlab().initialize();
}
}
```
This also disallows quickly testing the allocation slowpaths in Loom code.
```
StackChunkAllocator allocator(klass, size_in_words, stack_size, current);
oop fast_oop = allocator.try_allocate_in_existing_tlab();
```
...it calls:
```
oop MemAllocator::try_allocate_in_existing_tlab() {
oop obj = NULL;
{
HeapWord* mem = allocate_inside_tlab_fast();
...
}
return obj;
}
HeapWord* MemAllocator::allocate_inside_tlab_fast() const {
return _thread->tlab().allocate(_word_size);
}
```
...without checking for `UseTLAB`. If you reach to `_thread->tlab()` when TLABs are disabled, then you would get into the uncomfortable territory of dealing with uninitialized TLABs, because it initialization is predicated on `UseTLAB` itself:
```
void Thread::initialize_tlab() {
if (UseTLAB) {
tlab().initialize();
}
}
```
This also disallows quickly testing the allocation slowpaths in Loom code.
- blocks
-
JDK-8297570 jdk/jfr/threading/TestDeepVirtualStackTrace.java fails with -XX:-UseTLAB
-
- Resolved
-