Compare commits

..

107 Commits

Author SHA1 Message Date
Alexander Zvegintsev
fe9f05023e 8322750: Test "api/java_awt/interactive/SystemTrayTests.html" failed because A blue ball icon is added outside of the system tray
Reviewed-by: prr
Backport-of: 5a988a5087
2024-02-15 22:10:56 +00:00
Per Minborg
6d9a50ea14 8325001: Typo in the javadocs for the Arena::ofShared method
Reviewed-by: mcimadamore
Backport-of: 6b84f9bb3e
2024-02-08 11:53:56 +00:00
Paul Sandoz
9cc260d3a1 8324858: [vectorapi] Bounds checking issues when accessing memory segments
Reviewed-by: shade
Backport-of: 1ae851387f
2024-02-07 19:58:59 +00:00
Doug Simon
d8dc7118fd 8324983: Race in CompileBroker::possibly_add_compiler_threads
Reviewed-by: kvn, never
Backport-of: 1993652653
2024-02-06 21:56:20 +00:00
Calvin Cheung
9a4d4ab101 8324041: ModuleOption.java failed with update release versioning scheme
Reviewed-by: dholmes
Backport-of: 39005e27d6
2024-02-06 15:53:54 +00:00
David Holmes
ac7a3c00bb 8322066: Update troff manpages in JDK 22 before RC
Reviewed-by: darcy, iris
2024-02-06 04:55:46 +00:00
Jesper Wilhelmsson
bff5e90359 8319547: Remove EA from the JDK 22 version string with first RC promotion
Reviewed-by: mikael
2024-02-06 00:20:40 +00:00
David Holmes
d2927cfa24 8307788: vmTestbase/gc/gctests/LargeObjects/large003/TestDescription.java timed out
Reviewed-by: pchilanomate
Backport-of: 929af9ed03
2024-02-02 00:46:10 +00:00
Calvin Cheung
ee4d54c500 8323950: Null CLD while loading shared lambda proxy class with javaagent active
Reviewed-by: dholmes
Backport-of: d51aaf6304
2024-02-01 23:34:47 +00:00
Sean Coffey
306e364ffd 8325096: Test java/security/cert/CertPathBuilder/akiExt/AKISerialNumber.java is failing
Reviewed-by: weijun
Backport-of: ac1cd31949
2024-02-01 14:11:00 +00:00
Calvin Cheung
4338cb3d70 8323556: CDS archive space addresses should be randomized with ArchiveRelocationMode=1
Reviewed-by: coleenp
Backport-of: 437342b93e
2024-01-26 20:11:12 +00:00
Christian Hagedorn
b7f38fc54f 8324688: C2: Disable ReduceAllocationMerges by default
Reviewed-by: thartmann, kvn
2024-01-26 14:25:49 +00:00
Goetz Lindenmaier
57bc96e5cd 8319128: sun/security/pkcs11 tests fail on OL 7.9 aarch64
Reviewed-by: lucy
Backport-of: c2e77e2f17
2024-01-25 09:03:18 +00:00
Aleksey Shipilev
23301d5776 8322282: Incorrect LoaderConstraintTable::add_entry after JDK-8298468
Reviewed-by: coleenp
Backport-of: bde650f21e
2024-01-22 16:02:33 +00:00
Anthony Scarpino
5a77c29032 8322100: Fix GCMIncrementByte4 & GCMIncrementDirect4, and increase overlap testing
Reviewed-by: jnimeh
Backport-of: 51dbd36c74
2024-01-18 22:07:53 +00:00
Daniel D. Daugherty
79c3d47cfe 8324082: more monitoring test timeout adjustments
Reviewed-by: ayang, kevinw
Backport-of: 806ffb1085
2024-01-18 15:41:00 +00:00
Daniel D. Daugherty
73c77d9624 8324074: increase timeout for jvmci test TestResolvedJavaMethod.java
Reviewed-by: ayang, thartmann
Backport-of: aeb304b29e
2024-01-18 15:40:50 +00:00
Daniel D. Daugherty
b178894423 8321938: java/foreign/critical/TestCriticalUpcall.java does not need a core file
Reviewed-by: ayang
Backport-of: a22ae909bc
2024-01-18 15:39:48 +00:00
Patricio Chilano Mateo
9c7cab5404 8323595: is_aligned(p, alignof(OopT))) assertion fails in Jetty without compressed OOPs
Reviewed-by: fparain
Backport-of: 52f787f675
2024-01-18 14:26:13 +00:00
Alexey Semenyuk
b5ed8cca77 8322799: Test JPKG003-013: ServiceTest fails because the user cannot uninstall the "servicetest" package on OEL 9.2 x64 and OEL 9.2 64-bit Arm (aarch64)
Reviewed-by: almatvee
Backport-of: 8e12053e03
2024-01-17 23:05:44 +00:00
Calvin Cheung
f9f7a27ffa 8322657: CDS filemap fastdebug assert while loading Graal CE Polyglot in isolated classloader
Reviewed-by: dholmes
Backport-of: 841ab487f8
2024-01-17 21:42:25 +00:00
Jim Laskey
60c68a1363 8322512: StringBuffer.repeat does not work correctly after toString() was called
Reviewed-by: prappo, redestad
Backport-of: df22fb322e
2024-01-17 20:02:26 +00:00
Tobias Hartmann
78150ca9df 8316756: C2 EA fails with "missing memory path" when encountering unsafe_arraycopy stub call
Reviewed-by: tholenstein
Backport-of: b89172149d
2024-01-17 12:21:24 +00:00
Per Minborg
887a93b7c9 8323159: Consider adding some text re. memory zeroing in Arena::allocate
8323745: Missing comma in copyright header in TestScope

Reviewed-by: mcimadamore, alanb
Backport-of: f5b757ced6
2024-01-17 10:35:43 +00:00
Emanuel Peter
eb2c4b0b83 8320175: [BACKOUT] 8316533: C2 compilation fails with assert(verify(phase)) failed: missing Value() optimization
Reviewed-by: thartmann
Backport-of: e01f6da1b8
2024-01-17 07:59:43 +00:00
Henry Jen
b2cc1890ff Merge
Reviewed-by: erikj
2024-01-17 01:41:13 +00:00
Calvin Cheung
f1802d5300 8321479: java -D-D crashes
Reviewed-by: dholmes
Backport-of: dcdcd48d8f
2024-01-17 01:22:03 +00:00
David Holmes
b40b18823b 8323243: JNI invocation of an abstract instance method corrupts the stack
Reviewed-by: iklam
Backport-of: 71d9a83dec
2024-01-17 00:37:26 +00:00
Chris Hegarty
c1ea6daa5b 8323659: LinkedTransferQueue add and put methods call overridable offer
Reviewed-by: alanb
Backport-of: ee4d9aa4c1
2024-01-16 23:56:29 +00:00
Justin Lu
b9a535b8ac 8322235: Split up and improve LocaleProvidersRun
Reviewed-by: naoto, iris
Backport-of: 4ea7b36447
2024-01-16 22:09:47 +00:00
Ferenc Rakoczi
c7f1c97312 8317547: Enhance TLS connection support
Reviewed-by: ahgross, rhalade, weijun, valeriep
2024-01-16 16:09:21 +00:00
Christian Hagedorn
7fc13bb537 8314307: Improve loop handling
Co-authored-by: Christian Hagedorn <chagedorn@openjdk.org>
Co-authored-by: Roland Westrelin <rwestrel@redhat.com>
Co-authored-by: Emanuel Peter <epeter@openjdk.org>
Reviewed-by: mschoene, rhalade, thartmann, epeter
2024-01-16 16:09:21 +00:00
Tobias Hartmann
175184cb18 8318588: Windows build failure after JDK-8314468 due to ambiguous call
Reviewed-by: epeter
2024-01-16 16:09:21 +00:00
Tobias Hartmann
dfea48b7f5 8314468: Improve Compiler loops
Co-authored-by: Dean Long <dlong@openjdk.org>
Reviewed-by: rhalade, mschoene, iveresov, kvn
2024-01-16 16:09:20 +00:00
Coleen Phillimore
83f0f841ee 8317331: Solaris build failed with "declaration can not follow a statement (E_DECLARATION_IN_CODE)"
Backport-of: 852276d1f833d49802693f2a5a82ba6eb2722de6
2024-01-16 16:09:20 +00:00
Coleen Phillimore
7586d8e43f 8314295: Enhance verification of verifier
Reviewed-by: mschoene, rhalade, dholmes, dlong
2024-01-16 16:09:20 +00:00
Sean Mullan
e5cb83cd74 8308204: Enhanced certificate processing
Reviewed-by: mschoene, rhalade, jnimeh
2024-01-16 16:09:20 +00:00
Jorn Vernee
247a4360f6 8323651: compiler/c2/irTests/TestPrunedExHandler.java fails with -XX:+DeoptimizeALot
Reviewed-by: thartmann
Backport-of: 2fd775f69c
2024-01-16 15:51:53 +00:00
Markus Grönlund
4799c8d40c 8323631: JfrTypeSet::write_klass can enqueue a CLD klass that is unloading
Reviewed-by: egahlin
Backport-of: e2d6023cb9
2024-01-16 15:18:49 +00:00
Thomas Schatzl
bb43aae61f 8322330: JavadocHelperTest.java OOMEs with Parallel GC and ZGC
Reviewed-by: ayang, sjohanss
Backport-of: 52c7ff1d81
2024-01-16 11:34:37 +00:00
Thomas Schatzl
4034787ccb 8322987: Remove gc/stress/gclocker/TestGCLocker* since they always fail with OOME
8323508: Remove TestGCLockerWithShenandoah.java line from TEST.groups

Reviewed-by: ayang, sjohanss
2024-01-16 11:32:55 +00:00
Stefan Karlsson
a91569dd20 8322957: Generational ZGC: Relocation selection must join the STS
Reviewed-by: aboldtch
Backport-of: ba23025cd8
2024-01-16 11:17:40 +00:00
Christian Hagedorn
9257505059 8323101: C2: assert(n->in(0) == nullptr) failed: divisions with zero check should already have bailed out earlier in split-if
Reviewed-by: thartmann
Backport-of: 7e0a4ed629
2024-01-16 10:34:00 +00:00
Alan Bateman
628e31b8c1 8322818: Thread::getStackTrace can fail with InternalError if virtual thread is timed-parked when pinned
8323002: test/jdk/java/lang/Thread/virtual/stress/GetStackTraceALotWhenPinned.java times out on macosx-x64
8323296: java/lang/Thread/virtual/stress/GetStackTraceALotWhenPinned.java#id1 timed out

Reviewed-by: jpai
Backport-of: 4db7a1c3bb
2024-01-16 08:19:42 +00:00
Alan Bateman
3017281956 8322846: Running with -Djdk.tracePinnedThreads set can hang
Reviewed-by: jpai
Backport-of: faa9c6909d
2024-01-16 08:19:22 +00:00
Christoph Langer
8db5d865c1 8323008: filter out harmful -std* flags added by autoconf from CXX
Reviewed-by: mdoerr
Backport-of: 68c4286026
2024-01-15 15:13:45 +00:00
Thomas Schatzl
ba96094128 8323610: G1: HeapRegion pin count should be size_t to avoid overflows
Reviewed-by: ayang
Backport-of: 8643cc2133
2024-01-15 12:05:33 +00:00
Alan Bateman
01f780fab2 8319757: java/nio/channels/DatagramChannel/InterruptibleOrNot.java failed: wrong exception thrown
Reviewed-by: jpai
Backport-of: ace010b38a
2024-01-13 16:00:58 +00:00
Sandhya Viswanathan
b0920c24cd 8321712: C2: "failed: Multiple uses of register" in C2_MacroAssembler::vminmax_fp
Reviewed-by: kvn, thartmann
Backport-of: e10d14004f
2024-01-12 16:59:06 +00:00
Per Minborg
3909d74af5 8321786: SegmentAllocator:allocateFrom(ValueLayout, MemorySegment,ValueLayout,long,long) spec mismatch in exception scenario
Reviewed-by: mcimadamore
Backport-of: 7edd10e5fa
2024-01-12 14:41:43 +00:00
Tobias Hartmann
d115295df8 8323190: Segfault during deoptimization of C2-compiled code
Reviewed-by: epeter
Backport-of: ed18222365
2024-01-12 12:42:36 +00:00
Serguei Spitsyn
71a05bf03f 8322538: remove fatal from JVM_VirtualThread functions for !INCLUDE_JVMTI
Reviewed-by: dholmes
Backport-of: aff659aaf7
2024-01-12 11:57:01 +00:00
Serguei Spitsyn
d3f18d0469 8321685: Missing ResourceMark in code called from JvmtiEnvBase::get_vthread_jvf
Reviewed-by: amenkov
Backport-of: 2806adee2d
2024-01-12 10:17:48 +00:00
Jan Lahoda
07a8911ce8 8322003: JShell - Incorrect type inference in lists of records implementing interfaces
Reviewed-by: vromero
Backport-of: 57a65fe436
2024-01-12 10:01:40 +00:00
Thomas Schatzl
749f749f04 8323066: gc/g1/TestSkipRebuildRemsetPhase.java fails with 'Skipping Remembered Set Rebuild.' missing
Reviewed-by: ayang
Backport-of: ee98d26218
2024-01-12 09:09:05 +00:00
David Holmes
6022e73d73 8322513: Build failure with minimal
Reviewed-by: bpb, jpai
Backport-of: 7db69e6a12
2024-01-12 02:14:16 +00:00
Joe Wang
46f1df38a0 8323571: Regression in source resolution process
Reviewed-by: naoto, iris
Backport-of: e4389d8dc2
2024-01-12 01:45:57 +00:00
Alex Menkov
3984a00ea9 8322237: Heap dump contains duplicate thread records for mounted virtual threads
Reviewed-by: sspitsyn
Backport-of: dd8ae61643
2024-01-11 21:12:31 +00:00
Weijun Wang
4ea14b2720 8322971: KEM.getInstance() should check if a 3rd-party security provider is signed
Reviewed-by: mullan, valeriep
Backport-of: 9fd855ed47
2024-01-11 20:57:14 +00:00
Weibing Xiao
3daa936f2d 8318971: Better Error Handling for Jar Tool When Processing Non-existent Files
Reviewed-by: jpai
Backport-of: 8ae309ebac
2024-01-11 12:16:41 +00:00
Jorn Vernee
db3427582d 8322324: java/foreign/TestStubAllocFailure.java times out while waiting for forked process
8322637: java/foreign/critical/TestCriticalUpcall.java timed out

