Skip to content

Commit

Permalink
Merge branch 'upstream-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Datadog Syncup Service committed Sep 7, 2024
2 parents 2ddc616 + deeb09a commit 034b5bd
Show file tree
Hide file tree
Showing 18 changed files with 554 additions and 87 deletions.
4 changes: 2 additions & 2 deletions src/hotspot/cpu/x86/downcallLinker_x86_64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@

#define __ _masm->

static const int native_invoker_code_base_size = 512;
static const int native_invoker_size_per_arg = 8;
static const int native_invoker_code_base_size = 256;
static const int native_invoker_size_per_arg = 16;

RuntimeStub* DowncallLinker::make_downcall_stub(BasicType* signature,
int num_args,
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/code/codeBlob.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@ class UpcallLinker;

// A (Panama) upcall stub. Not used by JNI.
class UpcallStub: public RuntimeBlob {
friend class VMStructs;
friend class UpcallLinker;
private:
jobject _receiver;
Expand Down
13 changes: 12 additions & 1 deletion src/hotspot/share/runtime/vmStructs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,12 @@
\
nonstatic_field(DeoptimizationBlob, _unpack_offset, int) \
\
/*****************************************************/ \
/* UpcallStubs (NOTE: incomplete, but only a little) */ \
/*****************************************************/ \
\
nonstatic_field(UpcallStub, _frame_data_offset, ByteSize) \
\
/**************************************************/ \
/* NMethods (NOTE: incomplete, but only a little) */ \
/**************************************************/ \
Expand Down Expand Up @@ -1012,7 +1018,9 @@
nonstatic_field(AccessFlags, _flags, jint) \
nonstatic_field(elapsedTimer, _counter, jlong) \
nonstatic_field(elapsedTimer, _active, bool) \
nonstatic_field(InvocationCounter, _counter, unsigned int)
nonstatic_field(InvocationCounter, _counter, unsigned int) \
\
nonstatic_field(UpcallStub::FrameData, jfa, JavaFrameAnchor)

//--------------------------------------------------------------------------------
// VM_TYPES
Expand Down Expand Up @@ -1306,6 +1314,7 @@
declare_type(nmethod, CodeBlob) \
declare_type(RuntimeStub, RuntimeBlob) \
declare_type(SingletonBlob, RuntimeBlob) \
declare_type(UpcallStub, RuntimeBlob) \
declare_type(SafepointBlob, SingletonBlob) \
declare_type(DeoptimizationBlob, SingletonBlob) \
declare_c2_type(ExceptionBlob, SingletonBlob) \
Expand Down Expand Up @@ -1900,6 +1909,7 @@
declare_integer_type(BasicType) /* FIXME: wrong type (not integer) */ \
\
declare_integer_type(CompLevel) \
declare_integer_type(ByteSize) \
JVMTI_ONLY(declare_toplevel_type(BreakpointInfo)) \
JVMTI_ONLY(declare_toplevel_type(BreakpointInfo*)) \
declare_toplevel_type(CodeBlob*) \
Expand Down Expand Up @@ -1948,6 +1958,7 @@
declare_type(FileMapInfo, CHeapObj<mtInternal>) \
declare_toplevel_type(FileMapHeader) \
declare_toplevel_type(CDSFileMapRegion) \
declare_toplevel_type(UpcallStub::FrameData) \
\
/************/ \
/* GC types */ \
Expand Down
4 changes: 4 additions & 0 deletions src/java.base/share/classes/java/lang/System.java
Original file line number Diff line number Diff line change
Expand Up @@ -2642,6 +2642,10 @@ public Object stringConcat1(String[] constants) {
return new StringConcatHelper.Concat1(constants);
}

public byte stringInitCoder() {
return String.COMPACT_STRINGS ? String.LATIN1 : String.UTF16;
}

public int getCharsLatin1(long i, int index, byte[] buf) {
return StringLatin1.getChars(i, index, buf);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1196,9 +1196,14 @@ private static MethodTypeDesc prependArgs(MethodType concatArgs) {

/**
* Construct the MethodType of the coder method. The first parameter is the initialized coder.
* Only parameter types which can be UTF16 are added. Returns null if no such parameter exists.
* Only parameter types which can be UTF16 are added.
* Returns null if no such parameter exists or CompactStrings is off.
*/
private static MethodTypeDesc coderArgsIfMaybeUTF16(MethodType concatArgs) {
if (JLA.stringInitCoder() != 0) {
return null;
}

int parameterCount = concatArgs.parameterCount();

int maybeUTF16Count = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,11 @@ public interface JavaLangAccess {

Object stringConcat1(String[] constants);

/**
* Get the string initial coder, When COMPACT_STRINGS is on, it returns 0, and when it is off, it returns 1.
*/
byte stringInitCoder();

/**
* Join strings
*/
Expand Down
Loading

0 comments on commit 034b5bd

Please sign in to comment.