Skip to content

Commit c595a8d

Browse files
committed
Use separate constants for native invoker code size
1 parent 830c5ce commit c595a8d

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

src/hotspot/cpu/aarch64/universalNativeInvoker_aarch64.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
#include "runtime/interfaceSupport.inline.hpp"
3535
#include "runtime/javaCalls.hpp"
3636

37+
static constexpr CodeBuffer::csize_t native_invoker_size = 1024;
38+
3739
static void generate_invoke_native(MacroAssembler* _masm,
3840
const ABIDescriptor& abi,
3941
const BufferLayout& layout) {
@@ -152,7 +154,7 @@ jlong ProgrammableInvoker::generate_adapter(JNIEnv* env, jobject jabi, jobject j
152154
const ABIDescriptor abi = parseABIDescriptor(env, jabi);
153155
const BufferLayout layout = parseBufferLayout(env, jlayout);
154156

155-
BufferBlob* _invoke_native_blob = BufferBlob::create("invoke_native_blob", MethodHandles::adapter_code_size);
157+
BufferBlob* _invoke_native_blob = BufferBlob::create("invoke_native_blob", native_invoker_size);
156158

157159
CodeBuffer code2(_invoke_native_blob);
158160
ProgrammableInvokerGenerator g2(&code2, &abi, &layout);

src/hotspot/cpu/aarch64/universalUpcallHandler_aarch64.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
#include "runtime/javaCalls.hpp"
3939
#include "runtime/jniHandles.inline.hpp"
4040

41+
static constexpr CodeBuffer::csize_t upcall_stub_size = 1024;
42+
4143
extern struct JavaVM_ main_vm;
4244

4345
static struct {
@@ -121,7 +123,7 @@ static void upcall_helper(jobject rec, address buff) {
121123
static address generate_upcall_stub(jobject rec, const ABIDescriptor& abi,
122124
const BufferLayout& layout) {
123125
ResourceMark rm;
124-
CodeBuffer buffer("upcall_stub", 1024, 1024);
126+
CodeBuffer buffer("upcall_stub", 1024, upcall_stub_size);
125127

126128
MacroAssembler* _masm = new MacroAssembler(&buffer);
127129

src/hotspot/cpu/x86/universalNativeInvoker_x86.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
#include "runtime/jniHandles.inline.hpp"
3939
#include "prims/methodHandles.hpp"
4040

41+
static constexpr CodeBuffer::csize_t native_invoker_size = 1024;
42+
4143
void generate_invoke_native(MacroAssembler* _masm, const ABIDescriptor& abi, const BufferLayout& layout) {
4244

4345
#if 0
@@ -190,7 +192,7 @@ jlong ProgrammableInvoker::generate_adapter(JNIEnv* env, jobject jabi, jobject j
190192
const ABIDescriptor abi = parseABIDescriptor(env, jabi);
191193
const BufferLayout layout = parseBufferLayout(env, jlayout);
192194

193-
BufferBlob* _invoke_native_blob = BufferBlob::create("invoke_native_blob", MethodHandles::adapter_code_size);
195+
BufferBlob* _invoke_native_blob = BufferBlob::create("invoke_native_blob", native_invoker_size);
194196

195197
CodeBuffer code2(_invoke_native_blob);
196198
ProgrammableInvokerGenerator g2(&code2, &abi, &layout);

src/hotspot/cpu/x86/universalUpcallHandler_x86.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
#include "runtime/jniHandles.inline.hpp"
4040
#include "classfile/symbolTable.hpp"
4141

42+
static constexpr CodeBuffer::csize_t upcall_stub_size = 1024;
43+
4244
extern struct JavaVM_ main_vm;
4345

4446
static struct {
@@ -119,7 +121,7 @@ static void upcall_helper(jobject rec, address buff) {
119121

120122
static address generate_upcall_stub(jobject rec, const ABIDescriptor& abi, const BufferLayout& layout) {
121123
ResourceMark rm;
122-
CodeBuffer buffer("upcall_stub", 1024, 1024);
124+
CodeBuffer buffer("upcall_stub", 1024, upcall_stub_size);
123125

124126
MacroAssembler* _masm = new MacroAssembler(&buffer);
125127
int stack_alignment_C = 16; // bytes

0 commit comments

Comments
 (0)