Reviewed-by: mcimadamore
Backport-of: d2d58dd6a8
2024-01-11 12:09:20 +00:00
Stefan Karlsson
5308410724 8321683: Tests fail with AssertionError in RangeWithPageSize
Reviewed-by: ehelin
Backport-of: dce7a5732e
2024-01-11 08:05:53 +00:00
Naoto Sato
6951987b65 8320788: The system properties page is missing some properties
Reviewed-by: rriggs, iris
Backport-of: 3bd9042054
2024-01-11 00:03:10 +00:00
Mandy Chung
34222839e8 8323547: tools/jlink/plugins/SystemModuleDescriptors/ModuleMainClassTest.java fails to compile
Reviewed-by: naoto
2024-01-10 21:29:34 +00:00
Markus Grönlund
dfe52be4ef 8323540: assert((!((((method)->is_trace_flag_set(((1 << 4) << 8))))))) failed: invariant
Reviewed-by: egahlin
Backport-of: c1282b57f5
2024-01-10 18:47:13 +00:00
Serguei Spitsyn
865cf888ef 8311218: fatal error: stuck in JvmtiVTMSTransitionDisabler::VTMS_transition_disable
Reviewed-by: alanb
Backport-of: 0f8e4e0a81
2024-01-10 18:16:45 +00:00
Mandy Chung
71cc879bd4 8322809: SystemModulesMap::classNames and moduleNames arrays do not match the order
Reviewed-by: alanb
Backport-of: f3be138eb8
2024-01-10 18:14:22 +00:00
Naoto Sato
46b1b1ae8d 8320919: Clarify Locale related system properties
Reviewed-by: iris
Backport-of: 376051a9be
2024-01-10 17:33:13 +00:00
Markus Grönlund
da24559051 8316241: Test jdk/jdk/jfr/jvm/TestChunkIntegrity.java failed
Reviewed-by: egahlin
Backport-of: b2a39c5767
2024-01-10 13:59:27 +00:00
Athijegannathan Sundararajan
33f07b56ef 8310995: missing @since tags in 36 jdk.dynalink classes
Reviewed-by: jlaskey
Backport-of: 176606d0cb
2024-01-10 11:31:26 +00:00
Christoph Langer
28db238d52 8322163: runtime/Unsafe/InternalErrorTest.java fails on Alpine after JDK-8320886
Reviewed-by: mbaesken
Backport-of: 1230853343
2024-01-10 08:28:13 +00:00
David Holmes
6b79e792ac 8323241: jcmd manpage should use lists for argument lists
Reviewed-by: cjplummer
Backport-of: 075fed91bd
2024-01-10 04:29:04 +00:00
Justin Lu
a8df559763 8321480: ISO 4217 Amendment 176 Update
Reviewed-by: naoto, iris
Backport-of: 8b24851b9d
2024-01-09 22:55:51 +00:00
Dan Lutker
acc4829ec3 8322725: (tz) Update Timezone Data to 2023d
Reviewed-by: naoto, iris
Backport-of: 2a9c3589d9
2024-01-09 17:53:56 +00:00
Goetz Lindenmaier
e5f3366efa 8322418: Problem list gc/TestAllocHumongousFragment.java subtests for 8298781
Reviewed-by: clanger
Backport-of: 6de23bf36e
2024-01-09 11:21:19 +00:00
Jan Lahoda
29ed3878cc 8322532: JShell : Unnamed variable issue
Reviewed-by: asotona
Backport-of: f0cfd361bd
2024-01-08 14:02:57 +00:00
Erik Gahlin
2110300246 8322142: JFR: Periodic tasks aren't orphaned between recordings
Reviewed-by: mgronlun
Backport-of: 1551928502
2024-01-08 12:58:58 +00:00
Markus Grönlund
f27efd6a29 8322489: 22-b27: Up to 7% regression in all Footprint3-*-G1/ZGC
Reviewed-by: egahlin
Backport-of: 09c6c4ff02
2024-01-08 12:46:32 +00:00
Tobias Hartmann
0442d772b0 8310844: [AArch64] C1 compilation fails because monitor offset in OSR buffer is too large for immediate
Reviewed-by: chagedorn
Backport-of: ade21a965f
2024-01-08 11:36:26 +00:00
David Holmes
6aace1819c 8319948: jcmd man page needs to be updated
Reviewed-by: alanb
Backport-of: 028ec7e744
2024-01-05 21:02:40 +00:00
Tobias Hartmann
28279ee615 8322985: [BACKOUT] 8318562: Computational test more than 2x slower when AVX instructions are used
Reviewed-by: shade, kvn
Backport-of: ed9f3243f0
2024-01-05 17:31:26 +00:00
Patricio Chilano Mateo
01cb043b29 8320275: assert(_chunk->bitmap().at(index)) failed: Bit not set at index
Reviewed-by: dholmes
Backport-of: e9e694f4ef
2024-01-05 15:52:47 +00:00
Jan Lahoda
bb0e203d13 8321582: yield <primitive-type>.class not parsed correctly.
Reviewed-by: shade, vromero
Backport-of: ce8399fd60
2024-01-05 12:43:15 +00:00
Joe Wang
b121931959 8322214: Return value of XMLInputFactory.getProperty() changed from boolean to String in JDK 22 early access builds
Reviewed-by: naoto, iris
Backport-of: 755722ced6
2024-01-05 02:26:02 +00:00
Aleksei Voitylov
a6e35650f9 8321515: ARM32: Move method resolution information out of the cpCache properly
Reviewed-by: shade
Backport-of: f573f6d233
2024-01-04 18:19:11 +00:00
Naoto Sato
a72afb3845 8322647: Short name for the Europe/Lisbon time zone is incorrect
Reviewed-by: joehw
Backport-of: ad31ec5c5f
2024-01-04 17:51:03 +00:00
Tobias Hartmann
b8c88a3e91 8321599: Data loss in AVX3 Base64 decoding
Reviewed-by: chagedorn
Backport-of: 13c11487f7
2024-01-04 09:16:19 +00:00
Ioi Lam
ea6d79ff94 8322321: Add man page doc for -XX:+VerifySharedSpaces
Reviewed-by: ccheung
Backport-of: f7dc257a20
2023-12-21 02:24:53 +00:00
Gui Cao
c249229b3c 8322154: RISC-V: JDK-8315743 missed change in MacroAssembler::load_reserved
Reviewed-by: fyang
Backport-of: 59073fa3eb
2023-12-21 02:09:05 +00:00
Alex Menkov
fb3cc98da3 8321565: [REDO] Heap dump does not contain virtual Thread stack references
Reviewed-by: sspitsyn
Backport-of: cf948548c3
2023-12-21 01:48:37 +00:00
Alisen Chung
a05f3d10cc 8322041: JDK 22 RDP1 L10n resource files update
Reviewed-by: kcr, naoto
Backport-of: b061b6678f
2023-12-20 21:41:55 +00:00
Erik Österlund
3ae97bc502 8321619: Generational ZGC: ZColorStoreGoodOopClosure is only valid for young objects
Reviewed-by: sjohanss
Backport-of: be49dabd0d
2023-12-20 09:16:55 +00:00
Aleksei Voitylov
049be572ef 8321514: UTF16 string gets constructed incorrectly from codepoints if CompactStrings is not enabled
Reviewed-by: rriggs, iris
Backport-of: fde5b16817
2023-12-19 21:33:50 +00:00
Naoto Sato
57d97b52c9 8321958: @param/@return descriptions of ZoneRules#isDaylightSavings() are incorrect
Reviewed-by: bpb
Backport-of: 87ef73329f
2023-12-15 18:12:37 +00:00
Tobias Hartmann
6b46c776e4 8320682: [AArch64] C1 compilation fails with "Field too big for insn"
Reviewed-by: chagedorn
Backport-of: 69014cd55b
2023-12-15 14:28:47 +00:00
Jamil Nimeh
d7b592ab21 8321542: C2: Missing ChaCha20 stub for x86_32 leads to crashes
Reviewed-by: kvn
Backport-of: 5718039a46
2023-12-14 18:09:04 +00:00
Jorn Vernee
d62249a3ab 8321400: java/foreign/TestStubAllocFailure.java fails with code cache exhaustion
Reviewed-by: mcimadamore
Backport-of: 7ece9e90c0
2023-12-14 14:58:01 +00:00
Tobias Hartmann
41b7296f49 8321974: Crash in ciKlass::is_subtype_of because TypeAryPtr::_klass is not initialized
Reviewed-by: epeter, tholenstein
Backport-of: c8ad7b7f84
2023-12-14 09:42:38 +00:00
Adam Sotona
a55e18baf0 8321641: ClassFile ModuleAttribute.ModuleAttributeBuilder::moduleVersion spec contains a copy-paste error
Reviewed-by: alanb
Backport-of: 3c6459e1de
2023-12-13 08:48:44 +00:00
Christian Stein
ae77bd009f 8321739: Source launcher fails with "Not a directory" error
Reviewed-by: jlahoda
Backport-of: df4ed7eff7
2023-12-12 21:07:56 +00:00
Jorn Vernee
9f0469b94a 8320886: Unsafe_SetMemory0 is not guarded
Reviewed-by: shade
Backport-of: ce4b257fa5
2023-12-12 14:26:38 +00:00
Thomas Schatzl
379a8bbb5d 8321422: Test gc/g1/pinnedobjs/TestPinnedObjectTypes.java times out after completion
Reviewed-by: ayang, iwalulya
Backport-of: 7d903964fb
2023-12-12 11:09:28 +00:00
Per Minborg
e88a022072 8321387: SegmentAllocator:allocateFrom(AddressLayout, MemorySegment) does not throw stated UnsupportedOperationException
Reviewed-by: mcimadamore
Backport-of: d13302f8b0
2023-12-11 16:43:40 +00:00
Martin Doerr
cbec97c945 8321539: Minimal build is broken by JDK-8320935
Reviewed-by: iklam
Backport-of: 5e6bfc5eaa
2023-12-09 00:04:14 +00:00
Naoto Sato
e5684da6e5 8321409: Console read line with zero out should zero out underlying buffer in JLine (redux)
Reviewed-by: alanb
Backport-of: 4ed38f5ad5
2023-12-08 18:15:10 +00:00
Jaikiran Pai
508d04f71f 8316738: java/net/httpclient/HttpClientLocalAddrTest.java failed in timeout
Reviewed-by: dfuchs
Backport-of: f577385fc8
2023-12-08 11:03:34 +00:00
Weijun Wang
7de0fb3613 8320597: RSA signature verification fails on signed data that does not encode params correctly
Reviewed-by: valeriep
Backport-of: 11e4a925be
2023-12-08 03:01:17 +00:00
604 changed files with 9652 additions and 18175 deletions

View File

@@ -1,7 +1,7 @@
[general]
project=jdk
jbs=JDK
version=23
version=22
[checks]
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists

View File

