From 51e2dde018746f419922ae40cd039cd6f27f1b75 Mon Sep 17 00:00:00 2001 From: Robbin Ehn Date: Wed, 21 Feb 2024 14:33:29 +0000 Subject: [PATCH] 8326235: RISC-V: Size CodeCache for short calls encoding Reviewed-by: fyang, tonyp --- src/hotspot/cpu/riscv/globalDefinitions_riscv.hpp | 3 +++ src/hotspot/share/utilities/globalDefinitions.hpp | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/hotspot/cpu/riscv/globalDefinitions_riscv.hpp b/src/hotspot/cpu/riscv/globalDefinitions_riscv.hpp index e368bbdc914..68cd51ece5f 100644 --- a/src/hotspot/cpu/riscv/globalDefinitions_riscv.hpp +++ b/src/hotspot/cpu/riscv/globalDefinitions_riscv.hpp @@ -50,6 +50,9 @@ const bool CCallingConventionRequiresIntsAsLongs = false; #define USE_POINTERS_TO_REGISTER_IMPL_ARRAY +// auipc useable for all cc -> cc calls and jumps +#define CODE_CACHE_SIZE_LIMIT ((2*G)-(2*K)) + // The expected size in bytes of a cache line. #define DEFAULT_CACHE_LINE_SIZE 64 diff --git a/src/hotspot/share/utilities/globalDefinitions.hpp b/src/hotspot/share/utilities/globalDefinitions.hpp index 08eb2582870..c0f5b719666 100644 --- a/src/hotspot/share/utilities/globalDefinitions.hpp +++ b/src/hotspot/share/utilities/globalDefinitions.hpp @@ -581,13 +581,16 @@ extern uint64_t OopEncodingHeapMax; // Machine dependent stuff +#include CPU_HEADER(globalDefinitions) + // The maximum size of the code cache. Can be overridden by targets. +#ifndef CODE_CACHE_SIZE_LIMIT #define CODE_CACHE_SIZE_LIMIT (2*G) +#endif + // Allow targets to reduce the default size of the code cache. #define CODE_CACHE_DEFAULT_LIMIT CODE_CACHE_SIZE_LIMIT -#include CPU_HEADER(globalDefinitions) - // To assure the IRIW property on processors that are not multiple copy // atomic, sync instructions must be issued between volatile reads to // assure their ordering, instead of after volatile stores.