Skip to content

Commit

Permalink
8314220: Configurable InlineCacheBuffer size
Browse files Browse the repository at this point in the history
Reviewed-by: phh
Backport-of: a40d8d97e84d88d1a65aba81bfc09339be95e427
  • Loading branch information
Ekaterina Vergizova committed Mar 11, 2024
1 parent e6cec8f commit c8ca55b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/hotspot/share/code/icBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void InlineCacheBuffer::init_next_stub() {

void InlineCacheBuffer::initialize() {
if (_buffer != NULL) return; // already initialized
_buffer = new StubQueue(new ICStubInterface, 10*K, InlineCacheBuffer_lock, "InlineCacheBuffer");
_buffer = new StubQueue(new ICStubInterface, checked_cast<int>(InlineCacheBufferSize), InlineCacheBuffer_lock, "InlineCacheBuffer");
assert (_buffer != NULL, "cannot allocate InlineCacheBuffer");
init_next_stub();
}
Expand Down
2 changes: 0 additions & 2 deletions src/hotspot/share/code/stubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,6 @@ void StubQueue::verify() {
guarantee(0 <= _queue_begin && _queue_begin < _buffer_limit, "_queue_begin out of bounds");
guarantee(0 <= _queue_end && _queue_end <= _buffer_limit, "_queue_end out of bounds");
// verify alignment
guarantee(_buffer_size % CodeEntryAlignment == 0, "_buffer_size not aligned");
guarantee(_buffer_limit % CodeEntryAlignment == 0, "_buffer_limit not aligned");
guarantee(_queue_begin % CodeEntryAlignment == 0, "_queue_begin not aligned");
guarantee(_queue_end % CodeEntryAlignment == 0, "_queue_end not aligned");
// verify buffer limit/size relationship
Expand Down
5 changes: 5 additions & 0 deletions src/hotspot/share/compiler/compilerDefinitions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,11 @@ bool CompilerConfig::check_args_consistency(bool status) {
"Invalid NonNMethodCodeHeapSize=%dK. Must be at least %uK.\n", NonNMethodCodeHeapSize/K,
min_code_cache_size/K);
status = false;
} else if (InlineCacheBufferSize > NonNMethodCodeHeapSize / 2) {
jio_fprintf(defaultStream::error_stream(),
"Invalid InlineCacheBufferSize=" SIZE_FORMAT "K. Must be less than or equal to " SIZE_FORMAT "K.\n",
InlineCacheBufferSize/K, NonNMethodCodeHeapSize/2/K);
status = false;
}

#ifdef _LP64
Expand Down
3 changes: 3 additions & 0 deletions src/hotspot/share/runtime/globals.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,9 @@ define_pd_global(uint64_t,MaxRAM, 1ULL*G);
product(bool, UseInlineCaches, true, \
"Use Inline Caches for virtual calls ") \
\
experimental(size_t, InlineCacheBufferSize, 10*K, \
"InlineCacheBuffer size") \
\
diagnostic(bool, InlineArrayCopy, true, \
"Inline arraycopy native that is known to be part of " \
"base library DLL") \
Expand Down

1 comment on commit c8ca55b

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.