@@ -58,7 +58,7 @@ DEMO_MANIFEST := $(SUPPORT_OUTPUTDIR)/demos/java-main-manifest.mf
# This rule will be depended on due to the MANIFEST line in SetupBuildDemo
# and SetupBuildJvmtiDemo.
$(eval $(call SetupTextFileProcessing, BUILD_JAVA_MANIFEST, \
SOURCE_FILES := $(TOPDIR)/make/data/mainmanifest/manifest.mf.template, \
SOURCE_FILES := $(TOPDIR)/make/data/mainmanifest/manifest.mf, \
OUTPUT_FILE := $(DEMO_MANIFEST), \
REPLACEMENTS := \
@@VERSION_SPECIFICATION@@ => $(VERSION_SPECIFICATION) ; \

View File

@@ -33,7 +33,7 @@ include TextFileProcessing.gmk
# This rule will be depended on due to the MANIFEST line
$(eval $(call SetupTextFileProcessing, BUILD_JAVA_MANIFEST, \
SOURCE_FILES := $(TOPDIR)/make/data/mainmanifest/manifest.mf.template, \
SOURCE_FILES := $(TOPDIR)/make/data/mainmanifest/manifest.mf, \
OUTPUT_FILE := $(SUPPORT_OUTPUTDIR)/java-main-manifest.mf, \
REPLACEMENTS := \
@@VERSION_SPECIFICATION@@ => $(VERSION_SPECIFICATION) ; \

View File

@@ -69,7 +69,7 @@ ifeq ($(call isTargetOs, macosx), true)
))
$(eval $(call SetupTextFileProcessing, BUILD_JDK_PLIST, \
SOURCE_FILES := $(MACOSX_PLIST_SRC)/JDK-Info.plist.template, \
SOURCE_FILES := $(MACOSX_PLIST_SRC)/JDK-Info.plist, \
OUTPUT_FILE := $(JDK_MACOSX_CONTENTS_DIR)/Info.plist, \
REPLACEMENTS := \
@@ID@@ => $(MACOSX_BUNDLE_ID_BASE).jdk ; \
@@ -82,7 +82,7 @@ ifeq ($(call isTargetOs, macosx), true)
))
$(eval $(call SetupTextFileProcessing, BUILD_JRE_PLIST, \
SOURCE_FILES := $(MACOSX_PLIST_SRC)/JRE-Info.plist.template, \
SOURCE_FILES := $(MACOSX_PLIST_SRC)/JRE-Info.plist, \
OUTPUT_FILE := $(JRE_MACOSX_CONTENTS_DIR)/Info.plist, \
REPLACEMENTS := \
@@ID@@ => $(MACOSX_BUNDLE_ID_BASE).jre ; \

View File

@@ -744,16 +744,9 @@ endif
$(eval $(call SetupTarget, build-test-lib, \
MAKEFILE := test/BuildTestLib, \
TARGET := build-test-lib, \
DEPS := exploded-image, \
))
$(eval $(call SetupTarget, test-image-lib, \
MAKEFILE := test/BuildTestLib, \
TARGET := test-image-lib, \
DEPS := build-test-lib, \
))
ifeq ($(BUILD_FAILURE_HANDLER), true)
# Builds the failure handler jtreg extension
$(eval $(call SetupTarget, build-test-failure-handler, \
@@ -788,7 +781,7 @@ endif
$(eval $(call SetupTarget, build-microbenchmark, \
MAKEFILE := test/BuildMicrobenchmark, \
DEPS := interim-langtools exploded-image build-test-lib, \
DEPS := interim-langtools exploded-image, \
))
################################################################################
@@ -1271,7 +1264,7 @@ all-docs-bundles: docs-jdk-bundles docs-javase-bundles docs-reference-bundles
# This target builds the test image
test-image: prepare-test-image test-image-jdk-jtreg-native \
test-image-demos-jdk test-image-libtest-jtreg-native \
test-image-lib test-image-lib-native
test-image-lib-native
ifneq ($(JVM_TEST_IMAGE_TARGETS), )
# If JVM_TEST_IMAGE_TARGETS is externally defined, use it instead of the

View File

@@ -448,17 +448,17 @@ AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
AC_SUBST(CONFIGURESUPPORT_OUTPUTDIR)
# The spec.gmk file contains all variables for the make system.
AC_CONFIG_FILES([$OUTPUTDIR/spec.gmk:$AUTOCONF_DIR/spec.gmk.template])
AC_CONFIG_FILES([$OUTPUTDIR/spec.gmk:$AUTOCONF_DIR/spec.gmk.in])
# The bootcycle-spec.gmk file contains support for boot cycle builds.
AC_CONFIG_FILES([$OUTPUTDIR/bootcycle-spec.gmk:$AUTOCONF_DIR/bootcycle-spec.gmk.template])
AC_CONFIG_FILES([$OUTPUTDIR/bootcycle-spec.gmk:$AUTOCONF_DIR/bootcycle-spec.gmk.in])
# The buildjdk-spec.gmk file contains support for building a buildjdk when cross compiling.
AC_CONFIG_FILES([$OUTPUTDIR/buildjdk-spec.gmk:$AUTOCONF_DIR/buildjdk-spec.gmk.template])
AC_CONFIG_FILES([$OUTPUTDIR/buildjdk-spec.gmk:$AUTOCONF_DIR/buildjdk-spec.gmk.in])
# The compare.sh is used to compare the build output to other builds.
AC_CONFIG_FILES([$OUTPUTDIR/compare.sh:$AUTOCONF_DIR/compare.sh.template])
AC_CONFIG_FILES([$OUTPUTDIR/compare.sh:$AUTOCONF_DIR/compare.sh.in])
# The generated Makefile knows where the spec.gmk is and where the source is.
# You can run make from the OUTPUTDIR, or from the top-level Makefile
# which will look for generated configurations
AC_CONFIG_FILES([$OUTPUTDIR/Makefile:$AUTOCONF_DIR/Makefile.template])
AC_CONFIG_FILES([$OUTPUTDIR/Makefile:$AUTOCONF_DIR/Makefile.in])
])
###############################################################################

View File

@@ -110,15 +110,6 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS],
CHECK_VALUE: [UTIL_CHECK_STRING_NON_EMPTY_PRINTABLE])
AC_SUBST(COMPANY_NAME)
# Set the JDK RC Company name
# Otherwise uses the value set for "vendor-name".
UTIL_ARG_WITH(NAME: jdk-rc-company-name, TYPE: string,
DEFAULT: $COMPANY_NAME,
DESC: [Set JDK RC company name. This is used for CompanyName properties of MS Windows binaries.],
DEFAULT_DESC: [from branding.conf],
CHECK_VALUE: [UTIL_CHECK_STRING_NON_EMPTY_PRINTABLE])
AC_SUBST(JDK_RC_COMPANY_NAME)
# The vendor URL, if any
# Only set VENDOR_URL if '--with-vendor-url' was used and is not empty.
# Otherwise we will use the value from "branding.conf" included above.

View File

@@ -191,7 +191,6 @@ PRODUCT_NAME := @PRODUCT_NAME@
PRODUCT_SUFFIX := @PRODUCT_SUFFIX@
JDK_RC_PLATFORM_NAME := @JDK_RC_PLATFORM_NAME@
JDK_RC_NAME := @JDK_RC_NAME@
JDK_RC_COMPANY_NAME:=@JDK_RC_COMPANY_NAME@
COMPANY_NAME := @COMPANY_NAME@
HOTSPOT_VM_DISTRO := @HOTSPOT_VM_DISTRO@
MACOSX_BUNDLE_NAME_BASE := @MACOSX_BUNDLE_NAME_BASE@

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -389,6 +389,10 @@ AC_DEFUN_ONCE([TOOLCHAIN_POST_DETECTION],
# This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2"
CFLAGS="$ORG_CFLAGS"
CXXFLAGS="$ORG_CXXFLAGS"
# filter out some unwanted additions autoconf may add to CXX; we saw this on macOS with autoconf 2.72
UTIL_GET_NON_MATCHING_VALUES(cxx_filtered, $CXX, -std=c++11 -std=gnu++11)
CXX="$cxx_filtered"
])
# Check if a compiler is of the toolchain type we expect, and save the version

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -199,7 +199,7 @@ AC_DEFUN([UTIL_GET_NON_MATCHING_VALUES],
if test -z "$legal_values"; then
$1="$2"
else
result=`$GREP -Fvx "$legal_values" <<< "$values_to_check" | $GREP -v '^$'`
result=`$GREP -Fvx -- "$legal_values" <<< "$values_to_check" | $GREP -v '^$'`
$1=${result//$'\n'/ }
fi
])
@@ -226,7 +226,7 @@ AC_DEFUN([UTIL_GET_MATCHING_VALUES],
if test -z "$illegal_values"; then
$1=""
else
result=`$GREP -Fx "$illegal_values" <<< "$values_to_check" | $GREP -v '^$'`
result=`$GREP -Fx -- "$illegal_values" <<< "$values_to_check" | $GREP -v '^$'`
$1=${result//$'\n'/ }
fi
])

View File

@@ -98,7 +98,7 @@ GLOBAL_VERSION_INFO_RESOURCE := $(TOPDIR)/src/java.base/windows/native/common/ve
JDK_RCFLAGS=$(RCFLAGS) \
-D"JDK_VERSION_STRING=$(VERSION_STRING)" \
-D"JDK_COMPANY=$(JDK_RC_COMPANY_NAME)" \
-D"JDK_COMPANY=$(COMPANY_NAME)" \
-D"JDK_VER=$(VERSION_NUMBER_FOUR_POSITIONS)" \
-D"JDK_COPYRIGHT=Copyright \xA9 $(COPYRIGHT_YEAR)" \
-D"JDK_NAME=$(JDK_RC_NAME) $(VERSION_SHORT)" \

View File

@@ -112,7 +112,7 @@ define SetupBuildLauncherBody
$1_PLIST_FILE := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/$1/Info.plist
$$(eval $$(call SetupTextFileProcessing, BUILD_PLIST_$1, \
SOURCE_FILES := $(TOPDIR)/make/data/bundle/cmdline-Info.plist.template, \
SOURCE_FILES := $(TOPDIR)/make/data/bundle/cmdline-Info.plist, \
OUTPUT_FILE := $$($1_PLIST_FILE), \
REPLACEMENTS := \
@@ID@@ => $(MACOSX_BUNDLE_ID_BASE).$1 ; \

View File

@@ -1206,7 +1206,7 @@ var getJibProfilesDependencies = function (input, common) {
jcov: {
organization: common.organization,
revision: "3.0-16-jdk-asm+1.0",
revision: "3.0-15-jdk-asm+1.0",
ext: "zip",
environment_name: "JCOV_HOME",
},

View File

@@ -26,17 +26,17 @@
# Default version, product, and vendor information to use,
# unless overridden by configure
DEFAULT_VERSION_FEATURE=23
DEFAULT_VERSION_FEATURE=22
DEFAULT_VERSION_INTERIM=0
DEFAULT_VERSION_UPDATE=0
DEFAULT_VERSION_PATCH=0
DEFAULT_VERSION_EXTRA1=0
DEFAULT_VERSION_EXTRA2=0
DEFAULT_VERSION_EXTRA3=0
DEFAULT_VERSION_DATE=2024-09-17
DEFAULT_VERSION_CLASSFILE_MAJOR=67 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
DEFAULT_VERSION_DATE=2024-03-19
DEFAULT_VERSION_CLASSFILE_MAJOR=66 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
DEFAULT_VERSION_CLASSFILE_MINOR=0
DEFAULT_VERSION_DOCS_API_SINCE=11
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="21 22 23"
DEFAULT_JDK_SOURCE_TARGET_VERSION=23
DEFAULT_PROMOTED_VERSION_PRE=ea
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="21 22"
DEFAULT_JDK_SOURCE_TARGET_VERSION=22
DEFAULT_PROMOTED_VERSION_PRE=

View File

@@ -223,6 +223,7 @@ JVM_VirtualThreadEnd
JVM_VirtualThreadMount
JVM_VirtualThreadUnmount
JVM_VirtualThreadHideFrames
JVM_VirtualThreadDisableSuspend
# Scoped values
JVM_EnsureMaterializedForStackWalk_func

View File

@@ -48,7 +48,7 @@ $(eval $(call IncludeCustomExtension, hotspot/gensrc/GenerateSources.gmk))
# Setup the hotspot launcher script for developer use
$(eval $(call SetupTextFileProcessing, CREATE_HOTSPOT_LAUNCHER, \
SOURCE_FILES := $(TOPDIR)/make/scripts/hotspot.sh.template, \
SOURCE_FILES := $(TOPDIR)/make/scripts/hotspot.sh, \
OUTPUT_FILE := $(JVM_OUTPUTDIR)/hotspot, \
REPLACEMENTS := \
@@LIBARCH@@ => $(OPENJDK_TARGET_CPU_LEGACY_LIB) ; \

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -1289,25 +1289,58 @@ public class CLDRConverter {
*/
private static void generateTZDBShortNamesMap() throws IOException {
Files.walk(Path.of(tzDataDir), 1, FileVisitOption.FOLLOW_LINKS)
.filter(p -> p.toFile().isFile())
.filter(p -> p.toFile().isFile() && !p.endsWith("jdk11_backward"))
.forEach(p -> {
try {
String zone = null;
String rule = null;
String format = null;
boolean inVanguard = false;
boolean inRearguard = false;
for (var line : Files.readAllLines(p)) {
if (line.contains("#STDOFF")) continue;
// Interpret the line in rearguard mode so that STD/DST
// correctly handles negative DST cases, such as "GMT/IST"
// vs. "IST/GMT" case for Europe/Dublin
if (inVanguard) {
if (line.startsWith("# Rearguard")) {
inVanguard = false;
inRearguard = true;
}
continue;
} else if (line.startsWith("# Vanguard")) {
inVanguard = true;
continue;
}
if (inRearguard) {
if (line.startsWith("# End of rearguard")) {
inRearguard = false;
continue;
} else {
if (line.startsWith("#\t")) {
line = line.substring(1); // omit #
}
}
}
if (line.isBlank() || line.matches("^[ \t]*#.*")) {
// ignore blank/comment lines
continue;
}
// remove comments in-line
line = line.replaceAll("[ \t]*#.*", "");
// Zone line
if (line.startsWith("Zone")) {
if (zone != null) {
tzdbShortNamesMap.put(zone, format + NBSP + rule);
}
var zl = line.split("[ \t]+", -1);
zone = zl[1];
rule = zl[3];
format = zl[4];
} else {
if (zone != null) {
if (line.isBlank()) {
if (line.startsWith("Rule") ||
line.startsWith("Link")) {
tzdbShortNamesMap.put(zone, format + NBSP + rule);
zone = null;
rule = null;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,7 @@ import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.Locale;
@@ -339,9 +340,15 @@ public class GenerateCurrencyData {
validCurrencyCodes.substring(i * 7 + 3, i * 7 + 6));
checkCurrencyCode(currencyCode);
int tableEntry = mainTable[(currencyCode.charAt(0) - 'A') * A_TO_Z + (currencyCode.charAt(1) - 'A')];
if (tableEntry == INVALID_COUNTRY_ENTRY ||
(tableEntry & SPECIAL_CASE_COUNTRY_MASK) != 0 ||
(tableEntry & SIMPLE_CASE_COUNTRY_FINAL_CHAR_MASK) != (currencyCode.charAt(2) - 'A')) {
// Do not allow a future currency to be classified as an otherCurrency,
// otherwise it will leak out into Currency:getAvailableCurrencies
boolean futureCurrency = Arrays.asList(specialCaseNewCurrencies).contains(currencyCode);
boolean simpleCurrency = (tableEntry & SIMPLE_CASE_COUNTRY_FINAL_CHAR_MASK) == (currencyCode.charAt(2) - 'A');
// If neither a simple currency, or one defined in the future
// then the current currency is applicable to be added to the otherTable
if (!futureCurrency && !simpleCurrency) {
if (otherCurrenciesCount == maxOtherCurrencies) {
throw new RuntimeException("too many other currencies");
}

View File

@@ -245,7 +245,7 @@ ifeq ($(call isTargetOs, linux)+$(call isTargetCpu, x86_64)+$(INCLUDE_COMPILER2)
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
OPTIMIZATION := HIGH, \
CFLAGS := $(CFLAGS_JDKLIB), \
CXXFLAGS := $(CXXFLAGS_JDKLIB) -std=c++17, \
CXXFLAGS := $(CXXFLAGS_JDKLIB), \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LIBS := $(LIBCXX), \

View File

@@ -53,10 +53,11 @@ JMH_UNPACKED_DIR := $(MICROBENCHMARK_OUTPUT)/jmh_jars
JMH_UNPACKED_JARS_DONE := $(JMH_UNPACKED_DIR)/_unpacked.marker
# External dependencies
WHITEBOX_JAR := $(SUPPORT_OUTPUTDIR)/test/lib/wb.jar
JMH_COMPILE_JARS := $(JMH_CORE_JAR) $(JMH_GENERATOR_JAR) $(WHITEBOX_JAR)
JMH_COMPILE_JARS := $(JMH_CORE_JAR) $(JMH_GENERATOR_JAR)
JMH_RUNTIME_JARS := $(JMH_CORE_JAR) $(JMH_COMMONS_MATH_JAR) $(JMH_JOPT_SIMPLE_JAR)
MICROBENCHMARK_CLASSPATH := $(call PathList, $(JMH_COMPILE_JARS))
# Native dependencies
MICROBENCHMARK_NATIVE_SRC_DIRS := $(MICROBENCHMARK_SRC)
MICROBENCHMARK_NATIVE_OUTPUT := $(MICROBENCHMARK_OUTPUT)/native
@@ -91,28 +92,24 @@ $(eval $(call SetupJavaCompilation, BUILD_INDIFY, \
$(eval $(call SetupJavaCompilation, BUILD_JDK_MICROBENCHMARK, \
TARGET_RELEASE := $(TARGET_RELEASE_NEWJDK_UPGRADED), \
SMALL_JAVA := false, \
CLASSPATH := $(JMH_COMPILE_JARS), \
DISABLED_WARNINGS := restricted this-escape processing rawtypes cast \
serial preview, \
CLASSPATH := $(MICROBENCHMARK_CLASSPATH), \
DISABLED_WARNINGS := restricted this-escape processing rawtypes cast serial preview, \
SRC := $(MICROBENCHMARK_SRC), \
BIN := $(MICROBENCHMARK_CLASSES), \
JAVAC_FLAGS := \
JAVAC_FLAGS := --add-exports java.base/sun.security.util=ALL-UNNAMED \
--add-exports java.base/sun.invoke.util=ALL-UNNAMED \
--add-exports java.base/jdk.internal.classfile.impl=ALL-UNNAMED \
--add-exports java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
--add-exports java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED \
--add-exports java.base/jdk.internal.vm=ALL-UNNAMED \
--add-exports java.base/jdk.internal.misc=ALL-UNNAMED \
--add-exports java.base/jdk.internal.event=ALL-UNNAMED \
--add-exports java.base/jdk.internal.foreign=ALL-UNNAMED \
--add-exports java.base/jdk.internal.misc=ALL-UNNAMED \
--add-exports java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED \
--add-exports java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
--add-exports java.base/jdk.internal.vm=ALL-UNNAMED \
--add-exports java.base/sun.invoke.util=ALL-UNNAMED \
--add-exports java.base/sun.security.util=ALL-UNNAMED \
--enable-preview \
-processor org.openjdk.jmh.generators.BenchmarkProcessor, \
JAVA_FLAGS := \
JAVA_FLAGS := --add-modules jdk.unsupported --limit-modules java.management \
--add-exports java.base/jdk.internal.vm=ALL-UNNAMED \
--add-modules jdk.unsupported \
--enable-preview \
--limit-modules java.management, \
--enable-preview, \
))
$(BUILD_JDK_MICROBENCHMARK): $(JMH_COMPILE_JARS)

View File

@@ -23,22 +23,12 @@
# questions.
#
################################################################################
# This file builds the Java components of testlib.
# It also covers the test-image part, where the built files are copied to the
# test image.
################################################################################
default: all
include $(SPEC)
include MakeBase.gmk
include JavaCompilation.gmk
################################################################################
# Targets for building the test lib jars
################################################################################
TARGETS :=
TEST_LIB_SOURCE_DIR := $(TOPDIR)/test/lib
@@ -73,21 +63,8 @@ $(eval $(call SetupJavaCompilation, BUILD_TEST_LIB_JAR, \
TARGETS += $(BUILD_TEST_LIB_JAR)
build-test-lib: $(TARGETS)
##########################################################################################
################################################################################
# Targets for building test-image.
################################################################################
all: $(TARGETS)
# Copy the jars to the test image.
$(eval $(call SetupCopyFiles, COPY_LIBTEST_JARS, \
DEST := $(TEST_IMAGE_DIR)/lib-test, \
FILES := $(BUILD_WB_JAR_JAR) $(BUILD_TEST_LIB_JAR_JAR), \
))
#
test-image-lib: $(COPY_LIBTEST_JARS)
all: build-test-lib
.PHONY: default all build-test-lib test-image-lib
.PHONY: default all

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -282,7 +282,8 @@ void LIR_Assembler::osr_entry() {
__ bind(L);
}
#endif
__ ldp(r19, r20, Address(OSR_buf, slot_offset));
__ ldr(r19, Address(OSR_buf, slot_offset));
__ ldr(r20, Address(OSR_buf, slot_offset + BytesPerWord));
__ str(r19, frame_map()->address_for_monitor_lock(i));
__ str(r20, frame_map()->address_for_monitor_object(i));
}

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2023, Red Hat, Inc. All rights reserved.
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -58,7 +58,7 @@ static char* reserve_at_eor_compatible_address(size_t size, bool aslr) {
0x7ffc, 0x7ffe, 0x7fff
};
static constexpr int num_immediates = sizeof(immediates) / sizeof(immediates[0]);
const int start_index = aslr ? os::random() : 0;
const int start_index = aslr ? os::next_random((int)os::javaTimeNanos()) : 0;
constexpr int max_tries = 64;
for (int ntry = 0; result == nullptr && ntry < max_tries; ntry ++) {
// As in os::attempt_reserve_memory_between, we alternate between higher and lower

View File

@@ -193,9 +193,4 @@
}
}
// Is SIMD sort supported for this CPU?
static bool supports_simd_sort(BasicType bt) {
return false;
}
#endif // CPU_AARCH64_MATCHER_AARCH64_HPP

View File

@@ -310,7 +310,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
uint int_args = 0;
uint fp_args = 0;
uint stk_args = 0; // inc by 2 each time
uint stk_args = 0;
for (int i = 0; i < total_args_passed; i++) {
switch (sig_bt[i]) {
@@ -322,8 +322,9 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
if (int_args < Argument::n_int_register_parameters_j) {
regs[i].set1(INT_ArgReg[int_args++]->as_VMReg());
} else {
stk_args = align_up(stk_args, 2);
regs[i].set1(VMRegImpl::stack2reg(stk_args));
stk_args += 2;
stk_args += 1;
}
break;
case T_VOID:
@@ -340,6 +341,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
if (int_args < Argument::n_int_register_parameters_j) {
regs[i].set2(INT_ArgReg[int_args++]->as_VMReg());
} else {
stk_args = align_up(stk_args, 2);
regs[i].set2(VMRegImpl::stack2reg(stk_args));
stk_args += 2;
}
@@ -348,8 +350,9 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
if (fp_args < Argument::n_float_register_parameters_j) {
regs[i].set1(FP_ArgReg[fp_args++]->as_VMReg());
} else {
stk_args = align_up(stk_args, 2);
regs[i].set1(VMRegImpl::stack2reg(stk_args));
stk_args += 2;
stk_args += 1;
}
break;
case T_DOUBLE:
@@ -357,6 +360,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
if (fp_args < Argument::n_float_register_parameters_j) {
regs[i].set2(FP_ArgReg[fp_args++]->as_VMReg());
} else {
stk_args = align_up(stk_args, 2);
regs[i].set2(VMRegImpl::stack2reg(stk_args));
stk_args += 2;
}
@@ -367,7 +371,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
}
}
return align_up(stk_args, 2);
return stk_args;
}
// Patch the callers callsite with entry to compiled code if it exists.

View File

@@ -186,9 +186,4 @@
}
}
// Is SIMD sort supported for this CPU?
static bool supports_simd_sort(BasicType bt) {
return false;
}
#endif // CPU_ARM_MATCHER_ARM_HPP

View File

@@ -441,7 +441,6 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
}
}
if (slot & 1) slot++;
return slot;
}

View File

@@ -195,9 +195,4 @@
}
}
// Is SIMD sort supported for this CPU?
static bool supports_simd_sort(BasicType bt) {
return false;
}
#endif // CPU_PPC_MATCHER_PPC_HPP

View File

@@ -734,7 +734,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
ShouldNotReachHere();
}
}
return align_up(stk, 2);
return stk;
}
#if defined(COMPILER1) || defined(COMPILER2)

View File

@@ -1459,112 +1459,6 @@ void C2_MacroAssembler::string_equals(Register a1, Register a2,
BLOCK_COMMENT("} string_equals");
}
// jdk.internal.util.ArraysSupport.vectorizedHashCode
void C2_MacroAssembler::arrays_hashcode(Register ary, Register cnt, Register result,
Register tmp1, Register tmp2, Register tmp3,
Register tmp4, Register tmp5, Register tmp6,
BasicType eltype)
{
assert_different_registers(ary, cnt, result, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, t0, t1);
const int elsize = arrays_hashcode_elsize(eltype);
const int chunks_end_shift = exact_log2(elsize);
switch (eltype) {
case T_BOOLEAN: BLOCK_COMMENT("arrays_hashcode(unsigned byte) {"); break;
case T_CHAR: BLOCK_COMMENT("arrays_hashcode(char) {"); break;
case T_BYTE: BLOCK_COMMENT("arrays_hashcode(byte) {"); break;
case T_SHORT: BLOCK_COMMENT("arrays_hashcode(short) {"); break;
case T_INT: BLOCK_COMMENT("arrays_hashcode(int) {"); break;
default:
ShouldNotReachHere();
}
const int stride = 4;
const Register pow31_4 = tmp1;
const Register pow31_3 = tmp2;
const Register pow31_2 = tmp3;
const Register chunks = tmp4;
const Register chunks_end = chunks;
Label DONE, TAIL, TAIL_LOOP, WIDE_LOOP;
// result has a value initially
beqz(cnt, DONE);
andi(chunks, cnt, ~(stride-1));
beqz(chunks, TAIL);
mv(pow31_4, 923521); // [31^^4]
mv(pow31_3, 29791); // [31^^3]
mv(pow31_2, 961); // [31^^2]
slli(chunks_end, chunks, chunks_end_shift);
add(chunks_end, ary, chunks_end);
andi(cnt, cnt, stride-1); // don't forget about tail!
bind(WIDE_LOOP);
mulw(result, result, pow31_4); // 31^^4 * h
arrays_hashcode_elload(t0, Address(ary, 0 * elsize), eltype);
arrays_hashcode_elload(t1, Address(ary, 1 * elsize), eltype);
arrays_hashcode_elload(tmp5, Address(ary, 2 * elsize), eltype);
arrays_hashcode_elload(tmp6, Address(ary, 3 * elsize), eltype);
mulw(t0, t0, pow31_3); // 31^^3 * ary[i+0]
addw(result, result, t0);
mulw(t1, t1, pow31_2); // 31^^2 * ary[i+1]
addw(result, result, t1);
slli(t0, tmp5, 5); // optimize 31^^1 * ary[i+2]
subw(tmp5, t0, tmp5); // with ary[i+2]<<5 - ary[i+2]
addw(result, result, tmp5);
addw(result, result, tmp6); // 31^^4 * h + 31^^3 * ary[i+0] + 31^^2 * ary[i+1]
// + 31^^1 * ary[i+2] + 31^^0 * ary[i+3]
addi(ary, ary, elsize * stride);
bne(ary, chunks_end, WIDE_LOOP);
beqz(cnt, DONE);
bind(TAIL);
slli(chunks_end, cnt, chunks_end_shift);
add(chunks_end, ary, chunks_end);
bind(TAIL_LOOP);
arrays_hashcode_elload(t0, Address(ary), eltype);
slli(t1, result, 5); // optimize 31 * result
subw(result, t1, result); // with result<<5 - result
addw(result, result, t0);
addi(ary, ary, elsize);
bne(ary, chunks_end, TAIL_LOOP);
bind(DONE);
BLOCK_COMMENT("} // arrays_hashcode");
}
int C2_MacroAssembler::arrays_hashcode_elsize(BasicType eltype) {
switch (eltype) {
case T_BOOLEAN: return sizeof(jboolean);
case T_BYTE: return sizeof(jbyte);
case T_SHORT: return sizeof(jshort);
case T_CHAR: return sizeof(jchar);
case T_INT: return sizeof(jint);
default:
ShouldNotReachHere();
return -1;
}
}
void C2_MacroAssembler::arrays_hashcode_elload(Register dst, Address src, BasicType eltype) {
switch (eltype) {
// T_BOOLEAN used as surrogate for unsigned byte
case T_BOOLEAN: lbu(dst, src); break;
case T_BYTE: lb(dst, src); break;
case T_SHORT: lh(dst, src); break;
case T_CHAR: lhu(dst, src); break;
case T_INT: lw(dst, src); break;
default:
ShouldNotReachHere();
}
}
typedef void (Assembler::*conditional_branch_insn)(Register op1, Register op2, Label& label, bool is_far);
typedef void (MacroAssembler::*float_conditional_branch_insn)(FloatRegister op1, FloatRegister op2, Label& label,
bool is_far, bool is_unordered);

View File

@@ -82,15 +82,6 @@
Register result, Register cnt1,
int elem_size);
void arrays_hashcode(Register ary, Register cnt, Register result,
Register tmp1, Register tmp2,
Register tmp3, Register tmp4,
Register tmp5, Register tmp6,
BasicType eltype);
// helper function for arrays_hashcode
int arrays_hashcode_elsize(BasicType eltype);
void arrays_hashcode_elload(Register dst, Address src, BasicType eltype);
void string_equals(Register r1, Register r2,
Register result, Register cnt1,
int elem_size);

View File

@@ -2771,7 +2771,7 @@ void MacroAssembler::load_reserved(Register dst,
break;
case uint32:
lr_w(dst, addr, acquire);
zero_extend(t0, t0, 32);
zero_extend(dst, dst, 32);
break;
default:
ShouldNotReachHere();

View File

@@ -192,9 +192,4 @@
}
}
// Is SIMD sort supported for this CPU?
static bool supports_simd_sort(BasicType bt) {
return false;
}
#endif // CPU_RISCV_MATCHER_RISCV_HPP

View File

@@ -10371,26 +10371,6 @@ instruct array_equalsC(iRegP_R11 ary1, iRegP_R12 ary2, iRegI_R10 result,
ins_pipe(pipe_class_memory);
%}
// fast ArraysSupport.vectorizedHashCode
instruct arrays_hashcode(iRegP_R11 ary, iRegI_R12 cnt, iRegI_R10 result, immI basic_type,
iRegLNoSp tmp1, iRegLNoSp tmp2,
iRegLNoSp tmp3, iRegLNoSp tmp4,
iRegLNoSp tmp5, iRegLNoSp tmp6, rFlagsReg cr)
%{
match(Set result (VectorizedHashCode (Binary ary cnt) (Binary result basic_type)));
effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, TEMP tmp5, TEMP tmp6,
USE_KILL ary, USE_KILL cnt, USE basic_type, KILL cr);
format %{ "Array HashCode array[] $ary,$cnt,$result,$basic_type -> $result // KILL all" %}
ins_encode %{
__ arrays_hashcode($ary$$Register, $cnt$$Register, $result$$Register,
$tmp1$$Register, $tmp2$$Register, $tmp3$$Register,
$tmp4$$Register, $tmp5$$Register, $tmp6$$Register,
(BasicType)$basic_type$$constant);
%}
ins_pipe(pipe_class_memory);
%}
// ============================================================================
// Safepoint Instructions

View File

@@ -266,7 +266,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
uint int_args = 0;
uint fp_args = 0;
uint stk_args = 0; // inc by 2 each time
uint stk_args = 0;
for (int i = 0; i < total_args_passed; i++) {
switch (sig_bt[i]) {
@@ -278,8 +278,9 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
if (int_args < Argument::n_int_register_parameters_j) {
regs[i].set1(INT_ArgReg[int_args++]->as_VMReg());
} else {
stk_args = align_up(stk_args, 2);
regs[i].set1(VMRegImpl::stack2reg(stk_args));
stk_args += 2;
stk_args += 1;
}
break;
case T_VOID:
@@ -295,6 +296,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
if (int_args < Argument::n_int_register_parameters_j) {
regs[i].set2(INT_ArgReg[int_args++]->as_VMReg());
} else {
stk_args = align_up(stk_args, 2);
regs[i].set2(VMRegImpl::stack2reg(stk_args));
stk_args += 2;
}
@@ -303,8 +305,9 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
if (fp_args < Argument::n_float_register_parameters_j) {
regs[i].set1(FP_ArgReg[fp_args++]->as_VMReg());
} else {
stk_args = align_up(stk_args, 2);
regs[i].set1(VMRegImpl::stack2reg(stk_args));
stk_args += 2;
stk_args += 1;
}
break;
case T_DOUBLE:
@@ -312,6 +315,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
if (fp_args < Argument::n_float_register_parameters_j) {
regs[i].set2(FP_ArgReg[fp_args++]->as_VMReg());
} else {
stk_args = align_up(stk_args, 2);
regs[i].set2(VMRegImpl::stack2reg(stk_args));
stk_args += 2;
}
@@ -321,7 +325,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
}
}
return align_up(stk_args, 2);
return stk_args;
}
// Patch the callers callsite with entry to compiled code if it exists.

View File

@@ -315,10 +315,6 @@ void VM_Version::c2_initialize() {
}
}
if (FLAG_IS_DEFAULT(UseVectorizedHashCodeIntrinsic)) {
FLAG_SET_DEFAULT(UseVectorizedHashCodeIntrinsic, true);
}
if (!UseZicbop) {
if (!FLAG_IS_DEFAULT(AllocatePrefetchStyle)) {
warning("Zicbop is not available on this CPU");

View File

@@ -184,9 +184,4 @@
}
}
// Is SIMD sort supported for this CPU?
static bool supports_simd_sort(BasicType bt) {
return false;
}
#endif // CPU_S390_MATCHER_S390_HPP

View File

@@ -755,7 +755,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
ShouldNotReachHere();
}
}
return align_up(stk, 2);
return stk;
}
int SharedRuntime::c_calling_convention(const BasicType *sig_bt,

View File

@@ -1089,7 +1089,8 @@ void C2_MacroAssembler::vminmax_fp(int opcode, BasicType elem_bt,
assert(opcode == Op_MinV || opcode == Op_MinReductionV ||
opcode == Op_MaxV || opcode == Op_MaxReductionV, "sanity");
assert(elem_bt == T_FLOAT || elem_bt == T_DOUBLE, "sanity");
assert_different_registers(a, b, tmp, atmp, btmp);
assert_different_registers(a, tmp, atmp, btmp);
assert_different_registers(b, tmp, atmp, btmp);
bool is_min = (opcode == Op_MinV || opcode == Op_MinReductionV);
bool is_double_word = is_double_word_type(elem_bt);
@@ -1176,7 +1177,8 @@ void C2_MacroAssembler::evminmax_fp(int opcode, BasicType elem_bt,
assert(opcode == Op_MinV || opcode == Op_MinReductionV ||
opcode == Op_MaxV || opcode == Op_MaxReductionV, "sanity");
assert(elem_bt == T_FLOAT || elem_bt == T_DOUBLE, "sanity");
assert_different_registers(dst, a, b, atmp, btmp);
assert_different_registers(dst, a, atmp, btmp);
assert_different_registers(dst, b, atmp, btmp);
bool is_min = (opcode == Op_MinV || opcode == Op_MinReductionV);
bool is_double_word = is_double_word_type(elem_bt);

View File

@@ -1871,92 +1871,6 @@ void MacroAssembler::cmpoop(Register src1, jobject src2, Register rscratch) {
}
#endif
void MacroAssembler::cvtss2sd(XMMRegister dst, XMMRegister src) {
if ((UseAVX > 0) && (dst != src)) {
xorpd(dst, dst);
}
Assembler::cvtss2sd(dst, src);
}
void MacroAssembler::cvtss2sd(XMMRegister dst, Address src) {
if (UseAVX > 0) {
xorpd(dst, dst);
}
Assembler::cvtss2sd(dst, src);
}
void MacroAssembler::cvtsd2ss(XMMRegister dst, XMMRegister src) {
if ((UseAVX > 0) && (dst != src)) {
xorps(dst, dst);
}
Assembler::cvtsd2ss(dst, src);
}
void MacroAssembler::cvtsd2ss(XMMRegister dst, Address src) {
if (UseAVX > 0) {
xorps(dst, dst);
}
Assembler::cvtsd2ss(dst, src);
}
void MacroAssembler::cvtsi2sdl(XMMRegister dst, Register src) {
if (UseAVX > 0) {
xorpd(dst, dst);
}
Assembler::cvtsi2sdl(dst, src);
}
void MacroAssembler::cvtsi2sdl(XMMRegister dst, Address src) {
if (UseAVX > 0) {
xorpd(dst, dst);
}
Assembler::cvtsi2sdl(dst, src);
}
void MacroAssembler::cvtsi2ssl(XMMRegister dst, Register src) {
if (UseAVX > 0) {
xorps(dst, dst);
}
Assembler::cvtsi2ssl(dst, src);
}
void MacroAssembler::cvtsi2ssl(XMMRegister dst, Address src) {
if (UseAVX > 0) {
xorps(dst, dst);
}
Assembler::cvtsi2ssl(dst, src);
}
#ifdef _LP64
void MacroAssembler::cvtsi2sdq(XMMRegister dst, Register src) {
if (UseAVX > 0) {
xorpd(dst, dst);
}
Assembler::cvtsi2sdq(dst, src);
}
void MacroAssembler::cvtsi2sdq(XMMRegister dst, Address src) {
if (UseAVX > 0) {
xorpd(dst, dst);
}
Assembler::cvtsi2sdq(dst, src);
}
void MacroAssembler::cvtsi2ssq(XMMRegister dst, Register src) {
if (UseAVX > 0) {
xorps(dst, dst);
}
Assembler::cvtsi2ssq(dst, src);
}
void MacroAssembler::cvtsi2ssq(XMMRegister dst, Address src) {
if (UseAVX > 0) {
xorps(dst, dst);
}
Assembler::cvtsi2ssq(dst, src);
}
#endif // _LP64
void MacroAssembler::locked_cmpxchgptr(Register reg, AddressLiteral adr, Register rscratch) {
assert(rscratch != noreg || always_reachable(adr), "missing");

View File

@@ -800,23 +800,6 @@ public:
void cmpxchgptr(Register reg, Address adr);
// cvt instructions
void cvtss2sd(XMMRegister dst, XMMRegister src);
void cvtss2sd(XMMRegister dst, Address src);
void cvtsd2ss(XMMRegister dst, XMMRegister src);
void cvtsd2ss(XMMRegister dst, Address src);
void cvtsi2sdl(XMMRegister dst, Register src);
void cvtsi2sdl(XMMRegister dst, Address src);
void cvtsi2ssl(XMMRegister dst, Register src);
void cvtsi2ssl(XMMRegister dst, Address src);
#ifdef _LP64
void cvtsi2sdq(XMMRegister dst, Register src);
void cvtsi2sdq(XMMRegister dst, Address src);
void cvtsi2ssq(XMMRegister dst, Register src);
void cvtsi2ssq(XMMRegister dst, Address src);
#endif
void locked_cmpxchgptr(Register reg, AddressLiteral adr, Register rscratch = noreg);
void imulptr(Register dst, Register src) { LP64_ONLY(imulq(dst, src)) NOT_LP64(imull(dst, src)); }

View File

@@ -248,17 +248,4 @@
}
}
// Is SIMD sort supported for this CPU?
static bool supports_simd_sort(BasicType bt) {
if (VM_Version::supports_avx512dq()) {
return true;
}
else if (VM_Version::supports_avx2() && !is_double_word_type(bt)) {
return true;
}
else {
return false;
}
}
#endif // CPU_X86_MATCHER_X86_HPP

View File

@@ -528,8 +528,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
}
}
// return value can be odd number of VMRegImpl stack slots make multiple of 2
return align_up(stack, 2);
return stack;
}
// Patch the callers callsite with entry to compiled code if it exists.

View File

@@ -498,7 +498,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
uint int_args = 0;
uint fp_args = 0;
uint stk_args = 0; // inc by 2 each time
uint stk_args = 0;
for (int i = 0; i < total_args_passed; i++) {
switch (sig_bt[i]) {
@@ -510,8 +510,9 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
if (int_args < Argument::n_int_register_parameters_j) {
regs[i].set1(INT_ArgReg[int_args++]->as_VMReg());
} else {
stk_args = align_up(stk_args, 2);
regs[i].set1(VMRegImpl::stack2reg(stk_args));
stk_args += 2;
stk_args += 1;
}
break;
case T_VOID:
@@ -528,6 +529,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
if (int_args < Argument::n_int_register_parameters_j) {
regs[i].set2(INT_ArgReg[int_args++]->as_VMReg());
} else {
stk_args = align_up(stk_args, 2);
regs[i].set2(VMRegImpl::stack2reg(stk_args));
stk_args += 2;
}
@@ -536,8 +538,9 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
if (fp_args < Argument::n_float_register_parameters_j) {
regs[i].set1(FP_ArgReg[fp_args++]->as_VMReg());
} else {
stk_args = align_up(stk_args, 2);
regs[i].set1(VMRegImpl::stack2reg(stk_args));
stk_args += 2;
stk_args += 1;
}
break;
case T_DOUBLE:
@@ -545,6 +548,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
if (fp_args < Argument::n_float_register_parameters_j) {
regs[i].set2(FP_ArgReg[fp_args++]->as_VMReg());
} else {
stk_args = align_up(stk_args, 2);
regs[i].set2(VMRegImpl::stack2reg(stk_args));
stk_args += 2;
}
@@ -555,7 +559,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
}
}
return align_up(stk_args, 2);
return stk_args;
}
// Patch the callers callsite with entry to compiled code if it exists.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -2318,7 +2318,7 @@ address StubGenerator::generate_base64_decodeBlock() {
const Register isURL = c_rarg5;// Base64 or URL character set
__ movl(isMIME, Address(rbp, 2 * wordSize));
#else
const Address dp_mem(rbp, 6 * wordSize); // length is on stack on Win64
const Address dp_mem(rbp, 6 * wordSize); // length is on stack on Win64
const Address isURL_mem(rbp, 7 * wordSize);
const Register isURL = r10; // pick the volatile windows register
const Register dp = r12;
@@ -2540,10 +2540,12 @@ address StubGenerator::generate_base64_decodeBlock() {
// output_size in r13
// Strip pad characters, if any, and adjust length and mask
__ addq(length, start_offset);
__ cmpb(Address(source, length, Address::times_1, -1), '=');
__ jcc(Assembler::equal, L_padding);
__ BIND(L_donePadding);
__ subq(length, start_offset);
// Output size is (64 - output_size), output mask is (all 1s >> output_size).
__ kmovql(input_mask, rax);
@@ -4193,23 +4195,22 @@ void StubGenerator::generate_compiler_stubs() {
= CAST_FROM_FN_PTR(address, SharedRuntime::montgomery_square);
}
// Load x86_64_sort library on supported hardware to enable SIMD sort and partition intrinsics
if (VM_Version::is_intel() && (VM_Version::supports_avx512dq() || VM_Version::supports_avx2())) {
// Load x86_64_sort library on supported hardware to enable avx512 sort and partition intrinsics
if (VM_Version::is_intel() && VM_Version::supports_avx512dq()) {
void *libsimdsort = nullptr;
char ebuf_[1024];
char dll_name_simd_sort[JVM_MAXPATHLEN];
if (os::dll_locate_lib(dll_name_simd_sort, sizeof(dll_name_simd_sort), Arguments::get_dll_dir(), "simdsort")) {
libsimdsort = os::dll_load(dll_name_simd_sort, ebuf_, sizeof ebuf_);
}
// Get addresses for SIMD sort and partition routines
// Get addresses for avx512 sort and partition routines
if (libsimdsort != nullptr) {
log_info(library)("Loaded library %s, handle " INTPTR_FORMAT, JNI_LIB_PREFIX "simdsort" JNI_LIB_SUFFIX, p2i(libsimdsort));
snprintf(ebuf_, sizeof(ebuf_), VM_Version::supports_avx512dq() ? "avx512_sort" : "avx2_sort");
snprintf(ebuf_, sizeof(ebuf_), "avx512_sort");
StubRoutines::_array_sort = (address)os::dll_lookup(libsimdsort, ebuf_);
snprintf(ebuf_, sizeof(ebuf_), VM_Version::supports_avx512dq() ? "avx512_partition" : "avx2_partition");
snprintf(ebuf_, sizeof(ebuf_), "avx512_partition");
StubRoutines::_array_partition = (address)os::dll_lookup(libsimdsort, ebuf_);
}
}

View File

@@ -858,7 +858,7 @@ void VM_Version::get_processor_features() {
// Check if processor has Intel Ecore
if (FLAG_IS_DEFAULT(EnableX86ECoreOpts) && is_intel() && cpu_family() == 6 &&
(_model == 0x97 || _model == 0xAA || _model == 0xAC || _model == 0xAF)) {
(_model == 0x97 || _model == 0xAC || _model == 0xAF)) {
FLAG_SET_DEFAULT(EnableX86ECoreOpts, true);
}

View File

@@ -10095,7 +10095,7 @@ instruct cmpD_imm(rRegI dst, regD src, immD con, rFlagsReg cr) %{
instruct convF2D_reg_reg(regD dst, regF src)
%{
match(Set dst (ConvF2D src));
effect(TEMP dst);
format %{ "cvtss2sd $dst, $src" %}
ins_encode %{
__ cvtss2sd ($dst$$XMMRegister, $src$$XMMRegister);
@@ -10117,7 +10117,7 @@ instruct convF2D_reg_mem(regD dst, memory src)
instruct convD2F_reg_reg(regF dst, regD src)
%{
match(Set dst (ConvD2F src));
effect(TEMP dst);
format %{ "cvtsd2ss $dst, $src" %}
ins_encode %{
__ cvtsd2ss ($dst$$XMMRegister, $src$$XMMRegister);

View File

@@ -72,7 +72,7 @@ CallingConvention* FrameMap::java_calling_convention(const BasicTypeArray* signa
}
}
intptr_t out_preserve = SharedRuntime::java_calling_convention(sig_bt, regs, sizeargs);
intptr_t out_preserve = align_up(SharedRuntime::java_calling_convention(sig_bt, regs, sizeargs), 2);
LIR_OprList* args = new LIR_OprList(signature->length());
for (i = 0; i < sizeargs;) {
BasicType t = sig_bt[i];

View File

@@ -421,8 +421,11 @@ void RangeCheckEliminator::add_access_indexed_info(InstructionList &indices, int
aii->_max = idx;
aii->_list = new AccessIndexedList();
} else if (idx >= aii->_min && idx <= aii->_max) {
remove_range_check(ai);
return;
// Guard against underflow/overflow (see 'range_cond' check in RangeCheckEliminator::in_block_motion)
if (aii->_max < 0 || (aii->_max + min_jint) <= aii->_min) {
remove_range_check(ai);
return;
}
}
aii->_min = MIN2(aii->_min, idx);
aii->_max = MAX2(aii->_max, idx);
@@ -465,9 +468,9 @@ void RangeCheckEliminator::in_block_motion(BlockBegin *block, AccessIndexedList
}
}
} else {
int last_integer = 0;
jint last_integer = 0;
Instruction *last_instruction = index;
int base = 0;
jint base = 0;
ArithmeticOp *ao = index->as_ArithmeticOp();
while (ao != nullptr && (ao->x()->as_Constant() || ao->y()->as_Constant()) && (ao->op() == Bytecodes::_iadd || ao->op() == Bytecodes::_isub)) {
@@ -479,12 +482,12 @@ void RangeCheckEliminator::in_block_motion(BlockBegin *block, AccessIndexedList
}
if (c) {
int value = c->type()->as_IntConstant()->value();
jint value = c->type()->as_IntConstant()->value();
if (value != min_jint) {
if (ao->op() == Bytecodes::_isub) {
value = -value;
}
base += value;
base = java_add(base, value);
last_integer = base;
last_instruction = other;
}
@@ -506,12 +509,12 @@ void RangeCheckEliminator::in_block_motion(BlockBegin *block, AccessIndexedList
assert(info != nullptr, "Info must not be null");
// if idx < 0, max > 0, max + idx may fall between 0 and
// length-1 and if min < 0, min + idx may overflow and be >=
// length-1 and if min < 0, min + idx may underflow/overflow and be >=
// 0. The predicate wouldn't trigger but some accesses could
// be with a negative index. This test guarantees that for the
// min and max value that are kept the predicate can't let
// some incorrect accesses happen.
bool range_cond = (info->_max < 0 || info->_max + min_jint <= info->_min);
bool range_cond = (info->_max < 0 || (info->_max + min_jint) <= info->_min);
// Generate code only if more than 2 range checks can be eliminated because of that.
// 2 because at least 2 comparisons are done
@@ -859,7 +862,7 @@ void RangeCheckEliminator::process_access_indexed(BlockBegin *loop_header, Block
);
remove_range_check(ai);
} else if (_optimistic && loop_header) {
} else if (false && _optimistic && loop_header) {
assert(ai->array(), "Array must not be null!");
assert(ai->index(), "Index must not be null!");

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -275,9 +275,11 @@
develop(bool, InstallMethods, true, \
"Install methods at the end of successful compilations") \
\
/* The compiler assumes, in many places, that methods are at most 1MB. */ \
/* Therefore, we restrict this flag to at most 1MB. */ \
develop(intx, NMethodSizeLimit, (64*K)*wordSize, \
"Maximum size of a compiled method.") \
range(0, max_jint) \
range(0, 1*M) \
\
develop(bool, TraceFPUStack, false, \
"Trace emulation of the FPU stack (intel only)") \

View File

@@ -129,23 +129,7 @@ CDSHeapVerifier::CDSHeapVerifier() : _archived_objs(0), _problems(0)
// This just points to an empty Map
ADD_EXCL("jdk/internal/reflect/Reflection", "methodFilterMap"); // E
ADD_EXCL("jdk/internal/util/StaticProperty", "FILE_ENCODING", // C
"JAVA_LOCALE_USE_OLD_ISO_CODES", // C
"USER_LANGUAGE", // C
"USER_LANGUAGE_DISPLAY", // C
"USER_LANGUAGE_FORMAT", // C
"USER_SCRIPT", // C
"USER_SCRIPT_DISPLAY", // C
"USER_SCRIPT_FORMAT", // C
"USER_COUNTRY", // C
"USER_COUNTRY_DISPLAY", // C
"USER_COUNTRY_FORMAT", // C
"USER_VARIANT", // C
"USER_VARIANT_DISPLAY", // C
"USER_VARIANT_FORMAT", // C
"USER_EXTENSIONS", // C
"USER_EXTENSIONS_DISPLAY", // C
"USER_EXTENSIONS_FORMAT", // C
"USER_REGION"); // C
"JAVA_LOCALE_USE_OLD_ISO_CODES"); // C
// Integer for 0 and 1 are in java/lang/Integer$IntegerCache and are archived
ADD_EXCL("sun/invoke/util/ValueConversions", "ONE_INT", // E

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -576,12 +576,14 @@ int FileMapInfo::get_module_shared_path_index(Symbol* location) {
const char* file = ClassLoader::skip_uri_protocol(location->as_C_string());
for (int i = ClassLoaderExt::app_module_paths_start_index(); i < get_number_of_shared_paths(); i++) {
SharedClassPathEntry* ent = shared_path(i);
assert(ent->in_named_module(), "must be");
bool cond = strcmp(file, ent->name()) == 0;
log_debug(class, path)("get_module_shared_path_index (%d) %s : %s = %s", i,
location->as_C_string(), ent->name(), cond ? "same" : "different");
if (cond) {
return i;
if (!ent->is_non_existent()) {
assert(ent->in_named_module(), "must be");
bool cond = strcmp(file, ent->name()) == 0;
log_debug(class, path)("get_module_shared_path_index (%d) %s : %s = %s", i,
location->as_C_string(), ent->name(), cond ? "same" : "different");
if (cond) {
return i;
}
}
}
@@ -1465,7 +1467,7 @@ BitMapView FileMapRegion::ptrmap_view() {
return bitmap_view(false);
}
bool FileMapRegion::check_region_crc(char* base) const {
bool FileMapRegion::check_region_crc() const {
// This function should be called after the region has been properly
// loaded into memory via FileMapInfo::map_region() or FileMapInfo::read_region().
// I.e., this->mapped_base() must be valid.
@@ -1474,8 +1476,8 @@ bool FileMapRegion::check_region_crc(char* base) const {
return true;
}
assert(base != nullptr, "must be initialized");
int crc = ClassLoader::crc32(0, base, (jint)sz);
assert(mapped_base() != nullptr, "must be initialized");
int crc = ClassLoader::crc32(0, mapped_base(), (jint)sz);
if (crc != this->crc()) {
log_warning(cds)("Checksum verification failed.");
return false;
@@ -1760,13 +1762,13 @@ bool FileMapInfo::read_region(int i, char* base, size_t size, bool do_commit) {
return false;
}
if (VerifySharedSpaces && !r->check_region_crc(base)) {
return false;
}
r->set_mapped_from_file(false);
r->set_mapped_base(base);
if (VerifySharedSpaces && !r->check_region_crc()) {
return false;
}
return true;
}
@@ -1803,7 +1805,6 @@ MapArchiveResult FileMapInfo::map_region(int i, intx addr_delta, char* mapped_ba
return MAP_ARCHIVE_OTHER_FAILURE; // oom or I/O error.
} else {
assert(r->mapped_base() != nullptr, "must be initialized");
return MAP_ARCHIVE_SUCCESS;
}
} else {
// Note that this may either be a "fresh" mapping into unreserved address
@@ -1818,16 +1819,15 @@ MapArchiveResult FileMapInfo::map_region(int i, intx addr_delta, char* mapped_ba
_memory_mapping_failed = true;
return MAP_ARCHIVE_MMAP_FAILURE;
}
if (VerifySharedSpaces && !r->check_region_crc(requested_addr)) {
return MAP_ARCHIVE_OTHER_FAILURE;
}
r->set_mapped_from_file(true);
r->set_mapped_base(requested_addr);
return MAP_ARCHIVE_SUCCESS;
}
if (VerifySharedSpaces && !r->check_region_crc()) {
return MAP_ARCHIVE_OTHER_FAILURE;
}
return MAP_ARCHIVE_SUCCESS;
}
// The return value is the location of the archive relocation bitmap.
@@ -1845,7 +1845,8 @@ char* FileMapInfo::map_bitmap_region() {
return nullptr;
}
if (VerifySharedSpaces && !r->check_region_crc(bitmap_base)) {
r->set_mapped_base(bitmap_base);
if (VerifySharedSpaces && !r->check_region_crc()) {
log_error(cds)("relocation bitmap CRC error");
if (!os::unmap_memory(bitmap_base, r->used_aligned())) {
fatal("os::unmap_memory of relocation bitmap failed");
@@ -1854,7 +1855,6 @@ char* FileMapInfo::map_bitmap_region() {
}
r->set_mapped_from_file(true);
r->set_mapped_base(bitmap_base);
log_info(cds)("Mapped %s region #%d at base " INTPTR_FORMAT " top " INTPTR_FORMAT " (%s)",
is_static() ? "static " : "dynamic",
MetaspaceShared::bm, p2i(r->mapped_base()), p2i(r->mapped_end()),
@@ -2130,14 +2130,13 @@ bool FileMapInfo::map_heap_region_impl() {
return false;
}
if (VerifySharedSpaces && !r->check_region_crc(base)) {
r->set_mapped_base(base);
if (VerifySharedSpaces && !r->check_region_crc()) {
dealloc_heap_region();
log_info(cds)("UseSharedSpaces: mapped heap region is corrupt");
return false;
}
r->set_mapped_base(base);
// If the requested range is different from the range allocated by GC, then
// the pointers need to be patched.
address mapped_start = (address) _mapped_heap_memregion.start();

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -89,6 +89,7 @@ public:
bool is_dir() const { return _type == dir_entry; }
bool is_modules_image() const { return _type == modules_image_entry; }
bool is_jar() const { return _type == jar_entry; }
bool is_non_existent() const { return _type == non_existent_entry; }
bool from_class_path_attr() { return _from_class_path_attr; }
time_t timestamp() const { return _timestamp; }
const char* name() const;
@@ -170,7 +171,7 @@ public:
BitMapView ptrmap_view();
bool has_ptrmap() { return _ptrmap_size_in_bits != 0; }
bool check_region_crc(char* base) const;
bool check_region_crc() const;
void print(outputStream* st, int region_index);
};

View File

@@ -149,8 +149,6 @@
#define JAVA_22_VERSION 66
#define JAVA_23_VERSION 67
void ClassFileParser::set_class_bad_constant_seen(short bad_constant) {
assert((bad_constant == JVM_CONSTANT_Module ||
bad_constant == JVM_CONSTANT_Package) && _major_version >= JAVA_9_VERSION,

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -387,7 +387,7 @@ bool LoaderConstraintTable::add_entry(Symbol* class_name,
} else if (pp1 == nullptr) {
pp2->extend_loader_constraint(class_name, loader1, klass);
} else if (pp2 == nullptr) {
pp1->extend_loader_constraint(class_name, loader1, klass);
pp1->extend_loader_constraint(class_name, loader2, klass);
} else {
merge_loader_constraints(class_name, pp1, pp2, klass);
}

View File

@@ -1111,14 +1111,13 @@ InstanceKlass* SystemDictionary::load_shared_lambda_proxy_class(InstanceKlass* i
if (loaded_ik != nullptr) {
assert(shared_nest_host->is_same_class_package(ik),
"lambda proxy class and its nest host must be in the same package");
// The lambda proxy class and its nest host have the same class loader and class loader data,
// as verified in SystemDictionaryShared::add_lambda_proxy_class()
assert(shared_nest_host->class_loader() == class_loader(), "mismatched class loader");
assert(shared_nest_host->class_loader_data() == class_loader_data(class_loader), "mismatched class loader data");
ik->set_nest_host(shared_nest_host);
}
// The lambda proxy class and its nest host have the same class loader and class loader data,
// as verified in SystemDictionaryShared::add_lambda_proxy_class()
assert(shared_nest_host->class_loader() == class_loader(), "mismatched class loader");
assert(shared_nest_host->class_loader_data() == class_loader_data(class_loader), "mismatched class loader data");
ik->set_nest_host(shared_nest_host);
return loaded_ik;
}

View File

@@ -2257,11 +2257,12 @@ void ClassVerifier::verify_switch(
"low must be less than or equal to high in tableswitch");
return;
}
keys = high - low + 1;
if (keys < 0) {
int64_t keys64 = ((int64_t)high - low) + 1;
if (keys64 > 65535) { // Max code length
verify_error(ErrorContext::bad_code(bci), "too many keys in tableswitch");
return;
}
keys = (int)keys64;
delta = 1;
} else {
keys = (int)Bytes::get_Java_u4(aligned_bcp + jintSize);

View File

@@ -597,6 +597,7 @@ class methodHandle;
do_intrinsic(_notifyJvmtiVThreadMount, java_lang_VirtualThread, notifyJvmtiMount_name, bool_void_signature, F_RN) \
do_intrinsic(_notifyJvmtiVThreadUnmount, java_lang_VirtualThread, notifyJvmtiUnmount_name, bool_void_signature, F_RN) \
do_intrinsic(_notifyJvmtiVThreadHideFrames, java_lang_VirtualThread, notifyJvmtiHideFrames_name, bool_void_signature, F_RN) \
do_intrinsic(_notifyJvmtiVThreadDisableSuspend, java_lang_VirtualThread, notifyJvmtiDisableSuspend_name, bool_void_signature, F_RN) \
\
/* support for UnsafeConstants */ \
do_class(jdk_internal_misc_UnsafeConstants, "jdk/internal/misc/UnsafeConstants") \

View File

@@ -421,6 +421,7 @@ class SerializeClosure;
template(notifyJvmtiMount_name, "notifyJvmtiMount") \
template(notifyJvmtiUnmount_name, "notifyJvmtiUnmount") \
template(notifyJvmtiHideFrames_name, "notifyJvmtiHideFrames") \
template(notifyJvmtiDisableSuspend_name, "notifyJvmtiDisableSuspend") \
template(doYield_name, "doYield") \
template(enter_name, "enter") \
template(enterSpecial_name, "enterSpecial") \

View File

@@ -3017,7 +3017,7 @@ void nmethod::print_nmethod_labels(outputStream* stream, address block_begin, bo
assert(sig_index == sizeargs, "");
}
const char* spname = "sp"; // make arch-specific?
intptr_t out_preserve = SharedRuntime::java_calling_convention(sig_bt, regs, sizeargs);
SharedRuntime::java_calling_convention(sig_bt, regs, sizeargs);
int stack_slot_offset = this->frame_size() * wordSize;
int tab1 = 14, tab2 = 24;
int sig_index = 0;

View File

@@ -841,8 +841,15 @@ void DeoptimizeObjectsALotThread::deoptimize_objects_alot_loop_all() {
JavaThread* CompileBroker::make_thread(ThreadType type, jobject thread_handle, CompileQueue* queue, AbstractCompiler* comp, JavaThread* THREAD) {
JavaThread* new_thread = nullptr;
Handle thread_oop(THREAD, JNIHandles::resolve_non_null(thread_handle));
if (java_lang_Thread::thread(thread_oop()) != nullptr) {
assert(type == compiler_t, "should only happen with reused compiler threads");
// The compiler thread hasn't actually exited yet so don't try to reuse it
return nullptr;
}
JavaThread* new_thread = nullptr;
switch (type) {
case compiler_t:
assert(comp != nullptr, "Compiler instance missing.");
@@ -871,7 +878,6 @@ JavaThread* CompileBroker::make_thread(ThreadType type, jobject thread_handle, C
// JavaThread due to lack of resources. We will handle that failure below.
// Also check new_thread so that static analysis is happy.
if (new_thread != nullptr && new_thread->osthread() != nullptr) {
Handle thread_oop(THREAD, JNIHandles::resolve_non_null(thread_handle));
if (type == compiler_t) {
CompilerThread::cast(new_thread)->set_compiler(comp);

View File

@@ -175,7 +175,7 @@ G1ConcurrentRefine::G1ConcurrentRefine(G1Policy* policy) :
{}
jint G1ConcurrentRefine::initialize() {
return _thread_control.initialize(this, G1ConcRefinementThreads);
return _thread_control.initialize(this, max_num_threads());
}
G1ConcurrentRefine* G1ConcurrentRefine::create(G1Policy* policy, jint* ecode) {
@@ -199,6 +199,10 @@ void G1ConcurrentRefine::threads_do(ThreadClosure *tc) {
_thread_control.worker_threads_do(tc);
}
uint G1ConcurrentRefine::max_num_threads() {
return G1ConcRefinementThreads;
}
void G1ConcurrentRefine::update_pending_cards_target(double logged_cards_time_ms,
size_t processed_logged_cards,
size_t predicted_thread_buffer_cards,

View File

@@ -215,6 +215,9 @@ public:
// Iterate over all concurrent refinement threads applying the given closure.
void threads_do(ThreadClosure *tc);
// Maximum number of refinement threads.
static uint max_num_threads();
};
#endif // SHARE_GC_G1_G1CONCURRENTREFINE_HPP

View File

@@ -81,7 +81,7 @@ void G1FromCardCache::print(outputStream* out) {
#endif
uint G1FromCardCache::num_par_rem_sets() {
return G1DirtyCardQueueSet::num_par_ids() + G1ConcRefinementThreads + MAX2(ConcGCThreads, ParallelGCThreads);
return G1DirtyCardQueueSet::num_par_ids() + G1ConcurrentRefine::max_num_threads() + MAX2(ConcGCThreads, ParallelGCThreads);
}
void G1FromCardCache::clear(uint region_idx) {

View File

@@ -91,6 +91,11 @@ class G1RemSetScanState : public CHeapObj<mtGC> {
size_t _max_reserved_regions;
// Has this region that is part of the regions in the collection set been processed yet.
typedef bool G1RemsetIterState;
G1RemsetIterState volatile* _collection_set_iter_state;
// Card table iteration claim for each heap region, from 0 (completely unscanned)
// to (>=) HeapRegion::CardsPerRegion (completely scanned).
uint volatile* _card_table_scan_state;

View File

@@ -67,7 +67,7 @@ double G1RemSetSummary::rs_thread_vtime(uint thread) const {
}
G1RemSetSummary::G1RemSetSummary(bool should_update) :
_num_vtimes(G1ConcRefinementThreads),
_num_vtimes(G1ConcurrentRefine::max_num_threads()),
_rs_threads_vtimes(NEW_C_HEAP_ARRAY(double, _num_vtimes, mtGC)) {
memset(_rs_threads_vtimes, 0, sizeof(double) * _num_vtimes);

View File

@@ -38,16 +38,18 @@ bool G1RemSetTrackingPolicy::needs_scan_for_rebuild(HeapRegion* r) const {
}
void G1RemSetTrackingPolicy::update_at_allocate(HeapRegion* r) {
assert(r->is_young() || r->is_humongous() || r->is_old(),
"Region %u with unexpected heap region type %s", r->hrm_index(), r->get_type_str());
if (r->is_old()) {
if (r->is_young()) {
// Always collect remembered set for young regions.
r->rem_set()->set_state_complete();
} else if (r->is_humongous()) {
// Collect remembered sets for humongous regions by default to allow eager reclaim.
r->rem_set()->set_state_complete();
} else if (r->is_old()) {
// By default, do not create remembered set for new old regions.
r->rem_set()->set_state_untracked();
return;
} else {
guarantee(false, "Unhandled region %u with heap region type %s", r->hrm_index(), r->get_type_str());
}
// Always collect remembered set for young regions and for humongous regions.
// Humongous regions need that for eager reclaim.
r->rem_set()->set_state_complete();
}
void G1RemSetTrackingPolicy::update_at_free(HeapRegion* r) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -403,7 +403,7 @@ class G1PrepareEvacuationTask : public WorkerTask {
_g1h->register_region_with_region_attr(hr);
}
log_debug(gc, humongous)("Humongous region %u (object size %zu @ " PTR_FORMAT ") remset %zu code roots %zu "
"marked %d pinned count %u reclaim candidate %d type array %d",
"marked %d pinned count %zu reclaim candidate %d type array %d",
index,
cast_to_oop(hr->bottom())->size() * HeapWordSize,
p2i(hr->bottom()),

View File

@@ -113,11 +113,11 @@
"of the optimal occupancy to start marking.") \
range(1, max_intx) \
\
product(uint, G1ConfidencePercent, 50, \
product(uint, G1ConfidencePercent, 50, \
"Confidence level for MMU/pause predictions") \
range(0, 100) \
\
product(uintx, G1SummarizeRSetStatsPeriod, 0, DIAGNOSTIC, \
product(intx, G1SummarizeRSetStatsPeriod, 0, DIAGNOSTIC, \
"The period (in number of GCs) at which we will generate " \
"update buffer processing info " \
"(0 means do not periodically generate this info); " \
@@ -148,7 +148,7 @@
"Number of entries in an SATB log buffer.") \
constraint(G1SATBBufferSizeConstraintFunc, AtParse) \
\
develop(uintx, G1SATBProcessCompletedThreshold, 20, \
develop(intx, G1SATBProcessCompletedThreshold, 20, \
"Number of completed buffers that triggers log processing.") \
range(0, max_jint) \
\

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -424,7 +424,7 @@ void HeapRegion::print_on(outputStream* st) const {
st->print("|-");
}
}
st->print("|%3u", Atomic::load(&_pinned_object_count));
st->print("|%3zu", Atomic::load(&_pinned_object_count));
st->print_cr("");
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -257,7 +257,7 @@ private:
uint _node_index;
// Number of objects in this region that are currently pinned.
volatile uint _pinned_object_count;
volatile size_t _pinned_object_count;
void report_region_type_change(G1HeapRegionTraceType::Type to);
@@ -408,7 +408,7 @@ public:
bool is_old_or_humongous() const { return _type.is_old_or_humongous(); }
uint pinned_count() const { return Atomic::load(&_pinned_object_count); }
size_t pinned_count() const { return Atomic::load(&_pinned_object_count); }
bool has_pinned_objects() const { return pinned_count() > 0; }
void set_free();

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -554,11 +554,11 @@ inline void HeapRegion::record_surv_words_in_group(size_t words_survived) {
}
inline void HeapRegion::increment_pinned_object_count() {
Atomic::add(&_pinned_object_count, 1u, memory_order_relaxed);
Atomic::add(&_pinned_object_count, (size_t)1, memory_order_relaxed);
}
inline void HeapRegion::decrement_pinned_object_count() {
Atomic::sub(&_pinned_object_count, 1u, memory_order_relaxed);
Atomic::sub(&_pinned_object_count, (size_t)1, memory_order_relaxed);
}
#endif // SHARE_GC_G1_HEAPREGION_INLINE_HPP

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -41,7 +41,7 @@
nonstatic_field(HeapRegion, _bottom, HeapWord* const) \
nonstatic_field(HeapRegion, _top, HeapWord* volatile) \
nonstatic_field(HeapRegion, _end, HeapWord* const) \
nonstatic_field(HeapRegion, _pinned_object_count, volatile uint) \
volatile_nonstatic_field(HeapRegion, _pinned_object_count, size_t) \
\
nonstatic_field(HeapRegionType, _tag, HeapRegionType::Tag volatile) \
\

View File

@@ -344,11 +344,17 @@ class AdaptiveSizePolicy : public CHeapObj<mtGC> {
AdaptiveWeightedAverage* avg_eden_live() const { return _avg_eden_live; }
AdaptiveWeightedAverage* avg_old_live() const { return _avg_old_live; }
AdaptivePaddedAverage* avg_survived() const { return _avg_survived; }
AdaptivePaddedNoZeroDevAverage* avg_pretenured() { return _avg_pretenured; }
// Methods indicating events of interest to the adaptive size policy,
// called by GC algorithms. It is the responsibility of users of this
// policy to call these methods at the correct times!
virtual void minor_collection_begin();
virtual void minor_collection_end(GCCause::Cause gc_cause);
virtual LinearLeastSquareFit* minor_pause_old_estimator() const {
return _minor_pause_old_estimator;
}
LinearLeastSquareFit* minor_pause_young_estimator() {
return _minor_pause_young_estimator;
@@ -398,6 +404,10 @@ class AdaptiveSizePolicy : public CHeapObj<mtGC> {
_overhead_checker.set_gc_overhead_limit_exceeded(v);
}
bool gc_overhead_limit_near() {
return _overhead_checker.gc_overhead_limit_near();
}
void reset_gc_overhead_limit_count() {
_overhead_checker.reset_gc_overhead_limit_count();
}

View File

@@ -31,6 +31,7 @@
#include "runtime/init.hpp"
#include "runtime/java.hpp"
#include "runtime/os.hpp"
#include "runtime/safepoint.hpp"
WorkerTaskDispatcher::WorkerTaskDispatcher() :
_task(nullptr),
@@ -141,40 +142,44 @@ void WorkerThreads::threads_do(ThreadClosure* tc) const {
}
}
void WorkerThreads::set_indirectly_suspendible_threads() {
template <typename Function>
void WorkerThreads::threads_do_f(Function function) const {
for (uint i = 0; i < _created_workers; i++) {
function(_workers[i]);
}
}
void WorkerThreads::set_indirect_states() {
#ifdef ASSERT
class SetIndirectlySuspendibleThreadClosure : public ThreadClosure {
virtual void do_thread(Thread* thread) {
const bool is_suspendible = Thread::current()->is_suspendible_thread();
const bool is_safepointed = Thread::current()->is_VM_thread() && SafepointSynchronize::is_at_safepoint();
threads_do_f([&](Thread* thread) {
assert(!thread->is_indirectly_suspendible_thread(), "Unexpected");
assert(!thread->is_indirectly_safepoint_thread(), "Unexpected");
if (is_suspendible) {
thread->set_indirectly_suspendible_thread();
}
};
if (Thread::current()->is_suspendible_thread()) {
SetIndirectlySuspendibleThreadClosure cl;
threads_do(&cl);
}
if (is_safepointed) {
thread->set_indirectly_safepoint_thread();
}
});
#endif
}
void WorkerThreads::clear_indirectly_suspendible_threads() {
void WorkerThreads::clear_indirect_states() {
#ifdef ASSERT
class ClearIndirectlySuspendibleThreadClosure : public ThreadClosure {
virtual void do_thread(Thread* thread) {
thread->clear_indirectly_suspendible_thread();
}
};
if (Thread::current()->is_suspendible_thread()) {
ClearIndirectlySuspendibleThreadClosure cl;
threads_do(&cl);
}
threads_do_f([&](Thread* thread) {
thread->clear_indirectly_suspendible_thread();
thread->clear_indirectly_safepoint_thread();
});
#endif
}
void WorkerThreads::run_task(WorkerTask* task) {
set_indirectly_suspendible_threads();
set_indirect_states();
_dispatcher.coordinator_distribute_task(task, _active_workers);
clear_indirectly_suspendible_threads();
clear_indirect_states();
}
void WorkerThreads::run_task(WorkerTask* task, uint num_workers) {

View File

@@ -93,8 +93,8 @@ private:
WorkerThread* create_worker(uint name_suffix);
void set_indirectly_suspendible_threads();
void clear_indirectly_suspendible_threads();
void set_indirect_states();
void clear_indirect_states();
protected:
virtual void on_create_worker(WorkerThread* worker) {}
@@ -111,6 +111,8 @@ public:
uint set_active_workers(uint num_workers);
void threads_do(ThreadClosure* tc) const;
template <typename Function>
void threads_do_f(Function function) const;
const char* name() const { return _name; }

View File

@@ -26,14 +26,13 @@
#include "gc/z/zBarrier.hpp"
#include "code/codeCache.hpp"
#include "gc/z/zAddress.inline.hpp"
#include "gc/z/zGeneration.inline.hpp"
#include "gc/z/zHeap.inline.hpp"
#include "gc/z/zResurrection.inline.hpp"
#include "gc/z/zVerify.hpp"
#include "oops/oop.hpp"
#include "runtime/atomic.hpp"
#include "runtime/continuation.hpp"
// A self heal must always "upgrade" the address metadata bits in
// accordance with the metadata bits state machine. The following
@@ -320,17 +319,9 @@ inline zaddress ZBarrier::make_load_good_no_relocate(zpointer o) {
return remap(ZPointer::uncolor_unsafe(o), remap_generation(o));
}
inline void z_assert_is_barrier_safe() {
assert(!Thread::current()->is_ConcurrentGC_thread() || /* Need extra checks for ConcurrentGCThreads */
Thread::current()->is_suspendible_thread() || /* Thread prevents safepoints */
Thread::current()->is_indirectly_suspendible_thread() || /* Coordinator thread prevents safepoints */
SafepointSynchronize::is_at_safepoint(), /* Is at safepoint */
"Shouldn't perform load barrier");
}
template <typename ZBarrierSlowPath>
inline zaddress ZBarrier::barrier(ZBarrierFastPath fast_path, ZBarrierSlowPath slow_path, ZBarrierColor color, volatile zpointer* p, zpointer o, bool allow_null) {
z_assert_is_barrier_safe();
z_verify_safepoints_are_blocked();
// Fast path
if (fast_path(o)) {

View File

@@ -152,6 +152,19 @@ void ZBarrierSet::on_slowpath_allocation_exit(JavaThread* thread, oop new_obj) {
deoptimize_allocation(thread);
}
void ZBarrierSet::clone_obj_array(objArrayOop src_obj, objArrayOop dst_obj, size_t size) {
volatile zpointer* src = (volatile zpointer*)src_obj->base();
volatile zpointer* dst = (volatile zpointer*)dst_obj->base();
for (const zpointer* const end = cast_from_oop<const zpointer*>(src_obj) + size; src < end; src++, dst++) {
zaddress elem = ZBarrier::load_barrier_on_oop_field(src);
// We avoid healing here because the store below colors the pointer store good,
// hence avoiding the cost of a CAS.
ZBarrier::store_barrier_on_heap_oop_field(dst, false /* heal */);
Atomic::store(dst, ZAddress::store_good(elem));
}
}
void ZBarrierSet::print_on(outputStream* st) const {
st->print_cr("ZBarrierSet");
}

View File

@@ -39,6 +39,8 @@ public:
static ZBarrierSetAssembler* assembler();
static bool barrier_needed(DecoratorSet decorators, BasicType type);
static void clone_obj_array(objArrayOop src, objArrayOop dst, size_t size);
virtual void on_thread_create(Thread* thread);
virtual void on_thread_destroy(Thread* thread);
virtual void on_thread_attach(Thread* thread);

View File

@@ -403,14 +403,13 @@ inline bool ZBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_arraycopy_i
return oop_arraycopy_in_heap_no_check_cast(dst, src, length);
}
class ZStoreBarrierOopClosure : public BasicOopIterateClosure {
class ZColorStoreGoodOopClosure : public BasicOopIterateClosure {
public:
virtual void do_oop(oop* p_) {
volatile zpointer* const p = (volatile zpointer*)p_;
const zpointer ptr = ZBarrier::load_atomic(p);
const zaddress addr = ZPointer::uncolor(ptr);
ZBarrier::store_barrier_on_heap_oop_field(p, false /* heal */);
*p = ZAddress::store_good(addr);
Atomic::store(p, ZAddress::store_good(addr));
}
virtual void do_oop(narrowOop* p) {
@@ -433,6 +432,17 @@ template <DecoratorSet decorators, typename BarrierSetT>
inline void ZBarrierSet::AccessBarrier<decorators, BarrierSetT>::clone_in_heap(oop src, oop dst, size_t size) {
assert_is_valid(to_zaddress(src));
if (dst->is_objArray()) {
// Cloning an object array is similar to performing array copy.
// If an array is large enough to have its allocation segmented,
// this operation might require GC barriers. However, the intrinsics
// for cloning arrays transform the clone to an optimized allocation
// and arraycopy sequence, so the performance of this runtime call
// does not matter for object arrays.
clone_obj_array(objArrayOop(src), objArrayOop(dst), size);
return;
}
// Fix the oops
ZLoadBarrierOopClosure cl;
ZIterator::oop_iterate(src, &cl);
@@ -440,10 +450,10 @@ inline void ZBarrierSet::AccessBarrier<decorators, BarrierSetT>::clone_in_heap(o
// Clone the object
Raw::clone_in_heap(src, dst, size);
assert(ZHeap::heap()->is_young(to_zaddress(dst)), "ZColorStoreGoodOopClosure is only valid for young objects");
assert(dst->is_typeArray() || ZHeap::heap()->is_young(to_zaddress(dst)), "ZColorStoreGoodOopClosure is only valid for young objects");
// Color store good before handing out
ZStoreBarrierOopClosure cl_sg;
ZColorStoreGoodOopClosure cl_sg;
ZIterator::oop_iterate(dst, &cl_sg);
}

View File

@@ -286,6 +286,10 @@ void ZGeneration::desynchronize_relocation() {
_relocate.desynchronize();
}
bool ZGeneration::is_relocate_queue_active() const {
return _relocate.is_queue_active();
}
void ZGeneration::reset_statistics() {
assert(SafepointSynchronize::is_at_safepoint(), "Should be at safepoint");
_freed = 0;
@@ -1496,7 +1500,7 @@ void ZGenerationOld::remap_young_roots() {
uint remap_nworkers = clamp(ZGeneration::young()->workers()->active_workers() + prev_nworkers, 1u, ZOldGCThreads);
_workers.set_active_workers(remap_nworkers);
// TODO: The STS joiner is only needed to satisfy z_assert_is_barrier_safe that doesn't
// TODO: The STS joiner is only needed to satisfy ZBarrier::assert_is_state_barrier_safe that doesn't
// understand the driver locker. Consider making the assert aware of the driver locker.
SuspendibleThreadSetJoiner sts_joiner;

View File

@@ -166,6 +166,7 @@ public:
// Relocation
void synchronize_relocation();
void desynchronize_relocation();
bool is_relocate_queue_active() const;
zaddress relocate_or_remap_object(zaddress_unsafe addr);
zaddress remap_object(zaddress_unsafe addr);

View File

@@ -26,11 +26,21 @@
#include "gc/z/zIterator.hpp"
#include "gc/z/zVerify.hpp"
#include "memory/iterator.inline.hpp"
#include "oops/objArrayOop.hpp"
#include "oops/oop.inline.hpp"
inline bool ZIterator::is_invisible_object(oop obj) {
// This is a good place to make sure that we can't concurrently iterate over
// objects while VMThread operations think they have exclusive access to the
// object graph.
//
// One example that have caused problems is the JFR Leak Profiler, which
// sets the mark word to a value that makes the object arrays look like
// invisible objects.
z_verify_safepoints_are_blocked();
return obj->mark_acquire().is_marked();
}

View File

@@ -87,6 +87,7 @@ ZRelocateQueue::ZRelocateQueue()
_nworkers(0),
_nsynchronized(0),
_synchronize(false),
_is_active(false),
_needs_attention(0) {}
bool ZRelocateQueue::needs_attention() const {
@@ -103,6 +104,20 @@ void ZRelocateQueue::dec_needs_attention() {
assert(needs_attention == 0 || needs_attention == 1, "Invalid state");
}
void ZRelocateQueue::activate(uint nworkers) {
_is_active = true;
join(nworkers);
}
void ZRelocateQueue::deactivate() {
Atomic::store(&_is_active, false);
clear();
}
bool ZRelocateQueue::is_active() const {
return Atomic::load(&_is_active);
}
void ZRelocateQueue::join(uint nworkers) {
assert(nworkers != 0, "Must request at least one worker");
assert(_nworkers == 0, "Invalid state");
@@ -327,7 +342,7 @@ ZWorkers* ZRelocate::workers() const {
}
void ZRelocate::start() {
_queue.join(workers()->active_workers());
_queue.activate(workers()->active_workers());
}
void ZRelocate::add_remset(volatile zpointer* p) {
@@ -1088,6 +1103,9 @@ public:
~ZRelocateTask() {
_generation->stat_relocation()->at_relocate_end(_small_allocator.in_place_count(), _medium_allocator.in_place_count());
// Signal that we're not using the queue anymore. Used mostly for asserts.
_queue->deactivate();
}
virtual void work() {
@@ -1232,8 +1250,6 @@ void ZRelocate::relocate(ZRelocationSet* relocation_set) {
ZRelocateAddRemsetForFlipPromoted task(relocation_set->flip_promoted_pages());
workers()->run(&task);
}
_queue.clear();
}
ZPageAge ZRelocate::compute_to_age(ZPageAge from_age) {
@@ -1316,3 +1332,7 @@ void ZRelocate::desynchronize() {
ZRelocateQueue* ZRelocate::queue() {
return &_queue;
}
bool ZRelocate::is_queue_active() const {
return _queue.is_active();
}

View File

@@ -41,6 +41,7 @@ private:
uint _nworkers;
uint _nsynchronized;
bool _synchronize;
volatile bool _is_active;
volatile int _needs_attention;
bool needs_attention() const;
@@ -53,6 +54,10 @@ private:
public:
ZRelocateQueue();
void activate(uint nworkers);
void deactivate();
bool is_active() const;
void join(uint nworkers);
void resize_workers(uint nworkers);
void leave();
@@ -99,6 +104,8 @@ public:
void desynchronize();
ZRelocateQueue* queue();
bool is_queue_active() const;
};
#endif // SHARE_GC_Z_ZRELOCATE_HPP

View File

@@ -106,11 +106,16 @@ public:
}
virtual void work() {
// Join the STS to block out VMThreads while running promote_barrier_on_young_oop_field
SuspendibleThreadSetJoiner sts_joiner;
// Allocate and install forwardings for small pages
for (size_t page_index; _small_iter.next_index(&page_index);) {
ZPage* page = _small->at(int(page_index));
ZForwarding* const forwarding = ZForwarding::alloc(_allocator, page, to_age(page));
install_small(forwarding, _medium->length() + page_index);
SuspendibleThreadSet::yield();
}
// Allocate and install forwardings for medium pages
@@ -118,6 +123,8 @@ public:
ZPage* page = _medium->at(int(page_index));
ZForwarding* const forwarding = ZForwarding::alloc(_allocator, page, to_age(page));
install_medium(forwarding, page_index);
SuspendibleThreadSet::yield();
}
}

View File

@@ -29,11 +29,12 @@
#include "gc/z/zAddress.inline.hpp"
#include "gc/z/zBarrier.inline.hpp"
#include "gc/z/zHeap.inline.hpp"
#include "gc/z/zBarrier.hpp"
#include "oops/oop.hpp"
template <typename ObjectFunctionT>
inline void ZUncoloredRoot::barrier(ObjectFunctionT function, zaddress_unsafe* p, uintptr_t color) {
z_assert_is_barrier_safe();
z_verify_safepoints_are_blocked();
const zaddress_unsafe addr = Atomic::load(p);
assert_is_valid(addr);

View File

@@ -43,16 +43,67 @@
#include "runtime/frame.inline.hpp"
#include "runtime/globals.hpp"
#include "runtime/handles.hpp"
#include "runtime/javaThread.hpp"
#include "runtime/javaThread.inline.hpp"
#include "runtime/mutexLocker.hpp"
#include "runtime/safepoint.hpp"
#include "runtime/stackFrameStream.inline.hpp"
#include "runtime/stackWatermark.inline.hpp"
#include "runtime/stackWatermarkSet.inline.hpp"
#include "runtime/thread.hpp"
#include "utilities/debug.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/preserveException.hpp"
#include "utilities/resourceHash.hpp"
#ifdef ASSERT
// Used to verify that safepoints operations can't be scheduled concurrently
// with callers to this function. Typically used to verify that object oops
// and headers are safe to access.
void z_verify_safepoints_are_blocked() {
Thread* current = Thread::current();
if (current->is_ConcurrentGC_thread()) {
assert(current->is_suspendible_thread(), // Thread prevents safepoints
"Safepoints are not blocked by current thread");
} else if (current->is_Worker_thread()) {
assert(// Check if ...
// the thread prevents safepoints
current->is_suspendible_thread() ||
// the coordinator thread is the safepointing VMThread
current->is_indirectly_safepoint_thread() ||
// the coordinator thread prevents safepoints
current->is_indirectly_suspendible_thread() ||
// the RelocateQueue prevents safepoints
//
// RelocateQueue acts as a pseudo STS leaver/joiner and blocks
// safepoints. There's currently no infrastructure to check if the
// current thread is active or not, so check the global states instead.
ZGeneration::young()->is_relocate_queue_active() ||
ZGeneration::old()->is_relocate_queue_active(),
"Safepoints are not blocked by current thread");
} else if (current->is_Java_thread()) {
JavaThreadState state = JavaThread::cast(current)->thread_state();
assert(state == _thread_in_Java || state == _thread_in_vm || state == _thread_new,
"Safepoints are not blocked by current thread from state: %d", state);
} else if (current->is_JfrSampler_thread()) {
// The JFR sampler thread blocks out safepoints with this lock.
assert_lock_strong(Threads_lock);
} else if (current->is_VM_thread()) {
// The VM Thread doesn't schedule new safepoints while executing
// other safepoint or handshake operations.
} else {
fatal("Unexpected thread type");
}
}
#endif
#define BAD_OOP_ARG(o, p) "Bad oop " PTR_FORMAT " found at " PTR_FORMAT, untype(o), p2i(p)
static bool z_is_null_relaxed(zpointer o) {

View File

@@ -30,6 +30,8 @@ class frame;
class ZForwarding;
class ZPageAllocator;
NOT_DEBUG(inline) void z_verify_safepoints_are_blocked() NOT_DEBUG_RETURN;
class ZVerify : public AllStatic {
private:
static void roots_strong(bool verify_after_old_mark);

View File

@@ -1154,6 +1154,9 @@ JVM_VirtualThreadUnmount(JNIEnv* env, jobject vthread, jboolean hide);
JNIEXPORT void JNICALL
JVM_VirtualThreadHideFrames(JNIEnv* env, jobject vthread, jboolean hide);
JNIEXPORT void JNICALL
JVM_VirtualThreadDisableSuspend(JNIEnv* env, jobject vthread, jboolean enter);
/*
* Core reflection support.
*/

View File

@@ -385,13 +385,18 @@ int Bytecodes::special_length_at(Bytecodes::Code code, address bcp, address end)
if (end != nullptr && aligned_bcp + 3*jintSize >= end) {
return -1; // don't read past end of code buffer
}
// Promote calculation to 64 bits to do range checks, used by the verifier.
// Promote calculation to signed 64 bits to do range checks, used by the verifier.
int64_t lo = (int)Bytes::get_Java_u4(aligned_bcp + 1*jintSize);
int64_t hi = (int)Bytes::get_Java_u4(aligned_bcp + 2*jintSize);
int64_t len = (aligned_bcp - bcp) + (3 + hi - lo + 1)*jintSize;
// only return len if it can be represented as a positive int;
// return -1 otherwise
return (len > 0 && len == (int)len) ? (int)len : -1;
// Only return len if it can be represented as a positive int and lo <= hi.
// The caller checks for bytecode stream overflow.
if (lo <= hi && len == (int)len) {
assert(len > 0, "must be");
return (int)len;
} else {
return -1;
}
}
case _lookupswitch: // fall through
@@ -404,9 +409,13 @@ int Bytecodes::special_length_at(Bytecodes::Code code, address bcp, address end)
// Promote calculation to 64 bits to do range checks, used by the verifier.
int64_t npairs = (int)Bytes::get_Java_u4(aligned_bcp + jintSize);
int64_t len = (aligned_bcp - bcp) + (2 + 2*npairs)*jintSize;
// only return len if it can be represented as a positive int;
// return -1 otherwise
return (len > 0 && len == (int)len) ? (int)len : -1;
// Only return len if it can be represented as a positive int and npairs >= 0.
if (npairs >= 0 && len == (int)len) {
assert(len > 0, "must be");
return (int)len;
} else {
return -1;
}
}
default:
// Note: Length functions must return <=0 for invalid bytecodes.

Some files were not shown because too many files have changed in this diff Show More