Skip to content

Commit 034b5bd

Browse files
author
Datadog Syncup Service
committed
Merge branch 'upstream-master'
2 parents 2ddc616 + deeb09a commit 034b5bd

File tree

18 files changed

+554
-87
lines changed

18 files changed

+554
-87
lines changed

src/hotspot/cpu/x86/downcallLinker_x86_64.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434

3535
#define __ _masm->
3636

37-
static const int native_invoker_code_base_size = 512;
38-
static const int native_invoker_size_per_arg = 8;
37+
static const int native_invoker_code_base_size = 256;
38+
static const int native_invoker_size_per_arg = 16;
3939

4040
RuntimeStub* DowncallLinker::make_downcall_stub(BasicType* signature,
4141
int num_args,

src/hotspot/share/code/codeBlob.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,7 @@ class UpcallLinker;
595595

596596
// A (Panama) upcall stub. Not used by JNI.
597597
class UpcallStub: public RuntimeBlob {
598+
friend class VMStructs;
598599
friend class UpcallLinker;
599600
private:
600601
jobject _receiver;

src/hotspot/share/runtime/vmStructs.cpp

+12-1
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,12 @@
563563
\
564564
nonstatic_field(DeoptimizationBlob, _unpack_offset, int) \
565565
\
566+
/*****************************************************/ \
567+
/* UpcallStubs (NOTE: incomplete, but only a little) */ \
568+
/*****************************************************/ \
569+
\
570+
nonstatic_field(UpcallStub, _frame_data_offset, ByteSize) \
571+
\
566572
/**************************************************/ \
567573
/* NMethods (NOTE: incomplete, but only a little) */ \
568574
/**************************************************/ \
@@ -1012,7 +1018,9 @@
10121018
nonstatic_field(AccessFlags, _flags, jint) \
10131019
nonstatic_field(elapsedTimer, _counter, jlong) \
10141020
nonstatic_field(elapsedTimer, _active, bool) \
1015-
nonstatic_field(InvocationCounter, _counter, unsigned int)
1021+
nonstatic_field(InvocationCounter, _counter, unsigned int) \
1022+
\
1023+
nonstatic_field(UpcallStub::FrameData, jfa, JavaFrameAnchor)
10161024

10171025
//--------------------------------------------------------------------------------
10181026
// VM_TYPES
@@ -1306,6 +1314,7 @@
13061314
declare_type(nmethod, CodeBlob) \
13071315
declare_type(RuntimeStub, RuntimeBlob) \
13081316
declare_type(SingletonBlob, RuntimeBlob) \
1317+
declare_type(UpcallStub, RuntimeBlob) \
13091318
declare_type(SafepointBlob, SingletonBlob) \
13101319
declare_type(DeoptimizationBlob, SingletonBlob) \
13111320
declare_c2_type(ExceptionBlob, SingletonBlob) \
@@ -1900,6 +1909,7 @@
19001909
declare_integer_type(BasicType) /* FIXME: wrong type (not integer) */ \
19011910
\
19021911
declare_integer_type(CompLevel) \
1912+
declare_integer_type(ByteSize) \
19031913
JVMTI_ONLY(declare_toplevel_type(BreakpointInfo)) \
19041914
JVMTI_ONLY(declare_toplevel_type(BreakpointInfo*)) \
19051915
declare_toplevel_type(CodeBlob*) \
@@ -1948,6 +1958,7 @@
19481958
declare_type(FileMapInfo, CHeapObj<mtInternal>) \
19491959
declare_toplevel_type(FileMapHeader) \
19501960
declare_toplevel_type(CDSFileMapRegion) \
1961+
declare_toplevel_type(UpcallStub::FrameData) \
19511962
\
19521963
/************/ \
19531964
/* GC types */ \

src/java.base/share/classes/java/lang/System.java

+4
Original file line numberDiff line numberDiff line change
@@ -2642,6 +2642,10 @@ public Object stringConcat1(String[] constants) {
26422642
return new StringConcatHelper.Concat1(constants);
26432643
}
26442644

2645+
public byte stringInitCoder() {
2646+
return String.COMPACT_STRINGS ? String.LATIN1 : String.UTF16;
2647+
}
2648+
26452649
public int getCharsLatin1(long i, int index, byte[] buf) {
26462650
return StringLatin1.getChars(i, index, buf);
26472651
}

src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -1196,9 +1196,14 @@ private static MethodTypeDesc prependArgs(MethodType concatArgs) {
11961196

11971197
/**
11981198
* Construct the MethodType of the coder method. The first parameter is the initialized coder.
1199-
* Only parameter types which can be UTF16 are added. Returns null if no such parameter exists.
1199+
* Only parameter types which can be UTF16 are added.
1200+
* Returns null if no such parameter exists or CompactStrings is off.
12001201
*/
12011202
private static MethodTypeDesc coderArgsIfMaybeUTF16(MethodType concatArgs) {
1203+
if (JLA.stringInitCoder() != 0) {
1204+
return null;
1205+
}
1206+
12021207
int parameterCount = concatArgs.parameterCount();
12031208

12041209
int maybeUTF16Count = 0;

src/java.base/share/classes/jdk/internal/access/JavaLangAccess.java

+5
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,11 @@ public interface JavaLangAccess {
459459

460460
Object stringConcat1(String[] constants);
461461

462+
/**
463+
* Get the string initial coder, When COMPACT_STRINGS is on, it returns 0, and when it is off, it returns 1.
464+
*/
465+
byte stringInitCoder();
466+
462467
/**
463468
* Join strings
464469
*/

0 commit comments

Comments
 (0)