Compare commits

...

677 Commits

Author SHA1 Message Date
Nikita Gubarkov
805a5b4f75 Add ExtendedGlyphCache and remove SampleJBRApi from JBR API 2021-09-13 16:47:25 +03:00
Artem Semenov
efabfd0370 8267385: Create NSAccessibilityElement implementation for JavaComponentAccessibility
8262031: Create implementation for NSAccessibilityNavigableStaticText protocol
8264287: Create implementation for NSAccessibilityComboBox protocol peer
8264303: Create implementation for NSAccessibilityTabGroup protocol peer
8264292: Create implementation for NSAccessibilityList protocol peer
8267387: Create implementation for NSAccessibilityOutline protocol
8267388: Create implementation for NSAccessibilityTable protocol
8264286: Create implementation for NSAccessibilityColumn protocol peer
8264298: Create implementation for NSAccessibilityRow protocol peer
8264291: Create implementation for NSAccessibilityCell protocol peer

Reviewed-by: kizune, pbansal, serb
2021-09-11 06:08:56 +07:00
Dmitry Batrak
f757a39090 JBR-3504 a11y focus is set on the wrong element when opening popups
(cherry-picked from commit a69e12e0d2)
2021-09-10 17:49:14 +03:00
Dmitry Batrak
1039653b97 JBR-3726 Modal windows 'disappear' on minimize in KDE
restrict change to KDE only, as it causes problems on GNOME (JBR-3750)

(cherry picked from commit 9c2841028f)
2021-09-10 17:49:09 +03:00
Maxim Kartashev
65fa801231 JBR-3665 Typing is slow in remote X session
Only call XGetKeyboardMapping() once for all valid codes and cache the
resulting table. Use the cache on the subsequent calls to
keycodeToKeysym().
2021-09-10 12:35:45 +03:00
Nikita Gubarkov
3d9ae4dbe8 JBR-3638 Adjust subpixel glyph positions for correct rounding in CStrike#getGlyphImageBounds 2021-09-08 04:23:24 +03:00
Maxim Kartashev
ef8e01b0d4 JBR-2273 JBR musl port
Detect if we're running on a musl-based system by checking for the presence
of the libgcompat.so glibc compatibility library in the process' map.
If so, java is re-started with LD_LIBRARY_PATH set to point to the right
directory with libjvm.so. This works around the problem with the musl
dynamic library loader.

(based on commit 13a904ddb5)
2021-09-07 15:02:17 +03:00
Alexey Ushakov
eaa9c1618e JBR-3727 JBR17-Metal: Flickering on tooltip appearance
Used setOpaque() method to set correct background of platform window
2021-09-03 15:14:58 +02:00
Maxim Kartashev
ee3c7edd84 JBR-3664 Logging for communications with X server
Introduced logging controlled with -Dsun.awt.x11.trace.
Currently, only looks at the AWT lock and reports methods holding it
sorted by average hold time.

(based on commit 792a58ea0e)
(based on commit 770b4dc9c1)
2021-09-01 23:02:37 -07:00
Dmitry Batrak
8a19c38728 JBR-3726 Modal windows 'disappear' on minimize in KDE
(cherry picked from commit d9baf2d9db)
2021-09-01 16:19:38 +03:00
Maxim Kartashev
4fcd80acf0 JBR-3712 Add project creation instructions to JBR README 2021-08-31 14:21:38 +03:00
Maxim Kartashev
6f5dd836de 8269223: -Xcheck:jni WARNINGs working with fonts on Linux
Reviewed-by: prr, serb

(AKA JBR-3542 Fix -Xcheck:jni warnings)
(Based on commit 9bc023220f, includes additional fixes for JBR-specific code)
2021-08-31 13:12:36 +03:00
Maxim Kartashev
2ff21b425e 8267307: Introduce new client property for XAWT: xawt.mwm_decor_title
Reviewed-by: azvegint, serb

(AKA JBR-3416 Introduce new client property for Linux: xawt.mwm_decor_title)
2021-08-30 06:50:11 -07:00
Dmitry Batrak
28e26bc344 JBR-3706 Toggling full screen mode for two frames doesn't work on macOS if invoked without delay
(cherry picked from commit 28cfc4815f)
2021-08-26 16:10:48 +03:00
Dmitry Batrak
1333261006 JBR-3695 JNF removal issue
(cherry picked from commit 83556f56e7)
2021-08-20 10:46:41 +03:00
Vitaly Provodin
519d67cd4c exclude FullScreenInsets test on macosx-aarch64 due to 8266245
exclude bug6596966 test on windows-all due to 8197552
2021-08-18 10:47:41 +07:00
Vladimir Kempik
096484d199 exclude FullScreenInsets test on macosx-aarch64 due to 8266245 2021-08-18 08:40:33 +07:00
Jonathan Gibbons
56dd7358a3 8270872: Final nroff manpage update for JDK 17
Reviewed-by: darcy, mr, iris, naoto
(cherry picked from commit dfacda488b)
2021-08-17 09:58:51 +07:00
Markus Grönlund
bf33424c15 8271588: JFR Recorder Thread crashed with SIGSEGV in write_klass
Reviewed-by: egahlin
(cherry picked from commit 90f85ff70f)
2021-08-17 09:58:51 +07:00
Daniel D. Daugherty
a2405cbfee 8271863: ProblemList serviceability/sa/TestJmapCore.java on linux-x64 with ZGC
Backport-of: a007cb1a1d
(cherry picked from commit f312f28b8b)
2021-08-17 09:58:50 +07:00
Daniel D. Daugherty
a09d00d0bc 8271894: ProblemList javax/swing/JComponent/7154030/bug7154030.java in JDK17
Reviewed-by: darcy
(cherry picked from commit cebcc07b1b)
2021-08-17 09:58:50 +07:00
Daniel D. Daugherty
6105c96011 8271877: ProblemList jdk/jfr/event/gc/detailed/TestEvacuationFailedEvent.java in JDK17
Reviewed-by: darcy
(cherry picked from commit 5f547e8c11)
2021-08-17 09:58:49 +07:00
Erik Österlund
8c77e17444 8271064: ZGC several jvm08 perf regressions after JDK-8268372
Reviewed-by: ayang, pliden, tschatzl
(cherry picked from commit 181483b90b)
2021-08-17 09:58:48 +07:00
Igor Ignatyev
9a0069f134 8067223: [TESTBUG] Rename Whitebox API package
Reviewed-by: dholmes, kvn
(cherry picked from commit ada58d13f7)
2021-08-17 09:58:48 +07:00
Saravana Kumar Vijayasekaran
fc79bda8dd 8271150: Remove EA from JDK 17 version string starting with Initial RC promotion on Aug 5, 2021(B34)
Reviewed-by: iris, mikael
(cherry picked from commit f8fb571307)
2021-08-17 09:58:47 +07:00
Roland Westrelin
ce8bb4ce8b 8271272: C2: assert(!had_error) failed: bad dominance
Reviewed-by: kvn, thartmann, chagedorn
(cherry picked from commit e351de3bd6)
2021-08-17 09:58:47 +07:00
Chris Plummer
6bb0b6266a 8271512: ProblemList serviceability/sa/sadebugd/DebugdConnectTest.java due to 8270326
Reviewed-by: dcubed
(cherry picked from commit 6180cf1f0d)
2021-08-17 09:58:46 +07:00
Chris Plummer
4b4310ed38 8271507: ProblemList SA tests that are failing with ZGC due to JDK-8248912
Reviewed-by: dcubed
(cherry picked from commit a1b5b818c5)
2021-08-17 09:58:45 +07:00
Roger Riggs
d221c5484e 8271489: (doc) Clarify Filter Factory example
Reviewed-by: iris, kcr, naoto, bpb
(cherry picked from commit 286d313635)
2021-08-17 09:58:45 +07:00
Igor Ignatyev
d31f71ece1 8271403: mark hotspot runtime/memory tests which ignore external VM flags
Reviewed-by: dholmes
(cherry picked from commit 20d2dc1f35)
2021-08-17 09:58:44 +07:00
Igor Ignatyev
b5c9d1299d 8271402: mark hotspot runtime/os tests which ignore external VM flags
Reviewed-by: dholmes
(cherry picked from commit e593e3de4c)
2021-08-17 09:58:44 +07:00
Daniel D. Daugherty
61a3a7b8e8 8271412: ProblemList javax/sound/midi/Sequencer/Looping.java
8271413: ProblemList 2 locale tests on macOS-x64

Reviewed-by: naoto
(cherry picked from commit 7bf72ce301)
2021-08-17 09:58:43 +07:00
Patricio Chilano Mateo
7b936ee500 8271251: JavaThread::java_suspend() fails with "fatal error: Illegal threadstate encountered: 6"
Reviewed-by: dholmes, dcubed
(cherry picked from commit 6878b05f8f)
2021-08-17 09:58:43 +07:00
Igor Ignatyev
5e807aadd3 8271174: runtime/ClassFile/UnsupportedClassFileVersion.java can be run in driver mode
Reviewed-by: mseledtsov, dholmes
(cherry picked from commit c8ae7e5b03)
2021-08-17 09:58:42 +07:00
Kim Barrett
9c224d7db0 8271352: Extend jcc erratum mitigation to additional processors
Reviewed-by: thartmann, eosterlund
(cherry picked from commit 5fcf72086f)
2021-08-17 09:58:42 +07:00
Christoph Göttschkes
b5e58a8c3b 8270908: TestParallelRefProc fails on single core machines
Reviewed-by: tschatzl, kbarrett
(cherry picked from commit 6e1da6440b)
2021-08-17 09:58:41 +07:00
Igor Ignatyev
af6b251d65 8271350: runtime/Safepoint tests use OutputAnalyzer::shouldMatch instead of shouldContaint
Reviewed-by: mseledtsov, dholmes
(cherry picked from commit f1e15c8c8f)
2021-08-17 09:58:40 +07:00
Hannes Wallnöfer
4500eca7d1 8270866: NPE in DocTreePath.getTreePath()
Reviewed-by: jjg
(cherry picked from commit fbe28e4ee1)
2021-08-17 09:58:40 +07:00
Markus Grönlund
24b37db586 8270491: SEGV at read_string_field(oopDesc*, char const*, JavaThread*)+0x54
Reviewed-by: egahlin
(cherry picked from commit f662127390)
2021-08-17 09:58:39 +07:00
Igor Ignatyev
c60f4a2a24 8271223: two runtime/ClassFile tests don't check exit code
Reviewed-by: dholmes
(cherry picked from commit cea7bc2dea)
2021-08-17 09:58:39 +07:00
Jim Laskey
eec8b0fa8c 8269150: UnicodeReader not translating \u005c\\u005d to \\]
Reviewed-by: jjg, jlahoda, darcy
(cherry picked from commit b76a83888b)
2021-08-17 09:58:38 +07:00
Igor Ignatyev
5c43e5aab7 8271175: runtime/jni/FindClassUtf8/FindClassUtf8.java doesn't have to be run in othervm
Reviewed-by: dholmes
(cherry picked from commit 7ddabbff74)
2021-08-17 09:58:38 +07:00
Igor Ignatyev
5867250cfd 8271222: two runtime/Monitor tests don't check exit code
Reviewed-by: dholmes
(cherry picked from commit 3c27f91986)
2021-08-17 09:58:37 +07:00
Alexander Zvegintsev
a48389b346 8015886: java/awt/Focus/DeiconifiedFrameLoosesFocus/DeiconifiedFrameLoosesFocus.java sometimes failed on ubuntu
Reviewed-by: kizune, serb
(cherry picked from commit 049b2ad4df)
2021-08-17 09:58:36 +07:00
Alexander Zuev
6a6a9ad953 8269984: [macos] JTabbedPane title looks like disabled
Reviewed-by: kcr, psadhukhan
(cherry picked from commit 8adf008b15)
2021-08-17 09:58:36 +07:00
Igor Ignatyev
b5781d975c 8271173: serviceability/jvmti/GetObjectSizeClass.java doesn't check exit code
Reviewed-by: dholmes
(cherry picked from commit e90ed6cc38)
2021-08-17 09:58:35 +07:00
Igor Ignatyev
c8f7de81c2 8271189: runtime/handshake/HandshakeTimeoutTest.java can be run in driver mode
Reviewed-by: dholmes
(cherry picked from commit b4c6229fd4)
2021-08-17 09:58:35 +07:00
Igor Ignatyev
8f58bb84d6 8271162: runtime/StackTrace/LargeClassTest.java can be run in driver mode
Reviewed-by: dholmes
(cherry picked from commit e3800e6497)
2021-08-17 09:58:34 +07:00
Igor Ignatyev
cdeb52b3e6 8271158: runtime/handshake/HandshakeTimeoutTest.java test doesn't check exit code
Reviewed-by: dcubed
(cherry picked from commit ee93cef8aa)
2021-08-17 09:58:34 +07:00
Igor Ignatyev
658dff0901 8271169: runtime/Safepoint/TestAbortVMOnSafepointTimeout.java can be run in driver mode
Reviewed-by: dholmes
(cherry picked from commit 84be910e1d)
2021-08-17 09:58:33 +07:00
Igor Ignatyev
61a02261ed 8271160: runtime/jni/checked/TestCheckedJniExceptionCheck.java doesn't set -Djava.library.path
Reviewed-by: dcubed, dholmes
(cherry picked from commit 2d165a2bdf)
2021-08-17 09:58:33 +07:00
Alexey Semenyuk
7863913daf 8271155: Wrong path separator in env variable
Reviewed-by: herrick, kcr, iris, almatvee
(cherry picked from commit 7165b3f105)
2021-08-17 09:58:32 +07:00
Joe Darcy
4cfbbdad3e 8270916: Update java.lang.annotation.Target for changes in JLS 9.6.4.1
Reviewed-by: bpb, naoto
(cherry picked from commit ecc37b06f2)
2021-08-17 09:58:31 +07:00
Igor Ignatyev
c21ea4475c 8271094: runtime/duplAttributes/DuplAttributesTest.java doesn't check exit code
Reviewed-by: jiefu, dholmes
(cherry picked from commit 4812e53791)
2021-08-17 09:58:31 +07:00
Igor Ignatyev
adc2dc1924 8271093: remove deadcode from runtime/Thread/TestThreadDumpSMRInfo.java test
Reviewed-by: jiefu, dholmes, dcubed
(cherry picked from commit 6a9ab6a2cf)
2021-08-17 09:58:30 +07:00
Patricio Chilano Mateo
591834dd4f 8270085: Suspend during block transition may deadlock if lock held
Co-authored-by: Robbin Ehn <rehn@openjdk.org>
Co-authored-by: Patricio Chilano Mateo <pchilanomate@openjdk.org>
Reviewed-by: dcubed, dholmes, coleenp
(cherry picked from commit e7f9009315)
2021-08-17 09:58:30 +07:00
Daniel D. Daugherty
90a5f1b1f0 8271126: ProblemList runtime/InvocationTests/invokevirtualTests.java
Backport-of: d1257d54f9
(cherry picked from commit 39b486db6d)
2021-08-17 09:58:29 +07:00
Tobias Hartmann
e965842e27 8270461: ZGC: Invalid oop passed to ZBarrierSetRuntime::load_barrier_on_oop_array
Reviewed-by: chagedorn, kvn
(cherry picked from commit 4119a52c4b)
2021-08-17 09:58:29 +07:00
Jamsheed Mohammed C M
e2bf64a981 8266347: assert(Dependencies::is_concrete_root_method(fm, ctxk) == Dependencies::is_concrete_method(m, ctxk)) failed: mismatch
Reviewed-by: vlivanov, thartmann
(cherry picked from commit 89f7998aa7)
2021-08-17 09:58:28 +07:00
Igor Veresov
385892a4cc 8264066: Enhance compiler validation
Reviewed-by: ahgross, kvn, rhalade, thartmann
(cherry picked from commit e1051ae069)
2021-08-17 09:58:27 +07:00
Sean Mullan
58ab9627eb 8265201: JarFile.getInputStream not validating invalid signed jars
Reviewed-by: pkoppula, coffeys
(cherry picked from commit add995be46)
2021-08-17 09:58:27 +07:00
Rahul Yadav
37bf4ef3e2 8258432: Improve File Transfers
Reviewed-by: michaelm, aefimov, dfuchs, chegar, ahgross, rhalade
(cherry picked from commit ca6b222c97)
2021-08-17 09:58:26 +07:00
Jamsheed Mohammed C M
9493774cb7 8264079: Improve abstractions
Reviewed-by: vlivanov, ahgross, thartmann, rhalade
(cherry picked from commit a3acce5210)
2021-08-17 09:58:26 +07:00
Joe Wang
f974f69c59 8262380: Enhance XML processing passes
Reviewed-by: lancea, naoto, ahgross, rhalade
(cherry picked from commit 138f59806f)
2021-08-17 09:58:25 +07:00
Conor Cleary
4dbf97b0ae 8262967: Improve Zip file support
Reviewed-by: ahgross, rhalade, aefimov
(cherry picked from commit 0e6c01163f)
2021-08-17 09:58:25 +07:00
Weijun Wang
7694dc9b9a 8264460: Improve NTLM support
Reviewed-by: xuelei
(cherry picked from commit e48af0069e)
2021-08-17 09:58:24 +07:00
Patrick Concannon
141ef26706 8256491: Better HTTP transport
Reviewed-by: dfuchs, michaelm, rhalade, ahgross
(cherry picked from commit b87e526af1)
2021-08-17 09:58:23 +07:00
Phil Race
46eefed923 8262477: Enhance String Conclusions
Reviewed-by: rhalade, mschoene, psadhukhan, jdv, serb
(cherry picked from commit 1c8b9727b7)
2021-08-17 09:58:23 +07:00
Sergey Bylokhov
bc88a4f828 8262403: Enhanced data transfers
Reviewed-by: rhalade, prr, vdyakov, ahgross
(cherry picked from commit 9accf7c894)
2021-08-17 09:58:22 +07:00
Weijun Wang
30364d564d 8260967: Better jar file validation
Reviewed-by: hchao, valeriep
(cherry picked from commit ef9315bead)
2021-08-17 09:58:22 +07:00
Hai-May Chao
36e35cd187 8260960: Signs of jarsigner signing
Reviewed-by: weijun, rhalade
(cherry picked from commit fc38331f44)
2021-08-17 09:58:21 +07:00
Naoto Sato
3a158aa101 8262410: Enhanced rules for zones
Reviewed-by: rriggs, rhalade
(cherry picked from commit 175b65c0a1)
2021-08-17 09:58:21 +07:00
Phil Race
a78f7f9944 8260453: Improve Font Bounding
Reviewed-by: rhalade, psadhukhan, mschoene, serb
(cherry picked from commit 7b6410f213)
2021-08-17 09:58:20 +07:00
Vicente Romero
7c75a911f7 8256157: Improve bytecode assembly
Reviewed-by: jlahoda, rhalade, mschoene
(cherry picked from commit 7ad6c23c32)
2021-08-17 09:58:20 +07:00
Igor Ignatyev
4fa577e6f4 8268612: a few runtime/memory tests don't check exit code
Reviewed-by: dholmes, mseledtsov
(cherry picked from commit 9b177a7486)
2021-08-17 09:58:19 +07:00
Alexander Zvegintsev
f6b7b7c042 8159904: [TEST_BUG] Failure on solaris of java/awt/Window/MultiWindowApp/MultiWindowAppTest.java
Reviewed-by: prr
(cherry picked from commit 6ce52e6277)
2021-08-17 09:58:18 +07:00
Daniel D. Daugherty
1357d8d714 8271070: ProblemList 3 client tests on Linux-X64
Reviewed-by: prr
(cherry picked from commit 08c52fd33c)
2021-08-17 09:58:18 +07:00
Jesper Wilhelmsson
3649fdd3ff 8270993: Missing forward declaration of ZeroFrame
Reviewed-by: kvn
(cherry picked from commit 61359c46a7)
2021-08-17 09:55:58 +07:00
Daniel D. Daugherty
861b487f85 8268223: Problemlist vmTestbase/nsk/jdi/HiddenClass/events/events001.java
Backport-of: 1e1039a7c8
(cherry picked from commit 8e8e87a765)
2021-08-17 09:55:57 +07:00
Jorn Vernee
8ea9d44f2c 8269240: java/foreign/stackwalk/TestAsyncStackWalk.java test failed with concurrent GC
Reviewed-by: vlivanov, dholmes
(cherry picked from commit 845c31dc4b)
2021-08-17 09:55:57 +07:00
Yi Yang
d5b55f9a38 8270307: C2: assert(false) failed: bad AD file after JDK-8267687
Co-authored-by: Kuai Wei <kuaiwei.kw@alibaba-inc.com>
Reviewed-by: kvn, thartmann
(cherry picked from commit 0cec11d3eb)
2021-08-17 09:55:56 +07:00
Roland Westrelin
8837d9f313 8269752: C2: assert(false) failed: Bad graph detected in build_loop_late
Reviewed-by: chagedorn, kvn
(cherry picked from commit c1304519b5)
2021-08-17 09:55:56 +07:00
Phil Race
77e740e5b3 8270858: Problem List java/awt/Window/MultiWindowApp/MultiWindowAppTest.java on Linux
Reviewed-by: mikael, pbansal
(cherry picked from commit 2dddcce29b)
2021-08-17 09:55:55 +07:00
Christoph Langer
702b2b2891 8270556: Exclude security/infra/java/security/cert/CertPathValidator/certification/LetsEncryptCA
Reviewed-by: mbaesken
(cherry picked from commit 1350e2bd22)
2021-08-17 09:55:05 +07:00
Dmitry Batrak
b59c13b2ff JBR-3686 Background window steals focus when converted to full screen on macOS
(cherry-picked from commit 07a5b9672e)
2021-08-16 16:09:21 +03:00
Dmitry Batrak
3b8c9e6177 JBR-3676 WINDOW_ACTIVATED/DEACTIVATED events sent to a frame when child window closes on macOS
fix cherry-pick issue
2021-08-10 19:23:04 +03:00
Dmitry Batrak
baf3c2335c JBR-3676 WINDOW_ACTIVATED/DEACTIVATED events sent to a frame when child window closes on macOS
(cherry-picked from commit 824f9ebec3)
2021-08-10 16:30:14 +03:00
Dmitry Batrak
1d23636724 JBR-3672 jb/java/awt/Focus/WrongFrameFocusedOnModalDialogClosing.java fails on linux by timeout
(cherry picked from commit 2a71dc5981)
2021-08-09 13:15:26 +03:00
Dmitry Batrak
2f3090185b JBR-3673 jb/java/awt/Window/FullScreenChildWindowShownBefore.java fails on MacOS
make test for JBR-3666 more reliable (not depending on macOS color display policy)

(cherry picked from commit 94a3885bbe)
2021-08-09 13:15:22 +03:00
Dmitry Batrak
978413cf09 JBR-3663, JBR-3671 Problems on macOS space switching
(cherry picked from commit 93588d0738)
2021-08-09 13:15:16 +03:00
Dmitry Batrak
1b373fe80d JBR-3666 Child window stays on default space when full-screen mode is activated for parent window on macOS
(cherry-picked from commit 1dcc612a81)
2021-08-05 10:16:19 +03:00
Dmitry Batrak
ad0ce132e9 JBR-3662 Focus jumps to another project tab after closing modal dialog
(cherry picked from commit bfd01081c3)
2021-08-04 12:35:33 +03:00
Dmitry Batrak
e915da51db JBR-3640 java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFAppModalTest.java: window Open button lost focus when it should not 2021-08-03 19:56:56 +03:00
Dmitry Batrak
c640f098dd JBR-3633 Modal dialog is shown not at the same space as its parent
fix the case when space switch is performed by clicking on app icon in dock, or using Cmd+Tab

(cherry-picked from commit 9fdc75969b)
2021-07-30 20:34:55 +03:00
Nikita Gubarkov
afa513bf99 JBR-3648 Replace CacheCellInfo usages with MTLCacheCellInfo in metal rendering code 2021-07-30 10:45:06 +03:00
Dmitry Batrak
e992826344 JBR-3642 java/awt/Window/8159168/SetShapeTest.java fails on macOS-x64 & macOS-aarch64
make sure jb/java/awt/Focus/Typeahead* tests still pass
2021-07-29 11:13:54 +03:00
Dmitry Batrak
9d1b6ab67f JBR-3642 java/awt/Window/8159168/SetShapeTest.java fails on macOS-x64 & macOS-aarch64
revert JBR-1417 fix (JBR 11 does not support chain of popups)
2021-07-29 11:13:54 +03:00
Vitaly Provodin
d217c0224c JBR-3646 Remove duplicated lambdaFormInvokers.cpp 2021-07-28 11:08:34 +07:00
Vitaly Provodin
f18aaed3ce fixup! JBR-3639 add jbrsdk tarballs for dcevm, jcef builds (windows followup) 2021-07-28 06:56:42 +07:00
Vitaly Provodin
cede9b40a0 fixup! JBR-3639 add jbrsdk tarballs for dcevm, jcef builds 2021-07-27 17:53:58 +07:00
Vitaly Provodin
e7acf5cd13 JBR-3639 add jbrsdk tarballs for dcevm, jcef builds 2021-07-27 03:27:57 +07:00
Anton Tarasov
9813ac154e JBR-3627 include jmods in jbrsdk bundle for jbr-dev 2021-07-27 03:27:53 +07:00
David Holmes
f68f262fbd JBR-3520 AddressSanitizer: stack-use-after-scope in java.desktop/share/native/libawt/java2d/loops/FillRect.c:72 on jtreg tests with IDEA VM options
8269882: stack-use-after-scope in NewObjectA

Reviewed-by: kbarrett
(cherry picked from commit 20eba35515)
2021-07-23 12:33:51 +03:00
Nikita Gubarkov
8612216f60 Add line breaks to jshell script in mkjbrapi.sh 2021-07-21 20:28:44 +03:00
Dmitry Batrak
815e51804e JBR-3633 Modal dialog is shown not at the same space as its parent
(cherry-picked from commit a156c6b9bf)
2021-07-21 17:19:26 +03:00
Dmitry Batrak
f7c4619f5e JBR-3611 Unexpected workspace switch with dialog in full-screen mode on macOS
make test pass with jtreg

(cherry picked from commit 75335543f2)
2021-07-21 14:58:18 +03:00
Maxim Kartashev
90c3971d74 fixup! JBR-3597 Update project README for Java 17 2021-07-19 16:13:44 +03:00
Dmitry Batrak
f6edc4234d JBR-3611 Unexpected workspace switch with dialog in full-screen mode on macOS
(cherry-picked from commit 43fdd6cd26)
2021-07-19 10:36:12 +03:00
Maxim Kartashev
6bfa198ee9 JBR-3597 Update project README for Java 17 2021-07-16 15:53:08 +03:00
William Kemper
da0fcc518a 8268635: Corrupt oop in ClassLoaderData
Reviewed-by: coleenp
Backport-of: 3586a233a4
(cherry picked from commit e104dede6e)
2021-07-16 16:48:41 +07:00
Sibabrata Sahoo
7a7cdd3b68 8269276: Additional tests for MessageDigest with different providers
Reviewed-by: valeriep, wetmore
(cherry picked from commit a32d2eefea)
2021-07-16 16:48:37 +07:00
Erik Joelsson
5acc501904 8270422: Test build/AbsPathsInImage.java fails after JDK-8259848
Reviewed-by: mikael
(cherry picked from commit 7b4d84c654)
2021-07-16 16:48:34 +07:00
Jim Laskey
d4bc283f20 8266313: (JEP-356) - RandomGenerator spec implementation requirements tightly coupled to JDK internal classes
Reviewed-by: rriggs
(cherry picked from commit 72db09b1f3)
2021-07-16 16:48:32 +07:00
Jim Laskey
70b9911d53 8270075: SplittableRandom extends AbstractSplittableGenerator
Reviewed-by: rriggs, bpb
(cherry picked from commit 3bbd2332bd)
2021-07-16 16:48:12 +07:00
Anton Kozlov
023bb10f71 8266889: [macosx-aarch64] Crash with SIGBUS in MarkActivationClosure::do_code_blob during vmTestbase/nsk/jvmti/.../bi04t002 test run
Reviewed-by: dholmes, aph, sspitsyn
(cherry picked from commit 381bd62107)
2021-07-16 16:47:13 +07:00
Hannes Wallnöfer
5bf5168c92 8259499: Handling type arguments from outer classes for inner class in javadoc
Reviewed-by: jjg
(cherry picked from commit 82c256eb61)
2021-07-16 16:47:08 +07:00
Christoph Langer
e388ccea61 8268620: InfiniteLoopException test may fail on x86 platforms
Backport-of: 0b09129fae
(cherry picked from commit e5db9a9405)
2021-07-16 16:46:36 +07:00
Xin Liu
d0d118bb55 8269865: Async UL needs to handle ERANGE on exceeding SEM_VALUE_MAX
Reviewed-by: dholmes, pchilanomate
(cherry picked from commit 67273ae63c)
2021-07-16 16:46:08 +07:00
Yi Yang
aa01e45ca6 8270056: Generated lambda class can not access protected static method of target class
Reviewed-by: mchung
Backport-of: 07e9052457
(cherry picked from commit 0f5470715e)
2021-07-16 16:45:29 +07:00
Vicente Romero
5c1e58b79f 8270025: DynamicCallSiteDesc::withArgs doesn't throw NPE
Reviewed-by: jvernee, mchung
(cherry picked from commit 8583aab374)
2021-07-16 16:45:26 +07:00
Severin Gehwolf
803ac22b6b 8270184: [TESTBUG] Add coverage for jvmci ResolvedJavaType.toJavaName() for lambdas
Backport-of: 6a9bc10873
(cherry picked from commit d32e42cdd4)
2021-07-16 16:45:24 +07:00
Maurizio Cimadamore
9909566102 8269281: java/foreign/Test{Down,Up}call.java time out
Reviewed-by: jvernee
(cherry picked from commit b2416b60fb)
2021-07-16 16:44:53 +07:00
Markus Grönlund
388a1416f7 8269635: Stress test SEGV while emitting OldObjectSample
Reviewed-by: jbachorik
(cherry picked from commit bd95c0c9e0)
2021-07-16 16:44:23 +07:00
Markus Grönlund
b862093dac 8269525: Deadlock during Volano with JFR
Reviewed-by: egahlin
(cherry picked from commit 00ef65f34d)
2021-07-16 16:44:21 +07:00
Erik Joelsson
a4454856fd 8259848: Interim javadoc build does not support platform links
Reviewed-by: hannesw, jjg, ihse
(cherry picked from commit e631addd70)
2021-07-16 16:43:54 +07:00
Christian Hagedorn
bab149d8b1 8269795: C2: Out of bounds array load floats above its range check in loop peeling resulting in SEGV
Reviewed-by: thartmann, roland, kvn
(cherry picked from commit 040c02b942)
2021-07-16 16:43:22 +07:00
Erik Joelsson
d1d91195d9 8270203: Missing build dependency between jdk.jfr-gendata and buildtools-hotspot
Reviewed-by: tbell
(cherry picked from commit 0f32982872)
2021-07-16 16:42:48 +07:00
Sean Mullan
d4620dbb86 8266345: (fs) Custom DefaultFileSystemProvider security related loops
Co-authored-by: Brian Burkhalter <bpb@openjdk.org>
Reviewed-by: bpb, chegar
(cherry picked from commit 4fc3180f75)
2021-07-16 16:42:43 +07:00
Christoph Göttschkes
e4df27e296 8269873: serviceability/sa/Clhsdb tests are using a C2 specific VMStruct field
Reviewed-by: cjplummer, dholmes, sspitsyn
(cherry picked from commit 999ced03cc)
2021-07-16 16:42:13 +07:00
Alexey Bakhtin
6f3c06da75 8268965: TCP Connection Reset when connecting simple socket to SSL server
Reviewed-by: xuelei
Backport-of: 6f171b9f0d
(cherry picked from commit e1d3e73d4e)
2021-07-16 16:41:47 +07:00
Serguei Spitsyn
b364b5cf9d 8269558: fix of JDK-8252657 missed to update history at the end of JVM TI spec
Reviewed-by: dcubed, cjplummer
(cherry picked from commit 3d82b0e634)
2021-07-16 16:41:43 +07:00
Phil Race
9ba8f9c9ed 8270216: [macOS] Update named used for Java run loop mode
Reviewed-by: serb
(cherry picked from commit 254600658a)
2021-07-16 16:41:35 +07:00
Roger Riggs
ca438e64c5 8268826: Cleanup Override in Context-Specific Deserialization Filters
Reviewed-by: dfuchs, bchristi
(cherry picked from commit 6889a39a3f)
2021-07-16 16:40:44 +07:00
Christian Hagedorn
a8cfa4294c 8261147: C2: Node is wrongly marked as reduction resulting in a wrong execution due to wrong vector instructions
Reviewed-by: thartmann, kvn
(cherry picked from commit f791fdf23e)
2021-07-16 16:40:41 +07:00
Jan Lahoda
1e6ea40764 8270151: IncompatibleClassChangeError on empty pattern switch statement case
Reviewed-by: mcimadamore
(cherry picked from commit 1196b35684)
2021-07-16 16:40:07 +07:00
Jan Lahoda
63f8516aeb 8269146: Missing unreported constraints on pattern and other case label combination
8269301: Switch statement with a pattern, constant and default label elements crash javac

Reviewed-by: mcimadamore
(cherry picked from commit 885f7b1141)
2021-07-16 16:40:04 +07:00
Jatin Bhateja
f96765e155 8269952: compiler/vectorapi/VectorCastShape*Test.java tests failed on avx2 machines
Reviewed-by: kvn, dlong
(cherry picked from commit 62ff55d383)
2021-07-16 16:40:03 +07:00
Mikhailo Seledtsov
a48118e7ef 8269840: Update Platform.isDefaultCDSArchiveSupported() to return true for aarch64 platforms
Reviewed-by: minqi, iklam
(cherry picked from commit 46c610cbd8)
2021-07-16 16:39:02 +07:00
Jonathan Gibbons
a26f53bdf1 8269722: NPE in HtmlDocletWriter
Reviewed-by: hannesw
(cherry picked from commit 6401633800)
2021-07-16 16:38:25 +07:00
Daniel D. Daugherty
479a31ac0c 8270109: ProblemList 4 SA tests on macOS-aarch64
Reviewed-by: mikael
(cherry picked from commit 9acb2a69a9)
2021-07-16 16:38:24 +07:00
Brian Burkhalter
e1a1dfbbe6 6766844: ByteArrayInputStream#read with a byte array of length 0 not consistent with InputStream when at EOF
Reviewed-by: naoto, lancea, joehw
(cherry picked from commit f46a917270)
2021-07-16 16:38:15 +07:00
Guoxiong Li
5fa7692e35 8269738: AssertionError when combining pattern matching and function closure
Reviewed-by: jlahoda, vromero
(cherry picked from commit 9e75f922b1)
2021-07-16 16:37:15 +07:00
Jatin Bhateja
aaec4f2632 8269828: corrections in some instruction patterns for KNL x86 platform
Reviewed-by: kvn, dlong
(cherry picked from commit 168af2e6b2)
2021-07-16 16:36:38 +07:00
Jan Lahoda
7e75265125 8268766: Desugaring of pattern matching enum switch should be improved
Reviewed-by: mcimadamore, psandoz
(cherry picked from commit fa08cc62df)
2021-07-16 16:35:43 +07:00
Jan Lahoda
f6e0c51f4e 8270006: Switches with 'case null:' should be exhaustive
Reviewed-by: vromero
(cherry picked from commit 4f70759175)
2021-07-16 16:35:38 +07:00
Roland Westrelin
90c72465df 8269746: C2: assert(!in->is_CFG()) failed: CFG Node with no controlling input?
Reviewed-by: chagedorn, thartmann
(cherry picked from commit 8f798b8222)
2021-07-16 16:34:50 +07:00
Roger Riggs
11d8b4c79e 8269929: (test) Add diagnostic info to ProceessBuilder/Basic.java for unexpected output
Reviewed-by: iris, bpb, naoto
(cherry picked from commit c812bbbe8f)
2021-07-16 16:34:45 +07:00
Alexey Semenyuk
095240f421 8269185: Directories in /opt/runtimepackagetest and /path/to/jdk-17 are different
Reviewed-by: almatvee, herrick
(cherry picked from commit 6000950b33)
2021-07-16 16:34:22 +07:00
Martin Doerr
6dbe81fb17 8269879: [PPC64] C2: Math.rint intrinsic uses wrong rounding mode
Reviewed-by: lucy, goetz
(cherry picked from commit 1f2bf1d194)
2021-07-16 16:33:49 +07:00
Jan Lahoda
953b61ad5b 8266036: class file for sun.misc.Contended not found
8258421: (jdeprscan) tools/jdeprscan/tests/jdk/jdeprscan/TestRelease.java failed with "error: cannot access jdk.internal.ValueBased"

Reviewed-by: darcy
(cherry picked from commit 7fcd5ca025)
2021-07-16 16:33:46 +07:00
Daniel Fuchs
70fa9155fa 8269772: [macos-aarch64] test compilation failed with "SocketException: No buffer space available"
Reviewed-by: chegar, vtewari
(cherry picked from commit a49b1dc704)
2021-07-16 16:33:21 +07:00
Jan Lahoda
761faa1298 8268859: jshell throws exception while parsing illegal "case true"
Reviewed-by: mcimadamore
(cherry picked from commit 820f2900d8)
2021-07-16 16:31:50 +07:00
Jan Lahoda
6ec1bb5f41 8269802: javac fails to compile nested pattern matching switches
8269808: javac generates class with invalid stack map

Reviewed-by: mcimadamore
(cherry picked from commit 815e4af35d)
2021-07-16 16:31:45 +07:00
Chris Plummer
9fa5548588 8269830: SA's vm object vtable matching code sometimes matches on incorrect type
Reviewed-by: kevinw, sspitsyn
(cherry picked from commit 2daf39a59b)
2021-07-16 16:30:58 +07:00
Ioi Lam
d815eb0d7a 8268778: CDS check_excluded_classes needs DumpTimeTable_lock
Reviewed-by: minqi, ccheung
(cherry picked from commit 0ebf8aa9d7)
2021-07-16 16:30:54 +07:00
Vladimir Kozlov
177cbdd112 8269825: [TESTBUG] Missing testing for x86 KNL platforms
Reviewed-by: dlong, jbhateja
(cherry picked from commit 0d1cd3a745)
2021-07-16 16:30:26 +07:00
Vladimir Kozlov
0cee20e65f 8269955: ProblemList compiler/vectorapi/VectorCastShape[64|128]Test.java tests on x86
Reviewed-by: iignatyev, dlong
(cherry picked from commit e0c130f484)
2021-07-16 16:29:50 +07:00
Eric Liu
e435aad3c9 8268966: AArch64: 'bad AD file' in some vector conversion tests
Reviewed-by: aph
(cherry picked from commit 1166ef25e9)
2021-07-16 16:28:32 +07:00
Mandy Chung
dd28f92425 8225667: Clarify the behavior of System::gc w.r.t. reference processing
Reviewed-by: rriggs, kbarrett, tschatzl
(cherry picked from commit 3a69024033)
2021-07-16 16:28:26 +07:00
Xiaohong Gong
c678e99e32 8269568: JVM crashes when running VectorMask query tests
Co-authored-by: Sandhya Viswanathan <sviswanathan@openjdk.org>
Reviewed-by: psandoz, jiefu, jbhateja, sviswanathan
(cherry picked from commit 2b20778225)
2021-07-16 16:27:31 +07:00
Kim Barrett
4c27978cbc 8269661: JNI_GetStringCritical does not lock char array
8269650: Optimize gc-locker in [Get|Release]StringCritical for latin string

Reviewed-by: dholmes, tschatzl
(cherry picked from commit 0f4e07b7d9)
2021-07-16 16:27:23 +07:00
Roland Westrelin
be37a60ed6 8269575: C2: assert(false) failed: graph should be schedulable after JDK-8252372
Reviewed-by: kvn, thartmann
(cherry picked from commit df1364b508)
2021-07-16 16:26:15 +07:00
Roland Westrelin
31dee4fb83 8268883: C2: assert(false) failed: unscheduable graph
Reviewed-by: chagedorn, kvn, yyang
(cherry picked from commit 6d8fc7249a)
2021-07-16 16:25:54 +07:00
Tobias Hartmann
f8685a7abc 8268369: SIGSEGV in PhaseCFG::implicit_null_check due to missing null check
Reviewed-by: chagedorn, kvn
(cherry picked from commit 4ad8b04421)
2021-07-16 16:25:06 +07:00
Erik Gahlin
4aa623e53b 8266595: jdk/jfr/jcmd/TestJcmdDump.java with slowdebug bits fails with AttachNotSupportedException
Reviewed-by: mseledtsov, dholmes
(cherry picked from commit 5b8e1a266e)
2021-07-16 16:25:00 +07:00
Severin Gehwolf
3f1cace058 8269668: [aarch64] java.library.path not including /usr/lib64
Reviewed-by: aph, dholmes
(cherry picked from commit e14801cdd9)
2021-07-16 16:24:09 +07:00
Alexander Zuev
debea16d3d 8268775: Password is being converted to String in AccessibleJPasswordField
Reviewed-by: prr
(cherry picked from commit 97e0e9e73d)
2021-07-16 16:24:03 +07:00
Mikael Vidstedt
a01037bdff 8269768: JFR Terminology Refresh
Reviewed-by: iignatyev, egahlin
(cherry picked from commit 1c18f91438)
2021-07-16 16:23:17 +07:00
Sandhya Viswanathan
340db3385e 8269775: compiler/codegen/ClearArrayTest.java failed with "assert(false) failed: bad AD file"
Reviewed-by: kvn, dlong
(cherry picked from commit 6f0e8e79aa)
2021-07-16 16:23:13 +07:00
Weijun Wang
d36101f251 8269543: The warning for System::setSecurityManager should only appear once for each caller
Reviewed-by: lancea, alanb, dfuchs
(cherry picked from commit c4ea13edd0)
2021-07-16 16:22:21 +07:00
Christian Hagedorn
e1e0ae826c 8262017: C2: assert(n != __null) failed: Bad immediate dominator info.
Reviewed-by: roland, neliasso, kvn
(cherry picked from commit 2db9005c07)
2021-07-16 16:21:49 +07:00
Nils Eliasson
ee6ea9ef15 8269771: assert(tmp == _callprojs.fallthrough_catchproj) failed: allocation control projection
Reviewed-by: rbackman, kvn
(cherry picked from commit 7bc96dbc02)
2021-07-16 16:21:47 +07:00
Jamsheed Mohammed C M
4b8a63e362 8265132: C2 compilation fails with assert "missing precedence edge"
Reviewed-by: iveresov, kvn
(cherry picked from commit 5644c4f942)
2021-07-16 16:21:44 +07:00
Vladimir Kozlov
3655420bff 8269745: [JVMCI] restore original qualified exports to Graal
Reviewed-by: dnsimon, iveresov
(cherry picked from commit a4d2a9a77f)
2021-07-16 16:21:42 +07:00
Maurizio Cimadamore
fbcff00d33 8268566: java/foreign/TestResourceScope.java timed out
Reviewed-by: jvernee
(cherry picked from commit e3773977cf)
2021-07-16 16:21:17 +07:00
Kim Barrett
3ca10f742d 8260684: vmTestbase/gc/gctests/PhantomReference/phantom002/TestDescription.java timed out
Reviewed-by: pliden, lkorinth
(cherry picked from commit 6c76e77158)
2021-07-16 16:20:46 +07:00
Jatin Bhateja
e923c2d1f3 8269580: assert(is_valid()) failed: invalid register (-1)
Reviewed-by: kvn, dlong
(cherry picked from commit 4bbf11d4a9)
2021-07-16 16:20:45 +07:00
Naoto Sato
61cdd9d052 8269704: Typo in j.t.Normalizer.normalize()
Reviewed-by: joehw, prappo, iris
(cherry picked from commit 54dd510bd5)
2021-07-16 16:20:19 +07:00
Jan Lahoda
34dcccd5ed 8269354: javac crashes when processing parenthesized pattern in instanceof
Reviewed-by: vromero
(cherry picked from commit a8385feb30)
2021-07-16 16:19:40 +07:00
Aleksey Shipilev
4ec6d1e9ab 8269285: Crash/miscompile in CallGenerator::for_method_handle_inline after JDK-8191998
Reviewed-by: kvn, iveresov, vlivanov
(cherry picked from commit c16d1fc981)
2021-07-16 16:18:47 +07:00
Roland Westrelin
b26d081b93 8269088: C2 fails with assert(!n->is_Store() && !n->is_LoadStore()) failed: no node with a side effect
Reviewed-by: kvn, iveresov, neliasso
(cherry picked from commit ad27d9b3ec)
2021-07-16 16:18:40 +07:00
Roland Westrelin
f205149794 8269230: C2: main loop in micro benchmark never executed
Co-authored-by: Maurizio Cimadamore <mcimadamore@openjdk.org>
Reviewed-by: kvn, iveresov
(cherry picked from commit c67a7b039d)
2021-07-16 16:18:13 +07:00
Hannes Wallnöfer
230e39283d 8262886: javadoc generates broken links with {@inheritDoc}
Reviewed-by: jjg
(cherry picked from commit 962f1c1a9b)
2021-07-16 16:17:36 +07:00
Jayathirth D V
470b7c4988 8267602: [macos] [lanai] java/awt/PrintJob/Text/stringwidth.sh doesn't exit on cancelling print dialog
Reviewed-by: aghaisas, serb
(cherry picked from commit f7ffd5872d)
2021-07-16 16:16:39 +07:00
Liam Miller-Cushon
5868c93f64 8268592: JDK-8262891 causes an NPE in Lint.augment
Reviewed-by: vromero
(cherry picked from commit 4930ae96d8)
2021-07-16 16:16:03 +07:00
Mandy Chung
dabbf2615a 8262841: Clarify the behavior of PhantomReference::refersTo
Reviewed-by: kbarrett, rriggs
(cherry picked from commit 9ac63a6e08)
2021-07-16 16:15:58 +07:00
Daniel D. Daugherty
6e8b41c964 8269703: ProblemList vmTestbase/nsk/jvmti/scenarios/sampling/SP07/sp07t002/TestDescription.java on Windows-X64 with -Xcomp
Reviewed-by: dholmes
(cherry picked from commit aba6c55dac)
2021-07-16 16:15:09 +07:00
Naoto Sato
a4ba3f2dad 8269513: Clarify the spec wrt useOldISOCodes system property
Reviewed-by: lancea, bpb, iris, joehw
(cherry picked from commit 3e022247d2)
2021-07-16 16:15:05 +07:00
Nils Eliasson
cb9ef412b0 8268897: [TESTBUG] compiler/compilercontrol/mixed/RandomCommandsTest.java must not fail on Command.quiet
Reviewed-by: kvn
(cherry picked from commit 0dc65d3c74)
2021-07-16 16:14:03 +07:00
Hannes Wallnöfer
1327635718 8268557: Module page uses unstyled table class
Reviewed-by: jjg
(cherry picked from commit 3826012281)
2021-07-16 16:13:35 +07:00
Daniel D. Daugherty
91ef0bcc74 8269691: ProblemList sun/management/jdp/JdpDefaultsTest.java on Linux-aarch64
Reviewed-by: kvn, darcy
(cherry picked from commit 2b17e95e20)
2021-07-16 16:12:37 +07:00
Christoph Göttschkes
5cfeb00814 8269486: CallerAccessTest fails for non server variant
Reviewed-by: dholmes, stuefe, mchung, jvernee
(cherry picked from commit 1da5d4bb78)
2021-07-16 16:12:26 +07:00
Martin Doerr
bc5b89f2dc 8269614: [s390] Interpreter checks wrong bit for slow path instance allocation
Reviewed-by: shade, rrich
(cherry picked from commit be0ac92e18)
2021-07-16 16:12:00 +07:00
Zhengyu Gu
ff5fe2d979 8269594: assert(_handle_mark_nesting > 1) failed: memory leak: allocating handle outside HandleMark
Reviewed-by: coleenp, jvernee
(cherry picked from commit 4b4bef4e1e)
2021-07-16 16:10:54 +07:00
Jan Lahoda
b3644582ab 8268320: Better error recovery for broken patterns in switch
Reviewed-by: vromero
(cherry picked from commit 4ee400ae43)
2021-07-16 16:09:59 +07:00
Wang Huang
859283a07c 8265907: JVM crashes when matching VectorMaskCmp Node
Co-authored-by: Wang Huang <whuang@openjdk.org>
Co-authored-by: Ai Jiaming <aijiaming1@huawei.com>
Reviewed-by: njian, jbhateja, sviswanathan, dlong, adinn
(cherry picked from commit ca283c3ac0)
2021-07-16 16:09:53 +07:00
Jan Lahoda
9e9fcfbaa4 8269141: Switch statement containing pattern case label element gets in the loop during execution
Reviewed-by: vromero
(cherry picked from commit c3c918928c)
2021-07-16 16:09:51 +07:00
Leo Korinth
23d3fb6be2 8268350: Remove assert that ensures thread identifier remains the same
Reviewed-by: tschatzl, kbarrett
(cherry picked from commit 6b64a7956c)
2021-07-16 16:09:49 +07:00
Jatin Bhateja
32058159aa 8269528: VectorAPI Long512VectorTest fails on X86 KNL target
Reviewed-by: kvn, sviswanathan
(cherry picked from commit 90eb1189ae)
2021-07-16 16:09:46 +07:00
Jie Fu
06fbd5c211 8269065: [REDO] vmTestbase/vm/mlvm/anonloader/stress/oome/metaspace/Test.java failed with OutOfMemoryError
Reviewed-by: stuefe, iignatyev
(cherry picked from commit a661686e1e)
2021-07-16 16:09:42 +07:00
Sean Coffey
6a5ab3d595 8269034: AccessControlException for SunPKCS11 daemon threads
Reviewed-by: valeriep
(cherry picked from commit 0d745ae8fd)
2021-07-16 16:09:40 +07:00
Christoph Langer
9b4eab82e9 8269529: javax/swing/reliability/HangDuringStaticInitialization.java fails in Windows debug build
Reviewed-by: serb, psadhukhan, pbansal
(cherry picked from commit d042029509)
2021-07-16 16:09:37 +07:00
Chris Plummer
93e2c94ee0 8269232: assert(!is_jweak(handle)) failed: wrong method for detroying jweak
Reviewed-by: rkennke, amenkov, sspitsyn, sgehwolf
(cherry picked from commit 401cb0ad55)
2021-07-16 16:08:40 +07:00
Nils Eliasson
cbebd8b51d 8268884: C2: Compile::remove_speculative_types must iterate top-down
Reviewed-by: roland, kvn
(cherry picked from commit b8a16e931b)
2021-07-16 16:08:35 +07:00
Jonathan Gibbons
a5a7892de4 8249646: Runtime.exec(String, String[], File) documentation contains literal {@link ...}
Reviewed-by: sundar, iris
(cherry picked from commit 25f9f19af9)
2021-07-16 16:07:35 +07:00
Zhengyu Gu
ddf6d7811f 8268699: Shenandoah: Add test for JDK-8268127
Backport-of: e59acd9860
(cherry picked from commit 0d83dc2411)
2021-07-16 16:07:25 +07:00
Jie Fu
46f1f2ed10 8269517: compiler/loopopts/TestPartialPeelingSinkNodes.java crashes with -XX:+VerifyGraphEdges
Reviewed-by: kvn, dlong
(cherry picked from commit 7010dfdffa)
2021-07-16 16:06:54 +07:00
Thomas Schatzl
6c6693cb46 8269126: Rename G1AllowPreventiveGC option to G1UsePreventiveGC
Reviewed-by: kbarrett, iwalulya
(cherry picked from commit fc0fd96a5f)
2021-07-16 16:06:10 +07:00
Mandy Chung
8403603dc8 8269426: Rename test/jdk/java/lang/invoke/t8150782 to accessClassAndFindClass
Reviewed-by: jvernee
(cherry picked from commit 56240690f6)
2021-07-16 16:05:12 +07:00
Xin Liu
2a33a67003 8267952: async logging supports to dynamically change tags and decorators
Reviewed-by: dholmes, phh
(cherry picked from commit 09bb84685f)
2021-07-16 16:05:01 +07:00
Daniel D. Daugherty
6948b8d749 8269534: Remove java/util/concurrent/locks/Lock/TimedAcquireLeak.java from ProblemList.txt
Reviewed-by: iignatyev, tschatzl
(cherry picked from commit 20640a57f3)
2021-07-16 16:04:02 +07:00
Alexey Semenyuk
1ffc3f9840 8269403: Fix jpackage tests to gracefully handle jpackage app launcher crashes
Reviewed-by: almatvee, herrick
(cherry picked from commit efe8423d8c)
2021-07-16 16:03:56 +07:00
Vladimir Kozlov
68011d4190 8269304: Regression ~5% in 2005 in b27
Reviewed-by: dlong, roland
(cherry picked from commit 8d09596f27)
2021-07-16 16:02:54 +07:00
Jim Laskey
e9a70a8ab3 8268236: The documentation of the String.regionMatches method contains error
Reviewed-by: rriggs, dfuchs
(cherry picked from commit e4c5446340)
2021-07-16 16:02:49 +07:00
Dean Long
d81ce2f65c 8258746: illegal access to global field _jvmci_old_thread_counters by terminated thread causes crash
Reviewed-by: dholmes, kvn
(cherry picked from commit d9cb068f4b)
2021-07-16 16:01:07 +07:00
Mandy Chung
6c41e2ee42 8266269: Lookup::accessClass fails with IAE when accessing an arrayClass with a protected inner class as component class
Reviewed-by: chegar, alanb
(cherry picked from commit 6eb734a60f)
2021-07-16 16:00:57 +07:00
Mandy Chung
4c2e112513 8269351: Proxy::newProxyInstance and MethodHandleProxies::asInterfaceInstance should reject sealed interfaces
Reviewed-by: darcy, alanb
(cherry picked from commit 3d0d27ce57)
2021-07-16 16:00:01 +07:00
Vladimir Kozlov
c5e9f9e5b8 8269260: Add AVX512 and other SSE + AVX combinations testing for tests which generate vector instructions
Reviewed-by: iveresov, dlong
(cherry picked from commit 824a51693e)
2021-07-16 15:59:55 +07:00
Alex Menkov
658fb51f14 8269302: serviceability/dcmd/framework/InvalidCommandTest.java still fails after JDK-8268433
Reviewed-by: kevinw, dcubed
(cherry picked from commit 1404e4bf44)
2021-07-16 15:59:13 +07:00
Alexander Matveev
2659fbfca9 8269036: tools/jpackage/share/AppImagePackageTest.java failed with "hdiutil: create failed - Resource busy"
Reviewed-by: asemenyuk, herrick
(cherry picked from commit fb0a95fed4)
2021-07-16 15:58:07 +07:00
Brian Burkhalter
897f0afd57 8269074: (fs) Files.copy fails to copy from /proc on some linux kernel versions
Reviewed-by: alanb, vtewari
(cherry picked from commit 5ebed06e8a)
2021-07-16 15:55:43 +07:00
Joe Wang
0168f4f3d4 8256919: BCEL: Utility.encode forget to close
Reviewed-by: lancea, bpb, naoto
(cherry picked from commit d799563ac0)
2021-07-16 15:55:34 +07:00
Sandhya Viswanathan
de359bd9dd 8269335: Unable to load svml library
Reviewed-by: psandoz
(cherry picked from commit 1e3b418a53)
2021-07-16 15:55:29 +07:00
Jan Lahoda
ff82205e88 8268871: Adjust javac to updated exhaustiveness specification
Reviewed-by: vromero
(cherry picked from commit 4eb321298a)
2021-07-16 15:55:21 +07:00
Vitaly Provodin
0c86ae72f1 enabling dtrace-tests: added dtrace keyword
(cherry picked from commit 0b5119ca89)
2021-07-15 05:49:34 +07:00
Vitaly.Provodin
f4a2bb8896 add 32-sizes for native data types
(cherry picked from commit 3a79870da8)
2021-07-15 05:49:31 +07:00
Vitaly.Provodin
6cd4d74fa3 add dockerfile for x86
(cherry picked from commit 8fb2341ea8)
2021-07-15 05:49:28 +07:00
Maxim Kartashev
b83badc8be JBR-3323 Exclude parts of VM code from sanitizer checks
Exclude VM error-reporting code that treats memory as a raw sequence of
bytes from address sanitizer checks. This is needed to only get true
reports when running tests against the --enable-asan build.
2021-07-15 05:49:25 +07:00
Nikita Gubarkov
7067da9803 Added JBR-specific .idea project files 2021-07-15 05:48:19 +07:00
Nikita Gubarkov
fe9d001c4d Added Clion project setup 2021-07-15 05:48:16 +07:00
Nikita Gubarkov
736917f300 Updated IDEA project setup 2021-07-15 05:48:13 +07:00
Alexey Ushakov
d38d8d43ae JBR-3344 "Exit Full Screen" action doesn't work, the only way is mouse click on window's native "green" button.
Restored JBR-1931 fix partially reverted by JBR-1718

(cherry picked from commit c0be778e20)
2021-07-15 05:47:41 +07:00
Anton Tarasov
286c96e606 JBR-3337 jb/java/jcef/HandleJSQueryTest3314.sh: fails on macOS-aarch64 with "JS Query was not handled in 2nd opened browser"
(cherry picked from commit 8678f41971)
2021-07-15 05:47:36 +07:00
Anton Tarasov
5b6c64c6f7 JBR-3545 Window.setMinimumSize does not respect DPI scaling
(cherry picked from commit 9b4f72ad18)
2021-07-15 05:47:33 +07:00
Denis Fokin
84d66eab71 JRE-408 JBR-3515 fix NullPointerException in MetalRootPaneUI.installWindowListeners
(cherry picked from commit 584d554af529cff445b0f09bc2d57be55e138b7a)
(cherry picked from commit 6a42bb54bd)
2021-07-15 05:47:30 +07:00
Alexey Ushakov
dca1987fb5 JBR-2207 TitledBorder leaks PropertyChangeListener
Added a separate pass with sending setVisible(false) to the frames holding TitledBorder references in order to get WINDOW_DEACTIVATED (to clear KeyBoardFocusManager.activeWindow field)

(cherry picked from commit 3b03c698ce)
2021-07-15 05:47:26 +07:00
Elena Sayapina
089e6ac746 JBR-2657 [TESTBUG] ChainOfPopupsFocusTest misbehaving on Windows
- changed open popup shortcut from Ctrl+N to Ctrl+M, so no new explorer windows appear if desktop gets focused by error
- added a click on the main test frame, so it gets focus when running from background cygwin process on Windows, otherwise it just flashes on the taskbar

(cherry picked from commit eda8e4d50e)
2021-07-15 05:47:23 +07:00
Maxim Kartashev
2da9bf356d JBR-3590 Update JetBrains Runtime README 2021-07-15 05:47:20 +07:00
Maxim Kartashev
c6ddafe42b JBR-3572 Wayland: java/awt/Window/WindowTitleVisibleTest/WindowTitleVisibleTestLinuxGnome.java: title bar shown and hidden are the same.
Exclude the test when running under XWayland that doesn't implement
screen capture necessary for the test to function.
2021-07-15 05:47:17 +07:00
Denis Konoplev
702dc54df1 EA-252361: Check window for null
(cherry picked from commit 23a7dbd486)
2021-07-15 05:46:47 +07:00
Artem Bochkarev
bb2915684a JBR-3131: support custom view for system menu items
(cherry picked from commit 78d509ac0f)
2021-07-15 05:46:44 +07:00
Artem Bochkarev
5cdc76b6b4 JBR-3127: set NSWindowAllowsImplicitFullScreen=NO
fixed JBR-3127 Modal dialogs invoked from modal or floating dialogs are opened in full screen

(cherry picked from commit 0b8ff1a7e6)

JBR-3127: add possibility to load NSJavaVirtualMachine

JavaVM framework is deprecated but this class is still checked by AppKit, see https://youtrack.jetbrains.com/issue/JBR-3127#focus=Comments-27-4684465.0-0

(cherry picked from commit be6a2c4f0c)
2021-07-15 05:46:41 +07:00
Nikita Gubarkov
6e1a887629 JBR-3376 Added check for -1 glyph info pointer in OGLTextRenderer.c 2021-07-15 05:46:38 +07:00
Denis Fokin
df2255dc38 JBR-1417 JBR 11 does not support chain of popups
Adopted version of "JRE-864  Multiple child windows opened and closed in sequence"

(cherry picked from commits 54bb2dd097, 68c2fd0e3b, part of 1a9838082e)
2021-07-15 05:46:36 +07:00
Dmitry Batrak
daa33b828f JBR-3024 Popups are shown with 1x1 size sometimes
test case only

(cherry picked part of commit ee298f5287)
2021-07-15 05:46:32 +07:00
Vitaly Provodin
6d971e656e JBR-3314 add regression test
(cherry picked from commit c81adfed61)
2021-07-15 05:46:27 +07:00
Ivan Migalev
e7ecf5f164 JBR-3227 Reload type of required native file dialogs each time a file dialog is requested
(cherry picked from commit 26dd87ab7c)
2021-07-15 05:46:23 +07:00
Vitaly Provodin
2b805791d8 JBR-1505 add jdk.jcmd module into JBR
(cherry picked from commit c40b9c8b9e)
2021-07-15 05:46:20 +07:00
Ivan Migalev
2b88d5f79f JBR-3068 Update path selector behavior when sun.awt.windows.useCommonItemDialog is enabled
(cherry picked from commit 442bb7eecc)
2021-07-15 05:46:18 +07:00
Alexey Ushakov
3235582a15 JBR-2996 M1 warnings: CoreText note: Client requested name “.SFCompact-Black”, it will get Times-Roman rather than the intended font
Cached system fonts family names

(cherry picked from commit 56629e4c90)
2021-07-15 05:46:15 +07:00
Alexey Ushakov
7daa88599a JBR-3023 Gray idea frame after project open with ide.mac.transparentTitleBarAppearance.
Initiate move/resize event on first appearance of window having FULL_WINDOW_CONTENT property set

(cherry picked from commit a6ea081ba2)
2021-07-15 05:46:12 +07:00
Dmitry Batrak
c1c2294526 JBR-3017 Focus issue in presence of third-party accessibility tool
use the new invocation approach for 'makeKeyAndOrderFront' as well, as it can also cause synchronous back-calls to accessibility subsystem, and change the global call order unexpectedly

this commit fixes TypeaheadSetVisibleTest and TypeaheadToFrontTest, when they are run with AltTab active

Guard against possible deadlocks, if UI-related methods are invoked not on EDT.
Sample deadlock scenario:
* Application thread attempts to show the window, this involves calling CWrapper.NSWindow.makeKeyAndOrderFront under AWT tree lock, which blocks till 'makeKeyAndOrderFront' completes on AppKit thread
* AppKit thread, while executing 'makeKeyAndOrderFront' performs 'back-call' to CAccessibility.getFocusOwner, which waits for execution on EDT
* EDT performs some activity requiring AWT tree lock (e.g. processing of PaintEvent)

(cherry picked from commits e3aaff5db4, 09941119e1)
2021-07-15 05:46:09 +07:00
Dmitry Batrak
80cb66e92c JBR-3072 Deadlock on nested dialog hiding
(cherry picked from commit 99242748ee)
2021-07-15 05:46:06 +07:00
Dmitry Batrak
83c9e70a81 fix occasional freezes of JBR-3017 reproducer after the fix
(cherry picked from commit 7e6db54f77)
2021-07-15 05:46:01 +07:00
Dmitry Batrak
efa74fc5bf refactor nativeCreateNSWindow call wrapping
as part of JBR-3017

(cherry picked from commit eeef67a335)
2021-07-15 05:45:58 +07:00
Dmitry Batrak
d4d5831465 remove excessive wrapping with AccessController (AWTThreading does it internally now)
as part of JBR-3017

(cherry picked from commit f1dd523ba8)
2021-07-15 05:45:56 +07:00
Dmitry Batrak
42214ff9e8 log LWCToolkit invokeAndWait requests
as part of JBR-3017, to make investigation of similar issues simpler in the future

(cherry picked from commit a7fd723e43)
2021-07-15 05:45:53 +07:00
Dmitry Batrak
73ee629668 JBR-2971 Log more information about window creation and property changes
(cherry picked from commit 9d86b4d235)
2021-07-15 05:45:47 +07:00
Dmitry Batrak
5d4576306a JBR-2819 Create API to determine typographic family/subfamily for available fonts
(cherry picked from commit 89e519a4ef)
2021-07-15 05:45:42 +07:00
Dmitry Batrak
c072e7f84d JBR-2533 Popup is not focused on click when switching from another application on macOS
(cherry picked from commits d9ff151211, 67b174dc8c, 72b0add80c, 21af1eba85, 2f1d317d87, 6dd334f9f0, cd863bac0d, 010f6fc951, parts of 7d5ac56b6c, cd6dd5c3cf, e8bbd8ffdd)
2021-07-15 05:45:40 +07:00
Nikita Gubarkov
d6569503d5 Added jetbrains.api & jetbrains.api.impl modules 2021-07-15 05:45:36 +07:00
Nikita Gubarkov
5f74c7d374 JBR-2924 Do not try to create native italic font when we're going to make it fake italic 2021-07-15 05:45:33 +07:00
Nikita Gubarkov
7faec92ebe JBR-3269 Disabled subpixel antialiasing for macOS Big Sur and newer 2021-07-15 05:45:30 +07:00
Dmitry Batrak
d7e51fe60c JBR-3017 Focus issue in presence of third-party accessibility tool
(cherry picked from commit 88ead5d9e3)
2021-07-15 05:45:27 +07:00
Vitaly Provodin
84d33b36d9 JBR-1718 add a regression test
(cherry picked from commit 84ff4eab21)
2021-07-15 05:45:24 +07:00
Vitaly Provodin
2fc7d6a06e JBR-2957 notarize JBR and JBRSDK as APPL
(cherry picked from commit 0e7f9ce4ca)
2021-07-15 05:45:21 +07:00
Elena Sayapina
6be375b1cb JBR-2890 [TESTUPDATE] Enable jcef tests on macOS aarch64 platform
(cherry picked from commit 1714d7b627)
2021-07-15 05:45:18 +07:00
Vitaly Provodin
1428d2222c JBR-667 add shenandoahgc feature
(cherry picked from commit e15dad04)
2021-07-15 05:45:16 +07:00
Artem Bochkarev
66aa78a29d JBR-2562: fixed invokation of parent method
(cherry picked from commit 93cbab2f2d)

JBR-2562: suppress exceptions from [NSWindow _changeJustMain]

temporary workaround to prevent crashes

(cherry picked from commit dd055b5970)
2021-07-15 05:45:13 +07:00
Mikhail Grishchenko
baa0e2b390 JBR-2890 Disable jcef tests on 32-bit and aarch64 platforms
(cherry picked from commit d34d6528fe)
2021-07-15 05:45:10 +07:00
Alexey Ushakov
a190730b65 JBR-2879 Big Sur: Opening project in new window results in opening project in another tab
Disabled Tabbing mode for all NSWindows

(cherry picked from commit 8cb0377a31)
2021-07-15 05:45:08 +07:00
Nikita Gubarkov
666fb34a50 JBR-2910 Implemented extended glyph cache for macOS 2021-07-15 05:45:05 +07:00
Alexey Ushakov
6f3533688d JBR-2617 Text with opacity renders black
Implemented alpha blending in grayscale text rendering (UX-1320)
Corrected bright text thickness (smooth on), bright and dark text thickness (smooth off)
Added JVM properties for fine tuning

(cherry picked from commit c30306f779)
(cherry picked from commit c95adeb8f2)
(cherry picked from commit 269c9580fb)
(cherry picked from commit 55c7be5fe9)
(cherry picked from commit e28ff71e97)
2021-07-15 05:45:02 +07:00
Alexey Ushakov
b2dc10b682 JBR-2521 Ugly font in all 2020.2 EAPs on macOS
Provide gamma correction for both light and dark text

(cherry picked from commit 5953202a7e)
2021-07-15 05:45:00 +07:00
Alexey Ushakov
37197303c8 JBR-2591 Repainting is broken (was: Icons in tree list widgets became dark)
Save current blend mode before cached grayscale rendering

(cherry picked from commit 7beb75ccec)
(cherry picked from commit ed52fde57d)
2021-07-15 05:44:57 +07:00
Alexey Ushakov
fd8be6da0e JBR-1986 Enabling fractional metrics causes visual artifacts in font rendering on macOS 10.14+
Disable subpixel positioning for macOS 10.13+ if legacy LCD rendering is disabled

(cherry picked from commit dbd24232e4)
2021-07-15 05:44:55 +07:00
Vitaly Provodin
0f742d7307 exclude bug7154030 on macosx-aarch64 due to 8268284 2021-07-15 05:44:52 +07:00
Vitaly Provodin
1d59e7a82d exclude SharedMemoryPixmapsTest on macosx-all due to 8221451 2021-07-15 05:44:50 +07:00
Vyacheslav Moklev
e0f51f967a JBR-2442 fix memory leak of fileBuffer
fix was suggested by Nikita Gubarkov
2021-07-15 05:44:46 +07:00
Andrey Starovoyt
90452c5d8d JBR-2736 provide writeObjects implementation for copying files/folders from Project Explorer to the Finder
(cherry picked from commit 33db034d49)
(cherry picked from commit d3ec3d899d)
2021-07-15 05:44:43 +07:00
Sergey Malenkov
6c49aff129 EA-235126 - CME: HighlightableComponent.getPreferredSize
(cherry picked from commit 523d80cafd)
2021-07-15 05:44:41 +07:00
Kirill Kirichenko
b73ffc9f8a JBR-2667 Post review: rename win.darkTheme.on to win.lightTheme.on and reversed the logic
(cherry picked from commit eeab5252e6)
2021-07-15 05:44:39 +07:00
Kirill Kirichenko
5ed0df1831 JBR-2667 Add new AWT desktop property for light/dark theme detection on Windows 10
(cherry picked from commit 0e4ad056dd)
2021-07-15 05:44:37 +07:00
Alexey Ushakov
4d09bd3585 JBR-2593 Wide ligatures not rendered in Grayscale mode
Added missing flush of cached vertices

(cherry picked from commit ad409b4370)
2021-07-15 05:44:35 +07:00
Nikita Gubarkov
ef38f08cf3 JBR-2910 Implemented extended glyph cache for Linux 2021-07-15 05:44:33 +07:00
Nikita Gubarkov
58e65f63ec JBR-2910 Implemented extended glyph cache for Windows 2021-07-15 05:44:31 +07:00
Nikita Gubarkov
6776019bf6 JBR-2614 Fixed LCD glyph width to include both left & right padding, so that rowBytes = width * 3 2021-07-15 05:44:29 +07:00
Alexey Ushakov
d8a9899adb JBR-2463 Font rendering problem on macOS Mojave
Use adjusted advances for glyphs

(cherry picked from commit 1af5dd4aae)
2021-07-15 05:44:27 +07:00
Denis Konoplev
26c3855d83 JBR-3544: Generate popup invoked instead of New in this directory 2021-07-15 05:44:25 +07:00
Vitaly Provodin
2023dd87ef JBR-2545 Clean up the list of ignored Render tests
(cherry picked from commit f7b4c42e1d)
2021-07-15 05:44:22 +07:00
Jayathirth D V
652904e67b 8241490: Add large text performance tests in RenderPerfTest
(cherry picked from commit 803ee2f2b5)
2021-07-15 05:44:20 +07:00
Alexey Ushakov
5c42b00ddc 8230657: Create fine grained render perf test for metal pipeline
Converted gradle JUnit test to plain java for ant and gnumake

To run the tests:
cd src/demo/share/java2d/RenderPerfTest

ant run
or
java -jar dist/RenderPerfTest.jar
or
java -jar dist/RenderPerfTest.jar testWhiteTextBubblesGray

(cherry picked from commit 356121b18f)
(cherry picked from commit 8bd8d2d132)
2021-07-15 05:44:18 +07:00
Konstantin Bulenkov
49e44238ce Update FiraCode to 5.2
(cherry picked from commit 71e2a8d8ad)
2021-07-15 05:44:15 +07:00
Alexey Ushakov
8f05a1ce68 JBR-1929 Improve rendering of San Francisco font of macOS Catalina
Reverting gamma correction because of rendering artifacts in the light theme

This reverts commit 5016db51

(cherry picked from commit c1d644a004)
2021-07-15 05:44:13 +07:00
Alexey Ushakov
1d45486ac6 JBR-1929 Improve rendering of San Francisco font of macOS Catalina
Added gamma correction to match grayscale rendering with subpixel one

(cherry picked from commit 5016db518a)
2021-07-15 05:44:10 +07:00
Alexey Ushakov
bfe00c828d JBR-2463 Font rendering problem on macOS Mojave
Use adjusted advances for glyphs

(cherry picked from commit 1af5dd4aae)
2021-07-15 05:44:07 +07:00
Anton Tarasov
69c11fceae JBR-3413 use timeout in CAccessibility.invokeAndWait 2021-07-15 05:44:05 +07:00
Anton Tarasov
93aededb81 revert: JBR-1434 "New file dialog" popup remains above all windows on switching application
java.awt.peer.WindowPeer.isLightweightDialog() method does not exist.

(cherry picked from commit 7d8aeaf7de)
2021-07-15 05:44:03 +07:00
Anton Tarasov
60e75803ac JBR-2872 improve: JBR-2866 JCEF: Markdown editor steals focus from a different frame
(cherry picked from commit bad748e3d0)
2021-07-15 05:43:59 +07:00
Anton Tarasov
a6aa8067d0 JBR-2866 JCEF: Markdown editor steals focus from a different frame 2021-07-15 05:43:56 +07:00
Anton Tarasov
425ac11443 JBR-2645 enable CefBrowser.close(true) in jcef reg tests
(cherry picked from commit 492c217125)
2021-07-15 05:43:54 +07:00
Anton Tarasov
f4afe449dc JBR-2259 WebSite isn't loaded with .loadUrl method if browser isn't shown in UI
(cherry picked from commit 57bbddf071)
2021-07-15 05:43:51 +07:00
Anton Tarasov
a0aa5648bc JBR-2557 use com.jetbrains.cef.JCefAppConfig in JCEF tests
(cherry picked from commit e30a309f92)
2021-07-15 05:43:44 +07:00
Anton Tarasov
e71b914cb8 JBR-2489 Git branch operations (switch to another branch, rebase) sometimes crash WebStorm 202.5428.27
(cherry picked from commit 81d2156fb1)
2021-07-15 05:43:42 +07:00
Anton Tarasov
b2d4f0797c JBR-2282 [jcef] update to JCEF/80.0.4+g74f7b0c+chromium-80.0.3987.122
(cherry picked from commit a5adc725df)
2021-07-15 05:43:36 +07:00
Anton Tarasov
0d69196a64 JBR-2305 jcef: jb/java/jcef/JCEFStartupTest.java throws java.lang.ExceptionInInitializerError
(cherry picked from commit f0385f01ec)
2021-07-15 05:43:31 +07:00
Anton Tarasov
61a1b99c13 JBR-2306 jcef: jb/java/jcef/JCEFStartupTest.java unexpectedly exits with the exit code: 0
(cherry picked from commit ff7d7bd43c)
2021-07-15 05:43:28 +07:00
Anton Tarasov
85a6e859ba JBR-2299 [mac] jcef requests for "chromium safe storage" keychain access
(cherry picked from commit dd1334a352)
2021-07-15 05:43:26 +07:00
Anton Tarasov
298bf55b39 JBR-2222 Crash during closing IDE
(cherry picked from commit d0c367b31f)
2021-07-15 05:43:24 +07:00
Anton Tarasov
0d9d566017 JBR-2287 [jcef] add CefBrowser wrapper to jtreg tests
(cherry picked from commit fa961d1769)
2021-07-15 05:43:21 +07:00
Anton Tarasov
2763578a61 JBR-2169 AWTThreading: remove tracked invocation event from completion listener
(cherry picked from commit a855f3b835)
2021-07-15 05:43:18 +07:00
Anton Tarasov
5853fc0a5c JBR-2159 Native crash in thread AWT-EventQueue-0 when trying to push commit
(cherry picked from commit bba297b4a4)
2021-07-15 05:43:15 +07:00
Anton Tarasov
eee5f887d2 JBR-2148 JCEF: JBR bundle has invalid app structure
(cherry picked from commit f45f84d7ed)
2021-07-15 05:43:12 +07:00
Anton Tarasov
0b89a68acc JBR-2146 improve InvokeOnToolkitHelper to cover more generic case 2021-07-15 05:43:06 +07:00
Anton Tarasov
cd2d122aae JBR-2139 Idea freeze on dynamic plugin unloading
(cherry picked from commit e57bae4f66)
2021-07-15 05:43:03 +07:00
Anton Tarasov
a345d6bf2b JBR-2099 jb/java/jcef/JCEFStartupTest.java fails on Windows, Linux
(cherry picked from commit 3dfb0aa16a)
2021-07-15 05:42:56 +07:00
Anton Tarasov
af57a07bc9 JBR-2093 create reg test for JCEF startup
(cherry picked from commit e8c2761f5b)
2021-07-15 05:42:52 +07:00
Anton Tarasov
0f32a2912d JBR-2082 Revealing taskbar does not work when "Automatically hide the taskbar"
(cherry picked from commit b31a41fb2f)
2021-07-15 05:42:49 +07:00
Mikhail Grishchenko
bb7a6a5e99 JBR-2639, JBR-2412 [jcef] Tests that checks mouse events
JBR-2412 [windows] mouse listener does not work for jcef

(cherry picked from commit 66ad6472ae)
(cherry picked from commit 04246aac57)
(cherry picked from commit b7cde4fd05)
2021-07-15 05:42:45 +07:00
Mikhail Grishchenko
4c1fc5c81d JBR-2639 [win] jcef does not recognize vertical mouse wheel events
added regression test

(cherry picked from commit e8e4741bb0)
2021-07-15 05:42:41 +07:00
Mikhail Grishchenko
b126a231f2 JBR-2412 [windows] mouse listener does not work for jcef
added regression test

(cherry picked from commit d1479872f2)
2021-07-15 05:42:37 +07:00
Elena Sayapina
6c502a326a JBR-2630 Typing speed in IDE editor was dropped after switching to 11.0.8
Introduced sun.awt.osx.RobotSafeDelayMillis property to control macOS specific safe delay for Robot methods.
50 ms safe delay was initially hardcoded in 3862142d (JDK-8242174: [macos] The NestedModelessDialogTest test make the macOS unstable) which affected performance tests execution.

(cherry picked from commit 5f691bb788)
2021-07-15 05:42:33 +07:00
Mikhail Grishchenko
8e8d622b22 JBR-2430 [jcef] Added Regression test
Checks that JS Query is handled in 2nd opened browser

(cherry picked from commit 404ff84565)

Refactoring + changed EDT awaiting method

(cherry picked from commit dc24658b31)
2021-07-15 05:42:29 +07:00
Vitaly Provodin
3aea062227 exclude the new printer test 8262731 2021-07-15 05:42:24 +07:00
Alexey Ushakov
33e96a85e4 8266079: Lanai: AlphaComposite shows differences on Metal compared to OpenGL
Keep MTLLayer opacity in sync with window content view
2021-07-15 05:42:19 +07:00
Alexey Ushakov
c4e5dfaae3 JBR-2419 Improve performance of CStrike.getNativeGlyphOutlineBounds
Do not pass the result via java object. Use more straight api.

(cherry picked from commit 9f91fe91f5)
(cherry picked from commit c0fd2daf5c)
2021-07-15 05:42:13 +07:00
Alexey Ushakov
4b45577ac9 JBR-2382 Provide detailed stack trace in crash dumps for unhandled ObjC exceptions
Used user home dir for jbr_err files. Removed logging with reportException method

(cherry picked from commit 2c8cdb221b)

JBR-2382 Provide detailed stack trace in crash dumps for unhandled ObjC exceptions

Used process workdir for jbr_err files. Added one more logging to reportException method

(cherry picked from commit 95a47810d5)

JBR-2382 Provide detailed stack trace in crash dumps for unhandled ObjC exceptions

Generate jbr_err_pidXX.log file with detailed stack trace of the exception

(cherry picked from commit 4c42f75021)
2021-07-15 05:42:10 +07:00
Artem Bochkarev
54665fce33 JBR-2253: unset LD_PRELOAD just after VM loaded
workaround for JBR-2253 Preload libjsig.so to fix JNA crashes

(cherry picked from commit 127a2deddf)
2021-07-15 05:42:06 +07:00
Kirill Kirichenko
aa82961a76 JBR-1874 Cursor not changing from 'default' to 'text'. Additional fix after reopening.
(cherry picked from commit 5a29d4ade9)
2021-07-15 05:42:04 +07:00
Elena Sayapina
603f214e2c JBR-1388 [TESTBUG] Regression test java/awt/Graphics2D/DrawString/LCDTextSrcEa.java fails on macOS Mojave
(cherry picked from commit 50b24a147b)
2021-07-15 05:42:00 +07:00
Elena Sayapina
6a2a16c6b1 JBR-2585 [TESTBUG] TouchScreenEvent tests affect tests simulating mouse actions
- added workaround for JBR-2585
- added README.md about manual test run
- made an update to close LinuxTouchScreenDevice properly
- added an error exit from linux shell script if sudo password is empty or chown fails

(cherry picked from commit 4deb3bbe61)
2021-07-15 05:41:56 +07:00
Alexey Ushakov
6cc7a3b84f 8266079: Lanai: AlphaComposite shows differences on Metal compared to OpenGL
Implemented blit via compute kernel
2021-07-15 05:41:53 +07:00
Denis Konoplev
7566863a4f fixup! macOS national keyboard support
Remove unused import that broke compilation
2021-07-15 05:41:51 +07:00
Elena Sayapina
c405c7acb7 IDEA-165950 [TESTUPDATE] National keyboard layouts support
Update regression test after the following commits:

02fad83c: Remove public constants from KeyEvent
f4227faf: Impossible to assign cmd+ß shortcuts
(cherry picked from commit 264802cf4b)
2021-07-15 05:41:48 +07:00
Konstantin Aleev
788e352701 fix memory leaks in AccessibleJTree
(cherry picked from commit 561a7b8def)
2021-07-15 05:41:45 +07:00
Elena Sayapina
b62f8af476 JBR-2328 [TESTBUG] Regression test java/awt/keyboard/AllKeyCode/AllKeyCode.java is not correct
(cherry picked from commit 861f73c393)
(cherry picked from commit bfab6a9364)
(cherry picked from commit e9fa7a0882)
2021-07-15 05:41:42 +07:00
Mikhail Grishchenko
d7fbef52ba JBR-2259 WebSite isn't loaded with .loadUrl method if browser isn't shown in UI
Added reproducer

(cherry picked from commit e875bf72c9)
2021-07-15 05:41:38 +07:00
Denis Konoplev
ed5cdfa144 JBR-2490 Add option to work with Surface Pen
(cherry picked from commit 5acc7680a1)
2021-07-15 05:41:34 +07:00
Denis Konoplev
bc5a700665 JBR-2669: set unicode for both keyCode and extendedKeyCode
(cherry picked from commit ba3f14c83a)
2021-07-15 05:41:32 +07:00
Denis Konoplev
475a2ce0a0 JBR-2554: Proper unicode values in KeyEvent.keyCode
(cherry picked from commit 703d77a927)
2021-07-15 05:41:28 +07:00
Denis Konoplev
bffbcf2a6a JBR-215: Remove SystemInfo
(cherry picked from commit 9adf77a512)
2021-07-15 05:41:25 +07:00
Denis Konoplev
2938315764 JBR-215: Separate LatinNonAlphaNumKeycodes option
(cherry picked from commit caf366f6f3)
2021-07-15 05:41:21 +07:00
Denis Konoplev
0cde0dd327 JBR-215: Windows non-alphanumeric shortcuts
(cherry picked from commit 4f60efebe2)
2021-07-15 05:41:17 +07:00
Denis Konoplev
0cf08d613a JBR-2280: Fix regression. Mode compatible with old option.
(cherry picked from commit a3e3c23cb1)
2021-07-15 05:41:13 +07:00
Denis Fokin
30da8a6373 macOS national keyboard support 2021-07-15 05:41:08 +07:00
Sergey Malenkov
493048e6c6 JBR-1929 FractionalMetricsSupport
(cherry picked from commit bbdc159762)
2021-07-15 05:41:04 +07:00
Mikhail Grishchenko
c569d6e9c8 JBR-2256 JEditorPane with test/html type and zero margins is not shown
Updated reproducer

(cherry picked from commit 529a188b8b)

JBR-2256 JEditorPane with test/html type and zero margins is not shown

Added reproducer

(cherry picked from commit 41578a40b5)
2021-07-15 05:41:01 +07:00
Mikhail Grishchenko
5547506845 JBR-2210 IDEA fails to start (JVM crashes) when using the -Dfile.encoding=UTF-8in IDEA's vmoptions file
Added regression test

(cherry picked from commit 4e1f5a43b3)
2021-07-15 05:40:56 +07:00
Alexey Ushakov
980b08e0b4 JBR-2210 IDEA fails to start (JVM crashes) when using the -Dfile.encoding=UTF-8in IDEA's vmoptions file
Returning devanagari subset back for ja.UTF-8 to get non-null font name from WFontConfiguration.getTextComponentFontName(). It is a regression from JDK-8208179.

(cherry picked from commit b51254a975)
2021-07-15 05:40:53 +07:00
Mikhail Grishchenko
48a7c6052f JBR-1414 [Test] downscale frames to run on low-dpi screens
(cherry picked from commit b46e74fe6f)
2021-07-15 05:40:50 +07:00
Elena Sayapina
7561ca52ba JBR-1905 [TESBUG] java/awt/TextArea/DisposeTest/TestDispose.java: frame is not disposed
- java/awt/TextArea/DisposeTest/TestDispose.java, java/awt/TextField/DisposeTest/TestDispose.java: fixed test frame disposal
- java/awt/Frame/DisposeStressTest/DisposeStressTest.java: decreased test timeout from 2h to 10 min, added minor diagnostic logging

(cherry picked from commit 7f025f4e16)
(cherry picked from commit dda7f3d871)
(cherry picked from commit bc09aadadb)
2021-07-15 05:40:46 +07:00
Alexey Ushakov
20583a52d7 JBR-2135 Use CoreText api to select the font with the most recent version
Added a property to force loading bundled fonts: -Djava2d.font.noVersionCheck=true

(cherry picked from commit cbb148dff4)
2021-07-15 05:40:44 +07:00
Alexey Ushakov
803ce276fd JBR-2137 JetBrainsMono fonts update to v1.0.3
(cherry picked from commit a6e441828a)
2021-07-15 05:40:41 +07:00
Mikhail Grishchenko
8ced002288 JBR-1414: Added regression test for dnd with HiDPI scaling
(cherry picked from commit 1f4ab12fbb)
2021-07-15 05:40:38 +07:00
Elena Sayapina
56eef5d861 JBR-2041 [TEST] Added new regression test (Touchscreen devices support)
(cherry picked from commit 2d587b3728)
(cherry picked from commit 92606f2c7f)
(cherry picked from commit 05af375909)
(cherry picked from commit 0f895bf1b2)
(cherry picked from commit 08aa0852b7)
2021-07-15 05:40:35 +07:00
Konstantin Bulenkov
8a040acaeb Update JetBrains Mono to 1.0.2
(cherry picked from commit 6f4a13e46f)
2021-07-15 05:40:32 +07:00
Ivan Migalev
8ad5177715 Extract the DWM colorization parameters from registry (JBR-2070)
(cherry picked from commit 0330cab60b)
2021-07-15 05:40:29 +07:00
Ivan Migalev
98e5289b7f Refresh desktop properties on WM_DWMCOLORIZATIONCOLORCHANGED (JBR-2070)
(cherry picked from commit 06086f4a7e)
2021-07-15 05:40:27 +07:00
Ivan Migalev
a283748561 Fix a possible resource leak in ColorizationColorAffectsBorders
(cherry picked from commit 0c911b6ffe)
2021-07-15 05:40:23 +07:00
Elena Sayapina
b54dc58652 JBR-2086 JetBrainsMono fonts update to v1.0.1
(cherry picked from commit a4b373e631)
2021-07-15 05:40:20 +07:00
Konstantin Bulenkov
3db46764e4 JetBrains Mono 1.0
(cherry picked from commit d514f7a982)
2021-07-15 05:40:18 +07:00
Alexey Ushakov
0ea7ea90bd JBR-1110 [JDK11] java/awt/font/Outline/OutlineInvarianceTest.java: Failed for font java.awt.Font[family=Dialog,name=MS Gothic,style=bold,size=30]
Replaced FT_LOAD_NO_HINTING mode for non AA rendering with FT_LOAD_TARGET_LIGHT

(cherry picked from commit 3368768244)
2021-07-15 05:40:15 +07:00
Denis Konoplev
5de9756c44 JBR-3444: Return NullSurfaceData when gc == null
(cherry picked from commit 01ad15e61c)
2021-07-15 05:40:11 +07:00
Denis Konoplev
9e49fcd052 JBR-1995: Last character issue with korean
Fix for JTextComponent

(cherry picked from commit a7c8b0b535)
2021-07-15 05:40:07 +07:00
Denis Konoplev
7aeda8cec5 JBR-2891: Post PhaseEvents in the begin and end of Magnify and Rotate
(cherry picked from commit c811c295c2)
2021-07-15 05:40:04 +07:00
Denis Konoplev
96cbcb047e JBR-2444: Turn on IM workaround by default
(cherry picked from commit 15c4ce1d3e)
2021-07-15 05:40:01 +07:00
Denis Konoplev
df09ece395 Fix build: add import & fix jwhen 2021-07-15 05:39:56 +07:00
Denis Konoplev
e50c3ec7f8 JBR-2795: Add explicit conversion
(cherry picked from commit bf3e1c0c31)
2021-07-15 05:39:53 +07:00
Denis Konoplev
8e2cb933b7 IDEA-237231: Correct signarute mask
(cherry picked from commit 6974131eec)
2021-07-15 05:39:47 +07:00
Denis Konoplev
4d2dbd2d44 IDEA-237231: Possible fix for pen interraction
(cherry picked from commit 33a8c95d39)
2021-07-15 05:39:43 +07:00
Denis Konoplev
42a5fa0d1e JBR-2347: Free memory on other exceptions, rethrow ThreadDead & log it
(cherry picked from commit 16ca839ed3)
2021-07-15 05:39:40 +07:00
Denis Konoplev
5c90093b73 JBR-2347: Don't free memory when thread is dead
(cherry picked from commit afb3303db5)
2021-07-15 05:39:36 +07:00
Denis Konoplev
776e5ecec6 JBR-2041: Project view tap fix, recovery? constants & logging
(cherry picked from commit 1e904db3b0)
2021-07-15 05:39:31 +07:00
Denis Konoplev
92d767791d IDEA-229135: Fling animation stop on tap
(cherry picked from commit 7ce0f79561)
2021-07-15 05:39:25 +07:00
Denis Konoplev
e1908fa301 Windows touch screen support
(cherry picked from commit cab3f28907)
2021-07-15 05:39:22 +07:00
Denis Konoplev
be4d5d7671 Turn off multitouch
(cherry picked from commit a2576ffa9a)
2021-07-15 05:39:18 +07:00
Denis Konoplev
0972ea48a9 Check XInput extension && touch inertia
(cherry picked from commit cca7fb97f4)
2021-07-15 05:39:13 +07:00
Denis Konoplev
83e811b64f Touch scroll handling
(cherry picked from commit 6dcec3dc31)
2021-07-15 05:39:10 +07:00
Denis Konoplev
b78d1ec333 XI2 Constants
(cherry picked from commit 588cd6ee73)
2021-07-15 05:39:06 +07:00
Denis Konoplev
85ae37da78 XLibWrapper XI2 functions
(cherry picked from commit d6bd1bfa2b)
2021-07-15 05:39:01 +07:00
Denis Konoplev
bec5276b9f X11 native get put double
(cherry picked from commit f101bc1108)
2021-07-15 05:38:57 +07:00
Denis Konoplev
cb30efb89e Native data types
(cherry picked from commit 9504574dbb)
2021-07-15 05:38:51 +07:00
Denis Konoplev
61fe1a668e XI2 headers in xlib wrapper generator
(cherry picked from commit ef108067a1)
2021-07-15 05:38:45 +07:00
Denis Konoplev
0953651f6e Revert "Turn off multitouch"
This reverts commit 90ea3bf57e4c687e9d9bf0a37f2f64c82a81f4eb.
2021-07-15 05:38:42 +07:00
Denis Konoplev
d263283326 Turn off multitouch
(cherry picked from commit a2576ffa9a)
2021-07-15 05:38:38 +07:00
Alexey Ushakov
ab0cb6a773 JBR-2000 RM 2019.3.1 font rendering regression, normal text is heavier
Added -Djava2d.font.loadFontConfig=bundled to force loading bundled font.conf

(cherry picked from commit 788e078f64)
2021-07-15 05:38:33 +07:00
Alexey Ushakov
1b99fdbe03 JBR-1962 Allow to change font config
Replaced several privileged blocks with just one

(cherry picked from commit faa8d3d258)
2021-07-15 05:38:30 +07:00
Vitaly Provodin
f25ec931ad JBR-572: Regression test on the crash caused by the fix
(cherry picked from commit 6cc380ffb5)
(cherry picked from commit 958e25ed21)
(cherry picked from commit a7de601d5f)
2021-07-15 05:38:25 +07:00
Dennis Ushakov
9e71fe211a JBR-1863, JBR-1868 correct advances on Catalina 2021-07-15 05:38:18 +07:00
Dennis Ushakov
f3344cf11d JBR-1850: on macOS fonts should be sorted by weight to ensure proper population of the families 2021-07-15 05:37:33 +07:00
Dennis Ushakov
2dbce65b75 faster font family loading & lazy font family population
1. NSFont.familyName is faster than loading allFamilyNames
2. Prebuilt list of system fonts
3. Cleanup San Francisco family loading
4. Avoid calling expensive native getWidth on font when creating font family, load styles only when they would be used.
2021-07-15 05:37:28 +07:00
Dennis Ushakov
b022adc3a3 JBR-1756 use CoreText for all font rendering on Catalina 2021-07-15 05:37:24 +07:00
Nikita Gubarkov
fd0d59b9cb JBR-410 Added emoji support for Linux 2021-07-15 05:37:14 +07:00
Alexey Ushakov
e4ce4ce9c2 JBR-1997 JetBrainsMono fonts update to v0.22
(cherry picked from commit 41f4fddd34)
(cherry picked from commit f5302a02f4)
(cherry picked from commit 5d7fd2e1e5)
2021-07-15 05:37:10 +07:00
Anton Tarasov
a19e846fb7 JRE-729 [windows] unreasonable IME activity consumes CPU 2021-07-15 05:37:07 +07:00
Dmitry Batrak
dfa9da928f JBR-3119 Application's panel in KDE taskbar blinks when popup window is shown
this re-fixes JBR-2934 in a different way

(cherry picked from commit 63134e091b)
2021-07-15 05:37:04 +07:00
Dmitry Batrak
a6b4a9237e JBR-3038 Unexpected windows z-order change on workspace switch
(cherry picked from commit ddda860f42)
2021-07-15 05:37:00 +07:00
Dmitry Batrak
957ba2a03c JBR-3035 The Confirm Exit pop-up window remains hidden behind a window of another application
(cherry picked from commit 470c3bd1b5)
2021-07-15 05:36:57 +07:00
Dmitry Batrak
e3bd483d6d JBR-2934 Serious usability issue with GoLand 2020.3 caused by JBR
(cherry picked from commit 95be4351d4)
2021-07-15 05:36:54 +07:00
Dmitry Batrak
06c43c698d JBR-2977 Opening a recent project in a new window doesn't bring this window to the front
(cherry picked from commit 2d9fb9e7b8)
2021-07-15 05:36:50 +07:00
Dmitry Batrak
206fb3cf8a JBR-2698 setAutoRequestFocus(false) breaks focus logic under i3 window manager on Linux
(cherry picked from commit ebcdeb7d80)
2021-07-15 05:36:46 +07:00
Dmitry Batrak
c63cccddc4 JBR-2696 Log focus API invocations with stack traces
(cherry picked from commits 0f038754e5, a507cab6d3)
2021-07-15 05:36:44 +07:00
Dmitry Batrak
4b84bc3b93 JBR-2496 Prevent JVM stealing focus from other applications on Linux (JBR-2497, JBR-2499, JBR-2503, JBR-2652)
(cherry picked from commits 87525d1d2a, 66381f0dec, 8a789e04e9, 665ebc5d47, 98a9219c23)
2021-07-15 05:36:39 +07:00
Alexey Ushakov
63722ffd25 JBR-3509 Extend JDK-8267521 (Post JEP 411 refactoring: maximum covering > 50K) to JBR specific changes
Marked all the usages of SecurityManager related api
2021-07-15 05:36:35 +07:00
Artem Bochkarev
d63734bd7c JBR-1851: check NSArray length
and make more exception-safe
and minor optimization for logging (cache jobjects)

(cherry picked from commit 5839539379)
2021-07-15 05:36:32 +07:00
Artem Bochkarev
3a8cbb74ba JBR-1841: allow deferred disabling of InputMethods-support
(cherry picked from commit 969255904b)
2021-07-15 05:36:29 +07:00
Artem Bochkarev
0a9826f72e JBR-1762: request focus of immediate parent when dispose popup
because requesting focus for frame-parent causes to close whole popup chain

(cherry picked from commit 7a2ccfc521)

JBR-1762: fixed review comments

(cherry picked from commit 0efbe5d9b9)
2021-07-15 05:36:25 +07:00
Artem Bochkarev
2c2e35e558 JBR-1668: add hardcoded default values for preferences node NSServicesStatus
(cherry picked from commit 8445f53d85)
2021-07-15 05:36:20 +07:00
Artem Bochkarev
b7a12ea662 JBR-1515: obtain shortcut from OS to check inside AWTView.performKeyEquivalent
(cherry picked from commit 30d479fbd4)
2021-07-15 05:36:17 +07:00
Artem Bochkarev
dcee97a48c JBR-1668: add hardcoded descriptions of system actions
and minor fixes

fix memory management

(cherry picked from commit 15f7368309)
2021-07-15 05:36:15 +07:00
Elena Sayapina
100ec5b7d8 JBR-1417 [TEST] Added new regression test (JBR 11 does not support chain of popups)
(cherry picked from commit 41e89505be)
(cherry picked from commit 9fe5c778d9)
(cherry picked from commit 6ea9530d9f)
(cherry picked from commit d757108517)
(cherry picked from commit b99c1e7b5c)
2021-07-15 05:36:11 +07:00
Alexey Ushakov
e37ac4394d JBR-1690 Bundle new fonts
Test correction
Restored RenderUtil.java
Removed obsolete golden images
(cherry picked from commits:
aa13c8b4ea
943b1472c7
cab6dd5087
7997c7a5ee
cab6dd5087
7997c7a5ee
d3731df79d)
2021-07-15 05:36:08 +07:00
Dmitry Batrak
2fca3d8b3b IDEA-257525 Unable to show Chinese when using IDEA mac ARM version
The proposed solution is to use a 'normal' font as a base for 'San Francisco' font fallback.
Most of its fallback components/candidates (provided by the OS) are expected to be normal
fonts as well, and so the resulting coverage of Unicode character repertoire should be much better.

(cherry picked from commits 9b7113a6cf, 92b00d50b5, 53489fab27)
2021-07-15 05:36:05 +07:00
Dmitry Batrak
a0714881b4 JRE-469 Console with emoji output becomes slow
The fix consists of two parts:
* Making CCharToGlyphMapper remember that a particular character cannot be displayed (isn't mapped to glyph with given font). Checking this repeatedly in native code is very slow.
* Make CCompositeGlyphMapper remember the results of char-to-glyph mapping, this was missing in previous implementation. This reuses caching code in CompositeGlyphMapper, extending the range of characters for which the results are cached to include Supplementary Multilingual Plane (most emoji characters belong to it).

port commit 4e0ccde2 from JBR 9

port from JBR 11 to JBR 15 (cherry picked from commit 394e055ae6)

cherry picked from commit 0db7e948af
2021-07-15 05:36:02 +07:00
Dmitry Batrak
dc7d5bd44d reimplement JDK-7162125 to fix JDK-8147002
port commit ba38e5c4 from JBR 9

port from JBR 11 to JBR 15(cherry picked from commit a949f9d220)

cherry-picked from commit f309844f75
2021-07-15 05:35:58 +07:00
Artem Bochkarev
f5c2644e2d JBR-1771: fixed compilation errors (macosx-x86_64-normal-server-fastdebug)
(cherry picked from commit 1acada7cac)
2021-07-15 05:35:54 +07:00
Artem Bochkarev
14c136bd0a JBR-1668: minor fixes
fixed review comments

(cherry picked from commit 9dbcf194c9)
2021-07-15 05:35:51 +07:00
Vitaly Provodin
4453316fa4 JBR-1618: fixed misprint, added saving screenshots in case of failure
(cherry picked from commit e4a3889cf0)
2021-07-15 05:35:48 +07:00
Alexey Ushakov
dece0a4c69 JBR-1624 Fonts rendering is broken in the 2019.2 EAP (Fira Code)
Corrected lookup for bold fonts

(cherry picked from commit 114b8af38f)
2021-07-15 05:35:45 +07:00
Alexey Ushakov
703ccf6538 JBR-1399 Improve font discovery and loading by introducing font cache
Added unit test

(cherry picked from commit b4f5bf8bd3)
2021-07-15 05:35:40 +07:00
Elena Sayapina
44bad6a17d IDEA-165950 [TEST] Added new regression test (National keyboard layouts support)
(cherry picked from commit 0900a705bc)
2021-07-15 05:35:37 +07:00
Artem Bochkarev
af4325a847 JBR-1668: read system keyboard shortcuts
initial support for OS X

(cherry picked from commit 6bbe7102e2)
2021-07-15 05:35:34 +07:00
Artem Bochkarev
37076d0944 JBR-1573: restore current input context after cleanup
(cherry picked from commit b7acd7f6f6)
2021-07-15 05:35:31 +07:00
Alexey Ushakov
882afee8bf JBR-1624 Fonts rendering is broken in the 2019.2 EAP (Fira Code)
Restored old behaviour of registerFontsInDir as it does not affect idea bundled fonts

(cherry picked from commit cef29e8100)
2021-07-15 05:35:27 +07:00
Alexey Ushakov
c09469ba83 JBR-1874 Cursor not changing from 'default' to 'text'
Prevent OS from changing cursor

(cherry picked from commit 94a4eb7002)
2021-07-15 05:35:24 +07:00
Alexey Ushakov
dada50011d JBR-1778 Font in editor incorrect (always italics)
Added -it pattern into italic detection code
Added some more patterns to bold and italic detection code
'Anka/Coder' font support

(cherry picked from commit 5119eeee12)
(cherry picked from commit ec241e4a0a)
(cherry picked from commit 251068294e)
(cherry picked from commit 08ae9ff034)
2021-07-15 05:35:21 +07:00
Alexey Ushakov
0fbced8b2d JBR-1699 Use platform font rendering for bundled fonts on MacOS
Use different family for specific font faces. Refactoring

JBR-3071 Remove naming workaround for Fira Code

(cherry picked from commits c423003bd4, aee4b48d20)
2021-07-15 05:35:18 +07:00
Alexey Ushakov
f1175b9b7f JBR-1624 Fonts rendering is broken in the 2019.2 EAP (Fira Code)
Lower priority for idea bundled fonts to pickup platform ones
(if installed)

(cherry picked from commit e838103a24)
2021-07-15 05:35:14 +07:00
Alexey Ushakov
1d5270bce0 JBR-1885 JetBrainsMono fonts update to v0.19
Updated the fonts to v0.19. Bundled italic fonts

(cherry picked from commit 7f032e3fe7)
(cherry picked from commit a7b4c9449a)
2021-07-15 05:35:11 +07:00
Alexey Ushakov
4e8727c89b JBR-1624 Fonts rendering is broken in the 2019.2 EAP (Fira Code)
Lower priority for idea bundled fonts to pickup platform ones
(if installed)

(cherry picked from commit e838103a24)
2021-07-15 05:35:08 +07:00
Alexey Ushakov
846eb23b55 JBR-1699 Use platform font rendering for bundled fonts on MacOS
Used CFont instead of TrueTypeFont for bundled fonts on mac
Use different family for specific font faces. Refactoring

(cherry picked from commit 8c86ad3e96)
(cherry picked from commit c423003bd4)
(cherry picked from commit bcae402dc8)
2021-07-15 05:35:05 +07:00
Alexey Ushakov
43a0f7d0f1 JBR-1690 Bundle new fonts
Update family name for JetBrainsMono-Thin

(cherry picked from commit 0d2326ff34)
(cherry picked from commit 83843f9124)
(cherry picked from commit 2a2e1cfb36)
(cherry picked from commit 76abb69262)
2021-07-15 05:35:01 +07:00
Alexey Ushakov
decc261f32 JBR-1645 javax/swing/JTextArea/TestTabSize.java: Tab width calculation wrong
Corrected idea font filter

(cherry picked from commit 62f9d1f46a)
2021-07-15 05:34:59 +07:00
Artem Bochkarev
ec41c15e74 JBR-1573: workaround for 'Sudden keyboard death on Ubuntu 18'
recreate instance of system InputMethod when starts filter all events

(cherry picked from commit 3ad94911af)

(cherry picked from commit c8533a1219)
2021-07-15 05:34:56 +07:00
Alexey Ushakov
8ed2a4ef10 JBR-1399 Improve font discovery and loading by introducing font cache
Bundle IDEA fonts to improve startup performance

(cherry picked from commit 350a3fdef3)
2021-07-15 05:34:51 +07:00
Artem Bochkarev
6387eb8a28 JBR-1541: activate menu in completion handler of modal dialog
(cherry picked from commit e57384c1d6)
2021-07-15 05:34:46 +07:00
Alexey Ushakov
aa9325096f JBR-1314 Font difference in pycharm 2019.1 on Ubuntu
Removed disabling hints on MAX_FCSIZE_LTL_DISABLED font size

(cherry picked from commit 2b99dfed40)
2021-07-15 05:34:41 +07:00
Alexey Ushakov
6272a6fe04 JBR-1412 [fwp to JBR11] JBR-1393 RubyMine is hanging after log in (macOS)
Modified version of JBR8 fix

(cherry picked from commit 434166fe63)
2021-07-15 05:34:37 +07:00
Alexey Ushakov
f849f526cc JBR-1394 JBR11 does not support LCD text on Mac
Enable LCD rendering for transparent destinations

(cherry picked from commit 207c6b92ff)
2021-07-15 05:34:33 +07:00
Elena Sayapina
b7449a593a JBR-1380: [TESTBUG] Regression test java/awt/Graphics2D/DrawString/LCDTextSrcEa.java works incorrectly
(cherry picked from commit 95df9908f4)
2021-07-15 05:34:30 +07:00
Elena Sayapina
335c8f0290 JBR-1372: [TESTBUG] JDialog1054.java, MoveFocusShortcutTest.java regression tests need update
(cherry picked from commit a5948894bf)
2021-07-15 05:34:27 +07:00
Maxim Kartashev
f3d4125604 JBR-2755 IDE UI became slow via remote X Server connection from Windows
When XGetImage() calls become slow in a remote X11 session, fake
XGetImage() with client-side XCreateImage() that is filled with some
background color. The color is chosen from several top left corner
pixels of the "slow" images obtained with XGetImage().

This feature activates in a remote X11 session only and is
controlled with -Dremote.x11.workaround={true|false|auto}.
2021-07-15 05:34:23 +07:00
Vyacheslav Moklev
dd0cda9333 Fix const pointer after JDK-8225032 fix 2021-07-15 05:34:21 +07:00
Vyacheslav Moklev
31a8500fec Fix compilation on windows platform: awt_ole.h must be included before awt.h 2021-07-15 05:34:18 +07:00
Vyacheslav Moklev
5e4e0a9a43 JBR-1269 Common Item Dialog does not appear on Alt+Tab or click in windows toolbar
JBR-1270 Common Item Dialog does not have an icon

Select a proper window handle
2021-07-15 05:34:14 +07:00
Vyacheslav Moklev
d47131b7ab JBR-1271 Wrong parent of native windows dialogs
Set a proper parent to a dialog window
2021-07-15 05:34:10 +07:00
Vyacheslav Moklev
24508041d9 JBR-1273 Common Item Dialog does not open when wrong path to directory is passed
Handle set directory / set file properly
2021-07-15 05:34:07 +07:00
Vyacheslav Moklev
95cb510621 JBR-1274 Common Item Dialog sometimes crash the process
Prevent from freeing memory with CoTaskMemFree twice
2021-07-15 05:34:05 +07:00
Vyacheslav Moklev
280275eaae JBR-1257 CommonItemDialog modal window has no owner
Fix modality for Common Item Dialog

squash! JBR-1257 CommonItemDialog modal window has no owner

JBR-2478 java/awt/Modal/FileDialog/FileDialogNonModal7Test.java: DummyButton on Dialog did not gain focus when clicked

revert part of JBR-1271, that's related to 'old' file dialogs
2021-07-15 05:34:01 +07:00
Vyacheslav Moklev
7ca6eb25d7 JBR-1258 CommonItemDialog ignores directory to open
Fix parsing of directory path / file path
2021-07-15 05:33:58 +07:00
Vyacheslav Moklev
93261b19f9 JRE-1216 Implement Windows native file dialogs with the new Common Item Dialog API
Add implementation of file dialogs with the new Common Items Dialog API
2021-07-15 05:33:55 +07:00
Alexey Ushakov
ce23ff88d6 JBR-1144 [JDK11] [macos] Held down key is not deleted when press backspace after accent menu popup (Mojave)
Handled both Delete and ForwardDelete keys

(cherry picked from commit e3ba0bd651)
2021-07-15 05:33:51 +07:00
Alexey Ushakov
285d573e76 JBR-1144 [JDK11] [macos] Held down key is not deleted when press backspace after accent menu popup (Mojave)
Handled backspace separately

(cherry picked from commit 81916a92af)
2021-07-15 05:33:47 +07:00
Elena Sayapina
6b3cf6a99b JBR-1102: [TESTBUG] java/awt/Paint/ComponentIsNotDrawnAfterRemoveAddTest/ComponentIsNotDrawnAfterRemoveAddTest.java: 'paint' method of 60 components was not called
(cherry picked from commit dc7abebe17)
(cherry picked from commit c8d631a142)
2021-07-15 05:33:44 +07:00
Elena Sayapina
c4dc813dae JBR-998: [TEST] Added new regression test (Input freezes after MacOS key-selector on Mojave)
(cherry picked from commit 3d898a8024)
(cherry picked from commit f368f0f101)
2021-07-15 05:33:41 +07:00
Elena Sayapina
3e64a73ed2 JBR-318: [TEST] Added new regression test (Cmd+` doesn't work after update to JDK 152_*)
(cherry picked from commit 0be0a018b5)
(cherry picked from commit 5bb4c2a1d6)
2021-07-15 05:33:27 +07:00
Elena Sayapina
adf55cf01f JBR-1054: [TEST] Added new regression test (Weird non-modal dialog above modal dialog behaviour)
(cherry picked from commit b808be6a6a)
(cherry picked from commit 48b7dd874f)
2021-07-15 05:33:23 +07:00
Vitaly Provodin
dfcc8aed7a JRE-1117 J2DBench: introduced result reader for TC's charts (follow up)
separated printing values fo TC charts and values for comparisons

(cherry picked from commit bbdbe17e2a)
2021-07-15 05:33:19 +07:00
Vitaly Provodin
33f1eecc5b JRE-1117 J2DBench: introduced result reader for TC's charts
(cherry picked from commit 422fa59643)
2021-07-15 05:33:14 +07:00
Alexey Ushakov
6a8e099fb5 JRE-60 Editor font is distorted on Kubuntu Linux 16.04 with HiDPI
Override FC_HINT_SLIGHT only for small font sizes

(cherry picked from commit 0e1d23c807)
2021-07-15 05:32:59 +07:00
Alexey Ushakov
283587c032 JRE-471 Crash on macOS Sierra after Sleep
Replaced [NSScreen screens] 'objectAtIndex' with 'firstObject' to get nil instead of NSRangeException. Added nil checks

(cherry picked from commit d6b98511262055c01522d9ec8024253af7e91564)
(cherry picked from commit cef970e1ba)
2021-07-15 05:32:52 +07:00
Alexey Ushakov
280b1ae0e1 JRE-608 J2DBench metrics: up to 20x degradation
Increased rendering queue buffer up to 6.4 MB

(cherry picked from commit 9ef00f00a7fb6e14835393f8d3944157c6800727)
(cherry picked from commit 2a61e9e997a880a60c5acb361849205170501b91)
(cherry picked from commit 68ca9f00ded004c970b94bd047a04b9f09237047)
(cherry picked from commit 2fe5289178)
2021-07-15 05:32:44 +07:00
Alexey Ushakov
81ea8eff5a JRE-1028 fwport(9): JRE-1008 Do not use LCD shader on macOS 10.14+ in font rendering
Disable LCD text shader on macOS 10.14+ if LCD rendering is not explicitly specified

(cherry picked from commit dffea9d701)
2021-07-15 05:32:39 +07:00
Konstantin Bulenkov
101a3d97f8 update icons
(cherry picked from commit dfe387ff5037deda29d8d522cba6cc5370796ff4)
(cherry picked from commit de1e4a9d71)
2021-07-15 05:32:36 +07:00
Konstantin Bulenkov
713b02c036 add workspace.xml to gitignore
(cherry picked from commit bd5b9403fdca779ecc76f0b3af2918fe772f7ed1)

(cherry picked from commit 37e7661f85)
2021-07-15 05:32:32 +07:00
Vitaly Provodin
a9aa04dac1 Update README.md 2021-07-15 05:31:53 +07:00
Vitaly Provodin
d92caad2bc Regression test on https://bugs.openjdk.java.net/browse/JDK-8139176
(cherry picked from commit 6f1c0a6)
(cherry picked from commit 63130fd461)

add regression test on https://bugs.openjdk.java.net/browse/JDK-8139176

(cherry picked from commit 380c17456c)

(cherry picked from commit 6f1c0a6)
(cherry picked from commit 63130fd461)
2021-07-15 05:31:47 +07:00
Vitaly Provodin
18d0024c30 not for upstream: added disposing frames in order to provide the test with the chance on the second run
(cherry picked from commit 8170635)
(cherry picked from commit 7fc924f065)
2021-07-15 05:31:40 +07:00
Vitaly Provodin
15b1c19501 JRE-9: added regression test
(cherry picked from commit 4ffb665)
(cherry picked from commit 00a29ad129)
2021-07-15 05:31:35 +07:00
Sergey Malenkov
4c56854a4c JRE-100 Scroll with inertia (Mac os) should only work in the initial component
(cherry picked from commit e79502c708)
2021-07-15 05:31:32 +07:00
Sergey Malenkov
2103e42bc5 IDEA-161965 ignore dragged event that does not change mouse location Sierra is more sensit
(cherry picked from commit ef490fa465)
2021-07-15 05:31:27 +07:00
Stanislav Dombrovsky
999b23b9cb Fix rendering of HTML list dots + better vertical align for them.
(cherry picked from commit fa4a404533ba1ef638fe523adc74391aee8a3ebf)

(cherry picked from commit 9f079c66e9)
2021-07-15 05:31:22 +07:00
Vitaly Provodin
31b97772a4 configure BOOT_JDK to use JDK 16 2021-07-15 05:31:17 +07:00
Maxim Kartashev
4144c9ddf9 JBR-1430 (8195129) Windows: use UTF16 version of Win32 API to load DLL
Also correct library name encoding in exception messages.
2021-07-15 05:31:12 +07:00
Dmitry Batrak
f1958bb005 JBR-3353 Sibling popup window is shown below dialog on macOS
(cherry picked from commit 4c6f3e4510)
2021-07-15 05:31:04 +07:00
Dmitry Batrak
1186ad23b3 JBR-3339 Window requests focus on horizontal scroll (on Linux)
(cherry picked from commit 8d74e8e30b)
2021-07-15 05:30:34 +07:00
Alexey Ushakov
3837ba418f JRE-202 Deadlock in CGLGraphicsConfig.getCGLConfigInfo
Added processing system events while waiting for OGLRenderQueue.lock
Moved getCGLConfigInfo logic execution to AppKit thread so, awt lock is
 taken on one thread

(cherry picked from commit d1c8bf03e1bd41cb075aa73cc39558103af7fe1a)
(cherry picked from commit 6bf9f31986be64acf3755b34568802f9960a66ec)
(cherry picked from commit 4e21d67e0369bffac45662c63699b39946218a7a)
2021-07-15 05:29:56 +07:00
Anton Tarasov
f2958638f4 JRE-166 [macOS] deadlock with JFXPanel
(cherry picked from commit a9dbb6990fac0c659297487a261ba9170e5fb3ad)

(cherry picked from commit 8a44e1bb37)
2021-07-15 05:28:53 +07:00
Alexey Ushakov
2303fcb2c6 8265445: Introduce the new client property for mac: apple.awt.windowAppearance
Implemented apple.awt.windowAppearance client property
2021-07-15 05:26:03 +07:00
Anton Tarasov
a8c58cc330 JBR-3306 jbr-dev warnings: incompatible pointer to integer conversion returning 'void *' from a function with result type 'jlong' 2021-07-15 05:25:58 +07:00
Dmitry Batrak
c712f4642d JBR-2498 Fix unexpected window raising under Mutter WM
re-implement the fix, so that ChildAlwaysOnTopTest isn't failing
2021-07-15 05:25:18 +07:00
Maxim Kartashev
178eae1c33 JBR-3323 Improve sanitizer-enabled builds
Improve usability of builds with --enable-asan.
Add the --enable-usan option to build with Undefined Behavior Sanitizer.
2021-07-15 05:24:35 +07:00
Alexey Ushakov
3398d86c5e JBR-3327 [jbr-dev] Adjust mac window appearance according to AppleInterfaceStyle property
Set window appearance according to AppleInterfaceStyle default
2021-07-15 05:24:33 +07:00
Alexey Ushakov
25ffee6d3a JRE-238 [736] java.awt.AWTError: access denied ("java.lang.RuntimePermission" "canInvokeInSystemThreadGroup")
Moved task execution on AppKit to the privileged block. Minor refactoring

(cherry picked from commit 5dbb88471115c9e4a536ae37d0e6794de9e5ac9c)
2021-07-15 05:23:40 +07:00
Alexey Ushakov
8a1e3fa9a2 JRE-359 CGraphicsEnvironment.getDefaultScreenDevice() returns null
Moved CG api calls to AppKit thread

(cherry picked from commit fd0210f035199e8612097a2c1d42b90cfd2111f8)
(cherry picked from commit 5e99e376d9dfe477401121878704630c3c13f9f7)

(cherry picked from commit 6d73b25130)
2021-07-15 05:22:57 +07:00
Dmitry Batrak
eb6f1ab945 JBR-2973 Copy/Move dialog not in the focus on drag-n-drop to Project Tool window from external application
(cherry picked from commit 20fe78b650)
2021-07-15 05:22:27 +07:00
Dmitry Batrak
b34ea2d32f JBR-2759 Typeahead issue on Linux
(cherry picked from commits 76bdaf1131, b20c56ff3e)
2021-07-15 05:21:55 +07:00
Denis Fokin
f4e184b6da JBR-1362 Multiple child windows opened and closed in sequence result in a focus loss
(cherry picked from commit 3c9c599a2d)
2021-07-15 05:21:25 +07:00
Alexey Ushakov
6ac99f7bd4 JRE-444 CPlatformWindow.nativeGetTopmostPlatformWindowUnderMouse is slow
Replaced number of CGWindowListCopyWindowInfo for each window layer with [NSWindow windowNumberAtPoint: belowWindowWithWindowNumber:]

(cherry picked from commit 2a143af4d62340acdfd9c94d876f684385febbc8)
(cherry picked from commit 6fc369e8bf)
2021-07-15 05:20:54 +07:00
Alexey Ushakov
cf4430dc17 JRE-482 Java_sun_font_CStrike_getNativeGlyphOutline takes too much time in scrolling
Replaced glyph outlines with bounding boxes for glyph boundaries calculation for most common usages. Also, skipped unnecessary OGL flushes in OGL rendering queue

(cherry picked from commit c58dc052af48887338a38beb0c721eddca3af481)
(cherry picked from commit 7f6be7cfb907bbf1c3572b911df5690fa3039fde)
(cherry picked from commit c68913d82c0ba4b4c509179123f0a4bf7971f857)
(cherry picked from commit 9cfa04c93ad416a8177d9e7ca410850bd3ff880f)
(cherry picked from commit 0e930841704e4e98ecc0c888b144245e74218799)
(cherry picked from commit 8ffc190fbdb059d5a24842115c0bc3ade8b351b9)
(cherry picked from commit 0f7c26186a)
2021-07-15 05:20:22 +07:00
Alexey Ushakov
af8e00fc84 JRE-193 UI freeze and 12/second thread dumps
Moved CStrikeDisposer dispose code to AppKit

(cherry picked from commit 28774d6878)
2021-07-15 05:19:52 +07:00
Alexey Ushakov
b7aac6e05d JBR-3316 Reimplement CThreading functionality on top of OpenJDK17 sourcebase
Adopted CThreading related code to OpenJDK17 source base

(cherry picked from commit 5dfb30ae68b2c54d58c98a9195709c031f823581)
(cherry picked from commit 94163bd69f64616836523e81567aa1141480d841)
2021-07-15 05:19:20 +07:00
Alexey Ushakov
727892af71 JBR-3304 jbr-dev warnings: 'getPhysFontName' defined but not used [-Werror=unused-function]
Removed unused code
2021-07-15 05:18:49 +07:00
Vitaly Provodin
ebfdbff82b exclude javax/swing/JTabbedPane/4624207/bug4624207.java failing on windows due to 8197552 2021-07-15 05:18:18 +07:00
Alexey Ushakov
c6565a1f94 JRE-366 Add support for Awesome WM
Added detection of Awesome WM and handled similar to Sawfish WM

(cherry picked from commit 6742077ed198975949af567e8ef543f853397351)
(cherry picked from commit 2847be73c6)
2021-07-15 05:17:45 +07:00
Alexey Ushakov
d8b090823e JRE-353 Fedora 25 + XMonad rendering issues
Added support for Xmonad WM

(cherry picked from commit c690c3c7fdf1390e6b1a8d388ff752a09391ae3c)
(cherry picked from commit 6851dc3441)
2021-07-15 05:17:14 +07:00
Denis Konoplev
36733638a8 8264143: Change uint8_t to unsigned char 2021-07-15 05:16:40 +07:00
Dmitry Batrak
5995010a02 JBR-3255 Applying 'incline' transform might change character's advance
(cherry picked from commit b37f7cfdb1)
2021-07-15 05:16:03 +07:00
Dmitry Batrak
7dd1010299 JBR-3215 'deriveFont(float)' can return a different font (not just change the size)
(cherry picked from commit 8eafcaab24)
2021-07-15 05:15:03 +07:00
Dmitry Batrak
645eecc9e0 JBR-3157 Maximized window with custom decorations isn't focused on showing
(cherry picked from commit 62b04983f2)
2021-07-15 05:14:28 +07:00
Dmitry Batrak
4b77c976ca make AwtListGarbageCollectionTest pass reliably
(cherry picked from commit 304eb7f919)
2021-07-15 05:13:30 +07:00
Dmitry Batrak
245099e33b JBR-1752 Floating windows overlap modal dialogs
(cherry picked from commit 0161050077)
2021-07-15 05:13:27 +07:00
Dmitry Batrak
6b0572e738 JBR-3054 Focus is not returned to frame after closing of second-level popup on Windows
(cherry picked from commit 0c2b6e1c04)
2021-07-15 05:12:59 +07:00
Dmitry Batrak
9ecaafa2cb JBR-2702 Tooltips display through other applications on hover
(cherry picked from commits 11732c2469, 0ed7deabaa)
2021-07-15 05:12:26 +07:00
Dmitry Batrak
edacc6c4f0 added RobotSmokeTest
this test failing in jtreg launch most probably indicates either some problem with the environment (e.g. some windows left open from previously launched processes) or with java.awt.Robot implementation

(cherry picked from commit 1d525a2d2f)
2021-07-15 05:12:25 +07:00
Dmitry Batrak
fb78102ab6 JBR-2847 Always dispatch KEY_TYPED event to the same component as KEY_PRESSED event
also fixes JBR-2834, IDEA-254466, IDEA-254466
squashed with fixes for JBR-3291, JBR-3307, JBR-3598

(cherry picked from commits e94f6057a4, ba6b9c085e, 2ccf6b65a7, 3b0708af7d, 3674766d65)
2021-07-15 05:12:24 +07:00
Dmitry Batrak
62a5665bf7 JBR-2712 Typeahead mechanism doesn't work on Windows
(cherry picked from commits 1a9838082e, f5b6222835, acd7e3b2da, cd6dd5c3cf8556f97f3113cb7d615a92393b57bf(partially), e8bbd8ffdd90f57cd12d7d7e89188be97ee4be0b(partially))
2021-07-14 17:52:13 +07:00
Denis Konoplev
47dee01dff 8264143: Lanai: RenderPerfTest.BgrSwBlitImage has artefacts on apple M1
Add stdint include to fix x64 build
2021-07-14 17:52:12 +07:00
Dmitry Batrak
a48d7a23e2 JBR-2498 Fix unexpected window raising under Mutter WM
(cherry picked from commit 73b45fb899)
2021-07-14 17:52:12 +07:00
Dmitry Batrak
436429c870 JBR-2248 Support text wrapping in a <pre> tag in JEditorPane
port from JBR 11 to JBR 15 (cherry picked from commit ff2e915371)

cherry picked from commit 6a30c56138
2021-07-14 17:52:12 +07:00
Dmitry Batrak
1ffbb44449 JBR-2234 Support CSS setting overflow-wrap:anywhere in JEditorPane
port from JBR 11 to JBR 15 (cherry picked from commits b6583d0a71, 6003abc15f)

cherry picked from commit 93ad4f06dd
2021-07-14 17:52:12 +07:00
Dmitry Batrak
981d03b524 JBR-2050 Issue with keycap emojis
port from JBR 11 to JBR 15 (cherry picked from commit ae91e1d7f1)

cherry picked from commit d3018a1837
2021-07-14 17:52:11 +07:00
Dmitry Batrak
1df892c53a JBR-1987 Korean/Thai characters not printed properly in annotation tooltip (e.g. spellchecker)
This changes the fonts JDK uses for font fallback on Windows. These used to be DokChampa (for Thai) and Batang/Gulim/Gulim (for Korean).
Those fonts are not available by default on Windows 10, user needs to install supplementary font language packs to get them.
Now the following fonts will be used - Tahoma (for Thai) and Malgun Gothic (for Korean). They are available by default
on Windows 7, 8 and 10.

port from JBR 11 to JBR 15 (cherry picked from commit 850653192b)

cherry picked from commit 2bf43a57ab
2021-07-14 17:52:11 +07:00
Dmitry Batrak
5c12770f59 JBR-1714 Italic text is displayed using incorrect glyphs on Windows
port from JBR 11 to JBR 15 (cherry picked from commits 46e4cdfcbd, 9cc5cbc99b)

cherry picked from commit 6769b27e53
2021-07-14 17:52:11 +07:00
Dmitry Batrak
233e4b7466 JBR-1689 Incorrect painting of long strings on linux
port from JBR 11 to JBR 15 (cherry picked from commits e12c1d6f0d, 0429e74e9d)

cherry picked from commit e43cfd198f
2021-07-14 17:52:11 +07:00
Dmitry Batrak
4a7683dd32 JBR-1248 Exception caused by broken font
port from JBR 11 to JBR 15 (cherry picked from commit 4efa7eab3e)

cherry picked from commit 6e1c514c6c
2021-07-14 17:52:10 +07:00
Alexey Ushakov
bbbfc9f661 JRE-18 CCE in XRMaskFill.MaskFill
Throwing InvalidPipeException for incompatible surfaces

(cherry picked from commit 55dab103c24bf86cf025b9ce02b67e72508d41ba)
(cherry picked from commit 0a4fdad0f2)
2021-07-14 17:52:10 +07:00
Dmitry Batrak
a40dffc1b2 JBR-1245 [JDK 11] There are different letter spacings in some controls
port from JBR 11 to JBR 15 (cherry picked from commit a26b70568a)

cherry picked from commit e2637199e9
2021-07-14 17:52:10 +07:00
Dmitry Batrak
18bfc3e241 JRE-927 Unexpected wrapping of bidirectional text in JEditorPane on HiDPI screens
port commit 11a5a4a2 from JBR 9

port from JBR 11 to JBR 15 (cherry picked from commit 65a5e450d5)

cherry picked from commit 47ff31ae82
2021-07-14 17:52:10 +07:00
Dmitry Batrak
bd89999539 JRE-774 Don't paste BOM from clipboard on Mac
port commit ea9b75b3 from JBR 9

port from JBR 11 to JBR 15 (cherry picked from commit c6fed2cf58)

cherry picked from commit a5e25d1ef9
2021-07-14 17:52:10 +07:00
Dmitry Batrak
7bdc16f2c5 JRE-847 Box drawing characters have different widths with Monospaced font on Windows
port commit 778cef18 from JBR 9

port from JBR 11 to JBR 15 (cherry picked from commit 9caaac4a5a)

cherry picked from commit eea293f4a4
2021-07-14 17:52:09 +07:00
Dmitry Batrak
7ce28495d4 JRE-748 Strange dots with fractional metrics turned on
port commit 82e7c82d from JBR 9

port from JBR 11 to JBR 15 (cherry picked from commit e9bd5f5dad)

cherry picked from commit e0475e9ba2
2021-07-14 17:52:09 +07:00
Dmitry Batrak
a91dbcdeef JRE-593 Wrong italic font rendering for Source Code Pro
port commit 1f6bd200 from JBR 9

port from JBR 11 to JBR 15 (cherry picked from commit 32ce109355)

cherry picked from commit 087ff34c2e
2021-07-14 17:52:09 +07:00
Dmitry Batrak
1401557381 JRE-430 Font fallback sometimes doesn't work in Swing text components
port commit fc8003ad from JBR 9

port from JBR 11 to JBR 15 (cherry picked from commit 5b814d6b34)

cherry picked from commits b871188f44, 0a9f16dc90
2021-07-14 17:52:09 +07:00
Dmitry Batrak
18b47ed7f5 JRE-372 IntelliJ editors silently precompose diacritics
port commit f7facf1b from JBR 9

port from JBR 11 to JBR 15 (cherry picked from commit 67b1e552d8)

cherry picked from commit 51ce1d6427
2021-07-14 17:52:08 +07:00
Alexey Ushakov
4aee1f6a8d JRE-303 2017.1.1 update breaks linux fonts
Corrected rendering hints for Non-AA text rendering

(cherry picked from commit b923aa7a0729a10ea47d3438622d659fbead44c9)
(cherry picked from commit b6bdd04e41)
2021-07-14 17:52:08 +07:00
Alexey Ushakov
d56a66b04f JRE-205 Font is wrong and without anti aliasing in 2017.1 EAP
Added property to disable bundled font config:
  java2d.font.loadFontConf=false
Do not load custom font.conf by default

Moved hints adjusting logic from code to bundled font.conf file
Applied correction only for regular fonts with platform sizes less than 12
Some fonts are not corrected at all: Consolas, Noto Sans Mono
Used family name instead of physical one in requests to Fontconfig
Removed redundant call to FcConfigBuildFonts
Added privileged access to the properties (JRE-235,JRE-235)

(cherry picked from commit 4d4c915047077ebd966b0e3be056566d56ba11a4)
(cherry picked from commit 9d6f325f72482405264852f3ee2636f5fedaeaf0)
(cherry picked from commit e7e3372bf8db539c0f6bc85db9f1093f8fa4c380)
(cherry picked from commit 3e724caed2f199be50d25d1ecb20b7819c86be2e)
(cherry picked from commit d372b35963c096a32331b05b257e26841ace5d94)
(cherry picked from commit 18a5f5de03eb107f89dca138a44b9aab2151235c)
(cherry picked from commit 9ba320efef0539f75aa93fd1b5dd80266c954d0a)
(cherry picked from commit b8c38f419972af61291953f7f452c1698f7a1624)
(cherry picked from commit debba0128e200be60adc9a339d5985590ef4e230)
(cherry picked from commit 2fa17b1bd7d6524e4b5fa4d0b3ce2bf02a8fcc78)
(cherry picked from commit 09b4f61db0d4f5beea0e16ce9136c99e2185c10b)
(cherry picked from commit 3b6782dd742f9c74a9535145db2f9f7ffaccf7c8)
(cherry picked from commit f1b68149528c13a22fa64468c130b1405bf3d081)
(cherry picked from commit db5cf5a2b9cb454630fb86783c2d58cd5446cba6)
(cherry picked from commit 32140948578bc3c2a0c5f8adb537660421efe5e7)
(cherry picked from commit b978e3d0b131ed642774c5a14a649e13f764c20b)

(cherry picked from commit c75c1ef8b2)

(cherry picked from commit a29f19e6a2)
2021-07-14 17:52:08 +07:00
Dmitry Batrak
1e5e7e1ab7 fix direction of vertical glyph offsets (regression introduced by backporting JDK 9 changes for JRE-33)
port commit 9b98eaf0 from JBR 9

port from JBR 11 to JBR 15 (cherry picked from commit cbf4d301ee)

cherry picked from commit e6752600a5
2021-07-14 17:52:08 +07:00
Dmitry Batrak
67d5aaf19e an option to disable native rendering for rotated text (following JRE-19)
port commit ccc1ded6 from JBR 9

port from JBR 11 to JBR 15 (cherry picked from commit 72fb9ff7c4)

cherry picked from commit a5bd092449
2021-07-14 17:52:07 +07:00
Dmitry Batrak
8c14be8382 JRE-11 Support text rendering via DirectWrite API on Windows
port commits 7b180f8d, cccbcab4 from JBR 9

port from JBR 11 to JBR 15 (cherry picked from commit 030f15834c)

cherry picked from commit b16ee45915
2021-07-14 17:52:07 +07:00
Dmitry Batrak
11311a71f0 JRE-10 Ligatures are not working sometimes when characters from multiple scripts are present
ports commit 18b3f575 from JBR 9

port from JBR 11 to JBR 15 (cherry picked from commit c30407cb87)

cherry picked from commit 8c9402b60b
2021-07-14 17:52:07 +07:00
Dmitry Batrak
4ba80c3f60 IDEA-150876 OpenJDK fonts for toolwindow names look worse than Oracles's
don't apply FreeType-returned glyph advance for rotated glyphs rendered by GDI

This seems to produce a better looking text (more evenly spaced). Fractional metrics won't be respected by this code, but we can address this later if needed.

port commits c9debd5e, ed78cd00, 4c7e1619, 7aa0429c, 7bd6c17c from JBR 9

port from JBR 11 to JBR 15 (cherry picked from commits d6b588bdab, dbc15fb84e)

cherry picked from commit 2c0d6150d0
2021-07-14 17:52:07 +07:00
Vitaly Provodin
dd8fc4ea12 JRE-186 added regression test (Modal dialogs (Messages) shouldn't popup IDEA when another application is active)
(cherry picked from commit 236bd38d1b)
2021-07-14 17:52:06 +07:00
Vitaly Provodin
43f18a9559 JRE-269 added regression (JLabel doesn't scale <code>text</code> HTML fragments.)
(cherry picked from commit 1f4ad38d23)
2021-07-14 17:52:06 +07:00
Alexey Ushakov
03e8b654a5 JRE-307 Wrong dpi reported on Wayland
(cherry picked from commit 15693661cc)
2021-07-14 17:52:06 +07:00
Vitaly Provodin
127d5e05ca JRE-392 added regression (Tip of the day is not hidden while another modal window is shown)
(cherry picked from commit c7b0ac686f)
2021-07-14 17:52:06 +07:00
Vitaly Provodin
b22687d856 JRE-394 added regression test (System getenv doesn't return env var set in JNI code)
(cherry picked from commit 3a7b3c67b0)
2021-07-14 17:52:05 +07:00
Vitaly Provodin
80f6eb133a JRE-401 added regression test (AppCode freezes during autocomplete and other operations)
(cherry picked from commit cb4453b1d1)
2021-07-14 17:52:05 +07:00
Vitaly Provodin
e08a83bce2 JRE-422 added new regression test (AWTView deliverJavaMouseEvent leaks jEvent)
(cherry picked from commit 37dc13c603)
2021-07-14 17:52:05 +07:00
Vitaly Provodin
70b5ec36a2 JRE-430 added new regression test (Font fallback sometimes doesn't work in Swing text components)
(cherry picked from commit d04debc847)
2021-07-14 17:52:05 +07:00
Vitaly Provodin
d9bbf267a4 JRE-457 added new regression test (OGLTR_DisableGlyphModeState is slow)
(cherry picked from commit 3a43f4557f)
2021-07-14 17:52:04 +07:00
Vitaly Provodin
e27f2d31d1 JRE-458 added new regression test (Insufficient and inconsistent permissions on some files in Linux build)
(cherry picked from commit 82adbe9c25)
2021-07-14 17:52:04 +07:00
Vitaly Provodin
f4e6b1cc64 JRE-467 added new regression test (Wrong rendering of variation sequences)
(cherry picked from commit 0026095202)
2021-07-14 17:52:04 +07:00
Vitaly Provodin
820dec6612 JRE-468 added new regression test (Idea freezes on project loading)
(cherry picked from commit 1ce8c3ce82)
2021-07-14 17:52:04 +07:00
Vitaly Provodin
5e7c16965f JRE-501 added new regression test (Live resize is jerky for heavy java applications on Mac)
(cherry picked from commit c4a1277c1b)
2021-07-14 17:52:03 +07:00
Vitaly Provodin
50566bf303 JRE-638 added new regression test (enable unlimited cryptographic policy by default)
(cherry picked from commit 4a14c6f15a)
2021-07-14 17:52:03 +07:00
Vitaly Provodin
4f55bc2839 JRE-705 added new regression test (Z-order of child windows is broken on Mac OS)
(cherry picked from commit 82cd480619)
2021-07-14 17:52:03 +07:00
Vitaly Provodin
3c76faebbf JRE-741 added new regression test (Modal dialog stays above other process windows)
(cherry picked from commit 9ea664c299)
2021-07-14 17:52:03 +07:00
Vitaly Provodin
8b74350436 JRE-624 CThreading isAppKit() fails to detect main app thread if it was renamed
(cherry picked from commit c8f248a936)
2021-07-14 17:52:02 +07:00
Alexey Ushakov
a028fe1e49 IDEA-166173 IntelliJ freezes when returning from sleep
Fixed deadlock by removing unnecessary getScreenResolution call

(cherry picked from commit cec93cf1fd)
2021-07-14 17:52:02 +07:00
Alexey Ushakov
28600b046a Added missing fontconfig defines
(cherry picked from commit 2ac273a456)
2021-07-14 17:52:02 +07:00
Alexey Ushakov
2ac6a4aed8 JRE-12 CCE: XRTextRenderer.drawGlyphList (sun.java2d.NullSurfaceData cannot be cast to sun.java2d.xr.XRSurfaceData)
Throwing InvalidPipeException for incompatible surfaces

(cherry picked from commit f98f34c)
(cherry picked from commit fb2bbc47fe)
2021-07-14 17:52:02 +07:00
Alexey Ushakov
a205f73f8e JRE-43 Font.getFamily() does not work in headless mode
Removed unused code

(cherry picked from commit 5b523f049e)
2021-07-14 17:52:01 +07:00
Alexey Ushakov
56cdf95bb4 JRE-43 Font.getFamily() does not work in headless mode
Bundled Droid fonts to fallback in headless mode

(cherry picked from commit 5b523f049e)
2021-07-14 17:52:01 +07:00
Alexey Ushakov
2031d25572 JRE-15 Greyscale text is too dark comparing with subpixel AA
Adjusted default value for greyscale text rendering in freetype

(cherry picked from commit f80497c4f0)
2021-07-14 17:52:01 +07:00
Alexey Ushakov
f364feb7b5 IDEA-155347 On Ubuntu with High DPI tooltip font is too thick when the tooltip is fading in and out
Handled missing FC_RGBA_NONE value

(cherry picked from commit 44fcbdabf8)
2021-07-14 17:52:01 +07:00
Alexey Ushakov
236b64d8f6 IDEA-149882 Issue with fonts in Ubuntu 12.04
Provided fallback to default font rendering settings if libfontconfig unable to
match font pattern

(cherry picked from commit d93a5f1598)
2021-07-14 17:52:00 +07:00
Alexey Ushakov
3f02003ed3 IDEA-151619 CLion EAP fails to start with missing symbol: FT_Library_setLcdFilter
Skip FT_Library_setLcdFilter call if the symbol is not there
Cache negative FT_Library_setLcdFilter symbol lookup result
Used RTLD_DEFAULT handler for process symbols lookup

(cherry picked from commit e6f0055704)
2021-07-14 17:52:00 +07:00
Alexey Ushakov
df978a2824 JRE-29 fontconfig lib crashes CLion on OSX
Disabled fontconfig usage on OSX

(cherry picked from commit 431e14429c)
2021-07-14 17:52:00 +07:00
Vitaly Provodin
c04ca455ea exclude tests spontaneously creating windows during test execution 2021-07-14 17:52:00 +07:00
Alexey Ushakov
7774ef9ba2 JRE-48 built-in jre renders fonts abnormally heavier (normal text looks bold) than the oracle jre
Disable FT_LOAD_TARGET_LIGHT for fonts with FC_AUTOHINT=false (this target implicitly enables  FC_AUTOHINT)
Reused setupLoadRenderFlags for all rendering cases

(cherry picked from commit f3f2667a4c)
2021-07-14 17:51:59 +07:00
Alexey Ushakov
40a2df2a73 Added logging for freetypeScaler via env variable OPENJDK_LOG_FFS=yes
and for screen resolution in freetypeScaler

(cherry picked from commit 091d74a791)
2021-07-14 17:51:59 +07:00
Alexey Ushakov
11bff77826 JRE-34 IDE Crashes During Startup
Added validation of dpi settings coming from xserver

(cherry picked from commit b1c49c3b27)
2021-07-14 17:51:59 +07:00
Anton Tarasov
fd8ed694b8 Add build.gradle 2021-07-14 17:51:59 +07:00
Anton Tarasov
6f0bb4a82f JBR-2031 [mac] jcef deadlocks with a11y on start
(cherry picked from commit 4f44b37f08)
2021-07-14 17:51:58 +07:00
Alexey Ushakov
f492d938ed JRE-1083 [JDK11] Test com/sun/java/accessibility/util/8051626/Bug8051626.java fails on macOS on JB JDK11b
Wrapped SelectorPerformer invocation into privileged action

(cherry picked from commit 48e7b547ae)
2021-07-14 17:51:58 +07:00
Anton Tarasov
a8f3411e53 JBR-2019 provide getWindowHandle method for jcef
(cherry picked from commit 7ae706b629)
2021-07-14 17:51:58 +07:00
Anton Tarasov
4341a77257 Comment assertion (originally JRE-965)
The assert line crashes debug hotspot.

(cherry picked from commit a00074a86c)
2021-07-14 17:51:58 +07:00
Anton Tarasov
990f3ece05 JBR-1976 [jcef] need mouse-transparent window on Windows
(cherry picked from commit b60fac96b4)
2021-07-14 17:51:57 +07:00
Anton Tarasov
96e1833971 JBR-1834 [linux] runtime hidpi switch is broken
(cherry picked from commit eaa04303a7)
2021-07-14 17:51:57 +07:00
Anton Tarasov
3dfc653eb6 JBR-1824 export NSWindow::setIgnoresMouseEvents to java internal API
(cherry picked from commit 4399dc382c)
2021-07-14 17:51:57 +07:00
Anton Tarasov
ce4f0a09ef JBR-1802 com/sun/java/accessibility/util/8051626/Bug8051626.java: access denied ("java.lang.RuntimePermission" "getClassLoader")
(cherry picked from commit eae772aca9)
2021-07-14 17:51:57 +07:00
Anton Tarasov
187be0e513 JBR-1795 Project opened from Welcome screen goes to backgound after loading
(cherry picked from commit 322526458a)
2021-07-14 17:51:56 +07:00
Anton Tarasov
982b63afe8 JBR-1609 Jupyter Notebook eventually causes IDEA to become unresponsive on Mac OSX
(cherry picked from commit 8ae0be8eb6)
2021-07-14 17:51:56 +07:00
Anton Tarasov
b93c17931f JBR-1786 Weird white border for IDE window
(cherry picked from commit 4b09614a0e)
2021-07-14 17:51:56 +07:00
Vyacheslav Moklev
1145299f1b JBR-1552 Invalid screen bounds in full screen mode
Check is window is not in undecorated state

(cherry picked from commit 5547701e2c)
2021-07-14 17:51:56 +07:00
Vyacheslav Moklev
51fe41504a JBR-1509 Client area size is wrong in Borderless mode
Fix client area size

(cherry picked from commit 00d32e58dc)
2021-07-14 17:51:55 +07:00
Anton Tarasov
aaaade5dae JBR-1770 [windows] frame does not open as maximized
(cherry picked from commit d9dfc3c6c5)
2021-07-14 17:51:55 +07:00
Anton Tarasov
0c94851700 JBR-1693 difficult to input Japanese text with "Fast" Key Repeat
(cherry picked from commit 12de3e287e)
2021-07-14 17:51:55 +07:00
Anton Tarasov
fc89040251 JBR-1429 Scale is huge due to GDK_SCALE
(cherry picked from commit 1c3477df2e)
2021-07-14 17:51:55 +07:00
Anton Tarasov
abfa6f0f54 JBR-1669 IDE-managed HiDPI mode is broken
(cherry picked from commit 461b0b5cd4)
2021-07-14 17:51:54 +07:00
Anton Tarasov
b11eefd25d JBR-1650 propagate custom decoration title bar height to native
(cherry picked from commit f6fc65d014)
2021-07-14 17:51:54 +07:00
Anton Tarasov
b37affa771 JBR-1629 Maximized window cut at the right and bottom
(cherry picked from commit 9e768377db)
2021-07-14 17:51:54 +07:00
Anton Tarasov
4292586fd0 JBR-1492 Not able to start Intellij Idea 2017.2.5 with modified vmoptions
(cherry picked from commit e7ca6db66b)
2021-07-14 17:51:54 +07:00
Anton Tarasov
6e62a8fcf9 JBR-1427 pycharm jupyter preview stuck and no response when click on preview.
(cherry picked from commit 1746b04686)
2021-07-14 17:51:53 +07:00
Anton Tarasov
de6b76848a IDEA-210154 Borderless UI: Top frame of IDEA window is blue
(cherry picked from commit 2dd4163bc4)
2021-07-14 17:51:53 +07:00
Anton Tarasov
5249f29b22 JBR-1365 force IDE-managed HiDPI on Linux for fractional scales
(cherry picked from commit f092ff3962)
2021-07-14 17:51:53 +07:00
Anton Tarasov
e19f4be4db JBR-1351 Borderless UI: Bold frame around IDEA window appears on non-HiDPI display
(cherry picked from commit 06d35de069)
2021-07-14 17:51:53 +07:00
Anton Tarasov
c0eb1d0ba8 JBR-1313 wrong insets for non-resizable custom-decorated frame
(cherry picked from commit 9179718cb6)
2021-07-14 17:51:52 +07:00
Anton Tarasov
1e8525ba94 JBR-1293 do not modify client bounds when custom-decorated frame is set undecorated
(cherry picked from commit cb188edaab)
2021-07-14 17:51:52 +07:00
Anton Tarasov
63e892c254 JBR-1278 allow native border and shadow for custom decoration mode
(cherry picked from commit a879ad5739)
2021-07-14 17:51:52 +07:00
Anton Tarasov
bbc3a287ab JRE-1232 forwardport: JRE-1228 support custom frame decoration
(cherry picked from commit d2820524a1)
2021-07-14 17:51:52 +07:00
Anton Tarasov
ff99281985 JRE-1162 [jdk11] support on-the-fly DPI change on linux
(cherry picked from commit c06c4c69d3)
2021-07-14 17:51:51 +07:00
Anton Tarasov
9e339dbbb8 JRE-1142 [jdk11] hidpi is not detected since Ubuntu 18.04
(cherry picked from commit be4f8c0d9d)
2021-07-14 17:51:51 +07:00
Anton Tarasov
e62006872c JRE-1111 [JDK11] java/beans/Beans/TypoInBeanDescription.java crashes at libawt_xawt.so+0x4a30d
(cherry picked from commit b89e6aed0b)
2021-07-14 17:51:51 +07:00
Anton Tarasov
844f80bac5 fix JNI_OnUnload definition
(cherry picked from the commit  3571e39071)

(cherry picked from commit 1019d8f0f2)
2021-07-14 17:51:50 +07:00
Anton Tarasov
addaa817e7 JRE-981 IM workaround does not work anymore
forward port of 2d7c29b in JetBrains/jdk8u_jdk

(cherry picked from commit f3ccc53e02)
2021-07-14 17:51:50 +07:00
Anton Tarasov
c3d3131470 JRE-938 [windows] Frame.setMaximizedBounds not hidpi-aware
(cherry picked from commit cc97899923320e1fa17f5e44975c4a0f0ba51014)
(cherry picked from commit ccfe65be7f)
2021-07-14 17:51:50 +07:00
Anton Tarasov
7bbefb58bd JRE-907 macOS: add ability to check for scaled display mode
(cherry picked from commit e496262aa1)
2021-07-14 17:51:49 +07:00
Anton Tarasov
7631a99b6c JRE-934 Diff viewer errors are not visible on HiDPI Linux
(cherry picked from commit 641a09dd52)
2021-07-14 17:51:49 +07:00
Anton Tarasov
e6a0f240ea [jdk9] HiDPI scale is not detected on some linux desktops
(cherry picked from commit 9279d80110)
2021-07-14 17:51:49 +07:00
Anton Tarasov
dccf5eca52 JRE-681 [windows] direct drawing into frame graphics may have wrong translate
(cherry picked from commit 6ea1d45fd1)
2021-07-14 17:51:49 +07:00
Anton Tarasov
18a7887f46 Read org.gnome.desktop.interface/scaling-factor
(cherry picked from commit 277357ae73)
2021-07-14 17:51:48 +07:00
Anton Tarasov
1a75b54dac Revert "8239894: Xserver crashes when the wrong high refresh rate is used"
This code is needed for "Read org.gnome.desktop.interface/scaling-factor".
Keep it until "JDK-8260270 Implement the HiDPI scale factor reading" is fixed.

This reverts commit a7c2ebc7
2021-07-14 17:51:48 +07:00
Anton Tarasov
2ed8c0f9ae Do not scale base font in HiDPI mode on Linux
(cherry picked from commit 6fb2c36529)
2021-07-14 17:51:48 +07:00
Anton Tarasov
cf35c168f8 Allow HiDPI mode on Linux
(cherry picked from commit 34234263fb)
2021-07-14 17:51:47 +07:00
Anton Tarasov
27cf8fbeb9 JRE-772 swing returns incorrect FRC when AA is off
(cherry picked from commit a161897d908aa10da6306c06452c5d6317fed2f0)
(cherry picked from commit 2bf5a7ca5c)
2021-07-14 17:51:47 +07:00
Anton Tarasov
ecdae129f6 JRE-711 Horizontal grey lines appear in every window in IntelliJ Idea
(cherry picked from commit 62000130d86e5831d81cfb24659386c6930f84cf)

(cherry picked from commit e2d1655703)
2021-07-14 17:51:47 +07:00
Anton Tarasov
e25280ba09 JRE-681 [windows] direct drawing into frame graphics may have wrong translate
(cherry picked from commit ab6dee4c1fc453ad3cb5adb69fc243e550d184ae)

(cherry picked from commit 6ea1d45fd1)
2021-07-14 17:51:47 +07:00
Anton Tarasov
8e739ea8f1 JRE-665 Navigate Class/File/Symbol, Find in Path popup windows don't pick characters from input method
(cherry picked from commit 676f305b2b3b278e305bd4d9bde4269f27b3d676)
(cherry picked from commit 6ce31e0a32)
2021-07-14 17:51:46 +07:00
Anton Tarasov
f5f40c7ccf JRE-616 [linux] notify when dpi correction factor is applied to fonts
(cherry picked from commit f57d41f3118bfd773c99ce32d58cfae16931be6a)
(cherry picked from commit 6246abc72f)
2021-07-14 17:51:46 +07:00
Anton Tarasov
fcadab21b6 JRE-612 [windows] icon in frame title is not dpi-aware
(cherry picked from commit dec04385177a2abb677add909d3b94f94c62a14e)

(cherry picked from commit 38466cbab0)
2021-07-14 17:51:46 +07:00
Anton Tarasov
74f544ab6b JRE-604 [fps] frame's client area is one pixel beneath frame's borders
Adopted.

(cherry picked from commit ef2870ee38)
2021-07-14 17:51:46 +07:00
Anton Tarasov
8286f1a0b6 JRE-596 [windows] popup positioning is broken with JRE-573
Adopted: moved to AwtWindow::Reshape

(cherry picked from commit c5cc28d85d)
2021-07-14 17:51:45 +07:00
Anton Tarasov
b40dc31579 JRE-577 Goland 18 displays out of memory
(cherry picked from commit 2daaf21e420d4af15d3b1bfeb3f896074bea1e61)

(cherry picked from commit 9ea2011948)
2021-07-14 17:51:45 +07:00
Anton Tarasov
f30b2bca83 JRE-573 [windows] window client area bounds mismatch
Apply only WmEraseBkgnd

(cherry picked from commit afa68f7ad6440303c6417be3f675b1c4644b6014)

(cherry picked from commit 0651b45e13)
2021-07-14 17:51:45 +07:00
Anton Tarasov
c9298c88c5 JRE-489 -Dswing.bufferPerWindow is fractional scale unfriendly
(cherry picked from commit 5e183c397b)
2021-07-14 17:51:44 +07:00
Anton Tarasov
adc99a2416 JRE-310 check for Windows8.1 when enabling ui scale
Was "don't fallback on fractional scale" in JBSDK9.

(cherry picked from commit 263d8641974d263075c93f11c4db6208754d7325)

(cherry picked from commit deeda6fada)
2021-07-14 17:51:44 +07:00
Anton Tarasov
723e423aa5 JRE-382 Three AWT-tests become hanging starting since master-875
(cherry picked from commit 7d492101db8fcbb3d285fd8e9669f74b0e0fce8f)
(cherry picked from commit b965f85c1b)
2021-07-14 17:51:44 +07:00
Anton Tarasov
950d7c4725 JRE-373 [macos] nativeCreateNSWindow deadlocks with a11y
(cherry picked from commit 72c77a992bbf1b95b82ffc08cb2f4f3bc36b3657)

(cherry picked from commit aa09fa2c85)
2021-07-14 17:51:44 +07:00
Anton Tarasov
9900fe019a IDEA-172422 Popup at the wrong place on the second monitor (new hidpi)
Adopted: moved to AwtWindow::Reshape

(cherry picked from commit 11a0911d65)
2021-07-14 17:51:43 +07:00
Anton Tarasov
acedb2b62f JRE-309 [windows] on-screen position of a component is not pixel-perfect in user space in JRE-HiDPI mode
Adopted: moved to AwtWindow::Reshape

(cherry picked from commit 985908cf10)
2021-07-14 17:51:43 +07:00
Anton Tarasov
babb384fba JRE-269 JLabel doesn't scale <code>text</code> HTML fragments.
(cherry picked from commit 9ef72b6c3a477e4225f9b98e30fa9190613520e4)
(cherry picked from commit c17bc728ee)
2021-07-14 17:51:43 +07:00
Anton Tarasov
1f5f0de751 JRE-225 [macos] IDEA hangs on attempt to call getDefaultScreenDevice() from EDT
(cherry picked from commit 76aba25)

(cherry picked from commit df11dcc97bb5556ac5d0299b773a512b4f0bb5bb)
(cherry picked from commit aeea6c1ca3)
2021-07-14 17:51:43 +07:00
Anton Tarasov
f6d10cf5dc JRE-210 JEditorPane may return wrong preferred size as it moves b/w monitors of different scale
(cherry picked from commit 6c3087e6bda32ae9b095e069d8bea614502f5c03)
(cherry picked from commit adb3a4be16)
2021-07-14 17:51:42 +07:00
Anton Tarasov
ff5eb1a9ac JRE-119 [suppress updateGC() for WFileDialogPeer/WPrintDialogPeer]
updateGC() is called from WWindowPeer.<init> though it's not applicable to the named dialogs
as they don't have native AwtWindow peer required for the method.

(cherry picked from commit 72ed9f653177e273b811cfe70c2dba102a8636e4)
(cherry picked from commit cec49aaa38)
2021-07-14 17:51:42 +07:00
Anton Tarasov
842f7296fa JRE-119 [use default "sun.java2d.dpiaware=true" to be dpi-aware on Window 7]
This lets awt_Win32GraphicsEnv.cpp SetProcessDPIAwareProperty() call Win7 specific ::SetProcessDPIAware() API func.

(cherry picked from commit 5e7a766090810d839f4352d06fc2812499d766f8)
(cherry picked from commit 7d1d43bfa1)
2021-07-14 17:51:42 +07:00
Anton Tarasov
8efc1ba172 JRE-119 [Dynamically set DPI-awareness level to enable backward compatible HiDPI behavior]
Adopted: rely on java.manifest

(cherry picked from commit d00cfa4dc62a14a4cf89df9d4c4899970c9fc9e8)

Adopted

(cherry picked from commit 60be76b725)
2021-07-14 17:51:42 +07:00
Anton Tarasov
afa3b96044 JRE-119 [ask if ui scale is enabled natively]
(cherry picked from commit 801f45875fd8699edcbda5896210cec191062261)
(cherry picked from commit 20edebdefa)
2021-07-14 17:51:41 +07:00
Anton Tarasov
8360c5b884 IDEA-153474 let JDK detect Xft.dpi value on non-GTK Linux DEs
Use the GTK method:

https://developer.gnome.org/gobject/stable/gobject-The-Base-Object-Type.html#g-object-get

to retrieve "gtk-xft-dpi" integer property of the X settings.

Add the property to JDK's GtkEngine & gtk2-interface.
Then read the property via GtkEngine from GTK LaF when "gnome.Xft/dpi" is undefined. It's assumed GTK LaF is forcedly installed.

(cherry picked from commit e05fc391ae0a3cc389e836441f882c0cf6ab3b99)
(cherry picked from commit fd615a5b45)
2021-07-14 17:51:41 +07:00
Anton Tarasov
6658a7250b IDEA-148854: AppCode crashes randomly every 15 mins or so
(cherry picked from commit 02f9a5fbb4924ff67c8a04c15e490acfcc750003)
(cherry picked from commit b8f4b4a9ed)
2021-07-14 17:51:41 +07:00
Vitaly Provodin
63a890d6ab updated JTreg exclude list 2021-07-14 17:51:41 +07:00
Alexey Ushakov
7cbc3b072a Resolve merge compile problems on mac
(cherry picked from commit d1ed8ab118)
2021-07-14 17:51:40 +07:00
Anton Tarasov
6904200d9f IDEA-152524 can't compile fontconfig changes on Windows
(cherry picked from commit 4c8351fecf)

(cherry picked from commit 5faebc73d5)
2021-07-14 17:51:40 +07:00
Alexey Ushakov
7896275527 IDEA-57233 Editor font antialising/appearance problems on Linux
Used desktop DPI instead of hard-coded 72
Compensated increased glyph bitmap size by adjusting font size
Added LCD filter for sub-pixel rendering
Use fontconfig library to provide right rendering options for fonts
Corrected sizes passed to fontconfig library and hinting disabling policy
Added logging and versioned fontconfig lib loading
Resolved font rendering problem in lenses

(cherry picked from commit 0456745afb)

IDEA-152816, IDEA-152454 fix text rendering issues (text cutoff and incorrect rendering in editor fragment components)

FcMatchFont-type pattern substitutions shouldn't be invoked before specific font is selected - it can apply unrelated rules

port commit e21cd635 from JBR 9

(cherry picked from commit 5d704a963b)

partially rollback JBR-363 fix, to apply corresponding change from OpenJDK 12

(cherry picked from commit 3d7ac30072)
2021-07-14 17:51:40 +07:00
Vitaly Provodin
87e3ddb706 JBR-3401 enable macos-aarhc64 builds 2021-07-14 17:51:40 +07:00
Vitaly Provodin
cb2966b1b8 JBR-3305 remove the option --disable-warnings-as-errors from configure 2021-07-14 17:51:39 +07:00
Vitaly Provodin
bcad1ecd59 JBR-3398 remove the Experimental AOT and JIT Compiler (JEP 410) 2021-07-14 17:51:39 +07:00
Alexey Ushakov
49881d71d1 JBR-2807: JDK15: update modules.list to resolve jbr build failure
removed nashorn modules
2021-07-14 17:51:39 +07:00
Vitaly Provodin
8c6712d3f0 JBR-2130 remove module jdk.pack 2021-07-14 17:51:39 +07:00
Vitaly Provodin
4563419f9f JBR-2922 add JCEF to jbrsdk binaries
& fix a misprint in get_mods_list

JBR-2922 add JCEF to jbrsdk binaries

& fix a misprint in get_mods_list
2021-07-14 17:51:38 +07:00
Vitaly Provodin
9f20756e4e JBR-2912 add JBR 15 builds with DCEVM 2021-07-14 17:51:38 +07:00
Vitaly Provodin
8a0f4af8b5 JBR-2864 initial commit of DCEVM patches reworked for 15 2021-07-14 17:51:38 +07:00
Vitaly Provodin
4141615700 JBR-2812 remove --with-import-modules from configure for aarch64 2021-07-14 04:50:24 +07:00
Anton Tarasov
7d8b8e4508 JBR-2812 bundle jcef in jmod format instead of modular-sdk
Build test-image with non-jcef build target
2021-07-14 04:50:01 +07:00
Vitaly Provodin
c27a6ca555 JBR-2787 fix copying jcef files into jbr/jbrsdk binaries 2021-07-14 04:49:35 +07:00
Vitaly Provodin
0735fcc76b JBR-2758 refactor building scripts to apply patches adding required modules instead of excluding
Add jogl and gluegen modules to support jcef osr mode
2021-07-14 04:49:10 +07:00
Anton Tarasov
7459a56409 JBR-2016 add jcef module and export packages to it
(cherry picked from commit cf997f71c6)
2021-07-14 04:48:41 +07:00
Vitaly Provodin
cecbb4b81a JBR-2473 modify building scripts to add dcevm clauses, add git config to docker image
(cherry picked from commit 2620c62848)
2021-07-14 04:48:16 +07:00
Vitaly Provodin
d6ee02fca5 JBR-2473 add initial set of DCEVM patches
(cherry picked from commit c0c0a96cf4)
2021-07-14 04:47:43 +07:00
Vitaly Provodin
4fefe54b4c JBR-2395 eliminate JavaFX from JBR 2021-07-14 04:47:40 +07:00
Vitaly Provodin
5adc75835e JBR-2409 fix prameters for configure 2021-07-14 04:47:13 +07:00
Vitaly Provodin
e63bc31c09 JDK14: exclude dependencies on jcef in x86, fastdebug builds 2021-07-14 04:46:47 +07:00
Vitaly Provodin
ed62a76261 JBR-2396 fix CONF names 2021-07-14 04:46:23 +07:00
Vitaly Provodin
fd4d08b584 JBR-2394 replace --disable-debug-symbols with --with-native-debug-symbols=none 2021-07-14 04:46:03 +07:00
Vitaly Provodin
e81aea6ced add exec permitions to configure 2021-07-14 04:45:36 +07:00
Vitaly Provodin
ebdd6292aa split checkout before building JBR+JFX or JBR+JCEF on two separate commands 2021-07-14 04:45:06 +07:00
Vitaly Provodin
4d091e6689 change BOOT_JDK, fix target names 2021-07-14 04:44:41 +07:00
Vitaly Provodin
f2452f01e4 JBR-2291 add vendor info into bundles 2021-07-14 04:44:21 +07:00
Vitaly Provodin
9837370712 JBR-2324 address new layout in mac jcef 80.0.4+g74f7b0c+chromium-80.0.3987.122 2021-07-14 04:43:53 +07:00
Vitaly Provodin
d0f7d81b8b JBR-2320 add jdk.attach module into JBR 2021-07-14 04:43:27 +07:00
Vitaly Provodin
53e9b1c194 JBR-2217 provide JCEF-only (no JavaFX) bundle for master/202 branches 2021-07-14 04:43:03 +07:00
Vitaly Provodin
115277c443 JBR-2212 add scripts for linux_x86, linux_aarch64, linux_x64_fastdebug, osx_fastdebug, windows_x86 2021-07-14 04:42:35 +07:00
Vitaly Provodin
5baec57d29 JBR-1643 fix intermittent fialures of Windows builds at make/Init.gmk:304
combine images and test-image into one make invocation
2021-07-14 04:41:38 +07:00
Vitaly Provodin
3dd9bf9212 JBR-2181 create two separate JBR bundles with JFX and JFX+JCEF 2021-07-14 04:41:27 +07:00
Vitaly Provodin
bdd3b0e48b JBR-2148 modify signapp&build scripts to match to the new layout 2021-07-14 04:41:00 +07:00
Vitaly Provodin
0ebf81c267 JBR-2084 modify scripts to sign Contents/MacOS/libjli.dylib as a a normal file 2021-07-14 04:40:27 +07:00
Vitaly Provodin
d6a27a168a JBR-1821 notarize JBR bundles as a standalone app 2021-07-14 04:40:03 +07:00
Vitaly Provodin
4363bc3667 JBR-2162 move building scripts from TC to JBR repo 2021-07-14 04:39:41 +07:00
Anton Tarasov
b68025ec01 JBR-2016 add jcef module and export some sun.* packages to it 2021-07-14 04:39:14 +07:00
Vitaly Provodin
0159fc4751 JBR-2014 add jdk.hotspot.agent module to jbr 2021-07-14 04:38:45 +07:00
Vitaly Provodin
cc386232d2 JBR-1286 add jdk.compiler into JBR 2021-07-14 04:38:06 +07:00
Vitaly Provodin
80b949cdb6 JBR-1199 add JBR modules list for jlink 2021-07-14 04:38:02 +07:00
Vitaly Provodin
46184bc6ca Update docker script to create jdk15 build env 2021-07-14 04:37:41 +07:00
Vitaly Provodin
3f84dac089 JBR-3045 add pressing ESC to close the dialog after test completion
(cherry picked from commit 44d8b28b0b)
2021-07-14 04:37:19 +07:00
Vitaly Provodin
2370ef5473 JBR-3040 press the button END at the beggining in order to avoid text selection
(cherry picked from commit 1c2bf33db2)
2021-07-14 04:37:18 +07:00
Vitaly.Provodin
1d71d0eb6c updated JTreg exclude list 2021-07-14 04:37:16 +07:00
1026 changed files with 80711 additions and 6442 deletions

4
.gitignore vendored
View File

@@ -16,3 +16,7 @@ NashornProfile.txt
**/JTreport/**
**/JTwork/**
/src/utils/LogCompilation/target/
/.project/
/.settings/
*.class
.idea/workspace.xml

172
README.md
View File

@@ -1,11 +1,167 @@
# Welcome to the JDK!
[![official JetBrains project](http://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
For build instructions please see the
[online documentation](https://openjdk.java.net/groups/build/doc/building.html),
or either of these files:
# Welcome to JetBrains Runtime!
- [doc/building.html](doc/building.html) (html version)
- [doc/building.md](doc/building.md) (markdown version)
JetBrains Runtime is a fork of [OpenJDK](https://github.com/openjdk/jdk) available for Windows, Mac OS X, and Linux.
It includes a number enhancements in font rendering, HiDPI support, ligatures, performance improvements, and bugfixes.
See <https://openjdk.java.net/> for more information about
the OpenJDK Community and the JDK.
## Contents
- [Welcome to JetBrains Runtime](#jetbrains-runtime)
- [Products Built on JetBrains Runtime](#products-built-on-jetbrains-runtime)
- [Getting Sources](#getting-sources)
- [macOS, Linux](#macos-linux)
- [Windows](#sources-windows)
- [Configuring the Build Environment](#configuring-the-build-environment)
- [Linux (Docker)](#linux-docker)
- [Ubuntu Linux](#ubuntu-linux)
- [Windows](#build-windows)
- [macOS](#macos)
- [Developing](#developing)
- [Contributing](#contributing)
- [Resources](#resources)
## Products Built on JetBrains Runtime
* [Android Studio](https://developer.android.com/studio). The official IDE for Google's Android operating system.
* [CLion](https://www.jetbrains.com/clion/). A cross-platform IDE for C and C++ from JetBrains.
* [DataGrip](https://www.jetbrains.com/datagrip/). The IDE for Databases and SQL from JetBrains.
* [GoLand](https://www.jetbrains.com/go/). The cross-platform Go IDE from JetBrains.
* [IntelliJ IDEA](https://www.jetbrains.com/idea/). The IDE for JVM from JetBrains.
* [JProfiler](https://www.ej-technologies.com/products/jprofiler/overview.html). The Java profiler.
* [PhpStorm](https://www.jetbrains.com/phpstorm/). The PHP IDE from JetBrains.
* [PyCharm](https://www.jetbrains.com/pycharm/). The Python IDE from JetBrains.
* [Rider](https://www.jetbrains.com/rider/). The cross-platform .NET IDE from JetBrains.
* [RubyMine](https://www.jetbrains.com/ruby/). The Ruby and Rails IDE from JetBrains.
* [WebStorm](https://www.jetbrains.com/webstorm/). The JavaScript IDE from JetBrains.
* [YourKit](https://www.yourkit.com/). Java and .NET profilers.
## Getting Sources
### macOS, Linux
```
git config --global core.autocrlf input
git clone git@github.com:JetBrains/JetBrainsRuntime.git
```
### Windows
<a name="sources-windows"></a>
```
git config --global core.autocrlf false
git clone git@github.com:JetBrains/JetBrainsRuntime.git
```
## Configuring the Build Environment
Here are quick per-platform instructions for those who can't wait to get started.
Please refer to [OpenJDK build docs](https://openjdk.java.net/groups/build/doc/building.html) for in-depth
coverage of all the details.
> **_TIP:_** To get a preliminary report of what's missing, run `./configure` and check its output.
> It would usually have a meaningful advice on how to solve the problem.
### Linux (Docker)
Create a container:
```
$ cd jb/project/docker
$ docker build .
...
Successfully built 942ea9900054
```
Run these commands in the new container:
```
$ docker run -v `pwd`../../../../:/JetBrainsRuntime -it 942ea9900054
# cd /JetBrainsRuntime
# git checkout master17
# sh ./configure
# make images CONF=linux-x86_64-normal-server-release
```
### Ubuntu Linux
Install the necessary tools, libraries, and headers with:
```
$ sudo apt-get install autoconf make build-essential libx11-dev libxext-dev libxrender-dev libxtst-dev \
libxt-dev libxrandr-dev libcups2-dev libfontconfig1-dev libasound2-dev \
java-16-amazon-corretto-jdk
```
Then run the following:
```
$ cd JetBrainsRuntime
$ git checkout master17
$ sh ./configure
$ make images
```
This will build the release configuration under `./build/linux-x86_64-server-release/`.
### Windows
<a name="build-windows"></a>
Install the following:
* [Cygwin x64](http://www.cygwin.com/).
Required packages: `autoconf`, `binutils`, `cpio`, `diffutils`, `file`, `gawk`, `gcc-core`, `make`, `m4`, `unzip`, `zip`.
Install those together with Cygwin.
* [Visual Studio compiler toolset](https://visualstudio.microsoft.com/downloads/).
Install with the desktop development kit, which includes Windows SDK and compilers.
Visual Studio 2019 is supported by default.
* Java 16 (for instance, from [AdoptOpenJDK](https://adoptopenjdk.net/installation.html?variant=openjdk16&jvmVariant=hotspot#)).
If you have problems while configuring, read [Java tips on Cygwin](http://horstmann.com/articles/cygwin-tips.html).
From the command line:
```
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
"c:\Program_Files\cygwin64\bin\mintty.exe" /bin/bash -l
```
The first command sets up environment variables, the second starts a Cygwin shell with the proper environment.
In the Cygwin shell:
```
$ cd JetBrainsRuntime
$ git checkout master17
$ bash configure --with-toolchain-version=2019
$ make images
```
This will build the release configuration under `./build/windows-x86_64-server-release/`.
### macOS
Install the following:
* Xcode command line developer tools and `autoconf` via [Homebrew](getDpiInfo).
* Java 16 (for instance, from [AdoptOpenJDK](https://adoptopenjdk.net/installation.html?variant=openjdk16&jvmVariant=hotspot#)).
From the command line:
```
$ cd JetBrainsRuntime
$ git checkout master17
$ sh ./configure
$ make images
```
This will build the release configuration under `./build/macosx-x86_64-server-release/`.
## Developing
You can use [CLion](https://www.jetbrains.com/clion/) to develop native parts of the JetBrains Runtime and
[IntelliJ IDEA](https://www.jetbrains.com/idea/) for the parts written in Java.
Both require projects to be created.
### CLion
Run
```
$ make compile-commands
```
in the git root and open the resulting `build/.../compile_commands.json` file as a project.
Then use `Tools | Compilation Database | Change Project Root` to point to git root of this repository.
See also this detailed step-by-step tutorial for all platforms:
[How to develop OpenJDK with CLion](https://blog.jetbrains.com/clion/2020/03/openjdk-with-clion/).
### IDEA
Run
```
$ sh ./bin/idea.sh
```
in the git root to generate project files (add `--help` for options). If you have multiple
configurations (for example, `release` and `fastdebug`), supply the `--conf <conf_name>` argument.
Then open the git root directory as a project in IDEA.
## Contributing
We are happy to receive your pull requests!
Before you submit one, please sign our [Contributor License Agreement (CLA)](https://www.jetbrains.com/agreements/cla/).
## Resources
* [JetBrains Runtime on github](https://github.com/JetBrains/JetBrainsRuntime).
* [OpenJDK build instructions](https://openjdk.java.net/groups/build/doc/building.html).
* [OpenJDK test instructions](https://htmlpreview.github.io/?https://raw.githubusercontent.com/openjdk/jdk/master/doc/building.html#running-tests).
* [How to develop OpenJDK with CLion](https://blog.jetbrains.com/clion/2020/03/openjdk-with-clion/).

View File

@@ -25,7 +25,26 @@
# Shell script for generating an IDEA project from a given list of modules
usage() {
echo "usage: $0 [-h|--help] [-v|--verbose] [-o|--output <path>] [modules]+"
echo "Usage: $0 [-h|--help] [-q|--quiet] [-a|--absolute-paths] [-r|--root <path>] [-o|--output <path>] [-c|--conf <conf_name>] [modules...]"
echo " -h | --help"
echo " -q | --quiet
No stdout output"
echo " -a | --absolute-paths
Use absolute paths to this jdk, so that generated .idea
project files can be moved independently of jdk sources"
echo " -r | --root <path>
Project content root
Default: $TOPLEVEL_DIR"
echo " -o | --output <path>
Where .idea directory with project files will be generated
(e.g. using '-o .' will place project files in './.idea')
Default: same as --root"
echo " -c | --conf <conf_name>
make configuration (release, slowdebug etc)"
echo " [modules...]
Generate project modules for specific java modules
(e.g. 'java.base java.desktop')
Default: all existing modules (java.* and jdk.*)"
exit 1
}
@@ -33,10 +52,14 @@ SCRIPT_DIR=`dirname $0`
#assume TOP is the dir from which the script has been called
TOP=`pwd`
cd $SCRIPT_DIR; SCRIPT_DIR=`pwd`
if [ "x$TOPLEVEL_DIR" = "x" ] ; then
cd .. ; TOPLEVEL_DIR=`pwd`
fi
cd $TOP;
IDEA_OUTPUT=$TOP/.idea
VERBOSE="false"
VERBOSE=true
ABSOLUTE_PATHS=false
CONF_ARG=
while [ $# -gt 0 ]
do
case $1 in
@@ -44,12 +67,26 @@ do
usage
;;
-v | --vebose )
VERBOSE="true"
-q | --quiet )
VERBOSE=false
;;
-a | --absolute-paths )
ABSOLUTE_PATHS=true
;;
-r | --root )
TOPLEVEL_DIR="$2"
shift
;;
-o | --output )
IDEA_OUTPUT=$2/.idea
IDEA_OUTPUT="$2/.idea"
shift
;;
-c | --conf )
CONF_ARG="CONF_NAME=$2"
shift
;;
@@ -64,20 +101,21 @@ do
shift
done
mkdir -p $IDEA_OUTPUT || exit 1
cd $IDEA_OUTPUT; IDEA_OUTPUT=`pwd`
if [ "x$TOPLEVEL_DIR" = "x" ] ; then
cd $SCRIPT_DIR/..
TOPLEVEL_DIR=`pwd`
cd $IDEA_OUTPUT
if [ "x$IDEA_OUTPUT" = "x" ] ; then
IDEA_OUTPUT="$TOPLEVEL_DIR/.idea"
fi
MAKE_DIR="$SCRIPT_DIR/../make"
IDEA_MAKE="$MAKE_DIR/ide/idea/jdk"
mkdir -p $IDEA_OUTPUT || exit 1
cd "$TOP" ; cd $TOPLEVEL_DIR; TOPLEVEL_DIR=`pwd`
cd "$TOP" ; cd $IDEA_OUTPUT; IDEA_OUTPUT=`pwd`
cd ..; IDEA_OUTPUT_PARENT=`pwd`
cd "$SCRIPT_DIR/.." ; OPENJDK_DIR=`pwd`
IDEA_MAKE="$OPENJDK_DIR/make/ide/idea/jdk"
IDEA_TEMPLATE="$IDEA_MAKE/template"
cp -r "$IDEA_TEMPLATE"/* "$IDEA_OUTPUT"
cp -rn "$TOPLEVEL_DIR/jb/project/idea-project-files"/* "$IDEA_OUTPUT"
cp -rn "$IDEA_TEMPLATE"/* "$IDEA_OUTPUT"
#override template
if [ -d "$TEMPLATES_OVERRIDE" ] ; then
@@ -86,31 +124,31 @@ if [ -d "$TEMPLATES_OVERRIDE" ] ; then
done
fi
if [ "$VERBOSE" = "true" ] ; then
echo "output dir: $IDEA_OUTPUT"
echo "idea template dir: $IDEA_TEMPLATE"
if [ "$VERBOSE" = true ] ; then
echo "Will generate IDEA project files in \"$IDEA_OUTPUT\" for project \"$TOPLEVEL_DIR\""
fi
cd $TOP ; make -f "$IDEA_MAKE/idea.gmk" -I $MAKE_DIR/.. idea MAKEOVERRIDES= OUT=$IDEA_OUTPUT/env.cfg MODULES="$*" || exit 1
cd $TOP ; make -f "$IDEA_MAKE/idea.gmk" -I "$OPENJDK_DIR" idea TOPLEVEL_DIR="$TOPLEVEL_DIR" \
MAKEOVERRIDES= IDEA_OUTPUT_PARENT="$IDEA_OUTPUT_PARENT" OUT="$IDEA_OUTPUT/env.cfg" MODULES="$*" $CONF_ARG || exit 1
cd $SCRIPT_DIR
. $IDEA_OUTPUT/env.cfg
# Expect MODULE_ROOTS, MODULE_NAMES, BOOT_JDK & SPEC to be set
if [ "x$MODULE_ROOTS" = "x" ] ; then
echo "FATAL: MODULE_ROOTS is empty" >&2; exit 1
# Expect MODULES, MODULE_NAMES, RELATIVE_PROJECT_DIR, RELATIVE_BUILD_DIR to be set
if [ "xMODULES" = "x" ] ; then
echo "FATAL: MODULES is empty" >&2; exit 1
fi
if [ "x$MODULE_NAMES" = "x" ] ; then
echo "FATAL: MODULE_NAMES is empty" >&2; exit 1
fi
if [ "x$BOOT_JDK" = "x" ] ; then
echo "FATAL: BOOT_JDK is empty" >&2; exit 1
if [ "x$RELATIVE_PROJECT_DIR" = "x" ] ; then
echo "FATAL: RELATIVE_PROJECT_DIR is empty" >&2; exit 1
fi
if [ "x$SPEC" = "x" ] ; then
echo "FATAL: SPEC is empty" >&2; exit 1
if [ "x$RELATIVE_BUILD_DIR" = "x" ] ; then
echo "FATAL: RELATIVE_BUILD_DIR is empty" >&2; exit 1
fi
if [ -d "$TOPLEVEL_DIR/.hg" ] ; then
@@ -121,6 +159,43 @@ if [ -d "$TOPLEVEL_DIR/.git" ] ; then
VCS_TYPE="Git"
fi
if [ "$ABSOLUTE_PATHS" = true ] ; then
if [ "x$PATHTOOL" != "x" ]; then
PROJECT_DIR="`$PATHTOOL -am $OPENJDK_DIR`"
TOPLEVEL_PROJECT_DIR="`$PATHTOOL -am $TOPLEVEL_DIR`"
else
PROJECT_DIR="$OPENJDK_DIR"
TOPLEVEL_PROJECT_DIR="$TOPLEVEL_DIR"
fi
MODULE_DIR="$PROJECT_DIR"
TOPLEVEL_MODULE_DIR="$TOPLEVEL_PROJECT_DIR"
cd "$IDEA_OUTPUT_PARENT" && cd "$RELATIVE_BUILD_DIR" && BUILD_DIR="`pwd`"
CLION_SCRIPT_TOPDIR="$OPENJDK_DIR"
CLION_PROJECT_DIR="$PROJECT_DIR"
else
if [ "$RELATIVE_PROJECT_DIR" = "." ] ; then
PROJECT_DIR=""
else
PROJECT_DIR="/$RELATIVE_PROJECT_DIR"
fi
if [ "$RELATIVE_TOPLEVEL_PROJECT_DIR" = "." ] ; then
TOPLEVEL_PROJECT_DIR=""
else
TOPLEVEL_PROJECT_DIR="/$RELATIVE_TOPLEVEL_PROJECT_DIR"
fi
MODULE_DIR="\$MODULE_DIR\$$PROJECT_DIR"
PROJECT_DIR="\$PROJECT_DIR\$$PROJECT_DIR"
TOPLEVEL_MODULE_DIR="\$MODULE_DIR\$$TOPLEVEL_PROJECT_DIR"
TOPLEVEL_PROJECT_DIR="\$PROJECT_DIR\$$TOPLEVEL_PROJECT_DIR"
BUILD_DIR="\$PROJECT_DIR\$/$RELATIVE_BUILD_DIR"
CLION_SCRIPT_TOPDIR="$CLION_RELATIVE_PROJECT_DIR"
CLION_PROJECT_DIR="\$PROJECT_DIR\$/$CLION_SCRIPT_TOPDIR"
fi
if [ "$VERBOSE" = true ] ; then
echo "Project root: $PROJECT_DIR"
echo "Generating IDEA project files..."
fi
### Replace template variables
NUM_REPLACEMENTS=0
@@ -144,105 +219,106 @@ add_replacement() {
eval TO$NUM_REPLACEMENTS='$2'
}
add_replacement "###PATHTOOL###" "$PATHTOOL"
add_replacement "###CLION_SCRIPT_TOPDIR###" "$CLION_SCRIPT_TOPDIR"
add_replacement "###CLION_PROJECT_DIR###" "$CLION_PROJECT_DIR"
add_replacement "###PROJECT_DIR###" "$PROJECT_DIR"
add_replacement "###MODULE_DIR###" "$MODULE_DIR"
add_replacement "###TOPLEVEL_PROJECT_DIR###" "$TOPLEVEL_PROJECT_DIR"
add_replacement "###TOPLEVEL_MODULE_DIR###" "$TOPLEVEL_MODULE_DIR"
add_replacement "###MODULE_NAMES###" "$MODULE_NAMES"
add_replacement "###VCS_TYPE###" "$VCS_TYPE"
SPEC_DIR=`dirname $SPEC`
if [ "x$CYGPATH" != "x" ]; then
add_replacement "###BUILD_DIR###" "`cygpath -am $SPEC_DIR`"
add_replacement "###IMAGES_DIR###" "`cygpath -am $SPEC_DIR`/images/jdk"
add_replacement "###ROOT_DIR###" "`cygpath -am $TOPLEVEL_DIR`"
add_replacement "###IDEA_DIR###" "`cygpath -am $IDEA_OUTPUT`"
add_replacement "###BUILD_DIR###" "$BUILD_DIR"
add_replacement "###RELATIVE_BUILD_DIR###" "$RELATIVE_BUILD_DIR"
if [ "x$PATHTOOL" != "x" ]; then
add_replacement "###BASH_RUNNER_PREFIX###" "\$PROJECT_DIR\$/.idea/bash.bat"
else
add_replacement "###BASH_RUNNER_PREFIX###" ""
fi
if [ "x$PATHTOOL" != "x" ]; then
if [ "x$JT_HOME" = "x" ]; then
add_replacement "###JTREG_HOME###" ""
else
add_replacement "###JTREG_HOME###" "`cygpath -am $JT_HOME`"
fi
elif [ "x$WSL_DISTRO_NAME" != "x" ]; then
add_replacement "###BUILD_DIR###" "`wslpath -am $SPEC_DIR`"
add_replacement "###IMAGES_DIR###" "`wslpath -am $SPEC_DIR`/images/jdk"
add_replacement "###ROOT_DIR###" "`wslpath -am $TOPLEVEL_DIR`"
add_replacement "###IDEA_DIR###" "`wslpath -am $IDEA_OUTPUT`"
if [ "x$JT_HOME" = "x" ]; then
add_replacement "###JTREG_HOME###" ""
else
add_replacement "###JTREG_HOME###" "`wslpath -am $JT_HOME`"
add_replacement "###JTREG_HOME###" "`$PATHTOOL -am $JT_HOME`"
fi
else
add_replacement "###BUILD_DIR###" "$SPEC_DIR"
add_replacement "###JTREG_HOME###" "$JT_HOME"
add_replacement "###IMAGES_DIR###" "$SPEC_DIR/images/jdk"
add_replacement "###ROOT_DIR###" "$TOPLEVEL_DIR"
add_replacement "###IDEA_DIR###" "$IDEA_OUTPUT"
fi
SOURCE_PREFIX="<sourceFolder url=\"file://"
SOURCE_POSTFIX="\" isTestSource=\"false\" />"
for root in $MODULE_ROOTS; do
if [ "x$CYGPATH" != "x" ]; then
root=`cygpath -am $root`
elif [ "x$WSL_DISTRO_NAME" != "x" ]; then
root=`wslpath -am $root`
fi
VM_CI="jdk.internal.vm.ci/share/classes"
VM_COMPILER="src/jdk.internal.vm.compiler/share/classes"
if test "${root#*$VM_CI}" != "$root" || test "${root#*$VM_COMPILER}" != "$root"; then
for subdir in "$root"/*; do
if [ -d "$subdir" ]; then
SOURCES=$SOURCES" $SOURCE_PREFIX""$subdir"/src"$SOURCE_POSTFIX"
fi
done
else
SOURCES=$SOURCES" $SOURCE_PREFIX""$root""$SOURCE_POSTFIX"
fi
MODULE_IMLS=""
TEST_MODULE_DEPENDENCIES=""
for module in $MODULE_NAMES; do
MODULE_IMLS="$MODULE_IMLS<module fileurl=\"file://\$PROJECT_DIR$/.idea/$module.iml\" filepath=\"\$PROJECT_DIR$/.idea/$module.iml\" /> "
TEST_MODULE_DEPENDENCIES="$TEST_MODULE_DEPENDENCIES<orderEntry type=\"module\" module-name=\"$module\" scope=\"TEST\" /> "
done
add_replacement "###SOURCE_ROOTS###" "$SOURCES"
add_replacement "###MODULE_IMLS###" "$MODULE_IMLS"
add_replacement "###TEST_MODULE_DEPENDENCIES###" "$TEST_MODULE_DEPENDENCIES"
replace_template_dir "$IDEA_OUTPUT"
### Compile the custom Logger
### Generate module project files
CLASSES=$IDEA_OUTPUT/classes
if [ "$VERBOSE" = true ] ; then
echo "Generating project modules:"
fi
(
DEFAULT_IFS="$IFS"
IFS='#'
for value in $MODULES; do
(
eval "$value"
if [ "$VERBOSE" = true ] ; then
echo " $module"
fi
MAIN_SOURCE_DIRS=""
CONTENT_ROOTS=""
IFS=' '
for dir in $moduleSrcDirs; do
case $dir in
"src/"*) MAIN_SOURCE_DIRS="$MAIN_SOURCE_DIRS <sourceFolder url=\"file://$MODULE_DIR/$dir\" isTestSource=\"false\" />" ;;
*"/support/gensrc/$module") ;; # Exclude generated sources to avoid module-info conflicts, see https://youtrack.jetbrains.com/issue/IDEA-185108
*) CONTENT_ROOTS="$CONTENT_ROOTS <content url=\"file://$MODULE_DIR/$dir\">\
<sourceFolder url=\"file://$MODULE_DIR/$dir\" isTestSource=\"false\" generated=\"true\" /></content>" ;;
esac
done
if [ "x$MAIN_SOURCE_DIRS" != "x" ] ; then
CONTENT_ROOTS="<content url=\"file://$MODULE_DIR/src/$module\">$MAIN_SOURCE_DIRS</content>$CONTENT_ROOTS"
fi
add_replacement "###MODULE_CONTENT_ROOTS###" "$CONTENT_ROOTS"
DEPENDENCIES=""
for dep in $moduleDependencies; do
case $MODULE_NAMES in # Exclude skipped modules from dependencies
*"$dep"*) DEPENDENCIES="$DEPENDENCIES<orderEntry type=\"module\" module-name=\"$dep\" /> "
esac
done
add_replacement "###DEPENDENCIES###" "$DEPENDENCIES"
cp "$IDEA_OUTPUT/module.iml" "$IDEA_OUTPUT/$module.iml"
IFS="$DEFAULT_IFS"
replace_template_file "$IDEA_OUTPUT/$module.iml"
)
done
)
rm "$IDEA_OUTPUT/module.iml"
if [ "x$ANT_HOME" = "x" ] ; then
# try some common locations, before giving up
if [ -f "/usr/share/ant/lib/ant.jar" ] ; then
ANT_HOME="/usr/share/ant"
elif [ -f "/usr/local/Cellar/ant/1.9.4/libexec/lib/ant.jar" ] ; then
ANT_HOME="/usr/local/Cellar/ant/1.9.4/libexec"
else
echo "FATAL: cannot find ant. Try setting ANT_HOME." >&2; exit 1
fi
fi
CP=$ANT_HOME/lib/ant.jar
rm -rf $CLASSES; mkdir $CLASSES
### Create shell script runner for Windows
if [ "x$CYGPATH" != "x" ] ; then ## CYGPATH may be set in env.cfg
JAVAC_SOURCE_FILE=`cygpath -am $IDEA_OUTPUT/src/idea/IdeaLoggerWrapper.java`
JAVAC_SOURCE_PATH=`cygpath -am $IDEA_OUTPUT/src`
JAVAC_CLASSES=`cygpath -am $CLASSES`
JAVAC_CP=`cygpath -am $CP`
JAVAC=javac
elif [ "x$WSL_DISTRO_NAME" != "x" ]; then
JAVAC_SOURCE_FILE=`realpath --relative-to=./ $IDEA_OUTPUT/src/idea/IdeaLoggerWrapper.java`
JAVAC_SOURCE_PATH=`realpath --relative-to=./ $IDEA_OUTPUT/src`
JAVAC_CLASSES=`realpath --relative-to=./ $CLASSES`
ANT_TEMP=`mktemp -d -p ./`
cp $ANT_HOME/lib/ant.jar $ANT_TEMP/ant.jar
JAVAC_CP=$ANT_TEMP/ant.jar
JAVAC=javac.exe
else
JAVAC_SOURCE_FILE=$IDEA_OUTPUT/src/idea/IdeaLoggerWrapper.java
JAVAC_SOURCE_PATH=$IDEA_OUTPUT/src
JAVAC_CLASSES=$CLASSES
JAVAC_CP=$CP
JAVAC=javac
if [ "x$PATHTOOL" != "x" ]; then
echo "@echo off" > "$IDEA_OUTPUT/bash.bat"
if [ "x$WSL_DISTRO_NAME" != "x" ] ; then
echo "wsl -d $WSL_DISTRO_NAME --cd \"%cd%\" -e %*" >> "$IDEA_OUTPUT/bash.bat"
else
echo "$WINENV_ROOT\bin\bash.exe -l -c \"cd %CD:\=/%/ && %*\"" >> "$IDEA_OUTPUT/bash.bat"
fi
fi
$BOOT_JDK/bin/$JAVAC -d $JAVAC_CLASSES -sourcepath $JAVAC_SOURCE_PATH -cp $JAVAC_CP $JAVAC_SOURCE_FILE
if [ "x$WSL_DISTRO_NAME" != "x" ]; then
rm -rf $ANT_TEMP
if [ "$VERBOSE" = true ] ; then
IDEA_PROJECT_DIR="`dirname $IDEA_OUTPUT`"
if [ "x$PATHTOOL" != "x" ]; then
IDEA_PROJECT_DIR="`$PATHTOOL -am $IDEA_PROJECT_DIR`"
fi
echo "
Now you can open \"$IDEA_PROJECT_DIR\" as IDEA project
You can also run 'bash \"$IDEA_OUTPUT/jdk-clion/update-project.sh\"' to generate Clion project"
fi

0
configure vendored Normal file → Executable file
View File

View File

@@ -0,0 +1,13 @@
# jetbrains/runtime:jbr15env
FROM centos:7
RUN yum -y install centos-release-scl
RUN yum -y install devtoolset-8
RUN yum -y install zip bzip2 unzip tar wget make autoconf automake libtool gcc gcc-c++ libstdc++-devel alsa-devel cups-devel xorg-x11-devel libjpeg62-devel giflib-devel freetype-devel file which libXtst-devel libXt-devel libXrender-devel alsa-lib-devel fontconfig-devel libXrandr-devel libXi-devel git
# Install Java 16
RUN wget https://cdn.azul.com/zulu/bin/zulu16.28.11-ca-jdk16.0.0-linux_x64.tar.gz \
-O - | tar xz -C /
RUN mv /zulu16.28.11-ca-jdk16.0.0-linux_x64 /jdk16.0.0
ENV PATH /opt/rh/devtoolset-8/root/usr/bin:$PATH
RUN mkdir .git
RUN git config user.email "teamcity@jetbrains.com"
RUN git config user.name "builduser"

View File

@@ -0,0 +1,7 @@
FROM i386/ubuntu:xenial
RUN linux32 apt-get update && apt-get install -y --no-install-recommends apt-utils
COPY jbrsdk-11.0.5-b1 /jbrsdk-11.0.5-b1
RUN linux32 apt-get -y install file build-essential zip unzip curl libx11-dev libxext-dev \
libxrender-dev libxrandr-dev libxtst-dev libxt-dev libcups2-dev libasound2-data \
libpng12-0 libasound2 libfreetype6 libfontconfig1-dev libasound2-dev autoconf

View File

@@ -0,0 +1,9 @@
<component name="CopyrightManager">
<copyright>
<option name="notice" value="Copyright &amp;#36;originalComment.match(&quot;Copyright (\d+)&quot;, 1, &quot;-&quot;)&amp;#36;today.year JetBrains s.r.o.&#10;DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.&#10;&#10;This code is free software; you can redistribute it and/or modify it&#10;under the terms of the GNU General Public License version 2 only, as&#10;published by the Free Software Foundation.&#10;&#10;This code is distributed in the hope that it will be useful, but WITHOUT&#10;ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or&#10;FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License&#10;version 2 for more details (a copy is included in the LICENSE file that&#10;accompanied this code).&#10;&#10;You should have received a copy of the GNU General Public License version&#10;2 along with this work; if not, write to the Free Software Foundation,&#10;Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.&#10;&#10;Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA&#10;or visit www.oracle.com if you need additional information or have any&#10;questions." />
<option name="keyword" value="Copyright" />
<option name="allowReplaceKeyword" value="JetBrains" />
<option name="myName" value="JetBrains" />
<option name="myLocal" value="true" />
</copyright>
</component>

View File

@@ -0,0 +1,3 @@
<component name="CopyrightManager">
<settings default="JetBrains" />
</component>

View File

@@ -0,0 +1 @@
JetBrainsRuntime

View File

@@ -0,0 +1,9 @@
<component name="CopyrightManager">
<copyright>
<option name="notice" value="Copyright 2000-&amp;#36;today.year JetBrains s.r.o.&#10;&#10;Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);&#10;you may not use this file except in compliance with the License.&#10;You may obtain a copy of the License at&#10;&#10;http://www.apache.org/licenses/LICENSE-2.0&#10;&#10;Unless required by applicable law or agreed to in writing, software&#10;distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10;WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10;See the License for the specific language governing permissions and&#10;limitations under the License." />
<option name="keyword" value="Copyright" />
<option name="allowReplaceKeyword" value="JetBrains" />
<option name="myName" value="JetBrains" />
<option name="myLocal" value="true" />
</copyright>
</component>

View File

@@ -0,0 +1,3 @@
<component name="CopyrightManager">
<settings default="JetBrains" />
</component>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="IssueNavigationConfiguration">
<option name="links">
<list>
<IssueNavigationLink>
<option name="issueRegexp" value="(?:^|\s|\p{Punct})([A-Z]+\-\d+)(?=$|\s|\p{Punct})" />
<option name="linkRegexp" value="https://youtrack.jetbrains.com/issue/$1" />
</IssueNavigationLink>
<IssueNavigationLink>
<option name="issueRegexp" value="(?:^|\s|\p{Punct})(?:JDK-)?(\d{7})(?=$|\s|\p{Punct})" />
<option name="linkRegexp" value="https://bugs.openjdk.java.net/browse/JDK-$1" />
</IssueNavigationLink>
</list>
</option>
</component>
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
</component>
</project>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="IssueNavigationConfiguration">
<option name="links">
<list>
<IssueNavigationLink>
<option name="issueRegexp" value="(?:^|\s|\p{Punct})([A-Z]+\-\d+)(?=$|\s|\p{Punct})" />
<option name="linkRegexp" value="https://youtrack.jetbrains.com/issue/$1" />
</IssueNavigationLink>
<IssueNavigationLink>
<option name="issueRegexp" value="(?:^|\s|\p{Punct})(?:JDK-)?(\d{7})(?=$|\s|\p{Punct})" />
<option name="linkRegexp" value="https://bugs.openjdk.java.net/browse/JDK-$1" />
</IssueNavigationLink>
</list>
</option>
</component>
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@@ -0,0 +1,135 @@
apply plugin: 'java'
import org.gradle.internal.os.OperatingSystem
repositories {
mavenCentral()
}
def test_jvm = {
if (project.hasProperty('jbsdkhome')) {
file(jbsdkhome + (OperatingSystem.current().isWindows()?"/bin/java.exe" : "/bin/java")).absolutePath
} else {
if (OperatingSystem.current().isMacOsX()) {
file('../../../build/macosx-x86_64-normal-server-release/images/jdk-bundle/jdk-11.0.4.jdk/Contents/Home/bin/java').absolutePath
} else if (OperatingSystem.current().isLinux()) {
file('../../../build/linux-x86_64-normal-server-release/images/jdk/bin/java').absolutePath
} else {
file('../../../build/windows-x86_64-normal-server-release/images/jdk/bin/java.exe').absolutePath
}
}
}
dependencies {
testCompile('junit:junit:4.12'){
exclude group: 'org.hamcrest'
}
testCompile 'org.hamcrest:hamcrest-library:1.3'
testCompile 'net.java.dev.jna:jna:4.4.0'
testCompile 'com.twelvemonkeys.imageio:imageio-tiff:3.3.2'
testCompile 'org.apache.commons:commons-lang3:3.0'
}
def jdk_modules = ["java.base", "java.logging", "java.prefs",
"java.se.ee", "java.sql", "java.datatransfer",
"java.management", "java.rmi", "java.security.jgss",
"java.sql.rowset", "java.desktop", "java.management.rmi",
"java.scripting", "java.security.sasl", "java.transaction",
"java.instrument", "java.naming", "java.se",
"java.smartcardio", "java.xml.crypto"]
def jdk_class_dirs = []
jdk_modules.collect(jdk_class_dirs) {
new File("../../../src/" + it + "/share/classes")
}
if (OperatingSystem.current().isMacOsX())
jdk_modules.collect(jdk_class_dirs) {
"../../../src/" + it + "/macosx/classes"
}
else if (OperatingSystem.current().isLinux()) {
jdk_modules.collect(jdk_class_dirs) {
"../../../src/" + it + "/solaris/classes"
}
jdk_modules.collect(jdk_class_dirs) {
"../../../src/" + it + "/unix/classes"
}
} else
jdk_modules.collect(jdk_class_dirs) {
"../../../src/" + it + "/windows/classes"
}
sourceSets.main.java.srcDirs = jdk_class_dirs
sourceSets {
test {
java {
srcDir "../../../test/jdk/jbu"
}
}
}
test.dependsOn.clear()
test.dependsOn tasks.compileTestJava
test {
systemProperty "jb.java2d.metal", "true"
systemProperty "testdata", file('../../../test/jdk/jbu/testdata').absolutePath
// Generate golden images for DroidFontTest and MixedTextTest
// systemProperty "gentestdata", ""
// Enable Java2D logging (https://confluence.jetbrains.com/display/JRE/Java2D+Rendering+Logging)
// systemProperty "sun.java2d.trace", "log"
// systemProperty "sun.java2d.trace", "log,pimpl"
outputs.upToDateWhen { false }
executable = test_jvm()
// Enable async/dtrace profiler
jvmArgs "-XX:+PreserveFramePointer"
// Enable native J2D logging (only in debug build)
// Can be turned on for J2D by adding "#define DEBUG 1" into jdk/src/share/native/sun/java2d/Trace.h
// environment 'J2D_TRACE_LEVEL', '4'
}
def buildDir = project.buildscript.sourceFile.parentFile.parentFile.parentFile.parentFile
def make_cmd = "make"
if (OperatingSystem.current().isWindows()) {
def cyg_make_cmd = new File("c:/cygwin64/bin/make.exe")
if (cyg_make_cmd.exists()) make_cmd = cyg_make_cmd.absolutePath
}
def test_run = false
task make_images {
doLast {
if (!test_run) {
def pb = new ProcessBuilder().command(make_cmd.toString(), "-C", buildDir.absolutePath, "images")
def proc = pb.redirectErrorStream(true).start()
proc.inputStream.eachLine { println it }
assert proc.waitFor() == 0
}
}
}
task make_clean {
doLast {
def pb = new ProcessBuilder().command(make_cmd.toString(), "-C", buildDir.absolutePath, "clean")
def proc = pb.redirectErrorStream(true).start()
proc.inputStream.eachLine { println it }
assert proc.waitFor() == 0
}
}
task run_test {
doLast {
test_run = true
}
}
tasks.cleanTest.dependsOn tasks.run_test
classes.dependsOn.clear()
classes.dependsOn tasks.make_images
tasks.cleanClasses.dependsOn tasks.make_clean

View File

@@ -0,0 +1,64 @@
VENDOR_NAME="JetBrains s.r.o."
VENDOR_VERSION_STRING="JBR-${JBSDK_VERSION_WITH_DOTS}.${JDK_BUILD_NUMBER}-${build_number}"
[ -z "$bundle_type" ] || VENDOR_VERSION_STRING="${VENDOR_VERSION_STRING}-${bundle_type}"
do_reset_changes=0
do_reset_dcevm=0
HEAD_REVISION=0
function do_exit() {
exit_code=$1
[ $do_reset_changes -eq 1 ] && git checkout HEAD modules.list src/java.desktop/share/classes/module-info.java
if [ $do_reset_dcevm -eq 1 ]; then
[ ! -z $HEAD_REVISION ] && git reset --hard $HEAD_REVISION
fi
exit "$exit_code"
}
function update_jsdk_mods() {
__jsdk=$1
__jcef_mods=$2
__orig_jsdk_mods=$3
__updated_jsdk_mods=$4
# re-create java.desktop.jmod with updated module-info.class
tmp=.java.desktop.$$.tmp
mkdir "$tmp" || exit $?
"$__jsdk"/bin/jmod extract --dir "$tmp" "$__orig_jsdk_mods"/java.desktop.jmod || exit $?
"$__jsdk"/bin/javac \
--patch-module java.desktop="$__orig_jsdk_mods"/java.desktop.jmod \
--module-path "$__jcef_mods" -d "$tmp"/classes src/java.desktop/share/classes/module-info.java || exit $?
"$__jsdk"/bin/jmod \
create --class-path "$tmp"/classes --config "$tmp"/conf --header-files "$tmp"/include --legal-notice "$tmp"/legal --libs "$tmp"/lib \
java.desktop.jmod || exit $?
mv java.desktop.jmod "$__updated_jsdk_mods" || exit $?
rm -rf "$tmp"
# re-create java.base.jmod with updated hashes
tmp=.java.base.$$.tmp
mkdir "$tmp" || exit $?
hash_modules=$("$JSDK"/bin/jmod describe "$__orig_jsdk_mods"/java.base.jmod | grep hashes | awk '{print $2}' | tr '\n' '|' | sed s/\|$//) || exit $?
"$__jsdk"/bin/jmod extract --dir "$tmp" "$__orig_jsdk_mods"/java.base.jmod || exit $?
rm "$__updated_jsdk_mods"/java.base.jmod || exit $? # temp exclude from path
"$__jsdk"/bin/jmod \
create --module-path "$__updated_jsdk_mods" --hash-modules "$hash_modules" \
--class-path "$tmp"/classes --cmds "$tmp"/bin --config "$tmp"/conf --header-files "$tmp"/include --legal-notice "$tmp"/legal --libs "$tmp"/lib \
java.base.jmod || exit $?
mv java.base.jmod "$__updated_jsdk_mods" || exit $?
rm -rf "$tmp"
}
function get_mods_list() {
__mods=$1
echo $(ls $__mods) | sed s/\.jmod/,/g | sed s/,$//g | sed s/' '//g
}
function copy_jmods() {
__mods_list=$1
__jmods_from=$2
__jmods_to=$3
mkdir -p $__jmods_to
echo "${__mods_list}," | while read -d, mod; do cp $__jmods_from/$mod.jmod $__jmods_to/; done
}

View File

@@ -0,0 +1,84 @@
#!/bin/bash -x
# The following parameters must be specified:
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
# build_number - specifies the number of JetBrainsRuntime build
#
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
#
# $ ./java --version
# openjdk 11.0.6 2020-01-14
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
#
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
source jb/project/tools/common/scripts/common.sh
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
[ -z "$bundle_type" ] && (git apply -p0 < jb/project/tools/patches/exclude_jcef_module.patch || exit $?)
sh configure \
--with-debug-level=release \
--with-vendor-name="${VENDOR_NAME}" \
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
--with-jvm-features=shenandoahgc \
--with-version-pre= \
--with-version-build="${JDK_BUILD_NUMBER}" \
--with-version-opt=b${build_number} \
--with-boot-jdk=${BOOT_JDK} \
--enable-cds=yes || exit $?
make clean CONF=linux-aarch64-server-release || exit $?
make images CONF=linux-aarch64-server-release test-image || exit $?
JBSDK=${JBRSDK_BASE_NAME}-linux-aarch64-b${build_number}
BASE_DIR=build/linux-aarch64-server-release/images
JSDK=${BASE_DIR}/jdk
JBRSDK_BUNDLE=jbrsdk
echo Fixing permissions
chmod -R a+r $JSDK
rm -rf $BASE_DIR/$JBRSDK_BUNDLE
cp -r $JSDK $BASE_DIR/$JBRSDK_BUNDLE || exit $?
echo Creating $JBSDK.tar.gz ...
sed 's/JBR/JBRSDK/g' ${BASE_DIR}/${JBRSDK_BUNDLE}/release > release
mv release ${BASE_DIR}/${JBRSDK_BUNDLE}/release
tar -pcf $JBSDK.tar \
--exclude=*.debuginfo --exclude=demo --exclude=sample --exclude=man \
-C $BASE_DIR ${JBRSDK_BUNDLE} || exit $?
gzip $JBSDK.tar || exit $?
JBR_BUNDLE=jbr
JBR_BASE_NAME=jbr-$JBSDK_VERSION
rm -rf $BASE_DIR/$JBR_BUNDLE
JBR=$JBR_BASE_NAME-linux-aarch64-b$build_number
grep -v javafx modules.list | grep -v "jdk.internal.vm\|jdk.aot\|jcef" > modules.list.aarch64
echo Running jlink....
${JSDK}/bin/jlink \
--module-path ${JSDK}/jmods --no-man-pages --compress=2 \
--add-modules $(xargs < modules.list.aarch64 | sed s/" "//g | sed s/',$'//g) \
--output ${BASE_DIR}/${JBR_BUNDLE} || exit $?
echo Modifying release info ...
grep -v \"^JAVA_VERSION\" ${JSDK}/release | grep -v \"^MODULES\" >> ${BASE_DIR}/${JBR_BUNDLE}/release
echo Creating $JBR.tar.gz ...
tar -pcf $JBR.tar -C $BASE_DIR ${JBR_BUNDLE} || exit $?
gzip $JBR.tar || exit $?
JBRSDK_TEST=$JBRSDK_BASE_NAME-linux-test-aarch64-b$build_number
echo Creating $JBRSDK_TEST.tar.gz ...
tar -pcf $JBRSDK_TEST.tar -C $BASE_DIR --exclude='test/jdk/demos' test || exit $?
gzip $JBRSDK_TEST.tar || exit $?

View File

@@ -0,0 +1,138 @@
#!/bin/bash -x
# The following parameters must be specified:
# JBSDK_VERSION - specifies major version of OpenJDK e.g. 11_0_6 (instead of dots '.' underbars "_" are used)
# JDK_BUILD_NUMBER - specifies update release of OpenJDK build or the value of --with-version-build argument to configure
# build_number - specifies the number of JetBrainsRuntime build
# bundle_type - specifies bundle to be built; possible values:
# <empty> or nomod - the release bundles without any additional modules (jcef)
# jcef - the release bundles with jcef
# fd - the fastdebug bundles which also include the jcef module
#
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
#
# $ ./java --version
# openjdk 11.0.6 2020-01-14
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
#
# Environment variables:
# JCEF_PATH - specifies the path to the directory with JCEF binaries.
# By default JCEF binaries should be located in ./jcef_linux_x64
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
bundle_type=$4
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
JCEF_PATH=${JCEF_PATH:=./jcef_linux_x64}
source jb/project/tools/common/scripts/common.sh
function create_image_bundle {
__bundle_name=$1
__arch_name=$2
__modules_path=$3
__modules=$4
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
JBR=${__bundle_name}-${JBSDK_VERSION}-linux-x64-${fastdebug_infix}b${build_number}
echo Running jlink....
[ -d "$IMAGES_DIR"/"$__arch_name" ] && rm -rf "${IMAGES_DIR:?}"/"$__arch_name"
$JSDK/bin/jlink \
--module-path "$__modules_path" --no-man-pages --compress=2 \
--add-modules "$__modules" --output "$IMAGES_DIR"/"$__arch_name"
grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> "$IMAGES_DIR"/"$__arch_name"/release
if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then
sed 's/JBR/JBRSDK/g' "$IMAGES_DIR"/"$__arch_name"/release > release
mv release "$IMAGES_DIR"/"$__arch_name"/release
copy_jmods "$__modules" "$__modules_path" "$IMAGES_DIR"/"$__arch_name"/jmods
fi
# jmod does not preserve file permissions (JDK-8173610)
[ -f "$IMAGES_DIR"/"$__arch_name"/lib/jcef_helper ] && chmod a+x "$IMAGES_DIR"/"$__arch_name"/lib/jcef_helper
echo Creating "$JBR".tar.gz ...
tar -pcf "$JBR".tar -C "$IMAGES_DIR" "$__arch_name" || do_exit $?
[ -f "$JBR".tar.gz ] && rm "$JBR.tar.gz"
gzip "$JBR".tar || do_exit $?
rm -rf "${IMAGES_DIR:?}"/"$__arch_name"
}
WITH_DEBUG_LEVEL="--with-debug-level=release"
RELEASE_NAME=linux-x86_64-server-release
case "$bundle_type" in
"jcef")
do_reset_changes=1
;;
"dcevm")
HEAD_REVISION=$(git rev-parse HEAD)
git am jb/project/tools/patches/dcevm/*.patch || do_exit $?
do_reset_dcevm=1
do_reset_changes=1
;;
"nomod" | "")
bundle_type=""
;;
"fd")
do_reset_changes=1
WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
RELEASE_NAME=linux-x86_64-server-fastdebug
;;
esac
sh configure \
$WITH_DEBUG_LEVEL \
--with-vendor-name="$VENDOR_NAME" \
--with-vendor-version-string="$VENDOR_VERSION_STRING" \
--with-jvm-features=shenandoahgc \
--with-version-pre= \
--with-version-build="$JDK_BUILD_NUMBER" \
--with-version-opt=b"$build_number" \
--with-boot-jdk="$BOOT_JDK" \
--enable-cds=yes || do_exit $?
make clean CONF=$RELEASE_NAME || exit $?
make images CONF=$RELEASE_NAME || do_exit $?
IMAGES_DIR=build/$RELEASE_NAME/images
JSDK=$IMAGES_DIR/jdk
JSDK_MODS_DIR=$IMAGES_DIR/jmods
JBRSDK_BUNDLE=jbrsdk
echo Fixing permissions
chmod -R a+r $JSDK
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "dcevm" ] || [ "$bundle_type" == "fd" ]; then
git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
update_jsdk_mods $JSDK $JCEF_PATH/jmods $JSDK/jmods $JSDK_MODS_DIR || do_exit $?
cp $JCEF_PATH/jmods/* $JSDK_MODS_DIR # $JSDK/jmods is not changed
jbr_name_postfix="_${bundle_type}"
fi
# create runtime image bundle
modules=$(xargs < modules.list | sed s/" "//g) || do_exit $?
create_image_bundle "jbr${jbr_name_postfix}" "jbr" $JSDK_MODS_DIR "$modules" || do_exit $?
# create sdk image bundle
modules=$(cat $JSDK/release | grep MODULES | sed s/MODULES=//g | sed s/' '/','/g | sed s/\"//g | sed s/\\n//g) || do_exit $?
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "dcevm" ] || [ "$bundle_type" == "fd" ] || [ "$bundle_type" == "$JBRSDK_BUNDLE" ]; then
modules=${modules},$(get_mods_list "$JCEF_PATH"/jmods)
fi
create_image_bundle "$JBRSDK_BUNDLE${jbr_name_postfix}" $JBRSDK_BUNDLE $JSDK_MODS_DIR "$modules" || do_exit $?
if [ -z "$bundle_type" ]; then
JBRSDK_TEST=${JBRSDK_BUNDLE}-${JBSDK_VERSION}-linux-test-x64-b${build_number}
echo Creating "$JBRSDK_TEST" ...
make test-image CONF=$RELEASE_NAME || do_exit $?
tar -pcf "$JBRSDK_TEST".tar -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
[ -f "$JBRSDK_TEST.tar.gz" ] && rm "$JBRSDK_TEST.tar.gz"
gzip "$JBRSDK_TEST".tar || do_exit $?
fi
do_exit 0

View File

@@ -0,0 +1,80 @@
#!/bin/bash -x
# The following parameters must be specified:
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
# build_number - specifies the number of JetBrainsRuntime build
#
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
#
# $ ./java --version
# openjdk 11.0.6 2020-01-14
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
#
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
source jb/project/tools/common/scripts/common.sh
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
[ -z "$bundle_type" ] && (git apply -p0 < jb/project/tools/patches/exclude_jcef_module.patch || exit $?)
linux32 bash configure \
--with-debug-level=release \
--with-vendor-name="${VENDOR_NAME}" \
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
--with-version-pre= \
--with-version-build=$JDK_BUILD_NUMBER \
--with-version-opt=b${build_number} \
--with-boot-jdk=${BOOT_JDK} \
--enable-cds=yes || exit $?
make clean CONF=linux-x86-server-release || exit $?
make images CONF=linux-x86-server-release test-image || exit $?
JBSDK=${JBRSDK_BASE_NAME}-linux-x86-b${build_number}
BASE_DIR=build/linux-x86-server-release/images
JSDK=${BASE_DIR}/jdk
JBRSDK_BUNDLE=jbrsdk
echo Fixing permissions
chmod -R a+r $JSDK
rm -rf $BASE_DIR/$JBRSDK_BUNDLE
cp -r $JSDK $BASE_DIR/$JBRSDK_BUNDLE || exit $?
echo Creating $JBSDK.tar.gz ...
sed 's/JBR/JBRSDK/g' ${BASE_DIR}/${JBRSDK_BUNDLE}/release > release
mv release ${BASE_DIR}/${JBRSDK_BUNDLE}/release
tar -pcf $JBSDK.tar --exclude=*.debuginfo --exclude=demo --exclude=sample --exclude=man -C $BASE_DIR ${JBRSDK_BUNDLE} || exit $?
gzip $JBSDK.tar || exit $?
JBR_BUNDLE=jbr
JBR_BASE_NAME=jbr-$JBSDK_VERSION
rm -rf $BASE_DIR/$JBR_BUNDLE
JBR=$JBR_BASE_NAME-linux-x86-b$build_number
grep -v javafx modules.list | grep -v "jdk.internal.vm\|jdk.aot\|jcef" > modules.list.x86
echo Running jlink....
${JSDK}/bin/jlink \
--module-path ${JSDK}/jmods --no-man-pages --compress=2 \
--add-modules $(xargs < modules.list.x86 | sed s/" "//g | sed s/,$//g) --output ${BASE_DIR}/${JBR_BUNDLE} || exit $?
echo Modifying release info ...
grep -v \"^JAVA_VERSION\" ${JSDK}/release | grep -v \"^MODULES\" >> ${BASE_DIR}/${JBR_BUNDLE}/release
echo Creating $JBR.tar.gz ...
tar -pcf $JBR.tar -C $BASE_DIR $JBR_BUNDLE || exit $?
gzip $JBR.tar || exit $?
JBRSDK_TEST=$JBRSDK_BASE_NAME-linux-test-x86-b$build_number
echo Creating $JBRSDK_TEST.tar.gz ...
tar -pcf $JBRSDK_TEST.tar -C $BASE_DIR --exclude='test/jdk/demos' --exclude='test/hotspot/gtest' test || exit $?
gzip $JBRSDK_TEST.tar || exit $?

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.cs.disable-executable-page-protection</key>
<true/>
</dict>
</plist>

View File

@@ -0,0 +1,178 @@
#!/bin/bash -x
# The following parameters must be specified:
# JBSDK_VERSION - specifies major version of OpenJDK e.g. 11_0_6 (instead of dots '.' underbars "_" are used)
# JDK_BUILD_NUMBER - specifies update release of OpenJDK build or the value of --with-version-build argument to configure
# build_number - specifies the number of JetBrainsRuntime build
# bundle_type - specifies bundle to be built; possible values:
# <empty> or nomod - the release bundles without any additional modules (jcef)
# jcef - the release bundles with jcef
# fd - the fastdebug bundles which also include the jcef module
#
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
#
# $ ./java --version
# openjdk 11.0.6 2020-01-14
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
#
# Environment variables:
# JCEF_PATH - specifies the path to the directory with JCEF binaries.
# By default JCEF binaries should be located in ./jcef_mac
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
bundle_type=$4
architecture=$5 # aarch64 or x64
enable_aot=$6 # temporary param for building test jre with aot under aarch64
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
WITH_IMPORT_MODULES="--with-import-modules=${MODULAR_SDK_PATH:=./modular-sdk}"
JCEF_PATH=${JCEF_PATH:=./jcef_mac}
architecture=${architecture:=x64}
MAJOR_JBSDK_VERSION=$(echo "$JBSDK_VERSION_WITH_DOTS" | awk -F "." '{print $1}')
BOOT_JDK=${BOOT_JDK:=$(/usr/libexec/java_home -v 16)}
source jb/project/tools/common/scripts/common.sh
function copyJNF {
__contents_dir=$1
mkdir -p ${__contents_dir}/Frameworks
cp -Rp Frameworks/JavaNativeFoundation.framework ${__contents_dir}/Frameworks
}
function create_image_bundle {
__bundle_name=$1
__arch_name=$2
__modules_path=$3
__modules=$4
tmp=.bundle.$$.tmp
mkdir "$tmp" || do_exit $?
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
JBR=${__bundle_name}-${JBSDK_VERSION}-osx-${architecture}-${fastdebug_infix}b${build_number}
JRE_CONTENTS=$tmp/$__arch_name/Contents
mkdir -p "$JRE_CONTENTS" || do_exit $?
echo Running jlink...
"$JSDK"/bin/jlink \
--module-path "$__modules_path" --no-man-pages --compress=2 \
--add-modules "$__modules" --output "$JRE_CONTENTS/Home" || do_exit $?
grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> "$JRE_CONTENTS/Home/release"
if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then
sed 's/JBR/JBRSDK/g' $JRE_CONTENTS/Home/release > release
mv release $JRE_CONTENTS/Home/release
copy_jmods "$__modules" "$__modules_path" "$JRE_CONTENTS"/Home/jmods
fi
cp -R "$JSDK"/../MacOS "$JRE_CONTENTS"
cp "$JSDK"/../Info.plist "$JRE_CONTENTS"
if [[ "${architecture}" == *aarch64* ]]; then
# we can't notarize this library as usual framework (with headers and tbd-file)
# but single library notarizes correctly
copyJNF $JRE_CONTENTS
fi
[ -n "$bundle_type" ] && (cp -a $JCEF_PATH/Frameworks "$JRE_CONTENTS" || do_exit $?)
echo Creating "$JBR".tar.gz ...
COPYFILE_DISABLE=1 tar -pczf "$JBR".tar.gz --exclude='*.dSYM' --exclude='man' -C "$tmp" "$__arch_name" || do_exit $?
rm -rf "$tmp"
}
WITH_DEBUG_LEVEL="--with-debug-level=release"
CONF_ARCHITECTURE=x86_64
if [[ "${architecture}" == *aarch64* ]]; then
CONF_ARCHITECTURE=aarch64
fi
RELEASE_NAME=macosx-${CONF_ARCHITECTURE}-server-release
case "$bundle_type" in
"jcef")
do_reset_changes=1
;;
"dcevm")
HEAD_REVISION=$(git rev-parse HEAD)
git am jb/project/tools/patches/dcevm/*.patch || do_exit $?
do_reset_dcevm=1
do_reset_changes=1
;;
"nomod" | "")
bundle_type=""
;;
"fd")
do_reset_changes=1
WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
RELEASE_NAME=macosx-${CONF_ARCHITECTURE}-server-fastdebug
JBSDK=macosx-${architecture}-server-release
;;
esac
if [[ "${architecture}" == *aarch64* ]]; then
sh configure \
$WITH_DEBUG_LEVEL \
--with-vendor-name="${VENDOR_NAME}" \
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
--with-jvm-features=shenandoahgc \
--with-version-pre= \
--with-version-build="${JDK_BUILD_NUMBER}" \
--with-version-opt=b"${build_number}" \
--with-boot-jdk="$BOOT_JDK" \
--disable-hotspot-gtest --disable-javac-server --disable-full-docs --disable-manpages \
--enable-cds=no \
--with-extra-cflags="-F$(pwd)/Frameworks" \
--with-extra-cxxflags="-F$(pwd)/Frameworks" \
--with-extra-ldflags="-F$(pwd)/Frameworks" || do_exit $?
else
sh configure \
$WITH_DEBUG_LEVEL \
--with-vendor-name="$VENDOR_NAME" \
--with-vendor-version-string="$VENDOR_VERSION_STRING" \
--with-jvm-features=shenandoahgc \
--with-version-pre= \
--with-version-build="$JDK_BUILD_NUMBER" \
--with-version-opt=b"$build_number" \
--with-boot-jdk="$BOOT_JDK" \
--enable-cds=yes || do_exit $?
fi
make clean CONF=$RELEASE_NAME || do_exit $?
make images CONF=$RELEASE_NAME || do_exit $?
IMAGES_DIR=build/$RELEASE_NAME/images
JSDK=$IMAGES_DIR/jdk-bundle/jdk-$MAJOR_JBSDK_VERSION.jdk/Contents/Home
JSDK_MODS_DIR=$IMAGES_DIR/jmods
JBRSDK_BUNDLE=jbrsdk
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "dcevm" ] || [ "$bundle_type" == "fd" ]; then
git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
update_jsdk_mods "$JSDK" "$JCEF_PATH"/jmods "$JSDK"/jmods "$JSDK_MODS_DIR" || do_exit $?
cp $JCEF_PATH/jmods/* $JSDK_MODS_DIR # $JSDK/jmods is not changed
jbr_name_postfix="_${bundle_type}"
fi
# create runtime image bundle
modules=$(xargs < modules.list | sed s/" "//g) || do_exit $?
create_image_bundle "jbr${jbr_name_postfix}" "jbr" $JSDK_MODS_DIR "$modules" || do_exit $?
# create sdk image bundle
modules=$(cat "$JSDK"/release | grep MODULES | sed s/MODULES=//g | sed s/' '/','/g | sed s/\"//g | sed s/\\n//g) || do_exit $?
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "dcevm" ] || [ "$bundle_type" == "fd" ] || [ "$bundle_type" == "$JBRSDK_BUNDLE" ]; then
modules=${modules},$(get_mods_list "$JCEF_PATH"/jmods)
fi
create_image_bundle "$JBRSDK_BUNDLE${jbr_name_postfix}" "$JBRSDK_BUNDLE" "$JSDK_MODS_DIR" "$modules" || do_exit $?
if [ -z "$bundle_type" ]; then
JBRSDK_TEST=${JBRSDK_BUNDLE}-${JBSDK_VERSION}-osx-test-${architecture}-b${build_number}
echo Creating "$JBRSDK_TEST" ...
make test-image CONF=$RELEASE_NAME || do_exit $?
[ -f "$JBRSDK_TEST.tar.gz" ] && rm "$JBRSDK_TEST.tar.gz"
COPYFILE_DISABLE=1 tar -pczf "$JBRSDK_TEST".tar.gz -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
fi
do_exit 0

View File

@@ -0,0 +1,120 @@
#!/bin/bash
APP_DIRECTORY=$1
APPL_USER=$2
APPL_PASSWORD=$3
APP_NAME=$4
BUNDLE_ID=$5
FAKE_ROOT="${6:-fake-root}"
if [[ -z "$APP_DIRECTORY" ]] || [[ -z "$APPL_USER" ]] || [[ -z "$APPL_PASSWORD" ]]; then
echo "Usage: $0 AppDirectory Username Password"
exit 1
fi
if [[ ! -d "$APP_DIRECTORY" ]]; then
echo "AppDirectory '$APP_DIRECTORY' does not exist or not a directory"
exit 1
fi
function log() {
echo "$(date '+[%H:%M:%S]') $*"
}
function publish-log() {
id=$1
file=$2
curl -T "$file" "$ARTIFACTORY_URL/$id" || true
}
function altool-upload() {
# Since altool uses same file for upload token we have to trick it into using different folders for token file location
# Also it copies zip into TMPDIR so we override it too, to simplify cleanup
OLD_HOME="$HOME"
export HOME="$FAKE_ROOT/home"
export TMPDIR="$FAKE_ROOT/tmp"
mkdir -p "$HOME"
mkdir -p "$TMPDIR"
export _JAVA_OPTIONS="-Duser.home=$HOME -Djava.io.tmpdir=$TMPDIR"
# Reduce amount of downloads, cache transporter libraries
shared_itmstransporter="$OLD_HOME/shared-itmstransporter"
if [[ -f "$shared_itmstransporter" ]]; then
cp -r "$shared_itmstransporter" "$HOME/.itmstransporter"
fi
# For some reason altool prints everything to stderr, not stdout
set +e
xcrun altool --notarize-app \
--username "$APPL_USER" --password "$APPL_PASSWORD" \
--primary-bundle-id "$BUNDLE_ID" \
--asc-provider JetBrainssro --file "$1" 2>&1 | tee "altool.init.out"
unset TMPDIR
export HOME="$OLD_HOME"
set -e
}
#immediately exit script with an error if a command fails
set -euo pipefail
file="$APP_NAME.zip"
log "Zipping $file..."
rm -rf "$file"
ditto -c -k --sequesterRsrc --keepParent "$APP_DIRECTORY" "$file"
log "Notarizing $file..."
rm -rf "altool.init.out" "altool.check.out"
altool-upload "$file"
rm -rf "$file"
notarization_info="$(grep -e "RequestUUID" "altool.init.out" | grep -oE '([0-9a-f-]{36})')"
if [ -z "$notarization_info" ]; then
log "Faile to read RequestUUID from altool.init.out"
exit 10
fi
PATH="$PATH:/usr/local/bin/"
log "Notarization request sent, awaiting response"
spent=0
while true; do
# For some reason altool prints everything to stderr, not stdout
xcrun altool --username "$APPL_USER" --notarization-info "$notarization_info" --password "$APPL_PASSWORD" >"altool.check.out" 2>&1 || true
status="$(grep -oe 'Status: .*' "altool.check.out" | cut -c 9- || true)"
log "Current status: $status"
if [ "$status" = "invalid" ]; then
log "Notarization failed"
ec=1
elif [ "$status" = "success" ]; then
log "Notarization succeeded"
ec=0
else
if [ "$status" != "in progress" ]; then
log "Unknown notarization status, waiting more, altool output:"
cat "altool.check.out"
fi
if [[ $spent -gt 60 ]]; then
log "Waiting time out (apx 60 minutes)"
ec=2
break
fi
sleep 60
((spent += 1))
continue
fi
developer_log="developer_log.json"
log "Fetching $developer_log"
# TODO: Replace cut with trim or something better
url="$(grep -oe 'LogFileURL: .*' "altool.check.out" | cut -c 13-)"
wget "$url" -O "$developer_log" && cat "$developer_log" || true
if [ $ec != 0 ]; then
log "Publishing $developer_log"
publish-log "$notarization_info" "$developer_log"
fi
break
done
cat "altool.check.out"
rm -rf "altool.init.out" "altool.check.out"
exit $ec

View File

@@ -0,0 +1,107 @@
#!/bin/bash
APP_DIRECTORY=$1
JB_CERT=$2
if [[ -z "$APP_DIRECTORY" ]] || [[ -z "$JB_CERT" ]]; then
echo "Usage: $0 AppDirectory CertificateID"
exit 1
fi
if [[ ! -d "$APP_DIRECTORY" ]]; then
echo "AppDirectory '$APP_DIRECTORY' does not exist or not a directory"
exit 1
fi
function log() {
echo "$(date '+[%H:%M:%S]') $*"
}
#immediately exit script with an error if a command fails
set -euo pipefail
# Cleanup files left from previous sign attempt (if any)
find "$APP_DIRECTORY" -name '*.cstemp' -exec rm '{}' \;
log "Signing libraries and executables..."
# -perm +111 searches for executables
for f in \
"Contents/Home/bin" \
"Contents/Home/lib"; do
if [ -d "$APP_DIRECTORY/$f" ]; then
find "$APP_DIRECTORY/$f" \
-type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" -o -perm +111 \) \
-exec codesign --timestamp --force \
-v -s "$JB_CERT" --options=runtime \
--entitlements entitlements.xml {} \;
fi
done
if [ -d "$APP_DIRECTORY/Contents/Frameworks" ]; then
log "Signing frameworks..."
for f in $APP_DIRECTORY/Contents/Frameworks/*; do
find "$f" \
-type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" \) \
-exec codesign --timestamp --force \
-v -s "$JB_CERT" \
--entitlements entitlements.xml {} \;
codesign --timestamp --force \
-v -s "$JB_CERT" --options=runtime \
--entitlements entitlements.xml "$f"
done
fi
log "Signing libraries in jars in $PWD"
# todo: add set -euo pipefail; into the inner sh -c
# `-e` prevents `grep -q && printf` loginc
# with `-o pipefail` there's no input for 'while' loop
find "$APP_DIRECTORY" -name '*.jar' \
-exec sh -c "set -u; unzip -l \"\$0\" | grep -q -e '\.dylib\$' -e '\.jnilib\$' -e '\.so\$' -e '^jattach\$' && printf \"\$0\0\" " {} \; |
while IFS= read -r -d $'\0' file; do
log "Processing libraries in $file"
rm -rf jarfolder jar.jar
mkdir jarfolder
filename="${file##*/}"
log "Filename: $filename"
cp "$file" jarfolder && (cd jarfolder && jar xf "$filename" && rm "$filename")
find jarfolder \
-type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" -o -name "jattach" \) \
-exec codesign --timestamp --force \
-v -s "$JB_CERT" --options=runtime \
--entitlements entitlements.xml {} \;
(cd jarfolder; zip -q -r -o ../jar.jar .)
mv jar.jar "$file"
done
rm -rf jarfolder jar.jar
log "Signing other files..."
for f in \
"Contents/MacOS"; do
if [ -d "$APP_DIRECTORY/$f" ]; then
find "$APP_DIRECTORY/$f" \
-type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" -o -perm +111 \) \
-exec codesign --timestamp --force \
-v -s "$JB_CERT" --options=runtime \
--entitlements entitlements.xml {} \;
fi
done
#log "Signing executable..."
#codesign --timestamp \
# -v -s "$JB_CERT" --options=runtime \
# --force \
# --entitlements entitlements.xml "$APP_DIRECTORY/Contents/MacOS/idea"
log "Signing whole app..."
codesign --timestamp \
-v -s "$JB_CERT" --options=runtime \
--force \
--entitlements entitlements.xml "$APP_DIRECTORY"
log "Verifying java is not broken"
find "$APP_DIRECTORY" \
-type f -name 'java' -perm +111 -exec {} -version \;

View File

@@ -0,0 +1,134 @@
#!/bin/bash -x
#immediately exit script with an error if a command fails
set -euo pipefail
export COPY_EXTENDED_ATTRIBUTES_DISABLE=true
export COPYFILE_DISABLE=true
INPUT_FILE=$1
EXPLODED=$2.exploded
BACKUP_JMODS=$2.backup
USERNAME=$3
PASSWORD=$4
CODESIGN_STRING=$5
NOTARIZE=$6
BUNDLE_ID=$7
cd "$(dirname "$0")"
function log() {
echo "$(date '+[%H:%M:%S]') $*"
}
log "Deleting $EXPLODED ..."
if test -d "$EXPLODED"; then
find "$EXPLODED" -mindepth 1 -maxdepth 1 -exec chmod -R u+wx '{}' \;
fi
rm -rf "$EXPLODED"
mkdir "$EXPLODED"
rm -rf "$BACKUP_JMODS"
mkdir "$BACKUP_JMODS"
log "Unzipping $INPUT_FILE to $EXPLODED ..."
tar -xzvf "$INPUT_FILE" --directory $EXPLODED
BUILD_NAME="$(ls "$EXPLODED")"
sed -i '' s/BNDL/APPL/ $EXPLODED/$BUILD_NAME/Contents/Info.plist
rm -f $EXPLODED/$BUILD_NAME/Contents/CodeResources
rm "$INPUT_FILE"
if test -d $EXPLODED/$BUILD_NAME/Contents/Home/jmods; then
mv $EXPLODED/$BUILD_NAME/Contents/Home/jmods $BACKUP_JMODS
fi
log "$INPUT_FILE extracted and removed"
APPLICATION_PATH="$EXPLODED/$BUILD_NAME"
find "$APPLICATION_PATH/Contents/Home/bin" \
-maxdepth 1 -type f -name '*.jnilib' -print0 |
while IFS= read -r -d $'\0' file; do
if [ -f "$file" ]; then
log "Linking $file"
b="$(basename "$file" .jnilib)"
ln -sf "$b.jnilib" "$(dirname "$file")/$b.dylib"
fi
done
find "$APPLICATION_PATH/Contents/" \
-maxdepth 1 -type f -name '*.txt' -print0 |
while IFS= read -r -d $'\0' file; do
if [ -f "$file" ]; then
log "Moving $file"
mv "$file" "$APPLICATION_PATH/Contents/Resources"
fi
done
non_plist=$(find "$APPLICATION_PATH/Contents/" -maxdepth 1 -type f -and -not -name 'Info.plist' | wc -l)
if [[ $non_plist -gt 0 ]]; then
log "Only Info.plist file is allowed in Contents directory but found $non_plist file(s):"
log "$(find "$APPLICATION_PATH/Contents/" -maxdepth 1 -type f -and -not -name 'Info.plist')"
exit 1
fi
log "Unlocking keychain..."
# Make sure *.p12 is imported into local KeyChain
security unlock-keychain -p "$PASSWORD" "/Users/$USERNAME/Library/Keychains/login.keychain"
attempt=1
limit=3
set +e
while [[ $attempt -le $limit ]]; do
log "Signing (attempt $attempt) $APPLICATION_PATH ..."
./sign.sh "$APPLICATION_PATH" "$CODESIGN_STRING"
ec=$?
if [[ $ec -ne 0 ]]; then
((attempt += 1))
if [ $attempt -eq $limit ]; then
set -e
fi
log "Signing failed, wait for 30 sec and try to sign again"
sleep 30
else
log "Signing done"
codesign -v "$APPLICATION_PATH" -vvvvv
log "Check sign done"
((attempt += limit))
fi
done
set -e
if [ "$NOTARIZE" = "yes" ]; then
log "Notarizing..."
# shellcheck disable=SC1090
source "$HOME/.notarize_token"
APP_NAME=$(echo ${INPUT_FILE} | awk -F"." '{ print $1 }')
# Since notarization tool uses same file for upload token we have to trick it into using different folders, hence fake root
# Also it leaves copy of zip file in TMPDIR, so notarize.sh overrides it and uses FAKE_ROOT as location for temp TMPDIR
FAKE_ROOT="$(pwd)/fake-root"
mkdir -p "$FAKE_ROOT"
echo "Notarization will use fake root: $FAKE_ROOT"
./notarize.sh "$APPLICATION_PATH" "$APPLE_USERNAME" "$APPLE_PASSWORD" "$APP_NAME" "$BUNDLE_ID" "$FAKE_ROOT"
rm -rf "$FAKE_ROOT"
set +e
log "Stapling..."
xcrun stapler staple "$APPLICATION_PATH"
else
log "Notarization disabled"
log "Stapling disabled"
fi
log "Zipping $BUILD_NAME to $INPUT_FILE ..."
(
#cd "$EXPLODED"
#ditto -c -k --sequesterRsrc --keepParent "$BUILD_NAME" "../$INPUT_FILE"
if test -d $BACKUP_JMODS/jmods; then
mv $BACKUP_JMODS/jmods $EXPLODED/$BUILD_NAME/Contents/Home
fi
tar -pczvf $INPUT_FILE --exclude='*.dSYM' --exclude='man' -C $EXPLODED $BUILD_NAME
log "Finished zipping"
)
rm -rf "$EXPLODED"
log "Done"

56
jb/project/tools/mkjbrapi.sh Executable file
View File

@@ -0,0 +1,56 @@
#!/bin/bash -x
# How to call this script:
# eval $(jb/project/tools/mkjbrapi.sh)
# It is used to build jetbrains.api module
# After properly calling this script, you can use following variables:
# JBR_API_JAR - absolute path to resulting JAR
# JBR_API_SOURCES_JAR - absolute path to JAR with sources
# JBR_API_VERSION - JBR API version in form <major>.<minor>
# JBR_API_VERSION_MAJOR, JBR_API_VERSION_MINOR - JBR API version components
# JBR_BUILD_DIR - absolute path to JBR build directory
# JBR_BOOT_JDK - absolute path to used boot JDK
ROOT=$(pwd)
sh configure --with-debug-level=release --disable-warnings-as-errors 1>&2 || exit $?
# Get boot JDK & build directory using make script
make -f $ROOT/make/JBRApi.gmk -I $ROOT jbr-api MAKEOVERRIDES= CONF=release OUT="$ROOT/build/jbr-api.cfg" 1>&2 || exit $?
source "$ROOT/build/jbr-api.cfg" || exit $?
# Build module
make jetbrains.api 1>&2 || exit $?
# Get JBR API version from compiled class
JSHELL_COMMAND='
System.out.println("\nVERSION_MAJOR=" + com.jetbrains.JBRApi.getMajorVersion());
System.out.println("\nVERSION_MINOR=" + com.jetbrains.JBRApi.getMinorVersion());
/exit'
VERSION_VARIABLES=$("$BOOT_JDK/bin/jshell" -s --module-path "$BUILD_DIR/jdk/modules/jetbrains.api" \
--add-modules jetbrains.api <<< "$JSHELL_COMMAND" | grep "^VERSION\|^|") || exit $?
eval "$VERSION_VARIABLES" || exit $?
# Create JAR
(
cd "$BUILD_DIR/jdk/modules/jetbrains.api"
"$BOOT_JDK/bin/jar" -cf "$BUILD_DIR/jbr-api.jar" * 1>&2
) || exit $?
# Create source JAR
(
cd "src/jetbrains.api/share/classes"
"$BOOT_JDK/bin/jar" -cf "$BUILD_DIR/jbr-api-sources.jar" * 1>&2
) || exit $?
# Print output values
echo "JBR_API_JAR=$BUILD_DIR/jbr-api.jar"
echo "JBR_API_SOURCES_JAR=$BUILD_DIR/jbr-api-sources.jar"
echo "JBR_API_VERSION=$VERSION_MAJOR.$VERSION_MINOR"
echo "JBR_API_VERSION_MAJOR=$VERSION_MAJOR"
echo "JBR_API_VERSION_MINOR=$VERSION_MINOR"
echo "JBR_BUILD_DIR=$BUILD_DIR"
echo "JBR_BOOT_JDK=$BOOT_JDK"
echo "Success!" 1>&2

View File

@@ -0,0 +1,30 @@
diff --git modules.list modules.list
index dcf610a6a56..f8797505c23 100644
--- modules.list
+++ modules.list
@@ -51,4 +51,7 @@ jdk.zipfs,
jdk.hotspot.agent,
jetbrains.api,
jetbrains.api.impl,
-jdk.jcmd
+jdk.jcmd,
+jcef,
+gluegen.rt,
+jogl.all
diff --git src/java.desktop/share/classes/module-info.java src/java.desktop/share/classes/module-info.java
index 897647ee368..781d1809493 100644
--- src/java.desktop/share/classes/module-info.java
+++ src/java.desktop/share/classes/module-info.java
@@ -116,7 +116,11 @@ module java.desktop {
// see make/GensrcModuleInfo.gmk
exports sun.awt to
jdk.accessibility,
- jdk.unsupported.desktop;
+ jdk.unsupported.desktop,
+ jcef,
+ jogl.all;
+
+ exports java.awt.peer to jcef;
exports java.awt.dnd.peer to jdk.unsupported.desktop;
exports sun.awt.dnd to jdk.unsupported.desktop;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,29 @@
From d937dae078891013a644c6a53eb17f8f5deb8ec8 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Wed, 11 Mar 2020 14:19:34 +0100
Subject: [PATCH 03/39] Fix class cast exception on redefinition of class A,
that is superclass of B that has anonymous class C
---
src/hotspot/share/oops/instanceKlass.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
index 9327652d8fe..c18a5822939 100644
--- a/src/hotspot/share/oops/instanceKlass.cpp
+++ b/src/hotspot/share/oops/instanceKlass.cpp
@@ -908,7 +908,10 @@ bool InstanceKlass::link_class_impl(TRAPS) {
if (!is_linked()) {
if (!is_rewritten()) {
- {
+ // (DCEVM): If class A is being redefined and class B->A (B is extended from A) and B is host class of anonymous class C
+ // then second redefinition fails with cannot cast klass exception. So we currently turn off bytecode verification
+ // on redefinition.
+ if (!AllowEnhancedClassRedefinition || !newest_version()->is_redefining()) {
bool verify_ok = verify_code(THREAD);
if (!verify_ok) {
return false;
--
2.23.0

View File

@@ -0,0 +1,206 @@
From 53d50b53f83aa5135ff5092d0d566424024b8b4b Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sun, 4 Oct 2020 21:12:12 +0200
Subject: [PATCH 04/39] Support for Lambda class redefinition
---
.../share/classfile/classLoaderData.cpp | 9 +++
.../share/classfile/classLoaderData.hpp | 2 +-
.../share/classfile/systemDictionary.cpp | 10 ++-
.../prims/jvmtiEnhancedRedefineClasses.cpp | 65 +++++++++++++++++--
.../prims/jvmtiEnhancedRedefineClasses.hpp | 1 +
.../share/prims/resolvedMethodTable.cpp | 2 +
6 files changed, 80 insertions(+), 9 deletions(-)
diff --git a/src/hotspot/share/classfile/classLoaderData.cpp b/src/hotspot/share/classfile/classLoaderData.cpp
index 340ffadf837..db50b3edee8 100644
--- a/src/hotspot/share/classfile/classLoaderData.cpp
+++ b/src/hotspot/share/classfile/classLoaderData.cpp
@@ -599,6 +599,15 @@ Dictionary* ClassLoaderData::create_dictionary() {
return new Dictionary(this, size, resizable);
}
+void ClassLoaderData::exchange_holders(ClassLoaderData* cld) {
+ oop holder_oop = _holder.peek();
+ _holder.replace(cld->_holder.peek());
+ cld->_holder.replace(holder_oop);
+ WeakHandle<vm_class_loader_data> exchange = _holder;
+ _holder = cld->_holder;
+ cld->_holder = exchange;
+}
+
// Tell the GC to keep this klass alive while iterating ClassLoaderDataGraph
oop ClassLoaderData::holder_phantom() const {
// A klass that was previously considered dead can be looked up in the
diff --git a/src/hotspot/share/classfile/classLoaderData.hpp b/src/hotspot/share/classfile/classLoaderData.hpp
index 5a81ab90ca3..bda39f3e353 100644
--- a/src/hotspot/share/classfile/classLoaderData.hpp
+++ b/src/hotspot/share/classfile/classLoaderData.hpp
@@ -175,7 +175,7 @@ class ClassLoaderData : public CHeapObj<mtClass> {
oop holder_no_keepalive() const;
oop holder_phantom() const;
-
+ void exchange_holders(ClassLoaderData* cld);
private:
void unload();
bool keep_alive() const { return _keep_alive > 0; }
diff --git a/src/hotspot/share/classfile/systemDictionary.cpp b/src/hotspot/share/classfile/systemDictionary.cpp
index 2bfd9cb802f..cea614a574f 100644
--- a/src/hotspot/share/classfile/systemDictionary.cpp
+++ b/src/hotspot/share/classfile/systemDictionary.cpp
@@ -825,10 +825,14 @@ InstanceKlass* SystemDictionary::resolve_hidden_class_from_stream(
Symbol* class_name,
Handle class_loader,
const ClassLoadInfo& cl_info,
+ InstanceKlass* old_klass,
TRAPS) {
EventClassLoad class_load_start_event;
ClassLoaderData* loader_data;
+
+ bool is_redefining = (old_klass != NULL);
+
// - for hidden classes that are not strong: create a new CLD that has a class holder and
// whose loader is the Lookup class's loader.
@@ -845,9 +849,13 @@ InstanceKlass* SystemDictionary::resolve_hidden_class_from_stream(
class_name,
loader_data,
cl_info,
- false, // pick_newest
+ is_redefining, // pick_newest
CHECK_NULL);
assert(k != NULL, "no klass created");
+ if (is_redefining && k != NULL) {
+ k->set_redefining(true);
+ k->set_old_version(old_klass);
+ }
// Hidden classes that are not strong must update ClassLoaderData holder
// so that they can be unloaded when the mirror is no longer referenced.
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index 5551d3ca123..bf31819479d 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -492,6 +492,8 @@ void VM_EnhancedRedefineClasses::doit() {
ClassLoaderDataGraph::classes_do(&clear_cpool_cache);
+ // SystemDictionary::methods_do(fix_invoke_method);
+
// JSR-292 support
if (_any_class_has_resolved_methods) {
bool trace_name_printed = false;
@@ -754,12 +756,34 @@ jvmtiError VM_EnhancedRedefineClasses::load_new_class_versions(TRAPS) {
// load hook event.
state->set_class_being_redefined(the_class, _class_load_kind);
- InstanceKlass* k = SystemDictionary::resolve_from_stream(the_class_sym,
- the_class_loader,
- protection_domain,
- &st,
- the_class,
- THREAD);
+ InstanceKlass* k;
+
+ if (InstanceKlass::cast(the_class)->is_anonymous()) {
+ const InstanceKlass* host_class = the_class->host_klass();
+
+ // Make sure it's the real host class, not another anonymous class.
+ while (host_class != NULL && host_class->is_anonymous()) {
+ host_class = host_class->host_klass();
+ }
+
+ k = SystemDictionary::parse_stream(the_class_sym,
+ the_class_loader,
+ protection_domain,
+ &st,
+ host_class,
+ the_class,
+ NULL,
+ THREAD);
+ k->class_loader_data()->exchange_holders(the_class->class_loader_data());
+ the_class->class_loader_data()->inc_keep_alive();
+ } else {
+ k = SystemDictionary::resolve_from_stream(the_class_sym,
+ the_class_loader,
+ protection_domain,
+ &st,
+ the_class,
+ THREAD);
+ }
// Clear class_being_redefined just to be sure.
state->clear_class_being_redefined();
@@ -1440,6 +1464,30 @@ void VM_EnhancedRedefineClasses::MethodDataCleaner::do_klass(Klass* k) {
}
}
+void VM_EnhancedRedefineClasses::fix_invoke_method(Method* method) {
+
+ constantPoolHandle other_cp = constantPoolHandle(method->constants());
+
+ for (int i = 0; i < other_cp->length(); i++) {
+ if (other_cp->tag_at(i).is_klass()) {
+ Klass* klass = other_cp->resolved_klass_at(i);
+ if (klass->new_version() != NULL) {
+ // Constant pool entry points to redefined class -- update to the new version
+ other_cp->klass_at_put(i, klass->newest_version());
+ }
+ assert(other_cp->resolved_klass_at(i)->new_version() == NULL, "Must be new klass!");
+ }
+ }
+
+ ConstantPoolCache* cp_cache = other_cp->cache();
+ if (cp_cache != NULL) {
+ cp_cache->clear_entries();
+ }
+
+}
+
+
+
void VM_EnhancedRedefineClasses::update_jmethod_ids() {
for (int j = 0; j < _matching_methods_length; ++j) {
Method* old_method = _matching_old_methods[j];
@@ -1977,7 +2025,10 @@ jvmtiError VM_EnhancedRedefineClasses::find_sorted_affected_classes(TRAPS) {
// Find classes not directly redefined, but affected by a redefinition (because one of its supertypes is redefined)
AffectedKlassClosure closure(_affected_klasses);
// Updated in j10, from original SystemDictionary::classes_do
- ClassLoaderDataGraph::dictionary_classes_do(&closure);
+
+ ClassLoaderDataGraph::classes_do(&closure);
+ //ClassLoaderDataGraph::dictionary_classes_do(&closure);
+
log_trace(redefine, class, load)("%d classes affected", _affected_klasses->length());
// Sort the affected klasses such that a supertype is always on a smaller array index than its subtype.
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
index 60b62c3170a..d8a11b51fe9 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
@@ -116,6 +116,7 @@ class VM_EnhancedRedefineClasses: public VM_GC_Operation {
void rollback();
static void mark_as_scavengable(nmethod* nm);
static void unpatch_bytecode(Method* method);
+ static void fix_invoke_method(Method* method);
// Figure out which new methods match old methods in name and signature,
// which methods have been added, and which are no longer present
diff --git a/src/hotspot/share/prims/resolvedMethodTable.cpp b/src/hotspot/share/prims/resolvedMethodTable.cpp
index 6a8128e844f..8644937dbbb 100644
--- a/src/hotspot/share/prims/resolvedMethodTable.cpp
+++ b/src/hotspot/share/prims/resolvedMethodTable.cpp
@@ -409,6 +409,8 @@ void ResolvedMethodTable::adjust_method_entries_dcevm(bool * trace_name_printed)
InstanceKlass* newer_klass = InstanceKlass::cast(old_method->method_holder()->new_version());
Method* newer_method = newer_klass->method_with_idnum(old_method->orig_method_idnum());
+ log_info(redefine, class, load, exceptions)("Adjusting method: '%s' of new class %s", newer_method->name_and_sig_as_C_string(), newer_klass->name()->as_C_string());
+
assert(newer_klass == newer_method->method_holder(), "call after swapping redefined guts");
assert(newer_method != NULL, "method_with_idnum() should not be NULL");
assert(old_method != newer_method, "sanity check");
--
2.23.0

View File

@@ -0,0 +1,135 @@
From 7bb6ea77608cd43cb7ca8c1ea8d492ae07789a0f Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sat, 23 May 2020 10:02:15 +0200
Subject: [PATCH 05/39] Fix "no original bytecode found" error if method with
bkp is missing
Sometimes IDE can deploy class with erroneous method, such method has
n bytecode, but breakpoint position can still exist.
---
src/hotspot/share/interpreter/bytecodes.cpp | 2 +-
.../share/interpreter/interpreterRuntime.cpp | 2 +-
src/hotspot/share/oops/method.cpp | 8 ++++----
src/hotspot/share/oops/method.hpp | 4 ++--
.../prims/jvmtiEnhancedRedefineClasses.cpp | 18 ++++++++++--------
5 files changed, 18 insertions(+), 16 deletions(-)
diff --git a/src/hotspot/share/interpreter/bytecodes.cpp b/src/hotspot/share/interpreter/bytecodes.cpp
index 6711ba735db..4f0b655265a 100644
--- a/src/hotspot/share/interpreter/bytecodes.cpp
+++ b/src/hotspot/share/interpreter/bytecodes.cpp
@@ -84,7 +84,7 @@ Bytecodes::Code Bytecodes::code_at(Method* method, int bci) {
Bytecodes::Code Bytecodes::non_breakpoint_code_at(const Method* method, address bcp) {
assert(method != NULL, "must have the method for breakpoint conversion");
assert(method->contains(bcp), "must be valid bcp in method");
- return method->orig_bytecode_at(method->bci_from(bcp));
+ return method->orig_bytecode_at(method->bci_from(bcp), false);
}
int Bytecodes::special_length_at(Bytecodes::Code code, address bcp, address end) {
diff --git a/src/hotspot/share/interpreter/interpreterRuntime.cpp b/src/hotspot/share/interpreter/interpreterRuntime.cpp
index d66ed24d862..9bfcd9eb479 100644
--- a/src/hotspot/share/interpreter/interpreterRuntime.cpp
+++ b/src/hotspot/share/interpreter/interpreterRuntime.cpp
@@ -788,7 +788,7 @@ JRT_END
// Invokes
JRT_ENTRY(Bytecodes::Code, InterpreterRuntime::get_original_bytecode_at(JavaThread* current, Method* method, address bcp))
- return method->orig_bytecode_at(method->bci_from(bcp));
+ return method->orig_bytecode_at(method->bci_from(bcp), false);
JRT_END
JRT_ENTRY(void, InterpreterRuntime::set_original_bytecode_at(JavaThread* current, Method* method, address bcp, Bytecodes::Code new_code))
diff --git a/src/hotspot/share/oops/method.cpp b/src/hotspot/share/oops/method.cpp
index 613c10a9d8c..a5a12599997 100644
--- a/src/hotspot/share/oops/method.cpp
+++ b/src/hotspot/share/oops/method.cpp
@@ -1853,14 +1853,14 @@ bool CompressedLineNumberReadStream::read_pair() {
#if INCLUDE_JVMTI
-Bytecodes::Code Method::orig_bytecode_at(int bci) const {
+Bytecodes::Code Method::orig_bytecode_at(int bci, bool no_fatal) const {
BreakpointInfo* bp = method_holder()->breakpoints();
for (; bp != NULL; bp = bp->next()) {
if (bp->match(this, bci)) {
return bp->orig_bytecode();
}
}
- {
+ if (!no_fatal) {
ResourceMark rm;
fatal("no original bytecode found in %s at bci %d", name_and_sig_as_C_string(), bci);
}
@@ -1998,7 +1998,7 @@ BreakpointInfo::BreakpointInfo(Method* m, int bci) {
_signature_index = m->signature_index();
_orig_bytecode = (Bytecodes::Code) *m->bcp_from(_bci);
if (_orig_bytecode == Bytecodes::_breakpoint)
- _orig_bytecode = m->orig_bytecode_at(_bci);
+ _orig_bytecode = m->orig_bytecode_at(_bci, false);
_next = NULL;
}
@@ -2007,7 +2007,7 @@ void BreakpointInfo::set(Method* method) {
{
Bytecodes::Code code = (Bytecodes::Code) *method->bcp_from(_bci);
if (code == Bytecodes::_breakpoint)
- code = method->orig_bytecode_at(_bci);
+ code = method->orig_bytecode_at(_bci, false);
assert(orig_bytecode() == code, "original bytecode must be the same");
}
#endif
diff --git a/src/hotspot/share/oops/method.hpp b/src/hotspot/share/oops/method.hpp
index 030ddd1f675..a8d6507ff6c 100644
--- a/src/hotspot/share/oops/method.hpp
+++ b/src/hotspot/share/oops/method.hpp
@@ -226,7 +226,7 @@ class Method : public Metadata {
// JVMTI breakpoints
#if !INCLUDE_JVMTI
- Bytecodes::Code orig_bytecode_at(int bci) const {
+ Bytecodes::Code orig_bytecode_at(int bci, bool no_fatal) const {
ShouldNotReachHere();
return Bytecodes::_shouldnotreachhere;
}
@@ -235,7 +235,7 @@ class Method : public Metadata {
};
u2 number_of_breakpoints() const {return 0;}
#else // !INCLUDE_JVMTI
- Bytecodes::Code orig_bytecode_at(int bci) const;
+ Bytecodes::Code orig_bytecode_at(int bci, bool no_fatal) const;
void set_orig_bytecode_at(int bci, Bytecodes::Code code);
void set_breakpoint(int bci);
void clear_breakpoint(int bci);
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index bf31819479d..07935bd0ada 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -1360,14 +1360,16 @@ void VM_EnhancedRedefineClasses::unpatch_bytecode(Method* method) {
if (code == Bytecodes::_breakpoint) {
int bci = method->bci_from(bcp);
- code = method->orig_bytecode_at(bci);
- java_code = Bytecodes::java_code(code);
- if (code != java_code &&
- (java_code == Bytecodes::_getfield ||
- java_code == Bytecodes::_putfield ||
- java_code == Bytecodes::_aload_0)) {
- // Let breakpoint table handling unpatch bytecode
- method->set_orig_bytecode_at(bci, java_code);
+ code = method->orig_bytecode_at(bci, true);
+ if (code != Bytecodes::_shouldnotreachhere) {
+ java_code = Bytecodes::java_code(code);
+ if (code != java_code &&
+ (java_code == Bytecodes::_getfield ||
+ java_code == Bytecodes::_putfield ||
+ java_code == Bytecodes::_aload_0)) {
+ // Let breakpoint table handling unpatch bytecode
+ method->set_orig_bytecode_at(bci, java_code);
+ }
}
} else {
java_code = Bytecodes::java_code(code);
--
2.23.0

View File

@@ -0,0 +1,83 @@
From c40cd307310822e6e60c61931c14f97a8501f975 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sun, 24 May 2020 12:07:42 +0200
Subject: [PATCH 06/39] Replace deleted method with
Universe::throw_no_such_method_error
+ Change log level in advanced redefinition
- Change log level for "Comparing different class ver.." to debug
- Fix adjust_method_entries_dcevm logging levels and severity
---
.../prims/jvmtiEnhancedRedefineClasses.cpp | 2 +-
.../share/prims/resolvedMethodTable.cpp | 30 +++++++++----------
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index 07935bd0ada..3c86e8c68ac 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -881,7 +881,7 @@ jvmtiError VM_EnhancedRedefineClasses::load_new_class_versions(TRAPS) {
// Calculated the difference between new and old class (field change, method change, supertype change, ...).
int VM_EnhancedRedefineClasses::calculate_redefinition_flags(InstanceKlass* new_class) {
int result = Klass::NoRedefinition;
- log_info(redefine, class, load)("Comparing different class versions of class %s",new_class->name()->as_C_string());
+ log_debug(redefine, class, load)("Comparing different class versions of class %s",new_class->name()->as_C_string());
assert(new_class->old_version() != NULL, "must have old version");
InstanceKlass* the_class = InstanceKlass::cast(new_class->old_version());
diff --git a/src/hotspot/share/prims/resolvedMethodTable.cpp b/src/hotspot/share/prims/resolvedMethodTable.cpp
index 8644937dbbb..b8d039adff6 100644
--- a/src/hotspot/share/prims/resolvedMethodTable.cpp
+++ b/src/hotspot/share/prims/resolvedMethodTable.cpp
@@ -399,25 +399,25 @@ void ResolvedMethodTable::adjust_method_entries_dcevm(bool * trace_name_printed)
if (old_method->is_old()) {
+ InstanceKlass* newer_klass = InstanceKlass::cast(old_method->method_holder()->new_version());
+ Method* newer_method;
+
// Method* new_method;
if (old_method->is_deleted()) {
- // FIXME:(DCEVM) - check if exception can be thrown
- // new_method = Universe::throw_no_such_method_error();
- continue;
- }
-
- InstanceKlass* newer_klass = InstanceKlass::cast(old_method->method_holder()->new_version());
- Method* newer_method = newer_klass->method_with_idnum(old_method->orig_method_idnum());
+ newer_method = Universe::throw_no_such_method_error();
+ } else {
+ newer_method = newer_klass->method_with_idnum(old_method->orig_method_idnum());
- log_info(redefine, class, load, exceptions)("Adjusting method: '%s' of new class %s", newer_method->name_and_sig_as_C_string(), newer_klass->name()->as_C_string());
+ log_debug(redefine, class, update)("Adjusting method: '%s' of new class %s", newer_method->name_and_sig_as_C_string(), newer_klass->name()->as_C_string());
- assert(newer_klass == newer_method->method_holder(), "call after swapping redefined guts");
- assert(newer_method != NULL, "method_with_idnum() should not be NULL");
- assert(old_method != newer_method, "sanity check");
+ assert(newer_klass == newer_method->method_holder(), "call after swapping redefined guts");
+ assert(newer_method != NULL, "method_with_idnum() should not be NULL");
+ assert(old_method != newer_method, "sanity check");
- if (_the_table->lookup(newer_method) != NULL) {
- // old method was already adjusted if new method exists in _the_table
- continue;
+ if (_the_table->lookup(newer_method) != NULL) {
+ // old method was already adjusted if new method exists in _the_table
+ continue;
+ }
}
java_lang_invoke_ResolvedMethodName::set_vmtarget(mem_name, newer_method);
@@ -428,7 +428,7 @@ void ResolvedMethodTable::adjust_method_entries_dcevm(bool * trace_name_printed)
ResourceMark rm;
if (!(*trace_name_printed)) {
- log_info(redefine, class, update)("adjust: name=%s", old_method->method_holder()->external_name());
+ log_debug(redefine, class, update)("adjust: name=%s", old_method->method_holder()->external_name());
*trace_name_printed = true;
}
log_debug(redefine, class, update, constantpool)
--
2.23.0

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,26 @@
From e062743b148a099a8593a3110d5f1d9156f4ca23 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Tue, 6 Oct 2020 22:15:31 +0200
Subject: [PATCH 08/39] AllowEnhancedClassRedefinition is false (disabled) by
default
---
src/hotspot/share/runtime/globals.hpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp
index 2fcb02fcf49..7051b634a9b 100644
--- a/src/hotspot/share/runtime/globals.hpp
+++ b/src/hotspot/share/runtime/globals.hpp
@@ -2088,7 +2088,7 @@ const intx ObjectAlignmentInBytes = 8;
develop(bool, TraceOptimizedUpcallStubs, false, \
"Trace optimized upcall stub generation") \
\
- product(bool, AllowEnhancedClassRedefinition, true, \
+ product(bool, AllowEnhancedClassRedefinition, false, \
"Allow enhanced class redefinition beyond swapping method " \
"bodies")
--
2.23.0

View File

@@ -0,0 +1,74 @@
From 703cb7aa230b6a159c7f1f86b749a8e0119ef881 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Mon, 19 Oct 2020 20:00:04 +0200
Subject: [PATCH 09/39] Set HOTSPOT_VM_DISTRO=Dynamic Code Evolution
---
make/autoconf/version-numbers | 55 +++++++++++++++++++++++++++++++++++
1 file changed, 55 insertions(+)
create mode 100644 make/autoconf/version-numbers
diff --git a/make/autoconf/version-numbers b/make/autoconf/version-numbers
new file mode 100644
index 00000000000..df8025a2e84
--- /dev/null
+++ b/make/autoconf/version-numbers
@@ -0,0 +1,55 @@
+#
+# Copyright (c) 2011, 2019, 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
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation. Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+# Default version, product, and vendor information to use,
+# unless overridden by configure
+
+DEFAULT_VERSION_FEATURE=15
+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=2020-09-15
+DEFAULT_VERSION_CLASSFILE_MAJOR=59 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
+DEFAULT_VERSION_CLASSFILE_MINOR=0
+DEFAULT_ACCEPTABLE_BOOT_VERSIONS="14 15"
+DEFAULT_JDK_SOURCE_TARGET_VERSION=15
+DEFAULT_PROMOTED_VERSION_PRE=
+
+LAUNCHER_NAME=openjdk
+PRODUCT_NAME=OpenJDK
+PRODUCT_SUFFIX="Runtime Environment"
+JDK_RC_PLATFORM_NAME=Platform
+COMPANY_NAME=N/A
+HOTSPOT_VM_DISTRO="Dynamic Code Evolution"
+VENDOR_URL=https://openjdk.java.net/
+VENDOR_URL_BUG=https://bugreport.java.com/bugreport/
+VENDOR_URL_VM_BUG=https://bugreport.java.com/bugreport/crash.jsp
+
+# Might need better names for these
+MACOSX_BUNDLE_NAME_BASE="OpenJDK"
+MACOSX_BUNDLE_ID_BASE="net.java.openjdk"
--
2.23.0

View File

@@ -0,0 +1,206 @@
From 3b4788c779cb9ffe2751e996bba3b445b474eba7 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Fri, 23 Oct 2020 10:20:26 +0200
Subject: [PATCH 10/39] Clear dcevm code separation
---
src/hotspot/share/classfile/systemDictionary.cpp | 3 +--
src/hotspot/share/gc/serial/genMarkSweep.cpp | 8 +++++---
src/hotspot/share/interpreter/linkResolver.cpp | 14 ++++++++++----
.../instrumentation/jfrEventClassTransformer.cpp | 2 +-
src/hotspot/share/oops/cpCache.hpp | 8 +++++---
src/hotspot/share/oops/instanceKlass.cpp | 6 +++---
src/hotspot/share/oops/method.cpp | 2 +-
src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp | 2 +-
src/hotspot/share/runtime/reflection.cpp | 2 +-
9 files changed, 28 insertions(+), 19 deletions(-)
diff --git a/src/hotspot/share/classfile/systemDictionary.cpp b/src/hotspot/share/classfile/systemDictionary.cpp
index cea614a574f..98e2541c79b 100644
--- a/src/hotspot/share/classfile/systemDictionary.cpp
+++ b/src/hotspot/share/classfile/systemDictionary.cpp
@@ -830,9 +830,8 @@ InstanceKlass* SystemDictionary::resolve_hidden_class_from_stream(
EventClassLoad class_load_start_event;
ClassLoaderData* loader_data;
-
+
bool is_redefining = (old_klass != NULL);
-
// - for hidden classes that are not strong: create a new CLD that has a class holder and
// whose loader is the Lookup class's loader.
diff --git a/src/hotspot/share/gc/serial/genMarkSweep.cpp b/src/hotspot/share/gc/serial/genMarkSweep.cpp
index bbb2c02f2b2..00b8e44078e 100644
--- a/src/hotspot/share/gc/serial/genMarkSweep.cpp
+++ b/src/hotspot/share/gc/serial/genMarkSweep.cpp
@@ -316,7 +316,9 @@ void GenMarkSweep::mark_sweep_phase4() {
GenCompactClosure blk;
gch->generation_iterate(&blk, true);
- DcevmSharedGC::copy_rescued_objects_back(MarkSweep::_rescued_oops, true);
- DcevmSharedGC::clear_rescued_objects_resource(MarkSweep::_rescued_oops);
- MarkSweep::_rescued_oops = NULL;
+ if (AllowEnhancedClassRedefinition) {
+ DcevmSharedGC::copy_rescued_objects_back(MarkSweep::_rescued_oops, true);
+ DcevmSharedGC::clear_rescued_objects_resource(MarkSweep::_rescued_oops);
+ MarkSweep::_rescued_oops = NULL;
+ }
}
diff --git a/src/hotspot/share/interpreter/linkResolver.cpp b/src/hotspot/share/interpreter/linkResolver.cpp
index 8fb336762df..74a6af13ea4 100644
--- a/src/hotspot/share/interpreter/linkResolver.cpp
+++ b/src/hotspot/share/interpreter/linkResolver.cpp
@@ -287,9 +287,14 @@ void LinkResolver::check_klass_accessibility(Klass* ref_klass, Klass* sel_klass,
if (!base_klass->is_instance_klass()) {
return; // no relevant check to do
}
-
+ Klass* refKlassNewest = ref_klass;
+ Klass* baseKlassNewest = base_klass;
+ if (AllowEnhancedClassRedefinition) {
+ refKlassNewest = ref_klass->newest_version();
+ baseKlassNewest = base_klass->newest_version();
+ }
Reflection::VerifyClassAccessResults vca_result =
- Reflection::verify_class_access(ref_klass->newest_version(), InstanceKlass::cast(base_klass->newest_version()), true);
+ Reflection::verify_class_access(refKlassNewest, InstanceKlass::cast(baseKlassNewest), true);
if (vca_result != Reflection::ACCESS_OK) {
ResourceMark rm(THREAD);
char* msg = Reflection::verify_class_access_msg(ref_klass,
@@ -551,7 +556,8 @@ void LinkResolver::check_method_accessability(Klass* ref_klass,
// We'll check for the method name first, as that's most likely
// to be false (so we'll short-circuit out of these tests).
if (sel_method->name() == vmSymbols::clone_name() &&
- sel_klass->newest_version() == vmClasses::Object_klass()->newest_version() &&
+ ( !AllowEnhancedClassRedefinition && sel_klass == vmClasses::Object_klass() ||
+ AllowEnhancedClassRedefinition && sel_klass->newest_version() == vmClasses::Object_klass()->newest_version()) &&
resolved_klass->is_array_klass()) {
// We need to change "protected" to "public".
assert(flags.is_protected(), "clone not protected?");
@@ -997,7 +1003,7 @@ void LinkResolver::resolve_field(fieldDescriptor& fd,
// or by the <init> method (in case of an instance field).
if (is_put && fd.access_flags().is_final()) {
- if (sel_klass != current_klass && sel_klass != current_klass->active_version()) {
+ if (sel_klass != current_klass && (!AllowEnhancedClassRedefinition || sel_klass != current_klass->active_version())) {
ResourceMark rm(THREAD);
stringStream ss;
ss.print("Update to %s final field %s.%s attempted from a different class (%s) than the field's declaring class",
diff --git a/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp b/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp
index 88e520ec475..73832251f3f 100644
--- a/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp
+++ b/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp
@@ -1475,7 +1475,7 @@ static InstanceKlass* create_new_instance_klass(InstanceKlass* ik, ClassFileStre
cld,
&cl_info,
ClassFileParser::INTERNAL, // internal visibility
- false,
+ false,
THREAD);
if (HAS_PENDING_EXCEPTION) {
log_pending_exception(PENDING_EXCEPTION);
diff --git a/src/hotspot/share/oops/cpCache.hpp b/src/hotspot/share/oops/cpCache.hpp
index b934302f422..d7ae5edc7b3 100644
--- a/src/hotspot/share/oops/cpCache.hpp
+++ b/src/hotspot/share/oops/cpCache.hpp
@@ -148,13 +148,13 @@ class ConstantPoolCacheEntry {
void set_bytecode_2(Bytecodes::Code code);
void set_f1(Metadata* f1) {
Metadata* existing_f1 = _f1; // read once
- //assert(existing_f1 == NULL || existing_f1 == f1, "illegal field change");
+ assert(AllowEnhancedClassRedefinition || existing_f1 == NULL || existing_f1 == f1, "illegal field change");
_f1 = f1;
}
void release_set_f1(Metadata* f1);
void set_f2(intx f2) {
intx existing_f2 = _f2; // read once
- //assert(existing_f2 == 0 || existing_f2 == f2, "illegal field change");
+ assert(AllowEnhancedClassRedefinition || existing_f2 == 0 || existing_f2 == f2, "illegal field change");
_f2 = f2;
}
void set_f2_as_vfinal_method(Method* f2) {
@@ -215,7 +215,9 @@ class ConstantPoolCacheEntry {
void initialize_resolved_reference_index(int ref_index) {
assert(_f2 == 0, "set once"); // note: ref_index might be zero also
_f2 = ref_index;
- _flags = 1 << is_resolved_ref_shift;
+ if (AllowEnhancedClassRedefinition) {
+ _flags = 1 << is_resolved_ref_shift;
+ }
}
void set_field( // sets entry to resolved field state
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
index c18a5822939..994f6bf266f 100644
--- a/src/hotspot/share/oops/instanceKlass.cpp
+++ b/src/hotspot/share/oops/instanceKlass.cpp
@@ -968,7 +968,7 @@ bool InstanceKlass::link_class_impl(TRAPS) {
set_init_state(linked);
}
// (DCEVM) Must check for old version in order to prevent infinite loops.
- if (JvmtiExport::should_post_class_prepare() && old_version() == NULL /* JVMTI deadlock otherwise */) {
+ if (JvmtiExport::should_post_class_prepare() && (!AllowEnhancedClassRedefinition || old_version() == NULL /* JVMTI deadlock otherwise */) {
JvmtiExport::post_class_prepare(THREAD, this);
}
}
@@ -1046,7 +1046,7 @@ void InstanceKlass::initialize_impl(TRAPS) {
// we might end up throwing IE from link/symbol resolution sites
// that aren't expected to throw. This would wreak havoc. See 6320309.
while ((is_being_initialized() && !is_reentrant_initialization(jt))
- || (old_version() != NULL && InstanceKlass::cast(old_version())->is_being_initialized())) {
+ || (AllowEnhancedClassRedefinition && old_version() != NULL && InstanceKlass::cast(old_version())->is_being_initialized())) {
wait = true;
jt->set_class_to_be_initialized(this);
ol.wait_uninterruptibly(jt);
@@ -3796,7 +3796,7 @@ void InstanceKlass::verify_on(outputStream* st) {
guarantee(sib->is_klass(), "should be klass");
// TODO: (DCEVM) explain
- guarantee(sib->super() == super || super->newest_version() == SystemDictionary::Object_klass(), "siblings should have same superklass");
+ guarantee(sib->super() == super || AllowEnhancedClassRedefinition && super->newest_version() == SystemDictionary::Object_klass(), "siblings should have same superklass");
}
// Verify local interfaces
diff --git a/src/hotspot/share/oops/method.cpp b/src/hotspot/share/oops/method.cpp
index a5a12599997..4426f03fd40 100644
--- a/src/hotspot/share/oops/method.cpp
+++ b/src/hotspot/share/oops/method.cpp
@@ -2199,7 +2199,7 @@ void Method::ensure_jmethod_ids(ClassLoaderData* loader_data, int capacity) {
// Add a method id to the jmethod_ids
jmethodID Method::make_jmethod_id(ClassLoaderData* loader_data, Method* m) {
// FIXME: (DCEVM) ???
- if (m != m->newest_version()) {
+ if (AllowEnhancedClassRedefinition && m != m->newest_version()) {
m = m->newest_version();
}
ClassLoaderData* cld = loader_data;
diff --git a/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp b/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp
index 42e72c67879..c860ee24f80 100644
--- a/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp
@@ -76,7 +76,7 @@ public:
// the new version (SystemDictionary stores only new versions). But the LoadedClassesClosure's functionality was
// changed in java8 where jvmtiLoadedClasses collects all classes from all classloaders, therefore we
// must use new versions only.
- if (k->new_version()==NULL) {
+ if (AllowEnhancedClassRedefinition && k->new_version()==NULL) {
_classStack.push((jclass) _env->jni_reference(Handle(_cur_thread, k->java_mirror())));
if (_dictionary_walk) {
// Collect array classes this way when walking the dictionary (because array classes are
diff --git a/src/hotspot/share/runtime/reflection.cpp b/src/hotspot/share/runtime/reflection.cpp
index cc58f913ed5..21104c18423 100644
--- a/src/hotspot/share/runtime/reflection.cpp
+++ b/src/hotspot/share/runtime/reflection.cpp
@@ -608,7 +608,7 @@ bool Reflection::verify_member_access(const Klass* current_class,
TRAPS) {
// (DCEVM) Decide accessibility based on active version
- if (current_class != NULL) {
+ if (AllowEnhancedClassRedefinition && current_class != NULL) {
current_class = current_class->active_version();
}
--
2.23.0

View File

@@ -0,0 +1,26 @@
From bb8f91da24b2649507f2e200f1ff2bae2d2658bf Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Wed, 11 Nov 2020 18:45:15 +0100
Subject: [PATCH 11/39] Fix LoadedClassesClosure - fixes problems with remote
debugging
---
src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp b/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp
index c860ee24f80..dfe0bb8d96a 100644
--- a/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp
@@ -76,7 +76,7 @@ public:
// the new version (SystemDictionary stores only new versions). But the LoadedClassesClosure's functionality was
// changed in java8 where jvmtiLoadedClasses collects all classes from all classloaders, therefore we
// must use new versions only.
- if (AllowEnhancedClassRedefinition && k->new_version()==NULL) {
+ if (!AllowEnhancedClassRedefinition || k->new_version()==NULL) {
_classStack.push((jclass) _env->jni_reference(Handle(_cur_thread, k->java_mirror())));
if (_dictionary_walk) {
// Collect array classes this way when walking the dictionary (because array classes are
--
2.23.0

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,43 @@
From 9815ee603b27484953651bdc6d5705994a4d38aa Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sun, 22 Nov 2020 19:51:46 +0100
Subject: [PATCH 13/39] dcevm15 - add ClassLoaderDataGraph_lock on
ClassLoaderDataGraph::classes_do
ClassLoaderDataGraph::classes_do and need safepoint or lock,
find_sorted_affected_classes is not in safepoint therefore it must be
locked
ClassLoaderDataGraph::rollback_redefinition need safepoint too
---
src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index efaf11e1666..9f42d14ce98 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -1380,7 +1380,9 @@ void VM_EnhancedRedefineClasses::calculate_instance_update_information(Klass* ne
// Rollback all changes - clear new classes from the system dictionary, return old classes to directory, free memory.
void VM_EnhancedRedefineClasses::rollback() {
log_info(redefine, class, load)("Rolling back redefinition, result=%d", _res);
+ ClassLoaderDataGraph_lock->lock();
ClassLoaderDataGraph::rollback_redefinition();
+ ClassLoaderDataGraph_lock->unlock();
for (int i = 0; i < _new_classes->length(); i++) {
SystemDictionary::remove_from_hierarchy(_new_classes->at(i));
@@ -2063,7 +2065,10 @@ jvmtiError VM_EnhancedRedefineClasses::find_sorted_affected_classes(TRAPS) {
AffectedKlassClosure closure(_affected_klasses);
// Updated in j10, from original SystemDictionary::classes_do
- ClassLoaderDataGraph::classes_do(&closure);
+ {
+ MutexLocker mcld(ClassLoaderDataGraph_lock);
+ ClassLoaderDataGraph::classes_do(&closure);
+ }
//ClassLoaderDataGraph::dictionary_classes_do(&closure);
log_trace(redefine, class, load)("%d classes affected", _affected_klasses->length());
--
2.23.0

View File

@@ -0,0 +1,98 @@
From d3e5f8acd389021128bb8a899bb538294de353f6 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sun, 22 Nov 2020 12:05:50 +0100
Subject: [PATCH 14/39] dcevm15 - fix Universe::root_oops_do
Removed ClassLoaderDataGraph::cld_do was cause of crashes due multiple
oop patching. ClassLoaderDataGraph::cld_do replaced in dcevm15
previously used and removed SystemDictionary:oops_do
---
src/hotspot/share/memory/universe.cpp | 45 +++++++++++----------------
1 file changed, 19 insertions(+), 26 deletions(-)
diff --git a/src/hotspot/share/memory/universe.cpp b/src/hotspot/share/memory/universe.cpp
index 9fcbb6c41b3..247f2b3e8c0 100644
--- a/src/hotspot/share/memory/universe.cpp
+++ b/src/hotspot/share/memory/universe.cpp
@@ -44,6 +44,8 @@
#include "gc/shared/oopStorageSet.hpp"
#include "gc/shared/stringdedup/stringDedup.hpp"
#include "gc/shared/tlab_globals.hpp"
+#include "gc/shared/weakProcessor.hpp"
+#include "interpreter/interpreter.hpp"
#include "logging/log.hpp"
#include "logging/logStream.hpp"
#include "memory/metadataFactory.hpp"
@@ -71,6 +73,8 @@
#include "runtime/jniHandles.hpp"
#include "runtime/thread.inline.hpp"
#include "runtime/timerTrace.hpp"
+#include "runtime/vmOperations.hpp"
+#include "services/management.hpp"
#include "services/memoryService.hpp"
#include "utilities/align.hpp"
#include "utilities/autoRestore.hpp"
@@ -209,45 +213,34 @@ void Universe::basic_type_classes_do(KlassClosure *closure) {
// FIXME: (DCEVM) This method should iterate all pointers that are not within heap objects.
void Universe::root_oops_do(OopClosure *oopClosure) {
-
- class AlwaysTrueClosure: public BoolObjectClosure {
- public:
- void do_object(oop p) { ShouldNotReachHere(); }
- bool do_object_b(oop p) { return true; }
- };
- AlwaysTrueClosure always_true;
-
Universe::oops_do(oopClosure);
// ReferenceProcessor::oops_do(oopClosure); (tw) check why no longer there
JNIHandles::oops_do(oopClosure); // Global (strong) JNI handles
Threads::oops_do(oopClosure, NULL);
ObjectSynchronizer::oops_do(oopClosure);
- // TODO: review, flat profiler was removed in j10
- // FlatProfiler::oops_do(oopClosure);
- JvmtiExport::oops_do(oopClosure);
+ // (DCEVM) TODO: Check if this is correct?
+ Management::oops_do(oopClosure);
+ OopStorageSet::vm_global()->oops_do(oopClosure);
+ // CLDToOopClosure cld_closure(oopClosure, ClassLoaderData::_claim_none);
+ // ClassLoaderDataGraph::cld_do(&cld_closure);
// Now adjust pointers in remaining weak roots. (All of which should
// have been cleared if they pointed to non-surviving objects.)
// Global (weak) JNI handles
- JNIHandles::weak_oops_do(&always_true, oopClosure);
+ WeakProcessor::oops_do(oopClosure);
+
+ JvmtiExport::oops_do(oopClosure);
CodeBlobToOopClosure blobClosure(oopClosure, CodeBlobToOopClosure::FixRelocations);
CodeCache::blobs_do(&blobClosure);
- StringTable::oops_do(oopClosure);
+
+ AOT_ONLY(AOTLoader::oops_do(oopClosure);)
+
+ // StringTable::oops_do was removed in j15
+ // StringTable::oops_do(oopClosure);
+
+ // OopStorageSet::vm_global()->oops_do(oopClosure);
- // (DCEVM) TODO: Check if this is correct?
- //CodeCache::scavenge_root_nmethods_oops_do(oopClosure);
- //Management::oops_do(oopClosure);
- //ref_processor()->weak_oops_do(&oopClosure);
- //PSScavenge::reference_processor()->weak_oops_do(&oopClosure);
-
-#if INCLUDE_AOT
- if (UseAOT) {
- AOTLoader::oops_do(oopClosure);
- }
-#endif
- // SO_AllClasses
- SystemDictionary::oops_do(oopClosure);
}
void Universe::oops_do(OopClosure* f) {
--
2.23.0

View File

@@ -0,0 +1,29 @@
From 574cddeb00c3d93bddbaf1845a7d9d3ffdced324 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sat, 28 Nov 2020 19:29:42 +0100
Subject: [PATCH 15/39] dcevm15 - check if has_nestmate_access_to has newest
host class
---
src/hotspot/share/oops/instanceKlass.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
index ef0091fe288..b4d09e92830 100644
--- a/src/hotspot/share/oops/instanceKlass.cpp
+++ b/src/hotspot/share/oops/instanceKlass.cpp
@@ -398,6 +398,11 @@ bool InstanceKlass::has_nestmate_access_to(InstanceKlass* k, TRAPS) {
return false;
}
+ if (AllowEnhancedClassRedefinition) {
+ // TODO: (DCEVM) check if it correct. It fix problems with lambdas (hidden)
+ cur_host = InstanceKlass::cast(cur_host->newest_version());
+ }
+
Klass* k_nest_host = k->nest_host(CHECK_false);
if (k_nest_host == NULL) {
return false;
--
2.23.0

View File

@@ -0,0 +1,54 @@
From 983b4aaed2c56a74287b9400ddae4b7d7f3fd715 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sun, 29 Nov 2020 17:18:16 +0100
Subject: [PATCH 16/39] dcevm15 - mark_as_scavengable only alive methods
---
.../share/prims/jvmtiEnhancedRedefineClasses.cpp | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index 9f42d14ce98..db5fb1c472b 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -223,19 +223,21 @@ class FieldCopier : public FieldClosure {
// TODO: review...
void VM_EnhancedRedefineClasses::mark_as_scavengable(nmethod* nm) {
- ScavengableNMethods::register_nmethod(nm);
+ if (nm->is_alive()) {
+ ScavengableNMethods::register_nmethod(nm);
+ }
}
void VM_EnhancedRedefineClasses::unregister_nmethod_g1(nmethod* nm) {
// It should work not only for G1 but also for another GCs, but this way is safer now
- if (!nm->is_zombie() && !nm->is_unloaded()) {
+ if (nm->is_alive()) {
Universe::heap()->unregister_nmethod(nm);
}
}
void VM_EnhancedRedefineClasses::register_nmethod_g1(nmethod* nm) {
// It should work not only for G1 but also for another GCs, but this way is safer now
- if (!nm->is_zombie() && !nm->is_unloaded()) {
+ if (nm->is_alive()) {
Universe::heap()->register_nmethod(nm);
}
}
@@ -511,9 +513,9 @@ void VM_EnhancedRedefineClasses::doit() {
flush_dependent_code(thread);
// }
- // Adjust constantpool caches for all classes that reference methods of the evolved class.
- ClearCpoolCacheAndUnpatch clear_cpool_cache(thread);
- ClassLoaderDataGraph::classes_do(&clear_cpool_cache);
+ // Adjust constantpool caches for all classes that reference methods of the evolved class.
+ ClearCpoolCacheAndUnpatch clear_cpool_cache(thread);
+ ClassLoaderDataGraph::classes_do(&clear_cpool_cache);
// JSR-292 support
if (_any_class_has_resolved_methods) {
--
2.23.0

View File

@@ -0,0 +1,91 @@
From ed546016ead6064d8b95a9c1e4cdc6bc192f8d67 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sun, 29 Nov 2020 20:05:03 +0100
Subject: [PATCH 17/39] dcevm15 - fix hidded classes
---
.../prims/jvmtiEnhancedRedefineClasses.cpp | 41 ++++++++++++++-----
1 file changed, 30 insertions(+), 11 deletions(-)
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index db5fb1c472b..590f7fdfafe 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -722,7 +722,8 @@ bool VM_EnhancedRedefineClasses::is_modifiable_class(oop klass_mirror) {
}
// Cannot redefine or retransform an anonymous class.
- if (InstanceKlass::cast(k)->is_unsafe_anonymous()) {
+ // TODO: check if is correct in j15
+ if (InstanceKlass::cast(k)->is_unsafe_anonymous() || InstanceKlass::cast(k)->is_hidden()) {
return false;
}
return true;
@@ -808,21 +809,27 @@ jvmtiError VM_EnhancedRedefineClasses::load_new_class_versions(TRAPS) {
InstanceKlass* k;
- if (InstanceKlass::cast(the_class)->is_unsafe_anonymous()) {
- const InstanceKlass* host_class = the_class->unsafe_anonymous_host();
+ if (the_class->is_unsafe_anonymous() || the_class->is_hidden()) {
+ InstanceKlass* dynamic_host_class = NULL;
+ InstanceKlass* unsafe_anonymous_host = NULL;
- // Make sure it's the real host class, not another anonymous class.
- while (host_class != NULL && host_class->is_unsafe_anonymous()) {
- host_class = host_class->unsafe_anonymous_host();
+ if (the_class->is_hidden()) {
+ log_debug(redefine, class, load)("loading hidden class %s", the_class->name()->as_C_string());
+ dynamic_host_class = the_class->nest_host(THREAD);
+ }
+
+ if (the_class->is_unsafe_anonymous()) {
+ log_debug(redefine, class, load)("loading usafe anonymous %s", the_class->name()->as_C_string());
+ unsafe_anonymous_host = the_class->unsafe_anonymous_host();
}
ClassLoadInfo cl_info(protection_domain,
- host_class,
- NULL, // dynamic_nest_host
+ unsafe_anonymous_host,
NULL, // cp_patches
+ dynamic_host_class, // dynamic_nest_host
Handle(), // classData
- false, // is_hidden
- false, // is_strong_hidden
+ the_class->is_hidden(), // is_hidden
+ !the_class->is_non_strong_hidden(), // is_strong_hidden
true); // FIXME: check if correct. can_access_vm_annotations
k = SystemDictionary::parse_stream(the_class_sym,
@@ -833,7 +840,17 @@ jvmtiError VM_EnhancedRedefineClasses::load_new_class_versions(TRAPS) {
THREAD);
k->class_loader_data()->exchange_holders(the_class->class_loader_data());
- the_class->class_loader_data()->inc_keep_alive();
+
+ if (the_class->is_hidden()) {
+ // from jvm_lookup_define_class() (jvm.cpp):
+ // The hidden class loader data has been artificially been kept alive to
+ // this point. The mirror and any instances of this class have to keep
+ // it alive afterwards.
+ the_class->class_loader_data()->dec_keep_alive();
+ } else {
+ the_class->class_loader_data()->inc_keep_alive();
+ }
+
} else {
k = SystemDictionary::resolve_from_stream(the_class_sym,
the_class_loader,
@@ -1475,6 +1492,8 @@ void VM_EnhancedRedefineClasses::ClearCpoolCacheAndUnpatch::do_klass(Klass* k) {
ik->set_unsafe_anonymous_host(InstanceKlass::cast(ik->unsafe_anonymous_host()->newest_version()));
}
+ // FIXME: check new nest_host for hidden
+
// Update implementor if there is only one, in this case implementor() can reference old class
if (ik->is_interface()) {
Klass* implKlass = ik->implementor();
--
2.23.0

View File

@@ -0,0 +1,27 @@
From 9983c44fe6903daba758ed0c43b8c86e738e0741 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sun, 29 Nov 2020 20:08:57 +0100
Subject: [PATCH 18/39] dcevm15 - DON'T clear F2 in CP cache after indy
unevolving
It's not clear why it was cleared in dcevm7-11
---
src/hotspot/share/oops/cpCache.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/hotspot/share/oops/cpCache.cpp b/src/hotspot/share/oops/cpCache.cpp
index 167cb274661..7e72641ec5a 100644
--- a/src/hotspot/share/oops/cpCache.cpp
+++ b/src/hotspot/share/oops/cpCache.cpp
@@ -654,7 +654,7 @@ void ConstantPoolCacheEntry::clear_entry() {
if (clearData) {
if (!is_resolved_reference()) {
- _f2 = 0;
+ // _f2 = 0;
}
// FIXME: (DCEVM) we want to clear flags, but parameter size is actually used
// after we return from the method, before entry is re-initialized. So let's
--
2.23.0

View File

@@ -0,0 +1,66 @@
From 3b09df69c007285ea6c258388532a8e5f9fe3d45 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sun, 22 Nov 2020 12:03:32 +0100
Subject: [PATCH 19/39] Cleanup and review comments
---
src/hotspot/share/classfile/classLoaderDataGraph.hpp | 2 +-
src/hotspot/share/gc/shared/gcConfig.cpp | 2 +-
src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp | 1 +
src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp | 2 +-
4 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/hotspot/share/classfile/classLoaderDataGraph.hpp b/src/hotspot/share/classfile/classLoaderDataGraph.hpp
index 5f8913001b0..c3bcc7271e6 100644
--- a/src/hotspot/share/classfile/classLoaderDataGraph.hpp
+++ b/src/hotspot/share/classfile/classLoaderDataGraph.hpp
@@ -105,7 +105,7 @@ class ClassLoaderDataGraph : public AllStatic {
static void dictionary_classes_do(KlassClosure* klass_closure);
- // Enhanced class redefinition
+ // (DCEVM) Enhanced class redefinition
static void rollback_redefinition();
// VM_CounterDecay iteration support
diff --git a/src/hotspot/share/gc/shared/gcConfig.cpp b/src/hotspot/share/gc/shared/gcConfig.cpp
index 26a2b67b8e9..8e78696bef5 100644
--- a/src/hotspot/share/gc/shared/gcConfig.cpp
+++ b/src/hotspot/share/gc/shared/gcConfig.cpp
@@ -97,7 +97,7 @@ void GCConfig::fail_if_non_included_gc_is_selected() {
void GCConfig::select_gc_ergonomically() {
if (AllowEnhancedClassRedefinition && !UseG1GC) {
- // Enhanced class redefinition only supports serial GC at the moment
+ // (DCEVM) Enhanced class redefinition only supports serial GC at the moment
FLAG_SET_ERGO(UseSerialGC, true);
} else if (os::is_server_class_machine()) {
#if INCLUDE_G1GC
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index 590f7fdfafe..2a7dd35bdd1 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -842,6 +842,7 @@ jvmtiError VM_EnhancedRedefineClasses::load_new_class_versions(TRAPS) {
k->class_loader_data()->exchange_holders(the_class->class_loader_data());
if (the_class->is_hidden()) {
+ // TODO: (DCEVM) review if is correct
// from jvm_lookup_define_class() (jvm.cpp):
// The hidden class loader data has been artificially been kept alive to
// this point. The mirror and any instances of this class have to keep
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
index bd5e7d153be..5de375fb888 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
@@ -78,7 +78,7 @@ class VM_EnhancedRedefineClasses: public VM_GC_Operation {
// have any entries.
bool _any_class_has_resolved_methods;
- // Enhanced class redefinition, affected klasses contain all classes which should be redefined
+ // (DCEVM) Enhanced class redefinition, affected klasses contain all classes which should be redefined
// either because of redefine, class hierarchy or interface change
GrowableArray<Klass*>* _affected_klasses;
--
2.23.0

View File

@@ -0,0 +1,31 @@
From 5c41ecc9f48d22b81b3ac610e5655f1a74d25614 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Fri, 12 Feb 2021 10:11:10 +0100
Subject: [PATCH 20/39] Disable AllowEnhancedClassRedefinition in flight
recorder
---
src/hotspot/share/runtime/arguments.cpp | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp
index 567803b70b7..cbcd8f91c66 100644
--- a/src/hotspot/share/runtime/arguments.cpp
+++ b/src/hotspot/share/runtime/arguments.cpp
@@ -3994,6 +3994,13 @@ jint Arguments::parse(const JavaVMInitArgs* initial_cmd_args) {
// Set object alignment values.
set_object_alignment();
+ if (FlightRecorder) {
+ if (AllowEnhancedClassRedefinition) {
+ warning("EnhancedClassRedefinition was disabled, it is not allowed in FlightRecorder.");
+ AllowEnhancedClassRedefinition = false;
+ }
+ }
+
#if !INCLUDE_CDS
if (DumpSharedSpaces || RequireSharedSpaces) {
jio_fprintf(defaultStream::error_stream(),
--
2.23.0

View File

@@ -0,0 +1,695 @@
From e560b33cdec3ef0e4ce91714663d3befa87ff4e5 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Fri, 12 Feb 2021 09:44:28 +0100
Subject: [PATCH 21/39] dcevm17 - fix compilation issues
---
.../share/classfile/classLoaderData.cpp | 2 +-
src/hotspot/share/classfile/javaClasses.cpp | 4 +-
src/hotspot/share/classfile/javaClasses.hpp | 4 +-
.../share/classfile/lambdaFormInvokers.cpp | 152 ++++++++++++++++++
.../share/classfile/systemDictionary.cpp | 5 +-
.../share/classfile/systemDictionary.hpp | 6 +
src/hotspot/share/classfile/vmClassMacros.hpp | 2 +
.../share/gc/g1/g1FullGCCompactTask.cpp | 9 +-
.../share/gc/g1/g1FullGCCompactionPoint.cpp | 12 +-
src/hotspot/share/gc/shared/dcevmSharedGC.cpp | 2 +-
src/hotspot/share/gc/shared/space.inline.hpp | 2 +-
src/hotspot/share/memory/universe.cpp | 71 --------
src/hotspot/share/memory/universe.hpp | 7 -
src/hotspot/share/oops/instanceKlass.cpp | 4 +-
.../prims/jvmtiEnhancedRedefineClasses.cpp | 47 ++++--
.../prims/jvmtiEnhancedRedefineClasses.hpp | 2 +
.../share/prims/resolvedMethodTable.cpp | 5 +-
src/hotspot/share/runtime/arguments.hpp | 2 +
18 files changed, 221 insertions(+), 117 deletions(-)
create mode 100644 src/hotspot/share/classfile/lambdaFormInvokers.cpp
diff --git a/src/hotspot/share/classfile/classLoaderData.cpp b/src/hotspot/share/classfile/classLoaderData.cpp
index 2a826ff50a7..65ce4c4af8c 100644
--- a/src/hotspot/share/classfile/classLoaderData.cpp
+++ b/src/hotspot/share/classfile/classLoaderData.cpp
@@ -603,7 +603,7 @@ void ClassLoaderData::exchange_holders(ClassLoaderData* cld) {
oop holder_oop = _holder.peek();
_holder.replace(cld->_holder.peek());
cld->_holder.replace(holder_oop);
- WeakHandle<vm_weak_data> exchange = _holder;
+ WeakHandle exchange = _holder;
_holder = cld->_holder;
cld->_holder = exchange;
}
diff --git a/src/hotspot/share/classfile/javaClasses.cpp b/src/hotspot/share/classfile/javaClasses.cpp
index dc800debea4..66ff72b2f02 100644
--- a/src/hotspot/share/classfile/javaClasses.cpp
+++ b/src/hotspot/share/classfile/javaClasses.cpp
@@ -3827,7 +3827,7 @@ void java_lang_invoke_DirectMethodHandle_StaticAccessor::set_static_offset(oop d
macro(_static_offset_offset, k, vmSymbols::static_offset_name(), long_signature, false)
void java_lang_invoke_DirectMethodHandle_StaticAccessor::compute_offsets() {
- InstanceKlass* k = SystemDictionary::DirectMethodHandle_StaticAccessor_klass();
+ InstanceKlass* k = vmClasses::DirectMethodHandle_StaticAccessor_klass();
DIRECTMETHODHANDLE_STATIC_ACCESSOR_FIELDS_DO(FIELD_COMPUTE_OFFSET);
}
@@ -3855,7 +3855,7 @@ void java_lang_invoke_DirectMethodHandle_Accessor::set_field_offset(oop dmh, int
macro(_field_offset_offset, k, vmSymbols::field_offset_name(), int_signature, false)
void java_lang_invoke_DirectMethodHandle_Accessor::compute_offsets() {
- InstanceKlass* k = SystemDictionary::DirectMethodHandle_Accessor_klass();
+ InstanceKlass* k = vmClasses::DirectMethodHandle_Accessor_klass();
DIRECTMETHODHANDLE_ACCESSOR_FIELDS_DO(FIELD_COMPUTE_OFFSET);
}
diff --git a/src/hotspot/share/classfile/javaClasses.hpp b/src/hotspot/share/classfile/javaClasses.hpp
index 32348c90ef9..f7dc5ccbd8c 100644
--- a/src/hotspot/share/classfile/javaClasses.hpp
+++ b/src/hotspot/share/classfile/javaClasses.hpp
@@ -1029,7 +1029,7 @@ class java_lang_invoke_DirectMethodHandle_StaticAccessor: AllStatic {
// Testers
static bool is_subclass(Klass* klass) {
- return klass->is_subclass_of(SystemDictionary::DirectMethodHandle_StaticAccessor_klass());
+ return klass->is_subclass_of(vmClasses::DirectMethodHandle_StaticAccessor_klass());
}
static bool is_instance(oop obj);
@@ -1053,7 +1053,7 @@ class java_lang_invoke_DirectMethodHandle_Accessor: AllStatic {
// Testers
static bool is_subclass(Klass* klass) {
- return klass->is_subclass_of(SystemDictionary::DirectMethodHandle_Accessor_klass());
+ return klass->is_subclass_of(vmClasses::DirectMethodHandle_Accessor_klass());
}
static bool is_instance(oop obj);
diff --git a/src/hotspot/share/classfile/lambdaFormInvokers.cpp b/src/hotspot/share/classfile/lambdaFormInvokers.cpp
new file mode 100644
index 00000000000..281de58b482
--- /dev/null
+++ b/src/hotspot/share/classfile/lambdaFormInvokers.cpp
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2020, 2021, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "classfile/classLoadInfo.hpp"
+#include "classfile/classFileStream.hpp"
+#include "classfile/javaClasses.inline.hpp"
+#include "classfile/klassFactory.hpp"
+#include "classfile/lambdaFormInvokers.hpp"
+#include "classfile/symbolTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "classfile/systemDictionaryShared.hpp"
+#include "classfile/vmClasses.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "logging/log.hpp"
+#include "memory/oopFactory.hpp"
+#include "memory/metaspaceShared.hpp"
+#include "memory/resourceArea.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/klass.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "oops/objArrayOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/typeArrayOop.inline.hpp"
+#include "runtime/handles.inline.hpp"
+#include "runtime/javaCalls.hpp"
+
+GrowableArray<char*>* LambdaFormInvokers::_lambdaform_lines = NULL;
+
+void LambdaFormInvokers::append(char* line) {
+ if (_lambdaform_lines == NULL) {
+ _lambdaform_lines = new GrowableArray<char*>(100);
+ }
+ _lambdaform_lines->append(line);
+}
+
+void LambdaFormInvokers::regenerate_holder_classes(TRAPS) {
+ assert(_lambdaform_lines != NULL, "Bad List");
+ ResourceMark rm(THREAD);
+
+ Symbol* cds_name = vmSymbols::jdk_internal_misc_CDS();
+ Klass* cds_klass = SystemDictionary::resolve_or_null(cds_name, THREAD);
+ guarantee(cds_klass != NULL, "jdk/internal/misc/CDS must exist!");
+
+ int len = _lambdaform_lines->length();
+ objArrayHandle list_lines = oopFactory::new_objArray_handle(vmClasses::String_klass(), len, CHECK);
+ for (int i = 0; i < len; i++) {
+ Handle h_line = java_lang_String::create_from_str(_lambdaform_lines->at(i), CHECK);
+ list_lines->obj_at_put(i, h_line());
+ }
+
+ //
+ // Object[] CDS.generateLambdaFormHolderClasses(String[] lines)
+ // the returned Object[] layout:
+ // name, byte[], name, byte[] ....
+ Symbol* method = vmSymbols::generateLambdaFormHolderClasses();
+ Symbol* signrs = vmSymbols::generateLambdaFormHolderClasses_signature();
+
+ JavaValue result(T_OBJECT);
+ JavaCalls::call_static(&result, cds_klass, method, signrs, list_lines, THREAD);
+
+ if (HAS_PENDING_EXCEPTION) {
+ log_info(cds)("%s: %s", THREAD->pending_exception()->klass()->external_name(),
+ java_lang_String::as_utf8_string(java_lang_Throwable::message(THREAD->pending_exception())));
+ CLEAR_PENDING_EXCEPTION;
+ return;
+ }
+
+ objArrayHandle h_array(THREAD, (objArrayOop)result.get_oop());
+ int sz = h_array->length();
+ assert(sz % 2 == 0 && sz >= 2, "Must be even size of length");
+ for (int i = 0; i < sz; i+= 2) {
+ Handle h_name(THREAD, h_array->obj_at(i));
+ typeArrayHandle h_bytes(THREAD, (typeArrayOop)h_array->obj_at(i+1));
+ assert(h_name != NULL, "Class name is NULL");
+ assert(h_bytes != NULL, "Class bytes is NULL");
+
+ char *class_name = java_lang_String::as_utf8_string(h_name());
+ int len = h_bytes->length();
+ // make a copy of class bytes so GC will not affect us.
+ char *buf = resource_allocate_bytes(THREAD, len);
+ memcpy(buf, (char*)h_bytes->byte_at_addr(0), len);
+ ClassFileStream st((u1*)buf, len, NULL, ClassFileStream::verify);
+
+ reload_class(class_name, st, THREAD);
+ // free buf
+ resource_free_bytes(buf, len);
+
+ if (HAS_PENDING_EXCEPTION) {
+ log_info(cds)("Exception happened: %s", PENDING_EXCEPTION->klass()->name()->as_C_string());
+ log_info(cds)("Could not create InstanceKlass for class %s", class_name);
+ CLEAR_PENDING_EXCEPTION;
+ return;
+ }
+ }
+}
+
+// class_handle - the class name, bytes_handle - the class bytes
+void LambdaFormInvokers::reload_class(char* name, ClassFileStream& st, TRAPS) {
+ Symbol* class_name = SymbolTable::new_symbol((const char*)name);
+ // the class must exist
+ Klass* klass = SystemDictionary::resolve_or_null(class_name, THREAD);
+ if (klass == NULL) {
+ log_info(cds)("Class %s not present, skip", name);
+ return;
+ }
+ assert(klass->is_instance_klass(), "Should be");
+
+ ClassLoaderData* cld = ClassLoaderData::the_null_class_loader_data();
+ Handle protection_domain;
+ ClassLoadInfo cl_info(protection_domain);
+
+ InstanceKlass* result = KlassFactory::create_from_stream(&st,
+ class_name,
+ cld,
+ cl_info,
+ false,
+ CHECK);
+
+ {
+ MutexLocker mu_r(THREAD, Compile_lock); // add_to_hierarchy asserts this.
+ SystemDictionary::add_to_hierarchy(result);
+ }
+ // new class not linked yet.
+ MetaspaceShared::try_link_class(THREAD, result);
+ assert(!HAS_PENDING_EXCEPTION, "Invariant");
+
+ // exclude the existing class from dump
+ SystemDictionaryShared::set_excluded(InstanceKlass::cast(klass));
+ log_info(cds, lambda)("Replaced class %s, old: %p new: %p", name, klass, result);
+}
diff --git a/src/hotspot/share/classfile/systemDictionary.cpp b/src/hotspot/share/classfile/systemDictionary.cpp
index 98e2541c79b..63de2e2f099 100644
--- a/src/hotspot/share/classfile/systemDictionary.cpp
+++ b/src/hotspot/share/classfile/systemDictionary.cpp
@@ -963,11 +963,12 @@ InstanceKlass* SystemDictionary::resolve_from_stream(ClassFileStream* st,
Symbol* class_name,
Handle class_loader,
const ClassLoadInfo& cl_info,
+ InstanceKlass* old_klass,
TRAPS) {
if (cl_info.is_hidden()) {
- return resolve_hidden_class_from_stream(st, class_name, class_loader, cl_info, CHECK_NULL);
+ return resolve_hidden_class_from_stream(st, class_name, class_loader, cl_info, old_klass, CHECK_NULL);
} else {
- return resolve_class_from_stream(st, class_name, class_loader, cl_info, CHECK_NULL);
+ return resolve_class_from_stream(st, class_name, class_loader, cl_info, old_klass, CHECK_NULL);
}
}
diff --git a/src/hotspot/share/classfile/systemDictionary.hpp b/src/hotspot/share/classfile/systemDictionary.hpp
index 0c774dfeb51..65185a29b10 100644
--- a/src/hotspot/share/classfile/systemDictionary.hpp
+++ b/src/hotspot/share/classfile/systemDictionary.hpp
@@ -124,6 +124,7 @@ class SystemDictionary : AllStatic {
Symbol* class_name,
Handle class_loader,
const ClassLoadInfo& cl_info,
+ InstanceKlass* old_klass,
TRAPS);
// Resolve a class from stream (called by jni_DefineClass and JVM_DefineClass)
@@ -132,6 +133,7 @@ class SystemDictionary : AllStatic {
Symbol* class_name,
Handle class_loader,
const ClassLoadInfo& cl_info,
+ InstanceKlass* old_klass,
TRAPS);
public:
@@ -203,6 +205,10 @@ class SystemDictionary : AllStatic {
// Initialization
static void initialize(TRAPS);
+ // (DCEVM) Enhanced class redefinition
+ static void remove_from_hierarchy(InstanceKlass* k);
+ static void update_constraints_after_redefinition();
+
protected:
// Returns the class loader data to be used when looking up/updating the
// system dictionary.
diff --git a/src/hotspot/share/classfile/vmClassMacros.hpp b/src/hotspot/share/classfile/vmClassMacros.hpp
index a4f55641b51..fb205721a39 100644
--- a/src/hotspot/share/classfile/vmClassMacros.hpp
+++ b/src/hotspot/share/classfile/vmClassMacros.hpp
@@ -109,6 +109,8 @@
\
/* support for dynamic typing; it's OK if these are NULL in earlier JDKs */ \
do_klass(DirectMethodHandle_klass, java_lang_invoke_DirectMethodHandle ) \
+ do_klass(DirectMethodHandle_StaticAccessor_klass, java_lang_invoke_DirectMethodHandle_StaticAccessor ) \
+ do_klass(DirectMethodHandle_Accessor_klass, java_lang_invoke_DirectMethodHandle_Accessor ) \
do_klass(MethodHandle_klass, java_lang_invoke_MethodHandle ) \
do_klass(VarHandle_klass, java_lang_invoke_VarHandle ) \
do_klass(MemberName_klass, java_lang_invoke_MemberName ) \
diff --git a/src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp b/src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp
index 54edc9dffb5..058dea90828 100644
--- a/src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp
+++ b/src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp
@@ -141,7 +141,10 @@ void G1FullGCCompactTask::compact_region_dcevm(HeapRegion* hr, GrowableArray<Hea
// Once all objects have been moved the liveness information
// needs be cleared.
collector()->mark_bitmap()->clear_region(hr);
- hr->complete_compaction();
+ if (G1VerifyBitmaps) {
+ collector()->mark_bitmap()->clear_region(hr);
+ }
+ hr->reset_compacted_after_full_gc();
}
void G1FullGCCompactTask::serial_compaction_dcevm() {
@@ -184,13 +187,13 @@ size_t G1FullGCCompactTask::G1CompactRegionClosureDcevm::apply(oop obj) {
} else {
DcevmSharedGC::update_fields(obj, oop(destination));
}
- oop(destination)->init_mark_raw();
+ oop(destination)->init_mark();
assert(oop(destination)->klass() != NULL, "should have a class");
return size;
}
Copy::aligned_conjoint_words(obj_addr, destination, size);
- oop(destination)->init_mark_raw();
+ oop(destination)->init_mark();
assert(oop(destination)->klass() != NULL, "should have a class");
return size;
diff --git a/src/hotspot/share/gc/g1/g1FullGCCompactionPoint.cpp b/src/hotspot/share/gc/g1/g1FullGCCompactionPoint.cpp
index 71a46b88f9e..87b1977128a 100644
--- a/src/hotspot/share/gc/g1/g1FullGCCompactionPoint.cpp
+++ b/src/hotspot/share/gc/g1/g1FullGCCompactionPoint.cpp
@@ -36,8 +36,8 @@ G1FullGCCompactionPoint::G1FullGCCompactionPoint() :
{
_compaction_regions = new (ResourceObj::C_HEAP, mtGC) GrowableArray<HeapRegion*>(32, mtGC);
_compaction_region_iterator = _compaction_regions->begin();
- _rescued_oops = new (ResourceObj::C_HEAP, mtGC) GrowableArray<HeapWord*>(128, true, mtGC);
- _rescued_oops_values = new (ResourceObj::C_HEAP, mtGC) GrowableArray<HeapWord*>(128, true, mtGC);
+ _rescued_oops = new (ResourceObj::C_HEAP, mtGC) GrowableArray<HeapWord*>(128, mtGC);
+ _rescued_oops_values = new (ResourceObj::C_HEAP, mtGC) GrowableArray<HeapWord*>(128, mtGC);
}
G1FullGCCompactionPoint::~G1FullGCCompactionPoint() {
@@ -180,15 +180,15 @@ void G1FullGCCompactionPoint::forward_dcevm(oop object, size_t size, bool force_
// with BiasedLocking, in this case forwardee() will return NULL
// even if the mark-word is used. This is no problem since
// forwardee() will return NULL in the compaction phase as well.
- object->init_mark_raw();
+ object->init_mark();
} else {
// Make sure object has the correct mark-word set or that it will be
// fixed when restoring the preserved marks.
- assert(object->mark_raw() == markWord::prototype_for_klass(object->klass()) || // Correct mark
+ assert(object->mark() == markWord::prototype_for_klass(object->klass()) || // Correct mark
object->mark_must_be_preserved() || // Will be restored by PreservedMarksSet
- (UseBiasedLocking && object->has_bias_pattern_raw()), // Will be restored by BiasedLocking
+ (UseBiasedLocking && object->has_bias_pattern()), // Will be restored by BiasedLocking
"should have correct prototype obj: " PTR_FORMAT " mark: " PTR_FORMAT " prototype: " PTR_FORMAT,
- p2i(object), object->mark_raw().value(), markWord::prototype_for_klass(object->klass()).value());
+ p2i(object), object->mark().value(), markWord::prototype_for_klass(object->klass()).value());
}
assert(object->forwardee() == NULL, "should be forwarded to NULL");
}
diff --git a/src/hotspot/share/gc/shared/dcevmSharedGC.cpp b/src/hotspot/share/gc/shared/dcevmSharedGC.cpp
index 3dee097f1d3..edc19a3077d 100644
--- a/src/hotspot/share/gc/shared/dcevmSharedGC.cpp
+++ b/src/hotspot/share/gc/shared/dcevmSharedGC.cpp
@@ -64,7 +64,7 @@ void DcevmSharedGC::copy_rescued_objects_back(GrowableArray<HeapWord*>* rescued_
Copy::aligned_disjoint_words(cast_from_oop<HeapWord*>(rescued_obj), cast_from_oop<HeapWord*>(new_obj), size);
}
- new_obj->init_mark_raw();
+ new_obj->init_mark();
assert(oopDesc::is_oop(new_obj), "must be a valid oop");
}
}
diff --git a/src/hotspot/share/gc/shared/space.inline.hpp b/src/hotspot/share/gc/shared/space.inline.hpp
index e3a37280268..cafa2503ef4 100644
--- a/src/hotspot/share/gc/shared/space.inline.hpp
+++ b/src/hotspot/share/gc/shared/space.inline.hpp
@@ -371,7 +371,7 @@ inline void CompactibleSpace::scan_and_compact(SpaceType* space, bool redefiniti
} else {
DcevmSharedGC::update_fields(oop(cur_obj), oop(compaction_top));
}
- oop(compaction_top)->init_mark_raw();
+ oop(compaction_top)->init_mark();
assert(oop(compaction_top)->klass() != NULL, "should have a class");
debug_only(prev_obj = cur_obj);
diff --git a/src/hotspot/share/memory/universe.cpp b/src/hotspot/share/memory/universe.cpp
index 247f2b3e8c0..4ae3b382b67 100644
--- a/src/hotspot/share/memory/universe.cpp
+++ b/src/hotspot/share/memory/universe.cpp
@@ -44,8 +44,6 @@
#include "gc/shared/oopStorageSet.hpp"
#include "gc/shared/stringdedup/stringDedup.hpp"
#include "gc/shared/tlab_globals.hpp"
-#include "gc/shared/weakProcessor.hpp"
-#include "interpreter/interpreter.hpp"
#include "logging/log.hpp"
#include "logging/logStream.hpp"
#include "memory/metadataFactory.hpp"
@@ -73,8 +71,6 @@
#include "runtime/jniHandles.hpp"
#include "runtime/thread.inline.hpp"
#include "runtime/timerTrace.hpp"
-#include "runtime/vmOperations.hpp"
-#include "services/management.hpp"
#include "services/memoryService.hpp"
#include "utilities/align.hpp"
#include "utilities/autoRestore.hpp"
@@ -208,73 +204,6 @@ void Universe::basic_type_classes_do(KlassClosure *closure) {
}
}
-#define DO_PRIMITIVE_MIRROR(m) \
- f->do_oop((oop*) &m);
-
-// FIXME: (DCEVM) This method should iterate all pointers that are not within heap objects.
-void Universe::root_oops_do(OopClosure *oopClosure) {
- Universe::oops_do(oopClosure);
-// ReferenceProcessor::oops_do(oopClosure); (tw) check why no longer there
- JNIHandles::oops_do(oopClosure); // Global (strong) JNI handles
- Threads::oops_do(oopClosure, NULL);
- ObjectSynchronizer::oops_do(oopClosure);
- // (DCEVM) TODO: Check if this is correct?
- Management::oops_do(oopClosure);
- OopStorageSet::vm_global()->oops_do(oopClosure);
- // CLDToOopClosure cld_closure(oopClosure, ClassLoaderData::_claim_none);
- // ClassLoaderDataGraph::cld_do(&cld_closure);
-
- // Now adjust pointers in remaining weak roots. (All of which should
- // have been cleared if they pointed to non-surviving objects.)
- // Global (weak) JNI handles
- WeakProcessor::oops_do(oopClosure);
-
- JvmtiExport::oops_do(oopClosure);
-
- CodeBlobToOopClosure blobClosure(oopClosure, CodeBlobToOopClosure::FixRelocations);
- CodeCache::blobs_do(&blobClosure);
-
- AOT_ONLY(AOTLoader::oops_do(oopClosure);)
-
- // StringTable::oops_do was removed in j15
- // StringTable::oops_do(oopClosure);
-
- // OopStorageSet::vm_global()->oops_do(oopClosure);
-
-}
-
-void Universe::oops_do(OopClosure* f) {
- PRIMITIVE_MIRRORS_DO(DO_PRIMITIVE_MIRROR);
-
- for (int i = T_BOOLEAN; i < T_VOID+1; i++) {
- f->do_oop((oop*) &_mirrors[i]);
- }
- assert(_mirrors[0] == NULL && _mirrors[T_BOOLEAN - 1] == NULL, "checking");
-
- f->do_oop((oop*)&_the_empty_class_array);
- f->do_oop((oop*)&_the_null_sentinel);
- f->do_oop((oop*)&_the_null_string);
- f->do_oop((oop*)&_the_min_jint_string);
- f->do_oop((oop*)&out_of_memory_errors()->obj_at(_oom_java_heap));
- f->do_oop((oop*)&out_of_memory_errors()->obj_at(_oom_c_heap));
- f->do_oop((oop*)&out_of_memory_errors()->obj_at(_oom_metaspace));
- f->do_oop((oop*)&out_of_memory_errors()->obj_at(_oom_class_metaspace));
- f->do_oop((oop*)&out_of_memory_errors()->obj_at(_oom_array_size));
- f->do_oop((oop*)&out_of_memory_errors()->obj_at(_oom_gc_overhead_limit));
- f->do_oop((oop*)&out_of_memory_errors()->obj_at(_oom_realloc_objects));
- f->do_oop((oop*)&out_of_memory_errors()->obj_at(_oom_retry));
- f->do_oop((oop*)&_delayed_stack_overflow_error_message);
- f->do_oop((oop*)&_preallocated_out_of_memory_error_array);
- f->do_oop((oop*)&_null_ptr_exception_instance);
- f->do_oop((oop*)&_arithmetic_exception_instance);
- f->do_oop((oop*)&_virtual_machine_error_instance);
- f->do_oop((oop*)&_main_thread_group);
- f->do_oop((oop*)&_system_thread_group);
- f->do_oop((oop*)&_reference_pending_list);
- debug_only(f->do_oop((oop*)&_fullgc_alot_dummy_array);)
- ThreadsSMRSupport::exiting_threads_oops_do(f);
-}
-
void LatestMethodCache::metaspace_pointers_do(MetaspaceClosure* it) {
it->push(&_klass);
}
diff --git a/src/hotspot/share/memory/universe.hpp b/src/hotspot/share/memory/universe.hpp
index cb320076a55..4b2211c415e 100644
--- a/src/hotspot/share/memory/universe.hpp
+++ b/src/hotspot/share/memory/universe.hpp
@@ -326,13 +326,6 @@ class Universe: AllStatic {
static bool should_fill_in_stack_trace(Handle throwable);
static void check_alignment(uintx size, uintx alignment, const char* name);
- // Iteration
-
- static void root_oops_do(OopClosure *oopClosure); // FIXME: kill...
- // Apply "f" to the addresses of all the direct heap pointers maintained
- // as static fields of "Universe".
- static void oops_do(OopClosure* f);
-
// CDS support
static void serialize(SerializeClosure* f);
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
index b4d09e92830..c2de2bec7d4 100644
--- a/src/hotspot/share/oops/instanceKlass.cpp
+++ b/src/hotspot/share/oops/instanceKlass.cpp
@@ -1286,7 +1286,7 @@ void InstanceKlass::init_implementor() {
// (DCEVM) - init_implementor() for dcevm
void InstanceKlass::init_implementor_from_redefine() {
assert(is_interface(), "not interface");
- Klass* volatile* addr = adr_implementor();
+ InstanceKlass* volatile* addr = adr_implementor();
assert(addr != NULL, "null addr");
if (addr != NULL) {
*addr = NULL;
@@ -3816,7 +3816,7 @@ void InstanceKlass::verify_on(outputStream* st) {
guarantee(sib->is_klass(), "should be klass");
// TODO: (DCEVM) explain
- guarantee(sib->super() == super || AllowEnhancedClassRedefinition && super->newest_version() == SystemDictionary::Object_klass(), "siblings should have same superklass");
+ guarantee(sib->super() == super || AllowEnhancedClassRedefinition && super->newest_version() == vmClasses::Object_klass(), "siblings should have same superklass");
}
// Verify local interfaces
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index 2a7dd35bdd1..071dbc6d6ad 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -26,8 +26,10 @@
#include "aot/aotLoader.hpp"
#include "classfile/classFileParser.hpp"
#include "classfile/classFileStream.hpp"
+#include "classfile/classLoadInfo.hpp"
#include "classfile/metadataOnStackMark.hpp"
#include "classfile/systemDictionary.hpp"
+#include "classfile/symbolTable.hpp"
#include "classfile/verifier.hpp"
#include "classfile/dictionary.hpp"
#include "classfile/classLoaderDataGraph.hpp"
@@ -198,8 +200,8 @@ class FieldCopier : public FieldClosure {
if (found && result.is_static()) {
log_trace(redefine, class, obsolete, metadata)("Copying static field value for field %s old_offset=%d new_offset=%d",
fd->name()->as_C_string(), result.offset(), fd->offset());
- memcpy(cur_oop->obj_field_addr_raw<HeapWord>(fd->offset()),
- old_oop->obj_field_addr_raw<HeapWord>(result.offset()),
+ memcpy(cur_oop->obj_field_addr<HeapWord>(fd->offset()),
+ old_oop->obj_field_addr<HeapWord>(result.offset()),
type2aelembytes(fd->field_type()));
// Static fields may have references to java.lang.Class
@@ -242,6 +244,17 @@ void VM_EnhancedRedefineClasses::register_nmethod_g1(nmethod* nm) {
}
}
+void VM_EnhancedRedefineClasses::root_oops_do(OopClosure *oopClosure) {
+ Universe::vm_global()->oops_do(oopClosure);
+
+ Threads::oops_do(oopClosure, NULL);
+ AOT_ONLY(AOTLoader::oops_do(oopClosure);)
+ OopStorageSet::strong_oops_do(oopClosure);
+
+ CodeBlobToOopClosure blobClosure(oopClosure, CodeBlobToOopClosure::FixRelocations);
+ CodeCache::blobs_do(&blobClosure);
+}
+
// TODO comment
struct StoreBarrier {
// TODO: j10 review change ::oop_store -> HeapAccess<>::oop_store
@@ -558,7 +571,7 @@ void VM_EnhancedRedefineClasses::doit() {
_timer_heap_iterate.stop();
}
- Universe::root_oops_do(&oopClosureNoBarrier);
+ root_oops_do(&oopClosureNoBarrier);
if (UseG1GC) {
// this should work also for other GCs
@@ -737,8 +750,8 @@ bool VM_EnhancedRedefineClasses::is_modifiable_class(oop klass_mirror) {
// - link new classes
jvmtiError VM_EnhancedRedefineClasses::load_new_class_versions(TRAPS) {
- _affected_klasses = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<Klass*>(_class_count, true);
- _new_classes = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<InstanceKlass*>(_class_count, true);
+ _affected_klasses = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<Klass*>(_class_count);
+ _new_classes = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<InstanceKlass*>(_class_count);
ResourceMark rm(THREAD);
@@ -832,12 +845,12 @@ jvmtiError VM_EnhancedRedefineClasses::load_new_class_versions(TRAPS) {
!the_class->is_non_strong_hidden(), // is_strong_hidden
true); // FIXME: check if correct. can_access_vm_annotations
- k = SystemDictionary::parse_stream(the_class_sym,
- the_class_loader,
- &st,
- cl_info,
- the_class,
- THREAD);
+ k = SystemDictionary::resolve_from_stream(&st,
+ the_class_sym,
+ the_class_loader,
+ cl_info,
+ the_class,
+ THREAD);
k->class_loader_data()->exchange_holders(the_class->class_loader_data());
@@ -853,12 +866,12 @@ jvmtiError VM_EnhancedRedefineClasses::load_new_class_versions(TRAPS) {
}
} else {
- k = SystemDictionary::resolve_from_stream(the_class_sym,
- the_class_loader,
- protection_domain,
- &st,
- the_class,
- THREAD);
+ k = SystemDictionary::resolve_from_stream(&st,
+ the_class_sym,
+ the_class_loader,
+ protection_domain,
+ the_class,
+ THREAD);
}
// Clear class_being_redefined just to be sure.
state->clear_class_being_redefined();
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
index 5de375fb888..9be70039e32 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
@@ -124,6 +124,8 @@ class VM_EnhancedRedefineClasses: public VM_GC_Operation {
static void register_nmethod_g1(nmethod* nm);
static void unpatch_bytecode(Method* method, TRAPS);
+ void root_oops_do(OopClosure *oopClosure);
+
// Figure out which new methods match old methods in name and signature,
// which methods have been added, and which are no longer present
void compute_added_deleted_matching_methods();
diff --git a/src/hotspot/share/prims/resolvedMethodTable.cpp b/src/hotspot/share/prims/resolvedMethodTable.cpp
index 3c29eda4da0..a1eadc2958a 100644
--- a/src/hotspot/share/prims/resolvedMethodTable.cpp
+++ b/src/hotspot/share/prims/resolvedMethodTable.cpp
@@ -34,6 +34,7 @@
#include "oops/access.inline.hpp"
#include "oops/method.hpp"
#include "oops/oop.inline.hpp"
+#include "oops/klass.inline.hpp"
#include "oops/weakHandle.inline.hpp"
#include "prims/resolvedMethodTable.hpp"
#include "runtime/atomic.hpp"
@@ -375,7 +376,7 @@ class AdjustMethodEntriesDcevm : public StackObj {
GrowableArray<oop>* _oops_to_add;
public:
AdjustMethodEntriesDcevm(GrowableArray<oop>* oops_to_add, bool* trace_name_printed) : _trace_name_printed(trace_name_printed), _oops_to_add(oops_to_add) {};
- bool operator()(WeakHandle<vm_resolved_method_table_data>* entry) {
+ bool operator()(WeakHandle* entry) {
oop mem_name = entry->peek();
if (mem_name == NULL) {
// Removed
@@ -460,7 +461,7 @@ void ResolvedMethodTable::adjust_method_entries_dcevm(bool * trace_name_printed)
if (_local_table->get(thread, lookup, rmg)) {
break;
}
- WeakHandle<vm_resolved_method_table_data> wh = WeakHandle<vm_resolved_method_table_data>::create(Handle(thread, mem_name));
+ WeakHandle wh(_oop_storage, mem_name);
// The hash table takes ownership of the WeakHandle, even if it's not inserted.
if (_local_table->insert(thread, lookup, wh)) {
log_insert(method);
diff --git a/src/hotspot/share/runtime/arguments.hpp b/src/hotspot/share/runtime/arguments.hpp
index 1b7f8fe9f47..6a8ceb7fa8a 100644
--- a/src/hotspot/share/runtime/arguments.hpp
+++ b/src/hotspot/share/runtime/arguments.hpp
@@ -482,6 +482,8 @@ class Arguments : AllStatic {
// Adjusts the arguments after the OS have adjusted the arguments
static jint adjust_after_os();
+ // Check for consistency in the selection of the garbage collector.
+ static bool check_gc_consistency(); // Check user-selected gc
// Check consistency or otherwise of VM argument settings
static bool check_vm_args_consistency();
// Used by os_solaris
--
2.23.0

View File

@@ -0,0 +1,27 @@
From 6e18ad67981ab5a1bbdac46e1e0c7cc80beb4a5b Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Fri, 12 Feb 2021 11:38:48 +0100
Subject: [PATCH 22/39] Fix crash on GrowableArray allocation in C_HEAP
---
src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index 071dbc6d6ad..a5264077bfe 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -750,8 +750,8 @@ bool VM_EnhancedRedefineClasses::is_modifiable_class(oop klass_mirror) {
// - link new classes
jvmtiError VM_EnhancedRedefineClasses::load_new_class_versions(TRAPS) {
- _affected_klasses = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<Klass*>(_class_count);
- _new_classes = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<InstanceKlass*>(_class_count);
+ _affected_klasses = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<Klass*>(_class_count, mtInternal);
+ _new_classes = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<InstanceKlass*>(_class_count, mtInternal);
ResourceMark rm(THREAD);
--
2.23.0

View File

@@ -0,0 +1,49 @@
From 96680710816d9cd6e9cd8d5ce6dcbe054a7e53bd Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Fri, 12 Feb 2021 11:39:05 +0100
Subject: [PATCH 23/39] Rename confusing method name old_if_redefined to
old_if_redefining
---
src/hotspot/share/classfile/dictionary.cpp | 4 ++--
src/hotspot/share/classfile/dictionary.hpp | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/hotspot/share/classfile/dictionary.cpp b/src/hotspot/share/classfile/dictionary.cpp
index 223b9e1e7a9..2b236a7724e 100644
--- a/src/hotspot/share/classfile/dictionary.cpp
+++ b/src/hotspot/share/classfile/dictionary.cpp
@@ -359,7 +359,7 @@ InstanceKlass* Dictionary::find(unsigned int hash, Symbol* name,
int index = hash_to_index(hash);
DictionaryEntry* entry = get_entry(index, hash, name);
if (entry != NULL && entry->is_valid_protection_domain(protection_domain)) {
- return old_if_redefined(entry->instance_klass());
+ return old_if_redefining(entry->instance_klass());
} else {
return NULL;
}
@@ -373,7 +373,7 @@ InstanceKlass* Dictionary::find_class(unsigned int hash,
assert (index == index_for(name), "incorrect index?");
DictionaryEntry* entry = get_entry(index, hash, name);
- return old_if_redefined((entry != NULL) ? entry->instance_klass() : NULL);
+ return old_if_redefining((entry != NULL) ? entry->instance_klass() : NULL);
}
void Dictionary::add_protection_domain(int index, unsigned int hash,
diff --git a/src/hotspot/share/classfile/dictionary.hpp b/src/hotspot/share/classfile/dictionary.hpp
index bdfef5c8663..e997cfdcabd 100644
--- a/src/hotspot/share/classfile/dictionary.hpp
+++ b/src/hotspot/share/classfile/dictionary.hpp
@@ -109,7 +109,7 @@ public:
Handle protection_domain);
// (DCEVM) return old class if redefining in AllowEnhancedClassRedefinition, otherwise return "k"
- static InstanceKlass* old_if_redefined(InstanceKlass* k) {
+ static InstanceKlass* old_if_redefining(InstanceKlass* k) {
return (k != NULL && k->is_redefining()) ? ((InstanceKlass* )k->old_version()) : k;
}
};
--
2.23.0

View File

@@ -0,0 +1,43 @@
From 5d10d789150dfa6f8366dceb7fce3251d725ab8a Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Fri, 12 Feb 2021 12:33:47 +0100
Subject: [PATCH 24/39] Check InstanceKlass::has_nestmate_access_to with active
classes
Dcevm can leave old host in nested class if nested class is not
redefined together with host class
---
src/hotspot/share/oops/instanceKlass.cpp | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
index c2de2bec7d4..3cc96f98f41 100644
--- a/src/hotspot/share/oops/instanceKlass.cpp
+++ b/src/hotspot/share/oops/instanceKlass.cpp
@@ -398,9 +398,9 @@ bool InstanceKlass::has_nestmate_access_to(InstanceKlass* k, TRAPS) {
return false;
}
+ // (DCEVM) cur_host can be old, decide accessibility based on active version
if (AllowEnhancedClassRedefinition) {
- // TODO: (DCEVM) check if it correct. It fix problems with lambdas (hidden)
- cur_host = InstanceKlass::cast(cur_host->newest_version());
+ cur_host = InstanceKlass::cast(cur_host->active_version());
}
Klass* k_nest_host = k->nest_host(CHECK_false);
@@ -408,6 +408,11 @@ bool InstanceKlass::has_nestmate_access_to(InstanceKlass* k, TRAPS) {
return false;
}
+ // (DCEVM) k_nest_host can be old, decide accessibility based on active version
+ if (AllowEnhancedClassRedefinition) {
+ k_nest_host = InstanceKlass::cast(k_nest_host->active_version());
+ }
+
bool access = (cur_host == k_nest_host);
ResourceMark rm(THREAD);
--
2.23.0

View File

@@ -0,0 +1,95 @@
From dac9d7a7d87de680a50be7c2857646323c4c8ffa Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sat, 13 Feb 2021 20:47:52 +0100
Subject: [PATCH 25/39] JBR-3111 Update class in all dictionaries where it was
already defined
This patch keeps compatibility with std redefinition, that does not
create a new Klass, but modifies it, then it is modified in all
dictionaries containing this class.
---
src/hotspot/share/classfile/classLoaderDataGraph.cpp | 9 +++++++++
src/hotspot/share/classfile/classLoaderDataGraph.hpp | 3 +++
src/hotspot/share/classfile/dictionary.cpp | 2 +-
src/hotspot/share/classfile/dictionary.hpp | 2 +-
src/hotspot/share/classfile/systemDictionary.cpp | 4 +++-
5 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/src/hotspot/share/classfile/classLoaderDataGraph.cpp b/src/hotspot/share/classfile/classLoaderDataGraph.cpp
index fda5d2eb1ba..67ade5709f6 100644
--- a/src/hotspot/share/classfile/classLoaderDataGraph.cpp
+++ b/src/hotspot/share/classfile/classLoaderDataGraph.cpp
@@ -455,6 +455,15 @@ void ClassLoaderDataGraph::rollback_redefinition() {
}
}
+// (DCEVM) - iterate over all classes in all dictionaries
+bool ClassLoaderDataGraph::dictionary_classes_do_update_klass(Symbol* name, InstanceKlass* k, InstanceKlass* old_klass) {
+ bool ok = false;
+ FOR_ALL_DICTIONARY(cld) {
+ ok = cld->dictionary()->update_klass(name, k, old_klass) || ok;
+ }
+ return ok;
+}
+
void ClassLoaderDataGraph::verify_dictionary() {
FOR_ALL_DICTIONARY(cld) {
cld->dictionary()->verify();
diff --git a/src/hotspot/share/classfile/classLoaderDataGraph.hpp b/src/hotspot/share/classfile/classLoaderDataGraph.hpp
index c3bcc7271e6..ebdb0bc2c8c 100644
--- a/src/hotspot/share/classfile/classLoaderDataGraph.hpp
+++ b/src/hotspot/share/classfile/classLoaderDataGraph.hpp
@@ -108,6 +108,9 @@ class ClassLoaderDataGraph : public AllStatic {
// (DCEVM) Enhanced class redefinition
static void rollback_redefinition();
+ // Enhanced class redefinition
+ static bool dictionary_classes_do_update_klass(Symbol* name, InstanceKlass* k, InstanceKlass* old_klass);
+
// VM_CounterDecay iteration support
static InstanceKlass* try_get_next_class();
static void adjust_saved_class(ClassLoaderData* cld);
diff --git a/src/hotspot/share/classfile/dictionary.cpp b/src/hotspot/share/classfile/dictionary.cpp
index 2b236a7724e..bb1d09fa7a2 100644
--- a/src/hotspot/share/classfile/dictionary.cpp
+++ b/src/hotspot/share/classfile/dictionary.cpp
@@ -322,7 +322,7 @@ DictionaryEntry* Dictionary::get_entry(int index, unsigned int hash,
}
// (DCEVM) replace old_class by new class in dictionary
-bool Dictionary::update_klass(unsigned int hash, Symbol* name, ClassLoaderData* loader_data, InstanceKlass* k, InstanceKlass* old_klass) {
+bool Dictionary::update_klass(Symbol* name, InstanceKlass* k, InstanceKlass* old_klass) {
// There are several entries for the same class in the dictionary: One extra entry for each parent classloader of the classloader of the class.
bool found = false;
for (int index = 0; index < table_size(); index++) {
diff --git a/src/hotspot/share/classfile/dictionary.hpp b/src/hotspot/share/classfile/dictionary.hpp
index e997cfdcabd..7f8d8e35fc3 100644
--- a/src/hotspot/share/classfile/dictionary.hpp
+++ b/src/hotspot/share/classfile/dictionary.hpp
@@ -83,7 +83,7 @@ public:
void verify();
// (DCEVM) Enhanced class redefinition
- bool update_klass(unsigned int hash, Symbol* name, ClassLoaderData* loader_data, InstanceKlass* k, InstanceKlass* old_klass);
+ bool update_klass(Symbol* name, InstanceKlass* k, InstanceKlass* old_klass);
void rollback_redefinition();
diff --git a/src/hotspot/share/classfile/systemDictionary.cpp b/src/hotspot/share/classfile/systemDictionary.cpp
index 63de2e2f099..35e2f376870 100644
--- a/src/hotspot/share/classfile/systemDictionary.cpp
+++ b/src/hotspot/share/classfile/systemDictionary.cpp
@@ -1441,7 +1441,9 @@ void SystemDictionary::define_instance_class(InstanceKlass* k, InstanceKlass* ol
unsigned int name_hash = dictionary->compute_hash(name_h);
if (is_redefining) {
- bool ok = dictionary->update_klass(name_hash, name_h, loader_data, k, old_klass);
+ // Update all dictionaries containing old_class to new_class
+ // outcome must be same as result of standard redefinition, that does not create a new Klass
+ bool ok = ClassLoaderDataGraph::dictionary_classes_do_update_klass(name_h, k, old_klass);
assert (ok, "must have found old class and updated!");
}
check_constraints(name_hash, k, class_loader, !is_redefining, CHECK);
--
2.23.0

View File

@@ -0,0 +1,29 @@
From f42115a3d488c93a2d163aebd030530f060dcef8 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sat, 20 Feb 2021 15:47:47 +0100
Subject: [PATCH 26/39] Add ClassLoaderDataGraph_lock to define new class in
enhanced redefiniton
ClassLoaderDataGraph locking for introduced in redefinition in
java.version>11
---
src/hotspot/share/classfile/systemDictionary.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/hotspot/share/classfile/systemDictionary.cpp b/src/hotspot/share/classfile/systemDictionary.cpp
index 35e2f376870..c628cb9da83 100644
--- a/src/hotspot/share/classfile/systemDictionary.cpp
+++ b/src/hotspot/share/classfile/systemDictionary.cpp
@@ -1443,7 +1443,9 @@ void SystemDictionary::define_instance_class(InstanceKlass* k, InstanceKlass* ol
if (is_redefining) {
// Update all dictionaries containing old_class to new_class
// outcome must be same as result of standard redefinition, that does not create a new Klass
+ ClassLoaderDataGraph_lock->lock();
bool ok = ClassLoaderDataGraph::dictionary_classes_do_update_klass(name_h, k, old_klass);
+ ClassLoaderDataGraph_lock->unlock();
assert (ok, "must have found old class and updated!");
}
check_constraints(name_hash, k, class_loader, !is_redefining, CHECK);
--
2.23.0

View File

@@ -0,0 +1,180 @@
From 30308e893e43425da166175f5f18f84abf2c6110 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Thu, 18 Jun 2020 18:40:11 +0200
Subject: [PATCH 27/39] JBR-3140 - support for modularized HotswapAgent
Add -XX:HotswapAgent=[disabled,fatjar.core]
---
src/hotspot/share/runtime/arguments.cpp | 77 +++++++++++++++++++
src/hotspot/share/runtime/arguments.hpp | 4 +
.../flags/jvmFlagConstraintsRuntime.cpp | 9 +++
.../flags/jvmFlagConstraintsRuntime.hpp | 3 +-
src/hotspot/share/runtime/globals.hpp | 11 ++-
5 files changed, 102 insertions(+), 2 deletions(-)
diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp
index cbcd8f91c66..4f9cfde9323 100644
--- a/src/hotspot/share/runtime/arguments.cpp
+++ b/src/hotspot/share/runtime/arguments.cpp
@@ -4001,6 +4001,8 @@ jint Arguments::parse(const JavaVMInitArgs* initial_cmd_args) {
}
}
+ setup_hotswap_agent();
+
#if !INCLUDE_CDS
if (DumpSharedSpaces || RequireSharedSpaces) {
jio_fprintf(defaultStream::error_stream(),
@@ -4357,3 +4359,78 @@ bool Arguments::copy_expand_pid(const char* src, size_t srclen,
*b = '\0';
return (p == src_end); // return false if not all of the source was copied
}
+
+void Arguments::setup_hotswap_agent() {
+
+ if (DumpSharedSpaces)
+ return;
+
+ if (HotswapAgent == NULL || strcmp(HotswapAgent, "disabled") == 0)
+ return;
+
+ // Force AllowEnhancedClassRedefinition if HA is enabled
+ AllowEnhancedClassRedefinition = true;
+
+ bool ha_fatjar = strcmp(HotswapAgent, "fatjar") == 0;
+ bool ha_core = strcmp(HotswapAgent, "core") == 0;
+
+ // Set HotswapAgent
+ if (ha_fatjar || ha_core) {
+
+ char ext_path_str[JVM_MAXPATHLEN];
+
+ os::jvm_path(ext_path_str, sizeof(ext_path_str));
+ for (int i = 0; i < 3; i++) {
+ char *end = strrchr(ext_path_str, *os::file_separator());
+ if (end != NULL) *end = '\0';
+ }
+ size_t ext_path_length = strlen(ext_path_str);
+ if (ext_path_length >= 3) {
+ if (strcmp(ext_path_str + ext_path_length - 3, "lib") != 0) {
+ if (ext_path_length < JVM_MAXPATHLEN - 4) {
+ jio_snprintf(ext_path_str + ext_path_length, sizeof(ext_path_str) - ext_path_length, "%slib", os::file_separator());
+ ext_path_length += 4;
+ }
+ }
+ }
+ if (ext_path_length < JVM_MAXPATHLEN - 10) {
+ if (ha_fatjar) {
+ jio_snprintf(ext_path_str + ext_path_length, sizeof(ext_path_str) - ext_path_length,
+ "%shotswap%shotswap-agent.jar", os::file_separator(), os::file_separator());
+ } else {
+ jio_snprintf(ext_path_str + ext_path_length, sizeof(ext_path_str) - ext_path_length,
+ "%shotswap%shotswap-agent-core.jar", os::file_separator(), os::file_separator());
+ }
+ int fd = ::open(ext_path_str, O_RDONLY);
+ if (fd >= 0) {
+ os::close(fd);
+ size_t length = strlen(ext_path_str) + 1;
+ char *options = NEW_C_HEAP_ARRAY(char, length, mtArguments);
+ jio_snprintf(options, length, "%s", ext_path_str);
+ add_init_agent("instrument", ext_path_str, false);
+ jio_fprintf(defaultStream::output_stream(), "Starting HotswapAgent '%s'\n", ext_path_str);
+ }
+ else
+ {
+ jio_fprintf(defaultStream::error_stream(), "HotswapAgent not found on path:'%s'!\n", ext_path_str);
+ }
+ }
+ }
+
+ // TODO: open it only for org.hotswap.agent module
+ // Use to access java.lang.reflect.Proxy/proxyCache
+ create_numbered_module_property("jdk.module.addopens", "java.base/java.lang=ALL-UNNAMED", addopens_count++);
+ // Class of field java.lang.reflect.Proxy/proxyCache
+ create_numbered_module_property("jdk.module.addopens", "java.base/jdk.internal.loader=ALL-UNNAMED", addopens_count++);
+ // Use to access java.io.Reader, java.io.InputStream, java.io.FileInputStream
+ create_numbered_module_property("jdk.module.addopens", "java.base/java.io=ALL-UNNAMED", addopens_count++);
+ // java.beans.Introspector access
+ create_numbered_module_property("jdk.module.addopens", "java.desktop/java.beans=ALL-UNNAMED", addopens_count++);
+ // java.beans.Introspector access
+ create_numbered_module_property("jdk.module.addopens", "java.desktop/com.sun.beans=ALL-UNNAMED", addopens_count++);
+ // com.sun.beans.introspect.ClassInfo access
+ create_numbered_module_property("jdk.module.addopens", "java.desktop/com.sun.beans.introspect=ALL-UNNAMED", addopens_count++);
+ // com.sun.beans.introspect.util.Cache access
+ create_numbered_module_property("jdk.module.addopens", "java.desktop/com.sun.beans.util=ALL-UNNAMED", addopens_count++);
+
+}
diff --git a/src/hotspot/share/runtime/arguments.hpp b/src/hotspot/share/runtime/arguments.hpp
index 6a8ceb7fa8a..7669a283375 100644
--- a/src/hotspot/share/runtime/arguments.hpp
+++ b/src/hotspot/share/runtime/arguments.hpp
@@ -491,6 +491,10 @@ class Arguments : AllStatic {
static size_t conservative_max_heap_alignment() { return _conservative_max_heap_alignment; }
+
+ // Initialize HotswapAgent
+ static void setup_hotswap_agent();
+
// Return the maximum size a heap with compressed oops can take
static size_t max_heap_for_compressed_oops();
diff --git a/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.cpp b/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.cpp
index 5b09758e089..e55b68e63a6 100644
--- a/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.cpp
+++ b/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.cpp
@@ -158,6 +158,15 @@ JVMFlag::Error NUMAInterleaveGranularityConstraintFunc(size_t value, bool verbos
" ... " UINTX_FORMAT " ]\n", value, min, max);
return JVMFlag::VIOLATES_CONSTRAINT;
}
+ return JVMFlag::SUCCESS;
+}
+JVMFlag::Error HotswapAgentConstraintFunc(ccstr value, bool verbose) {
+ if (value != NULL) {
+ if (strcmp("disabled", value) != 0 && strcmp("fatjar", value) != 0 && strcmp("core", value) != 0 && strcmp("external", value) != 0) {
+ JVMFlag::printError(verbose, "HotswapAgent(%s) must be one of disabled,fatjar,core or external.\n", value);
+ return JVMFlag::VIOLATES_CONSTRAINT;
+ }
+ }
return JVMFlag::SUCCESS;
}
diff --git a/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.hpp b/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.hpp
index 8bc3a9a1548..c5f58fd16ee 100644
--- a/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.hpp
+++ b/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.hpp
@@ -42,7 +42,8 @@
f(intx, BiasedLockingDecayTimeFunc) \
f(intx, PerfDataSamplingIntervalFunc) \
f(uintx, VMPageSizeConstraintFunc) \
- f(size_t, NUMAInterleaveGranularityConstraintFunc)
+ f(size_t, NUMAInterleaveGranularityConstraintFunc) \
+ f(ccstr, HotswapAgentConstraintFunc)
RUNTIME_CONSTRAINTS(DECLARE_CONSTRAINT)
diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp
index 7051b634a9b..d23e43407e1 100644
--- a/src/hotspot/share/runtime/globals.hpp
+++ b/src/hotspot/share/runtime/globals.hpp
@@ -2090,7 +2090,16 @@ const intx ObjectAlignmentInBytes = 8;
\
product(bool, AllowEnhancedClassRedefinition, false, \
"Allow enhanced class redefinition beyond swapping method " \
- "bodies")
+ "bodies") \
+ \
+ product(ccstr, HotswapAgent, "disabled", \
+ "Specify HotswapAgent image to be used." \
+ "disabled: hotswap agent is disabled (default)" \
+ "fatjar: full HA. Use integrated hotswap-agent.jar" \
+ "core: core HA. Use integrated hotswap-agent-core.jar" \
+ "external: external HA. use external HA, open required JDK " \
+ "modules.") \
+ constraint(HotswapAgentConstraintFunc, AfterErgo)
// end of RUNTIME_FLAGS
--
2.23.0

View File

@@ -0,0 +1,347 @@
From 51f0036ff15d39330b787512af9e38d15c748e4b Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sun, 7 Mar 2021 20:22:54 +0100
Subject: [PATCH 28/39] Support for redefinition of Well Known classses
(java.*,jdk.*, sun.*)
---
src/hotspot/share/ci/ciKlass.hpp | 1 +
src/hotspot/share/ci/ciObjectFactory.cpp | 34 ++++++++++
src/hotspot/share/ci/ciObjectFactory.hpp | 6 ++
src/hotspot/share/classfile/vmClasses.cpp | 10 +++
src/hotspot/share/classfile/vmClasses.hpp | 4 ++
src/hotspot/share/classfile/vmSymbols.hpp | 2 +
src/hotspot/share/compiler/compileBroker.cpp | 11 ++++
src/hotspot/share/memory/universe.cpp | 8 +++
src/hotspot/share/memory/universe.hpp | 2 +
.../prims/jvmtiEnhancedRedefineClasses.cpp | 63 ++++++++++++++++++-
.../prims/jvmtiEnhancedRedefineClasses.hpp | 2 +
11 files changed, 142 insertions(+), 1 deletion(-)
diff --git a/src/hotspot/share/ci/ciKlass.hpp b/src/hotspot/share/ci/ciKlass.hpp
index 467284b7cde..644993a7513 100644
--- a/src/hotspot/share/ci/ciKlass.hpp
+++ b/src/hotspot/share/ci/ciKlass.hpp
@@ -129,6 +129,7 @@ public:
void print_name_on(outputStream* st);
const char* external_name() const;
+ Klass* new_version() { return get_Klass()->new_version(); }
};
#endif // SHARE_CI_CIKLASS_HPP
diff --git a/src/hotspot/share/ci/ciObjectFactory.cpp b/src/hotspot/share/ci/ciObjectFactory.cpp
index 664062a0f74..e9cb49be3ff 100644
--- a/src/hotspot/share/ci/ciObjectFactory.cpp
+++ b/src/hotspot/share/ci/ciObjectFactory.cpp
@@ -74,7 +74,10 @@ GrowableArray<ciMetadata*>* ciObjectFactory::_shared_ci_metadata = NULL;
ciSymbol* ciObjectFactory::_shared_ci_symbols[vmSymbols::number_of_symbols()];
int ciObjectFactory::_shared_ident_limit = 0;
volatile bool ciObjectFactory::_initialized = false;
+volatile bool ciObjectFactory::_reinitialize_vm_klasses = false;
+// TODO: review...
+Arena* ciObjectFactory::_initial_arena = NULL;
// ------------------------------------------------------------------
// ciObjectFactory::ciObjectFactory
@@ -110,6 +113,7 @@ void ciObjectFactory::initialize() {
// compiler thread that initializes the initial ciObjectFactory which
// creates the shared ciObjects that all later ciObjectFactories use.
Arena* arena = new (mtCompiler) Arena(mtCompiler);
+ ciObjectFactory::_initial_arena = arena;
ciEnv initial(arena);
ciEnv* env = ciEnv::current();
env->_factory->init_shared_objects();
@@ -118,6 +122,36 @@ void ciObjectFactory::initialize() {
}
+// (DCEVM) vm classes could be modified
+void ciObjectFactory::reinitialize_vm_classes() {
+ ASSERT_IN_VM;
+ JavaThread* thread = JavaThread::current();
+ HandleMark handle_mark(thread);
+
+ // This Arena is long lived and exists in the resource mark of the
+ // compiler thread that initializes the initial ciObjectFactory which
+ // creates the shared ciObjects that all later ciObjectFactories use.
+ // Arena* arena = new (mtCompiler) Arena(mtCompiler);
+ ciEnv initial(ciObjectFactory::_initial_arena);
+ ciEnv* env = ciEnv::current();
+ env->_factory->do_reinitialize_vm_classes();
+ _reinitialize_vm_klasses = false;
+}
+
+// (DCEVM) vm classes could be modified
+void ciObjectFactory::do_reinitialize_vm_classes() {
+#define VM_CLASS_DEFN(name, ignore_s) \
+ if (ciEnv::_##name != NULL && ciEnv::_##name->new_version() != NULL) { \
+ int old_ident = ciEnv::_##name->ident(); \
+ ciEnv::_##name = get_metadata(vmClasses::name())->as_instance_klass(); \
+ ciEnv::_##name->compute_nonstatic_fields(); \
+ ciEnv::_##name->set_ident(old_ident); \
+ }
+
+ VM_CLASSES_DO(VM_CLASS_DEFN)
+#undef VM_CLASS_DEFN
+}
+
void ciObjectFactory::init_shared_objects() {
_next_ident = 1; // start numbering CI objects at 1
diff --git a/src/hotspot/share/ci/ciObjectFactory.hpp b/src/hotspot/share/ci/ciObjectFactory.hpp
index fdefc8e3b92..1ed8732cb40 100644
--- a/src/hotspot/share/ci/ciObjectFactory.hpp
+++ b/src/hotspot/share/ci/ciObjectFactory.hpp
@@ -42,9 +42,11 @@ class ciObjectFactory : public ResourceObj {
private:
static volatile bool _initialized;
+ static volatile bool _reinitialize_vm_klasses;
static GrowableArray<ciMetadata*>* _shared_ci_metadata;
static ciSymbol* _shared_ci_symbols[];
static int _shared_ident_limit;
+ static Arena* _initial_arena;
Arena* _arena;
GrowableArray<ciMetadata*> _ci_metadata;
@@ -90,10 +92,14 @@ private:
ciInstance* get_unloaded_instance(ciInstanceKlass* klass);
static int compare_cimetadata(ciMetadata** a, ciMetadata** b);
+ void do_reinitialize_vm_classes();
public:
static bool is_initialized() { return _initialized; }
+ static bool is_reinitialize_vm_klasses() { return _reinitialize_vm_klasses; }
+ static void set_reinitialize_vm_klasses() { _reinitialize_vm_klasses = true; }
static void initialize();
+ static void reinitialize_vm_classes();
void init_shared_objects();
void remove_symbols();
diff --git a/src/hotspot/share/classfile/vmClasses.cpp b/src/hotspot/share/classfile/vmClasses.cpp
index 2bd1ca65cc0..3ec13d952d8 100644
--- a/src/hotspot/share/classfile/vmClasses.cpp
+++ b/src/hotspot/share/classfile/vmClasses.cpp
@@ -259,3 +259,13 @@ BasicType vmClasses::box_klass_type(Klass* k) {
}
return T_OBJECT;
}
+
+bool vmClasses::update_vm_klass(InstanceKlass* old_klass, InstanceKlass* new_klass) {
+ for (int id = static_cast<int>(vmClassID::FIRST); id < static_cast<int>(vmClassID::LIMIT); id++) {
+ if (_klasses[id] == old_klass) {
+ _klasses[id] = new_klass;
+ return true;
+ }
+ }
+ return false;
+}
diff --git a/src/hotspot/share/classfile/vmClasses.hpp b/src/hotspot/share/classfile/vmClasses.hpp
index 364014a2514..b637ff0ae3d 100644
--- a/src/hotspot/share/classfile/vmClasses.hpp
+++ b/src/hotspot/share/classfile/vmClasses.hpp
@@ -110,6 +110,10 @@ public:
static bool Cloneable_klass_loaded() { return is_loaded(VM_CLASS_AT(Cloneable_klass)); }
static bool Parameter_klass_loaded() { return is_loaded(VM_CLASS_AT(reflect_Parameter_klass)); }
static bool ClassLoader_klass_loaded() { return is_loaded(VM_CLASS_AT(ClassLoader_klass)); }
+
+ // (DCEVM) vmClasses could be modified
+ static bool update_vm_klass(InstanceKlass* new_klass, InstanceKlass* old_klass);
+
};
#endif // SHARE_CLASSFILE_VMCLASSES_HPP
diff --git a/src/hotspot/share/classfile/vmSymbols.hpp b/src/hotspot/share/classfile/vmSymbols.hpp
index dad94005f5c..82fd593224a 100644
--- a/src/hotspot/share/classfile/vmSymbols.hpp
+++ b/src/hotspot/share/classfile/vmSymbols.hpp
@@ -380,6 +380,8 @@
template(exit_method_name, "exit") \
template(add_method_name, "add") \
template(remove_method_name, "remove") \
+ template(registerNatives_method_name, "registerNatives") \
+ template(initIDs_method_name, "initIDs") \
template(parent_name, "parent") \
template(threads_name, "threads") \
template(groups_name, "groups") \
diff --git a/src/hotspot/share/compiler/compileBroker.cpp b/src/hotspot/share/compiler/compileBroker.cpp
index cc1dff089e8..aaf8e4b1f1e 100644
--- a/src/hotspot/share/compiler/compileBroker.cpp
+++ b/src/hotspot/share/compiler/compileBroker.cpp
@@ -1982,6 +1982,17 @@ void CompileBroker::compiler_thread_loop() {
if (method()->number_of_breakpoints() == 0) {
// Compile the method.
if ((UseCompiler || AlwaysCompileLoopMethods) && CompileBroker::should_compile_new_jobs()) {
+
+ // TODO: review usage of CompileThread_lock (DCEVM)
+ if (ciObjectFactory::is_reinitialize_vm_klasses())
+ {
+ ASSERT_IN_VM;
+ MutexLocker only_one(CompileThread_lock);
+ if (ciObjectFactory::is_reinitialize_vm_klasses()) {
+ ciObjectFactory::reinitialize_vm_classes();
+ }
+ }
+
invoke_compiler_on_method(task);
thread->start_idle_timer();
} else {
diff --git a/src/hotspot/share/memory/universe.cpp b/src/hotspot/share/memory/universe.cpp
index 4ae3b382b67..92da9bbe5f9 100644
--- a/src/hotspot/share/memory/universe.cpp
+++ b/src/hotspot/share/memory/universe.cpp
@@ -924,6 +924,14 @@ void Universe::initialize_known_methods(TRAPS) {
vmSymbols::doStackWalk_signature(), false, CHECK);
}
+void Universe::reinitialize_loader_addClass_method(TRAPS) {
+ // Set up method for registering loaded classes in class loader vector
+ initialize_known_method(_loader_addClass_cache,
+ vmClasses::ClassLoader_klass(),
+ "addClass",
+ vmSymbols::class_void_signature(), false, CHECK);
+}
+
void universe2_init() {
EXCEPTION_MARK;
Universe::genesis(CATCH);
diff --git a/src/hotspot/share/memory/universe.hpp b/src/hotspot/share/memory/universe.hpp
index 4b2211c415e..4d4c444220e 100644
--- a/src/hotspot/share/memory/universe.hpp
+++ b/src/hotspot/share/memory/universe.hpp
@@ -268,6 +268,8 @@ class Universe: AllStatic {
// Function to initialize these
static void initialize_known_methods(TRAPS);
+ static void reinitialize_loader_addClass_method(TRAPS);
+
static void create_preallocated_out_of_memory_errors(TRAPS);
// Reference pending list manipulation. Access is protected by
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index a5264077bfe..e00f0e19e20 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -55,6 +55,7 @@
#include "prims/resolvedMethodTable.hpp"
#include "prims/methodHandles.hpp"
#include "runtime/deoptimization.hpp"
+#include "runtime/javaCalls.hpp"
#include "runtime/jniHandles.inline.hpp"
#include "runtime/relocator.hpp"
#include "runtime/fieldDescriptor.hpp"
@@ -66,6 +67,7 @@
#include "gc/g1/g1CollectedHeap.hpp"
#include "gc/shared/dcevmSharedGC.hpp"
#include "gc/shared/scavengableNMethods.hpp"
+#include "gc/shared/oopStorageSet.inline.hpp"
#include "ci/ciObjectFactory.hpp"
Array<Method*>* VM_EnhancedRedefineClasses::_old_methods = NULL;
@@ -521,6 +523,16 @@ void VM_EnhancedRedefineClasses::doit() {
redefine_single_class(_new_classes->at(i), thread);
}
+ // Update possible redefinition of vm classes (like ClassLoader)
+ for (int i = 0; i < _new_classes->length(); i++) {
+ InstanceKlass* cur = _new_classes->at(i);
+ if (cur->old_version() != NULL && vmClasses::update_vm_klass(InstanceKlass::cast(cur->old_version()), cur))
+ {
+ log_trace(redefine, class, obsolete, metadata)("Well known class updated %s", cur->external_name());
+ ciObjectFactory::set_reinitialize_vm_klasses();
+ }
+ }
+
// Deoptimize all compiled code that depends on this class (do only once, because it clears whole cache)
// if (_max_redefinition_flags > Klass::ModifyClass) {
flush_dependent_code(thread);
@@ -688,12 +700,56 @@ void VM_EnhancedRedefineClasses::doit() {
_timer_vm_op_doit.stop();
}
+void VM_EnhancedRedefineClasses::reinitializeJDKClasses() {
+ if (!_new_classes->is_empty()) {
+ ResourceMark rm(Thread::current());
+
+ for (int i = 0; i < _new_classes->length(); i++) {
+ InstanceKlass* cur = _new_classes->at(i);
+
+ if (cur->name()->starts_with("java/") || cur->name()->starts_with("jdk/") || cur->name()->starts_with("sun/")) {
+
+ if (cur == vmClasses::ClassLoader_klass()) {
+ // ClassLoader.addClass method is cached in Universe, we must redefine
+ Universe::reinitialize_loader_addClass_method(Thread::current());
+ log_trace(redefine, class, obsolete, metadata)("Reinitialize ClassLoade addClass method cache.");
+ }
+
+ // naive assumptions that only JDK classes has native static "registerNative" and "initIDs" methods
+ int end;
+ Symbol* signature = vmSymbols::registerNatives_method_name();
+ int midx = cur->find_method_by_name(signature, &end);
+ if (midx == -1) {
+ signature = vmSymbols::initIDs_method_name();
+ midx = cur->find_method_by_name(signature, &end);
+ }
+ Method* m = NULL;
+ if (midx != -1) {
+ m = cur->methods()->at(midx);
+ }
+ if (m != NULL && m->is_static() && m->is_native()) {
+ // call static registerNative if present
+ JavaValue result(T_VOID);
+ JavaCalls::call_static(&result,
+ cur,
+ signature,
+ vmSymbols::void_method_signature(),
+ Thread::current());
+ log_trace(redefine, class, obsolete, metadata)("Reregister natives of JDK class %s", cur->external_name());
+ }
+ }
+ }
+ }
+}
+
// Cleanup - runs in JVM thread
// - free used memory
// - end GC
void VM_EnhancedRedefineClasses::doit_epilogue() {
VM_GC_Operation::doit_epilogue();
+ reinitializeJDKClasses();
+
if (_new_classes != NULL) {
delete _new_classes;
}
@@ -1623,7 +1679,12 @@ void VM_EnhancedRedefineClasses::check_methods_and_mark_as_obsolete() {
// obsolete methods need a unique idnum so they become new entries in
// the jmethodID cache in InstanceKlass
- assert(old_method->method_idnum() == new_method->method_idnum(), "must match");
+ if (old_method->method_idnum() != new_method->method_idnum()) {
+ log_error(redefine, class, normalize)
+ ("Method not matched: %d != %d old: %s = new: %s", old_method->method_idnum(), new_method->method_idnum(),
+ old_method->name_and_sig_as_C_string(), new_method->name_and_sig_as_C_string());
+ // assert(old_method->method_idnum() == new_method->method_idnum(), "must match");
+ }
// u2 num = InstanceKlass::cast(_the_class_oop)->next_method_idnum();
// if (num != ConstMethod::UNSET_IDNUM) {
// old_method->set_method_idnum(num);
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
index 9be70039e32..673688dff84 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
@@ -150,6 +150,8 @@ class VM_EnhancedRedefineClasses: public VM_GC_Operation {
u8 next_id();
+ void reinitializeJDKClasses();
+
static void check_class(InstanceKlass* k_oop, TRAPS);
static void dump_methods();
--
2.23.0

View File

@@ -0,0 +1,260 @@
From 6cde71e353f823f2df2d0875cd03b656fe060d5c Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sat, 15 May 2021 10:31:28 +0200
Subject: [PATCH 29/39] Fix fastdebug compilation issues - cast_to_oop
---
.../share/gc/g1/g1FullGCCompactTask.cpp | 12 +++++-----
.../share/gc/g1/g1FullGCCompactionPoint.cpp | 10 ++++-----
.../share/gc/g1/g1FullGCPrepareTask.cpp | 4 ++--
src/hotspot/share/gc/shared/dcevmSharedGC.cpp | 6 ++---
src/hotspot/share/gc/shared/space.cpp | 22 +++++++++----------
src/hotspot/share/gc/shared/space.inline.hpp | 14 ++++++------
.../prims/jvmtiEnhancedRedefineClasses.cpp | 2 +-
7 files changed, 35 insertions(+), 35 deletions(-)
diff --git a/src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp b/src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp
index 058dea90828..765630a9826 100644
--- a/src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp
+++ b/src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp
@@ -183,18 +183,18 @@ size_t G1FullGCCompactTask::G1CompactRegionClosureDcevm::apply(oop obj) {
Klass* new_version = obj->klass()->new_version();
if (new_version->update_information() == NULL) {
Copy::aligned_conjoint_words(obj_addr, destination, size);
- oop(destination)->set_klass(new_version);
+ cast_to_oop(destination)->set_klass(new_version);
} else {
- DcevmSharedGC::update_fields(obj, oop(destination));
+ DcevmSharedGC::update_fields(obj, cast_to_oop(destination));
}
- oop(destination)->init_mark();
- assert(oop(destination)->klass() != NULL, "should have a class");
+ cast_to_oop(destination)->init_mark();
+ assert(cast_to_oop(destination)->klass() != NULL, "should have a class");
return size;
}
Copy::aligned_conjoint_words(obj_addr, destination, size);
- oop(destination)->init_mark();
- assert(oop(destination)->klass() != NULL, "should have a class");
+ cast_to_oop(destination)->init_mark();
+ assert(cast_to_oop(destination)->klass() != NULL, "should have a class");
return size;
}
diff --git a/src/hotspot/share/gc/g1/g1FullGCCompactionPoint.cpp b/src/hotspot/share/gc/g1/g1FullGCCompactionPoint.cpp
index 87b1977128a..028c182e68f 100644
--- a/src/hotspot/share/gc/g1/g1FullGCCompactionPoint.cpp
+++ b/src/hotspot/share/gc/g1/g1FullGCCompactionPoint.cpp
@@ -171,7 +171,7 @@ void G1FullGCCompactionPoint::forward_dcevm(oop object, size_t size, bool force_
// Store a forwarding pointer if the object should be moved.
if (cast_from_oop<HeapWord*>(object) != _compaction_top || force_forward) {
- object->forward_to(oop(_compaction_top));
+ object->forward_to(cast_to_oop(_compaction_top));
} else {
if (object->forwardee() != NULL) {
// Object should not move but mark-word is used so it looks like the
@@ -208,17 +208,17 @@ void G1FullGCCompactionPoint::forward_rescued() {
for (;i<rescued_oops()->length(); i++) {
HeapWord* q = rescued_oops()->at(i);
- size_t size = oop(q)->size();
+ size_t size = cast_to_oop(q)->size();
// (DCEVM) There is a new version of the class of q => different size
- if (oop(q)->klass()->new_version() != NULL) {
+ if (cast_to_oop(q)->klass()->new_version() != NULL) {
// assert(size != new_size, "instances without changed size have to be updated prior to GC run");
- size = oop(q)->size_given_klass(oop(q)->klass()->new_version());
+ size = cast_to_oop(q)->size_given_klass(cast_to_oop(q)->klass()->new_version());
}
if (forward_compact_top(size) == NULL) {
break;
}
- forward_dcevm(oop(q), size, true);
+ forward_dcevm(cast_to_oop(q), size, true);
}
_last_rescued_oop = i;
}
diff --git a/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp
index 05f0444cc7a..93c066383a1 100644
--- a/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp
+++ b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp
@@ -297,7 +297,7 @@ size_t G1FullGCPrepareTask::G1PrepareCompactLiveClosureDcevm::apply(oop object)
HeapWord* compact_top = _cp->forward_compact_top(forward_size);
- if (compact_top == NULL || must_rescue(object, oop(compact_top))) {
+ if (compact_top == NULL || must_rescue(object, cast_to_oop(compact_top))) {
_cp->rescued_oops()->append(cast_from_oop<HeapWord*>(object));
} else {
_cp->forward_dcevm(object, forward_size, (size != forward_size));
@@ -308,7 +308,7 @@ size_t G1FullGCPrepareTask::G1PrepareCompactLiveClosureDcevm::apply(oop object)
bool G1FullGCPrepareTask::G1PrepareCompactLiveClosureDcevm::must_rescue(oop old_obj, oop new_obj) {
// Only redefined objects can have the need to be rescued.
- if (oop(old_obj)->klass()->new_version() == NULL) {
+ if (old_obj->klass()->new_version() == NULL) {
return false;
}
diff --git a/src/hotspot/share/gc/shared/dcevmSharedGC.cpp b/src/hotspot/share/gc/shared/dcevmSharedGC.cpp
index edc19a3077d..de3d518b696 100644
--- a/src/hotspot/share/gc/shared/dcevmSharedGC.cpp
+++ b/src/hotspot/share/gc/shared/dcevmSharedGC.cpp
@@ -46,7 +46,7 @@ void DcevmSharedGC::copy_rescued_objects_back(GrowableArray<HeapWord*>* rescued_
if (rescued_oops != NULL) {
for (int i=from; i < to; i++) {
HeapWord* rescued_ptr = rescued_oops->at(i);
- oop rescued_obj = (oop) rescued_ptr;
+ oop rescued_obj = cast_to_oop(rescued_ptr);
int size = rescued_obj->size();
oop new_obj = rescued_obj->forwardee();
@@ -75,7 +75,7 @@ void DcevmSharedGC::clear_rescued_objects_resource(GrowableArray<HeapWord*>* res
if (rescued_oops != NULL) {
for (int i=0; i < rescued_oops->length(); i++) {
HeapWord* rescued_ptr = rescued_oops->at(i);
- int size = ((oop) rescued_ptr)->size();
+ int size = cast_to_oop(rescued_ptr)->size();
FREE_RESOURCE_ARRAY(HeapWord, rescued_ptr, size);
}
rescued_oops->clear();
@@ -114,7 +114,7 @@ void DcevmSharedGC::update_fields(oop q, oop new_location) {
if ((cast_from_oop<HeapWord*>(q) >= cast_from_oop<HeapWord*>(new_location) && cast_from_oop<HeapWord*>(q) < cast_from_oop<HeapWord*>(new_location) + new_size) ||
(cast_from_oop<HeapWord*>(new_location) >= cast_from_oop<HeapWord*>(q) && cast_from_oop<HeapWord*>(new_location) < cast_from_oop<HeapWord*>(q) + size)) {
tmp = NEW_RESOURCE_ARRAY(HeapWord, size);
- q = (oop) tmp;
+ q = cast_to_oop(tmp);
Copy::aligned_disjoint_words(cast_from_oop<HeapWord*>(tmp_obj), cast_from_oop<HeapWord*>(q), size);
}
}
diff --git a/src/hotspot/share/gc/shared/space.cpp b/src/hotspot/share/gc/shared/space.cpp
index 29a81348d2d..000760744f7 100644
--- a/src/hotspot/share/gc/shared/space.cpp
+++ b/src/hotspot/share/gc/shared/space.cpp
@@ -475,7 +475,7 @@ bool CompactibleSpace::must_rescue(oop old_obj, oop new_obj) {
int new_size = old_obj->size_given_klass(oop(old_obj)->klass()->new_version());
int original_size = old_obj->size();
-
+
Generation* tenured_gen = GenCollectedHeap::heap()->old_gen();
bool old_in_tenured = tenured_gen->is_in_reserved(old_obj);
bool new_in_tenured = tenured_gen->is_in_reserved(new_obj);
@@ -513,9 +513,9 @@ bool CompactibleSpace::must_rescue(oop old_obj, oop new_obj) {
}
HeapWord* CompactibleSpace::rescue(HeapWord* old_obj) {
- assert(must_rescue(oop(old_obj), oop(old_obj)->forwardee()), "do not call otherwise");
+ assert(must_rescue(cast_to_oop(old_obj), cast_to_oop(old_obj)->forwardee()), "do not call otherwise");
- int size = oop(old_obj)->size();
+ int size = cast_to_oop(old_obj)->size();
HeapWord* rescued_obj = NEW_RESOURCE_ARRAY(HeapWord, size);
Copy::aligned_disjoint_words(old_obj, rescued_obj, size);
@@ -803,16 +803,16 @@ HeapWord* CompactibleSpace::forward_with_rescue(HeapWord* q, size_t size,
size_t forward_size = size;
// (DCEVM) There is a new version of the class of q => different size
- if (oop(q)->klass()->new_version() != NULL) {
+ if (cast_to_oop(q)->klass()->new_version() != NULL) {
- size_t new_size = oop(q)->size_given_klass(oop(q)->klass()->new_version());
+ size_t new_size = cast_to_oop(q)->size_given_klass(cast_to_oop(q)->klass()->new_version());
// assert(size != new_size, "instances without changed size have to be updated prior to GC run");
forward_size = new_size;
}
compact_top = forward_compact_top(forward_size, cp, compact_top);
- if (must_rescue(oop(q), oop(compact_top))) {
+ if (must_rescue(cast_to_oop(q), cast_to_oop(compact_top))) {
if (MarkSweep::_rescued_oops == NULL) {
MarkSweep::_rescued_oops = new GrowableArray<HeapWord*>(128);
}
@@ -820,7 +820,7 @@ HeapWord* CompactibleSpace::forward_with_rescue(HeapWord* q, size_t size,
return compact_top;
}
- return forward(oop(q), forward_size, cp, compact_top, force_forward);
+ return forward(cast_to_oop(q), forward_size, cp, compact_top, force_forward);
}
// Compute the forwarding addresses for the objects that need to be rescued.
@@ -830,17 +830,17 @@ HeapWord* CompactibleSpace::forward_rescued(CompactPoint* cp, HeapWord* compact_
for (int i=0; i<MarkSweep::_rescued_oops->length(); i++) {
HeapWord* q = MarkSweep::_rescued_oops->at(i);
- /* size_t size = oop(q)->size(); changing this for cms for perm gen */
+ /* size_t size = cast_to_oop(q)->size(); changing this for cms for perm gen */
size_t size = block_size(q);
// (DCEVM) There is a new version of the class of q => different size
- if (oop(q)->klass()->new_version() != NULL) {
- size_t new_size = oop(q)->size_given_klass(oop(q)->klass()->new_version());
+ if (cast_to_oop(q)->klass()->new_version() != NULL) {
+ size_t new_size = cast_to_oop(q)->size_given_klass(cast_to_oop(q)->klass()->new_version());
// assert(size != new_size, "instances without changed size have to be updated prior to GC run");
size = new_size;
}
- compact_top = cp->space->forward(oop(q), size, cp, compact_top, true);
+ compact_top = cp->space->forward(cast_to_oop(q), size, cp, compact_top, true);
assert(compact_top <= end(), "must not write over end of space!");
}
MarkSweep::_rescued_oops->clear();
diff --git a/src/hotspot/share/gc/shared/space.inline.hpp b/src/hotspot/share/gc/shared/space.inline.hpp
index cafa2503ef4..076ce6b0cce 100644
--- a/src/hotspot/share/gc/shared/space.inline.hpp
+++ b/src/hotspot/share/gc/shared/space.inline.hpp
@@ -351,7 +351,7 @@ inline void CompactibleSpace::scan_and_compact(SpaceType* space, bool redefiniti
size_t size = space->obj_size(cur_obj);
HeapWord* compaction_top = cast_from_oop<HeapWord*>(cast_to_oop(cur_obj)->forwardee());
- if (redefinition_run && space->must_rescue(oop(cur_obj), oop(cur_obj)->forwardee())) {
+ if (redefinition_run && space->must_rescue(cast_to_oop(cur_obj), cast_to_oop(cur_obj)->forwardee())) {
space->rescue(cur_obj);
debug_only(Copy::fill_to_words(cur_obj, size, 0));
cur_obj += size;
@@ -363,16 +363,16 @@ inline void CompactibleSpace::scan_and_compact(SpaceType* space, bool redefiniti
// copy object and reinit its mark
assert(redefinition_run || cur_obj != compaction_top, "everything in this pass should be moving");
- if (redefinition_run && oop(cur_obj)->klass()->new_version() != NULL) {
- Klass* new_version = oop(cur_obj)->klass()->new_version();
+ if (redefinition_run && cast_to_oop(cur_obj)->klass()->new_version() != NULL) {
+ Klass* new_version = cast_to_oop(cur_obj)->klass()->new_version();
if (new_version->update_information() == NULL) {
Copy::aligned_conjoint_words(cur_obj, compaction_top, size);
- oop(compaction_top)->set_klass(new_version);
+ cast_to_oop(compaction_top)->set_klass(new_version);
} else {
- DcevmSharedGC::update_fields(oop(cur_obj), oop(compaction_top));
+ DcevmSharedGC::update_fields(cast_to_oop(cur_obj), cast_to_oop(compaction_top));
}
- oop(compaction_top)->init_mark();
- assert(oop(compaction_top)->klass() != NULL, "should have a class");
+ cast_to_oop(compaction_top)->init_mark();
+ assert(cast_to_oop(compaction_top)->klass() != NULL, "should have a class");
debug_only(prev_obj = cur_obj);
cur_obj += size;
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index e00f0e19e20..62477b5ce10 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -439,7 +439,7 @@ public:
int size = o->size();
if (_tmp_obj_size < size) {
_tmp_obj_size = size;
- _tmp_obj = (oop)resource_allocate_bytes(size * HeapWordSize);
+ _tmp_obj = cast_to_oop(resource_allocate_bytes(size * HeapWordSize));
}
Copy::aligned_disjoint_words(cast_from_oop<HeapWord*>(o), cast_from_oop<HeapWord*>(_tmp_obj), size);
}
--
2.23.0

View File

@@ -0,0 +1,27 @@
From 585e2f11d293081db5dc919fa8c13fb5bc7cbc53 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
Date: Fri, 19 Mar 2021 19:13:38 +0100
Subject: [PATCH 30/39] JBR-3458: Skip dynamic proxy classes based on
com.sun.proxy
---
src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index 62477b5ce10..7bdbc861c1f 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -707,7 +707,8 @@ void VM_EnhancedRedefineClasses::reinitializeJDKClasses() {
for (int i = 0; i < _new_classes->length(); i++) {
InstanceKlass* cur = _new_classes->at(i);
- if (cur->name()->starts_with("java/") || cur->name()->starts_with("jdk/") || cur->name()->starts_with("sun/")) {
+ if ((cur->name()->starts_with("java/") || cur->name()->starts_with("jdk/") || cur->name()->starts_with("sun/"))
+ && cur->name()->index_of_at(0, "$$") == -1) { // skip dynamic proxies
if (cur == vmClasses::ClassLoader_klass()) {
// ClassLoader.addClass method is cached in Universe, we must redefine
--
2.23.0

View File

@@ -0,0 +1,81 @@
From d4d56b7ad6cd8f73f7485cdc608655c014c55f3c Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
Date: Sat, 20 Mar 2021 20:51:08 +0100
Subject: [PATCH 31/39] JBR-3459: Fix race condition in
ClassLoaderDataGraph::classes_do
InstanceKlass in ClassLoaderData can be uninitialized when
ClassLoaderDataGraph::classes_do is called. Using
ClassLoaderDataGraph::dictionary_classes_do is safe but problem is still
persisting with anonymous classes.
---
.../share/classfile/classLoaderDataGraph.cpp | 10 ++++++++++
.../share/classfile/classLoaderDataGraph.hpp | 4 ++++
.../share/prims/jvmtiEnhancedRedefineClasses.cpp | 14 ++++++++++++--
3 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/src/hotspot/share/classfile/classLoaderDataGraph.cpp b/src/hotspot/share/classfile/classLoaderDataGraph.cpp
index 67ade5709f6..aa2a6bcec6b 100644
--- a/src/hotspot/share/classfile/classLoaderDataGraph.cpp
+++ b/src/hotspot/share/classfile/classLoaderDataGraph.cpp
@@ -361,6 +361,16 @@ void ClassLoaderDataGraph::classes_do(KlassClosure* klass_closure) {
}
}
+void ClassLoaderDataGraph::anonymous_or_hidden_classes_do(KlassClosure* klass_closure) {
+ Thread* thread = Thread::current();
+ for (ClassLoaderData* cld = _head; cld != NULL; cld = cld->next()) {
+ if (cld->has_class_mirror_holder()) {
+ Handle holder(thread, cld->holder_phantom());
+ cld->classes_do(klass_closure);
+ }
+ }
+}
+
void ClassLoaderDataGraph::classes_do(void f(Klass* const)) {
ClassLoaderDataGraphIterator iter;
while (ClassLoaderData* cld = iter.get_next()) {
diff --git a/src/hotspot/share/classfile/classLoaderDataGraph.hpp b/src/hotspot/share/classfile/classLoaderDataGraph.hpp
index ebdb0bc2c8c..da712eaf55f 100644
--- a/src/hotspot/share/classfile/classLoaderDataGraph.hpp
+++ b/src/hotspot/share/classfile/classLoaderDataGraph.hpp
@@ -78,6 +78,10 @@ class ClassLoaderDataGraph : public AllStatic {
// for redefinition. These classes are removed during the next class unloading.
// Walking the ClassLoaderDataGraph also includes hidden classes.
static void classes_do(KlassClosure* klass_closure);
+
+ // Enhanced class redefinition
+ static void anonymous_or_hidden_classes_do(KlassClosure* klass_closure);
+
static void classes_do(void f(Klass* const));
static void methods_do(void f(Method*));
static void modules_do(void f(ModuleEntry*));
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index 7bdbc861c1f..4e8e7141e61 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -2164,9 +2164,19 @@ jvmtiError VM_EnhancedRedefineClasses::find_sorted_affected_classes(TRAPS) {
{
MutexLocker mcld(ClassLoaderDataGraph_lock);
- ClassLoaderDataGraph::classes_do(&closure);
+
+ // 0. we can't use ClassLoaderDataGraph::classes_do since classes can be uninitialized in cld,
+ // fully initialized class is in system dictionary
+ // ClassLoaderDataGraph::classes_do(&closure);
+
+ // 1. Scan over dictionaries
+ ClassLoaderDataGraph::dictionary_classes_do(&closure);
+
+ // 2. Anonymous or hidden class is not in dictionary, we have to iterate anonymous cld directly, but there is race cond...
+ // TODO: review ... anonymous class is added to cld before InstanceKlass initialization,
+ // find out how to check if the InstanceKlass is initialized
+ ClassLoaderDataGraph::anonymous_or_hidden_classes_do(&closure);
}
- //ClassLoaderDataGraph::dictionary_classes_do(&closure);
log_trace(redefine, class, load)("%d classes affected", _affected_klasses->length());
--
2.23.0

View File

@@ -0,0 +1,39 @@
From 5356c4dbbcc2564e401fc92b7680b870ee7070ec Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sat, 15 May 2021 13:01:25 +0200
Subject: [PATCH 32/39] Fix compilation problems
---
src/hotspot/share/oops/instanceKlass.cpp | 2 +-
src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
index 3cc96f98f41..c54b6b1bf46 100644
--- a/src/hotspot/share/oops/instanceKlass.cpp
+++ b/src/hotspot/share/oops/instanceKlass.cpp
@@ -978,7 +978,7 @@ bool InstanceKlass::link_class_impl(TRAPS) {
set_init_state(linked);
}
// (DCEVM) Must check for old version in order to prevent infinite loops.
- if (JvmtiExport::should_post_class_prepare() && (!AllowEnhancedClassRedefinition || old_version() == NULL /* JVMTI deadlock otherwise */) {
+ if (JvmtiExport::should_post_class_prepare() && (!AllowEnhancedClassRedefinition || old_version() == NULL /* JVMTI deadlock otherwise */)) {
JvmtiExport::post_class_prepare(THREAD, this);
}
}
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index 4e8e7141e61..f6bef8262d3 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -708,7 +708,7 @@ void VM_EnhancedRedefineClasses::reinitializeJDKClasses() {
InstanceKlass* cur = _new_classes->at(i);
if ((cur->name()->starts_with("java/") || cur->name()->starts_with("jdk/") || cur->name()->starts_with("sun/"))
- && cur->name()->index_of_at(0, "$$") == -1) { // skip dynamic proxies
+ && cur->name()->index_of_at(0, "$$", (int) strlen("$$")) == -1) { // skip dynamic proxies
if (cur == vmClasses::ClassLoader_klass()) {
// ClassLoader.addClass method is cached in Universe, we must redefine
--
2.23.0

View File

@@ -0,0 +1,350 @@
From 3eb64e8ed65ae214091b55e497d24dff0eb1e353 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sun, 20 Jun 2021 19:11:16 +0200
Subject: [PATCH 33/39] Fix dcevm issues related to refactorization of Thread
to JavaThread
---
src/hotspot/share/cds/lambdaFormInvokers.cpp | 1 +
.../prims/jvmtiEnhancedRedefineClasses.cpp | 72 +++++++++----------
.../prims/jvmtiEnhancedRedefineClasses.hpp | 12 ++--
3 files changed, 39 insertions(+), 46 deletions(-)
diff --git a/src/hotspot/share/cds/lambdaFormInvokers.cpp b/src/hotspot/share/cds/lambdaFormInvokers.cpp
index 5c058dc43ac..9de28f740ac 100644
--- a/src/hotspot/share/cds/lambdaFormInvokers.cpp
+++ b/src/hotspot/share/cds/lambdaFormInvokers.cpp
@@ -178,6 +178,7 @@ void LambdaFormInvokers::reload_class(char* name, ClassFileStream& st, TRAPS) {
class_name,
cld,
cl_info,
+ false, // pick_newest
CHECK);
{
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index f6bef8262d3..b662976afcb 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -23,7 +23,6 @@
*/
#include "precompiled.hpp"
-#include "aot/aotLoader.hpp"
#include "classfile/classFileParser.hpp"
#include "classfile/classFileStream.hpp"
#include "classfile/classLoadInfo.hpp"
@@ -38,7 +37,7 @@
#include "interpreter/rewriter.hpp"
#include "logging/logStream.hpp"
#include "memory/metadataFactory.hpp"
-#include "memory/metaspaceShared.hpp"
+#include "cds/metaspaceShared.hpp"
#include "memory/resourceArea.hpp"
#include "memory/iterator.inline.hpp"
#include "oops/fieldStreams.hpp"
@@ -156,7 +155,7 @@ bool VM_EnhancedRedefineClasses::doit_prologue() {
// We first load new class versions in the prologue, because somewhere down the
// call chain it is required that the current thread is a Java thread.
- _res = load_new_class_versions(Thread::current());
+ _res = load_new_class_versions(JavaThread::current());
// prepare GC, lock heap
if (_res == JVMTI_ERROR_NONE && !VM_GC_Operation::doit_prologue()) {
@@ -250,7 +249,6 @@ void VM_EnhancedRedefineClasses::root_oops_do(OopClosure *oopClosure) {
Universe::vm_global()->oops_do(oopClosure);
Threads::oops_do(oopClosure, NULL);
- AOT_ONLY(AOTLoader::oops_do(oopClosure);)
OopStorageSet::strong_oops_do(oopClosure);
CodeBlobToOopClosure blobClosure(oopClosure, CodeBlobToOopClosure::FixRelocations);
@@ -520,7 +518,7 @@ void VM_EnhancedRedefineClasses::doit() {
// before the stack walk again.
for (int i = 0; i < _new_classes->length(); i++) {
- redefine_single_class(_new_classes->at(i), thread);
+ redefine_single_class(thread, _new_classes->at(i));
}
// Update possible redefinition of vm classes (like ClassLoader)
@@ -535,7 +533,7 @@ void VM_EnhancedRedefineClasses::doit() {
// Deoptimize all compiled code that depends on this class (do only once, because it clears whole cache)
// if (_max_redefinition_flags > Klass::ModifyClass) {
- flush_dependent_code(thread);
+ flush_dependent_code();
// }
// Adjust constantpool caches for all classes that reference methods of the evolved class.
@@ -692,7 +690,7 @@ void VM_EnhancedRedefineClasses::doit() {
assert(new_version->super() == NULL || new_version->super()->new_version() == NULL, "Super class must be newest version");
}
log_trace(redefine, class, obsolete, metadata)("calling check_class");
- ClassLoaderData::the_null_class_loader_data()->dictionary()->classes_do(check_class, thread);
+ ClassLoaderData::the_null_class_loader_data()->dictionary()->classes_do(check_class);
#ifdef PRODUCT
}
#endif
@@ -702,7 +700,7 @@ void VM_EnhancedRedefineClasses::doit() {
void VM_EnhancedRedefineClasses::reinitializeJDKClasses() {
if (!_new_classes->is_empty()) {
- ResourceMark rm(Thread::current());
+ ResourceMark rm(JavaThread::current());
for (int i = 0; i < _new_classes->length(); i++) {
InstanceKlass* cur = _new_classes->at(i);
@@ -712,7 +710,7 @@ void VM_EnhancedRedefineClasses::reinitializeJDKClasses() {
if (cur == vmClasses::ClassLoader_klass()) {
// ClassLoader.addClass method is cached in Universe, we must redefine
- Universe::reinitialize_loader_addClass_method(Thread::current());
+ Universe::reinitialize_loader_addClass_method(JavaThread::current());
log_trace(redefine, class, obsolete, metadata)("Reinitialize ClassLoade addClass method cache.");
}
@@ -735,7 +733,7 @@ void VM_EnhancedRedefineClasses::reinitializeJDKClasses() {
cur,
signature,
vmSymbols::void_method_signature(),
- Thread::current());
+ JavaThread::current());
log_trace(redefine, class, obsolete, metadata)("Reregister natives of JDK class %s", cur->external_name());
}
}
@@ -793,7 +791,7 @@ bool VM_EnhancedRedefineClasses::is_modifiable_class(oop klass_mirror) {
// Cannot redefine or retransform an anonymous class.
// TODO: check if is correct in j15
- if (InstanceKlass::cast(k)->is_unsafe_anonymous() || InstanceKlass::cast(k)->is_hidden()) {
+ if (InstanceKlass::cast(k)->is_hidden()) {
return false;
}
return true;
@@ -879,23 +877,15 @@ jvmtiError VM_EnhancedRedefineClasses::load_new_class_versions(TRAPS) {
InstanceKlass* k;
- if (the_class->is_unsafe_anonymous() || the_class->is_hidden()) {
+ if (the_class->is_hidden()) {
InstanceKlass* dynamic_host_class = NULL;
- InstanceKlass* unsafe_anonymous_host = NULL;
if (the_class->is_hidden()) {
log_debug(redefine, class, load)("loading hidden class %s", the_class->name()->as_C_string());
dynamic_host_class = the_class->nest_host(THREAD);
}
- if (the_class->is_unsafe_anonymous()) {
- log_debug(redefine, class, load)("loading usafe anonymous %s", the_class->name()->as_C_string());
- unsafe_anonymous_host = the_class->unsafe_anonymous_host();
- }
-
ClassLoadInfo cl_info(protection_domain,
- unsafe_anonymous_host,
- NULL, // cp_patches
dynamic_host_class, // dynamic_nest_host
Handle(), // classData
the_class->is_hidden(), // is_hidden
@@ -1143,7 +1133,7 @@ int VM_EnhancedRedefineClasses::calculate_redefinition_flags(InstanceKlass* new_
Array<Method*>* k_new_methods(new_class->methods());
int n_old_methods = k_old_methods->length();
int n_new_methods = k_new_methods->length();
- Thread* thread = Thread::current();
+ JavaThread* thread = JavaThread::current();
int ni = 0;
int oi = 0;
@@ -1491,8 +1481,8 @@ void VM_EnhancedRedefineClasses::rollback() {
// Rewrite faster byte-codes back to their slower equivalent. Undoes rewriting happening in templateTable_xxx.cpp
// The reason is that once we zero cpool caches, we need to re-resolve all entries again. Faster bytecodes do not
// do that, they assume that cache entry is resolved already.
-void VM_EnhancedRedefineClasses::unpatch_bytecode(Method* method, TRAPS) {
- RawBytecodeStream bcs(methodHandle(THREAD, method));
+void VM_EnhancedRedefineClasses::unpatch_bytecode(Method* method) {
+ RawBytecodeStream bcs(methodHandle(Thread::current(), method));
Bytecodes::Code code;
Bytecodes::Code java_code;
while (!bcs.is_last_bytecode()) {
@@ -1535,10 +1525,10 @@ void VM_EnhancedRedefineClasses::unpatch_bytecode(Method* method, TRAPS) {
assert(code2 == Bytecodes::_fast_igetfield ||
code2 == Bytecodes::_fast_agetfield ||
code2 == Bytecodes::_fast_fgetfield, "");
- *(bcp + 1) = Bytecodes::java_code(code2);
- }
+ *(bcp + 1) = Bytecodes::java_code(code2);
}
}
+}
// Unevolving classes may point to old methods directly
// from their constant pool caches, itables, and/or vtables. We
@@ -1559,9 +1549,11 @@ void VM_EnhancedRedefineClasses::ClearCpoolCacheAndUnpatch::do_klass(Klass* k) {
constantPoolHandle other_cp = constantPoolHandle(_thread, ik->constants());
// Update host klass of anonymous classes (for example, produced by lambdas) to newest version.
+ /*
if (ik->is_unsafe_anonymous() && ik->unsafe_anonymous_host()->new_version() != NULL) {
ik->set_unsafe_anonymous_host(InstanceKlass::cast(ik->unsafe_anonymous_host()->newest_version()));
}
+ */
// FIXME: check new nest_host for hidden
@@ -1596,7 +1588,7 @@ void VM_EnhancedRedefineClasses::ClearCpoolCacheAndUnpatch::do_klass(Klass* k) {
// If bytecode rewriting is enabled, we also need to unpatch bytecode to force resolution of zeroed entries
if (RewriteBytecodes) {
- ik->methods_do(unpatch_bytecode, _thread);
+ ik->methods_do(unpatch_bytecode);
}
}
@@ -1628,7 +1620,7 @@ void VM_EnhancedRedefineClasses::MethodDataCleaner::do_klass(Klass* k) {
}
-void VM_EnhancedRedefineClasses::update_jmethod_ids(TRAPS) {
+void VM_EnhancedRedefineClasses::update_jmethod_ids(Thread* current) {
for (int j = 0; j < _matching_methods_length; ++j) {
Method* old_method = _matching_old_methods[j];
jmethodID jmid = old_method->find_jmethod_id_or_null();
@@ -1639,10 +1631,10 @@ void VM_EnhancedRedefineClasses::update_jmethod_ids(TRAPS) {
if (jmid != NULL) {
// There is a jmethodID, change it to point to the new method
- methodHandle new_method_h(THREAD, _matching_new_methods[j]);
+ methodHandle new_method_h(current, _matching_new_methods[j]);
if (old_method->new_version() == NULL) {
- methodHandle old_method_h(THREAD, _matching_old_methods[j]);
+ methodHandle old_method_h(current, _matching_old_methods[j]);
jmethodID new_jmethod_id = Method::make_jmethod_id(old_method_h->method_holder()->class_loader_data(), old_method_h());
bool result = InstanceKlass::cast(old_method_h->method_holder())->update_jmethod_id(old_method_h(), new_jmethod_id);
} else {
@@ -1864,7 +1856,7 @@ void VM_EnhancedRedefineClasses::mark_dependent_code(InstanceKlass* ik) {
// subsequent calls to RedefineClasses need only throw away code
// that depends on the class.
//
-void VM_EnhancedRedefineClasses::flush_dependent_code(TRAPS) {
+void VM_EnhancedRedefineClasses::flush_dependent_code() {
assert_locked_or_safepoint(Compile_lock);
// All dependencies have been recorded from startup or this is a second or
@@ -1959,9 +1951,9 @@ void VM_EnhancedRedefineClasses::compute_added_deleted_matching_methods() {
// a helper method to be specified. The interesting parameters
// that we would like to pass to the helper method are saved in
// static global fields in the VM operation.
-void VM_EnhancedRedefineClasses::redefine_single_class(InstanceKlass* new_class_oop, TRAPS) {
+void VM_EnhancedRedefineClasses::redefine_single_class(Thread* current, InstanceKlass* new_class_oop) {
- HandleMark hm(THREAD); // make sure handles from this call are freed
+ HandleMark hm(current); // make sure handles from this call are freed
InstanceKlass* new_class = new_class_oop;
InstanceKlass* the_class = InstanceKlass::cast(new_class_oop->old_version());
@@ -1980,7 +1972,7 @@ void VM_EnhancedRedefineClasses::redefine_single_class(InstanceKlass* new_class_
// track number of methods that are EMCP for add_previous_version() call below
check_methods_and_mark_as_obsolete();
- update_jmethod_ids(THREAD);
+ update_jmethod_ids(current);
_any_class_has_resolved_methods = the_class->has_resolved_methods() || _any_class_has_resolved_methods;
@@ -2002,14 +1994,14 @@ void VM_EnhancedRedefineClasses::redefine_single_class(InstanceKlass* new_class_
*/
{
- ResourceMark rm(THREAD);
+ ResourceMark rm(current);
// increment the classRedefinedCount field in the_class and in any
// direct and indirect subclasses of the_class
- increment_class_counter(new_class, THREAD);
+ increment_class_counter(current, new_class);
log_info(redefine, class, load)
("redefined name=%s, count=%d (avail_mem=" UINT64_FORMAT "K)",
new_class->external_name(), java_lang_Class::classRedefinedCount(new_class->java_mirror()), os::available_memory() >> 10);
- Events::log_redefinition(THREAD, "redefined class name=%s, count=%d",
+ Events::log_redefinition(current, "redefined class name=%s, count=%d",
new_class->external_name(),
java_lang_Class::classRedefinedCount(new_class->java_mirror()));
}
@@ -2018,21 +2010,21 @@ void VM_EnhancedRedefineClasses::redefine_single_class(InstanceKlass* new_class_
// Increment the classRedefinedCount field in the specific InstanceKlass
// and in all direct and indirect subclasses.
-void VM_EnhancedRedefineClasses::increment_class_counter(InstanceKlass *ik, TRAPS) {
+void VM_EnhancedRedefineClasses::increment_class_counter(Thread* current, InstanceKlass *ik) {
oop class_mirror = ik->old_version()->java_mirror();
Klass* class_oop = java_lang_Class::as_Klass(class_mirror);
int new_count = java_lang_Class::classRedefinedCount(class_mirror) + 1;
java_lang_Class::set_classRedefinedCount(ik->java_mirror(), new_count);
}
-void VM_EnhancedRedefineClasses::check_class(InstanceKlass* ik, TRAPS) {
+void VM_EnhancedRedefineClasses::check_class(InstanceKlass* ik) {
if (ik->is_instance_klass() && ik->old_version() != NULL) {
- HandleMark hm(THREAD);
+ HandleMark hm(Thread::current());
assert(ik->new_version() == NULL, "must be latest version in system dictionary");
if (ik->vtable_length() > 0) {
- ResourceMark rm(THREAD);
+ ResourceMark rm(Thread::current());
assert(ik->vtable().check_no_old_or_obsolete_entries(), "old method found");
ik->vtable().verify(tty, true);
}
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
index 673688dff84..378e6f78582 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
@@ -122,7 +122,7 @@ class VM_EnhancedRedefineClasses: public VM_GC_Operation {
static void mark_as_scavengable(nmethod* nm);
static void unregister_nmethod_g1(nmethod* nm);
static void register_nmethod_g1(nmethod* nm);
- static void unpatch_bytecode(Method* method, TRAPS);
+ static void unpatch_bytecode(Method* method);
void root_oops_do(OopClosure *oopClosure);
@@ -131,28 +131,28 @@ class VM_EnhancedRedefineClasses: public VM_GC_Operation {
void compute_added_deleted_matching_methods();
// Change jmethodIDs to point to the new methods
- void update_jmethod_ids(TRAPS);
+ void update_jmethod_ids(Thread* current);
// marking methods as old and/or obsolete
void check_methods_and_mark_as_obsolete();
void transfer_old_native_function_registrations(InstanceKlass* the_class);
// Install the redefinition of a class
- void redefine_single_class(InstanceKlass* new_class_oop, TRAPS);
+ void redefine_single_class(Thread* current, InstanceKlass* new_class_oop);
// Increment the classRedefinedCount field in the specific InstanceKlass
// and in all direct and indirect subclasses.
- void increment_class_counter(InstanceKlass *ik, TRAPS);
+ void increment_class_counter(Thread* current, InstanceKlass *ik);
void mark_dependent_code(InstanceKlass* ik);
- void flush_dependent_code(TRAPS);
+ void flush_dependent_code();
u8 next_id();
void reinitializeJDKClasses();
- static void check_class(InstanceKlass* k_oop, TRAPS);
+ static void check_class(InstanceKlass* k_oop);
static void dump_methods();
--
2.23.0

View File

@@ -0,0 +1,142 @@
From db2d7cd0cd956f297c58baa7500c1440092648bf Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Sun, 20 Jun 2021 19:42:51 +0200
Subject: [PATCH 34/39] Fix init_method_MemberName after Thread to JavaThread
refactorization
---
src/hotspot/share/interpreter/linkResolver.cpp | 14 ++++++++++----
src/hotspot/share/interpreter/linkResolver.hpp | 3 ++-
src/hotspot/share/oops/instanceKlass.cpp | 15 ---------------
src/hotspot/share/oops/instanceKlass.hpp | 1 -
.../share/prims/jvmtiEnhancedRedefineClasses.cpp | 11 +++++++++--
5 files changed, 21 insertions(+), 23 deletions(-)
diff --git a/src/hotspot/share/interpreter/linkResolver.cpp b/src/hotspot/share/interpreter/linkResolver.cpp
index 74a6af13ea4..78c9624a18b 100644
--- a/src/hotspot/share/interpreter/linkResolver.cpp
+++ b/src/hotspot/share/interpreter/linkResolver.cpp
@@ -131,14 +131,14 @@ void CallInfo::set_common(Klass* resolved_klass,
}
// utility query for unreflecting a method
-CallInfo::CallInfo(Method* resolved_method, Klass* resolved_klass, TRAPS) {
+CallInfo::CallInfo(Method* resolved_method, Klass* resolved_klass, Thread* thread) {
Klass* resolved_method_holder = resolved_method->method_holder();
if (resolved_klass == NULL) { // 2nd argument defaults to holder of 1st
resolved_klass = resolved_method_holder;
}
_resolved_klass = resolved_klass;
- _resolved_method = methodHandle(THREAD, resolved_method);
- _selected_method = methodHandle(THREAD, resolved_method);
+ _resolved_method = methodHandle(thread, resolved_method);
+ _selected_method = methodHandle(thread, resolved_method);
// classify:
CallKind kind = CallInfo::unknown_kind;
int index = resolved_method->vtable_index();
@@ -179,7 +179,9 @@ CallInfo::CallInfo(Method* resolved_method, Klass* resolved_klass, TRAPS) {
_call_index = index;
_resolved_appendix = Handle();
// Find or create a ResolvedMethod instance for this Method*
- set_resolved_method_name(CHECK);
+ if (thread->is_Java_thread()) { // exclude DCEVM VM thread
+ set_resolved_method_name(thread->as_Java_thread());
+ }
DEBUG_ONLY(verify());
}
@@ -190,6 +192,10 @@ void CallInfo::set_resolved_method_name(TRAPS) {
_resolved_method_name = Handle(THREAD, rmethod_name);
}
+void CallInfo::set_resolved_method_name_dcevm(oop rmethod_name, Thread* thread) {
+ _resolved_method_name = Handle(thread, rmethod_name);
+}
+
#ifdef ASSERT
void CallInfo::verify() {
switch (call_kind()) { // the meaning and allowed value of index depends on kind
diff --git a/src/hotspot/share/interpreter/linkResolver.hpp b/src/hotspot/share/interpreter/linkResolver.hpp
index 9eeb10cc6fd..871eaab7464 100644
--- a/src/hotspot/share/interpreter/linkResolver.hpp
+++ b/src/hotspot/share/interpreter/linkResolver.hpp
@@ -91,7 +91,7 @@ class CallInfo : public StackObj {
// utility to extract an effective CallInfo from a method and an optional receiver limit
// does not queue the method for compilation. This also creates a ResolvedMethodName
// object for the resolved_method.
- CallInfo(Method* resolved_method, Klass* resolved_klass, TRAPS);
+ CallInfo(Method* resolved_method, Klass* resolved_klass, Thread* thread);
Klass* resolved_klass() const { return _resolved_klass; }
Method* resolved_method() const { return _resolved_method(); }
@@ -100,6 +100,7 @@ class CallInfo : public StackObj {
Handle resolved_method_name() const { return _resolved_method_name; }
// Materialize a java.lang.invoke.ResolvedMethodName for this resolved_method
void set_resolved_method_name(TRAPS);
+ void set_resolved_method_name_dcevm(oop rmethod_name, Thread* thread);
BasicType result_type() const { return selected_method()->result_type(); }
CallKind call_kind() const { return _call_kind; }
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
index c54b6b1bf46..8d259451032 100644
--- a/src/hotspot/share/oops/instanceKlass.cpp
+++ b/src/hotspot/share/oops/instanceKlass.cpp
@@ -1643,21 +1643,6 @@ void InstanceKlass::methods_do(void f(Method* method)) {
}
}
-void InstanceKlass::methods_do(void f(Method* method, TRAPS), TRAPS) {
- // Methods aren't stable until they are loaded. This can be read outside
- // a lock through the ClassLoaderData for profiling
- if (!is_loaded()) {
- return;
- }
-
- int len = methods()->length();
- for (int index = 0; index < len; index++) {
- Method* m = methods()->at(index);
- assert(m->is_method(), "must be method");
- f(m, CHECK);
- }
-}
-
// (DCEVM) Update information contains mapping of fields from old class to the new class.
// Info is stored on HEAP, you need to call clear_update_information to free the space.
void InstanceKlass::store_update_information(GrowableArray<int> &values) {
diff --git a/src/hotspot/share/oops/instanceKlass.hpp b/src/hotspot/share/oops/instanceKlass.hpp
index 317a006a4ec..36587031fec 100644
--- a/src/hotspot/share/oops/instanceKlass.hpp
+++ b/src/hotspot/share/oops/instanceKlass.hpp
@@ -1017,7 +1017,6 @@ public:
void clear_update_information();
void methods_do(void f(Method* method));
- void methods_do(void f(Method* method, TRAPS), TRAPS);
void array_klasses_do(void f(Klass* k));
void array_klasses_do(void f(Klass* k, TRAPS), TRAPS);
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index b662976afcb..ff012383872 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -292,8 +292,15 @@ class ChangePointersOopClosure : public BasicOopIterateClosure {
// Note: we might set NULL at this point, which should force AbstractMethodError at runtime
Thread *thread = Thread::current();
CallInfo info(new_method, newest, thread);
- Handle objHandle(thread, obj);
- MethodHandles::init_method_MemberName(objHandle, info);
+ oop resolved_method = ResolvedMethodTable::find_method(info.resolved_method());
+ if (resolved_method != NULL) {
+ info.set_resolved_method_name_dcevm(resolved_method, thread);
+ Handle objHandle(thread, obj);
+ MethodHandles::init_method_MemberName(objHandle, info);
+ } else {
+ assert(0, "Must be resolved");
+ java_lang_invoke_MemberName::set_method(obj, NULL);
+ }
} else {
java_lang_invoke_MemberName::set_method(obj, NULL);
}
--
2.23.0

View File

@@ -0,0 +1,25 @@
From bfbbae66340a223328542722b299f67c21166c52 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Mon, 21 Jun 2021 20:44:17 +0200
Subject: [PATCH 35/39] Fix "implicit conversion of NULL constant to 'bool'"
---
src/hotspot/share/prims/jvmtiRedefineClasses.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/hotspot/share/prims/jvmtiRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiRedefineClasses.cpp
index 87b3b5f47ce..6915a09cf85 100644
--- a/src/hotspot/share/prims/jvmtiRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiRedefineClasses.cpp
@@ -1390,7 +1390,7 @@ jvmtiError VM_RedefineClasses::load_new_class_versions() {
the_class->name(),
the_class->class_loader_data(),
cl_info,
- NULL,
+ false,
THREAD);
// Clear class_being_redefined just to be sure.
--
2.23.0

View File

@@ -0,0 +1,35 @@
From 5bb6ef0fc266a748232c7c51191deab47d4f3857 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Wed, 30 Jun 2021 18:30:00 +0200
Subject: [PATCH 36/39] Fix, pass SystemDictionary::resolve_from_stream cl_info
param
---
src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index ff012383872..cbcb484a290 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -920,10 +920,16 @@ jvmtiError VM_EnhancedRedefineClasses::load_new_class_versions(TRAPS) {
}
} else {
+ ClassLoadInfo cl_info(protection_domain,
+ NULL, // dynamic_nest_host
+ Handle(), // classData
+ false, // is_hidden
+ !the_class->is_non_strong_hidden(), // is_strong_hidden
+ true); // FIXME: check if correct. can_access_vm_annotations
k = SystemDictionary::resolve_from_stream(&st,
the_class_sym,
the_class_loader,
- protection_domain,
+ cl_info,
the_class,
THREAD);
}
--
2.23.0

View File

@@ -0,0 +1,113 @@
From 563e06d1c56cfc3f4e93e3975cd6c2dab8183c98 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Wed, 30 Jun 2021 18:50:38 +0200
Subject: [PATCH 37/39] Search for affected classes in all initialized classes
in cld
Fix also case when lambda interface is redefined. Lambda class is
missing in cld dictionary since it is hidden since j17
---
src/hotspot/share/classfile/classLoaderData.cpp | 10 ++++++++++
src/hotspot/share/classfile/classLoaderData.hpp | 1 +
.../share/classfile/classLoaderDataGraph.cpp | 11 ++++-------
.../share/classfile/classLoaderDataGraph.hpp | 2 +-
.../share/prims/jvmtiEnhancedRedefineClasses.cpp | 13 ++++---------
5 files changed, 20 insertions(+), 17 deletions(-)
diff --git a/src/hotspot/share/classfile/classLoaderData.cpp b/src/hotspot/share/classfile/classLoaderData.cpp
index 65ce4c4af8c..1c51e83e86e 100644
--- a/src/hotspot/share/classfile/classLoaderData.cpp
+++ b/src/hotspot/share/classfile/classLoaderData.cpp
@@ -337,6 +337,16 @@ void ClassLoaderData::classes_do(KlassClosure* klass_closure) {
}
}
+void ClassLoaderData::initialized_classes_do(KlassClosure* klass_closure) {
+ // Lock-free access requires load_acquire
+ for (Klass* k = Atomic::load_acquire(&_klasses); k != NULL; k = k->next_link()) {
+ if (k->is_instance_klass() && InstanceKlass::cast(k)->is_initialized()) {
+ klass_closure->do_klass(k);
+ }
+ assert(k != k->next_link(), "no loops!");
+ }
+}
+
void ClassLoaderData::classes_do(void f(Klass * const)) {
// Lock-free access requires load_acquire
for (Klass* k = Atomic::load_acquire(&_klasses); k != NULL; k = k->next_link()) {
diff --git a/src/hotspot/share/classfile/classLoaderData.hpp b/src/hotspot/share/classfile/classLoaderData.hpp
index bda39f3e353..28fc9060e03 100644
--- a/src/hotspot/share/classfile/classLoaderData.hpp
+++ b/src/hotspot/share/classfile/classLoaderData.hpp
@@ -272,6 +272,7 @@ class ClassLoaderData : public CHeapObj<mtClass> {
void oops_do(OopClosure* f, int claim_value, bool clear_modified_oops = false);
void classes_do(KlassClosure* klass_closure);
+ void initialized_classes_do(KlassClosure* klass_closure);
Klass* klasses() { return _klasses; }
JNIMethodBlock* jmethod_ids() const { return _jmethod_ids; }
diff --git a/src/hotspot/share/classfile/classLoaderDataGraph.cpp b/src/hotspot/share/classfile/classLoaderDataGraph.cpp
index aa2a6bcec6b..f2394f72dbd 100644
--- a/src/hotspot/share/classfile/classLoaderDataGraph.cpp
+++ b/src/hotspot/share/classfile/classLoaderDataGraph.cpp
@@ -361,13 +361,10 @@ void ClassLoaderDataGraph::classes_do(KlassClosure* klass_closure) {
}
}
-void ClassLoaderDataGraph::anonymous_or_hidden_classes_do(KlassClosure* klass_closure) {
- Thread* thread = Thread::current();
- for (ClassLoaderData* cld = _head; cld != NULL; cld = cld->next()) {
- if (cld->has_class_mirror_holder()) {
- Handle holder(thread, cld->holder_phantom());
- cld->classes_do(klass_closure);
- }
+void ClassLoaderDataGraph::initialized_classes_do(KlassClosure* klass_closure) {
+ ClassLoaderDataGraphIterator iter;
+ while (ClassLoaderData* cld = iter.get_next()) {
+ cld->initialized_classes_do(klass_closure);
}
}
diff --git a/src/hotspot/share/classfile/classLoaderDataGraph.hpp b/src/hotspot/share/classfile/classLoaderDataGraph.hpp
index da712eaf55f..ff391ec74fc 100644
--- a/src/hotspot/share/classfile/classLoaderDataGraph.hpp
+++ b/src/hotspot/share/classfile/classLoaderDataGraph.hpp
@@ -80,7 +80,7 @@ class ClassLoaderDataGraph : public AllStatic {
static void classes_do(KlassClosure* klass_closure);
// Enhanced class redefinition
- static void anonymous_or_hidden_classes_do(KlassClosure* klass_closure);
+ static void initialized_classes_do(KlassClosure* klass_closure);
static void classes_do(void f(Klass* const));
static void methods_do(void f(Method*));
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index cbcb484a290..43899ea3d48 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -2170,17 +2170,12 @@ jvmtiError VM_EnhancedRedefineClasses::find_sorted_affected_classes(TRAPS) {
{
MutexLocker mcld(ClassLoaderDataGraph_lock);
- // 0. we can't use ClassLoaderDataGraph::classes_do since classes can be uninitialized in cld,
- // fully initialized class is in system dictionary
+ // We can't use ClassLoaderDataGraph::classes_do since classes can be uninitialized in cld,
+ // fully initialized class is in system dictionary, but hidden classes are excluded. Therefore
+ // we use special method iterating over initialized classes only
// ClassLoaderDataGraph::classes_do(&closure);
- // 1. Scan over dictionaries
- ClassLoaderDataGraph::dictionary_classes_do(&closure);
-
- // 2. Anonymous or hidden class is not in dictionary, we have to iterate anonymous cld directly, but there is race cond...
- // TODO: review ... anonymous class is added to cld before InstanceKlass initialization,
- // find out how to check if the InstanceKlass is initialized
- ClassLoaderDataGraph::anonymous_or_hidden_classes_do(&closure);
+ ClassLoaderDataGraph::initialized_classes_do(&closure);
}
log_trace(redefine, class, load)("%d classes affected", _affected_klasses->length());
--
2.23.0

View File

@@ -0,0 +1,27 @@
From acad06204bc4f7e7a89e9a44ded6b9d27082327b Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Wed, 30 Jun 2021 18:58:47 +0200
Subject: [PATCH 38/39] Fix compilation issue
---
src/hotspot/share/interpreter/linkResolver.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/hotspot/share/interpreter/linkResolver.cpp b/src/hotspot/share/interpreter/linkResolver.cpp
index 78c9624a18b..28dccd0face 100644
--- a/src/hotspot/share/interpreter/linkResolver.cpp
+++ b/src/hotspot/share/interpreter/linkResolver.cpp
@@ -562,8 +562,8 @@ void LinkResolver::check_method_accessability(Klass* ref_klass,
// We'll check for the method name first, as that's most likely
// to be false (so we'll short-circuit out of these tests).
if (sel_method->name() == vmSymbols::clone_name() &&
- ( !AllowEnhancedClassRedefinition && sel_klass == vmClasses::Object_klass() ||
- AllowEnhancedClassRedefinition && sel_klass->newest_version() == vmClasses::Object_klass()->newest_version()) &&
+ ( (!AllowEnhancedClassRedefinition && sel_klass == vmClasses::Object_klass()) ||
+ (AllowEnhancedClassRedefinition && sel_klass->newest_version() == vmClasses::Object_klass()->newest_version()) ) &&
resolved_klass->is_array_klass()) {
// We need to change "protected" to "public".
assert(flags.is_protected(), "clone not protected?");
--
2.23.0

View File

@@ -0,0 +1,171 @@
From 563465b112da14e8b81ef32eefc06c79015a809b Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@jetbrains.com>
Date: Tue, 27 Jul 2021 21:32:51 +0200
Subject: [PATCH 39/39] Remove duplicated lambdaFormInvokers.cpp
---
.../share/classfile/lambdaFormInvokers.cpp | 152 ------------------
1 file changed, 152 deletions(-)
delete mode 100644 src/hotspot/share/classfile/lambdaFormInvokers.cpp
diff --git a/src/hotspot/share/classfile/lambdaFormInvokers.cpp b/src/hotspot/share/classfile/lambdaFormInvokers.cpp
deleted file mode 100644
index 281de58b482..00000000000
--- a/src/hotspot/share/classfile/lambdaFormInvokers.cpp
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright (c) 2020, 2021, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#include "precompiled.hpp"
-#include "classfile/classLoadInfo.hpp"
-#include "classfile/classFileStream.hpp"
-#include "classfile/javaClasses.inline.hpp"
-#include "classfile/klassFactory.hpp"
-#include "classfile/lambdaFormInvokers.hpp"
-#include "classfile/symbolTable.hpp"
-#include "classfile/systemDictionary.hpp"
-#include "classfile/systemDictionaryShared.hpp"
-#include "classfile/vmClasses.hpp"
-#include "classfile/vmSymbols.hpp"
-#include "logging/log.hpp"
-#include "memory/oopFactory.hpp"
-#include "memory/metaspaceShared.hpp"
-#include "memory/resourceArea.hpp"
-#include "oops/instanceKlass.hpp"
-#include "oops/klass.hpp"
-#include "oops/objArrayKlass.hpp"
-#include "oops/objArrayOop.hpp"
-#include "oops/oop.inline.hpp"
-#include "oops/typeArrayOop.inline.hpp"
-#include "runtime/handles.inline.hpp"
-#include "runtime/javaCalls.hpp"
-
-GrowableArray<char*>* LambdaFormInvokers::_lambdaform_lines = NULL;
-
-void LambdaFormInvokers::append(char* line) {
- if (_lambdaform_lines == NULL) {
- _lambdaform_lines = new GrowableArray<char*>(100);
- }
- _lambdaform_lines->append(line);
-}
-
-void LambdaFormInvokers::regenerate_holder_classes(TRAPS) {
- assert(_lambdaform_lines != NULL, "Bad List");
- ResourceMark rm(THREAD);
-
- Symbol* cds_name = vmSymbols::jdk_internal_misc_CDS();
- Klass* cds_klass = SystemDictionary::resolve_or_null(cds_name, THREAD);
- guarantee(cds_klass != NULL, "jdk/internal/misc/CDS must exist!");
-
- int len = _lambdaform_lines->length();
- objArrayHandle list_lines = oopFactory::new_objArray_handle(vmClasses::String_klass(), len, CHECK);
- for (int i = 0; i < len; i++) {
- Handle h_line = java_lang_String::create_from_str(_lambdaform_lines->at(i), CHECK);
- list_lines->obj_at_put(i, h_line());
- }
-
- //
- // Object[] CDS.generateLambdaFormHolderClasses(String[] lines)
- // the returned Object[] layout:
- // name, byte[], name, byte[] ....
- Symbol* method = vmSymbols::generateLambdaFormHolderClasses();
- Symbol* signrs = vmSymbols::generateLambdaFormHolderClasses_signature();
-
- JavaValue result(T_OBJECT);
- JavaCalls::call_static(&result, cds_klass, method, signrs, list_lines, THREAD);
-
- if (HAS_PENDING_EXCEPTION) {
- log_info(cds)("%s: %s", THREAD->pending_exception()->klass()->external_name(),
- java_lang_String::as_utf8_string(java_lang_Throwable::message(THREAD->pending_exception())));
- CLEAR_PENDING_EXCEPTION;
- return;
- }
-
- objArrayHandle h_array(THREAD, (objArrayOop)result.get_oop());
- int sz = h_array->length();
- assert(sz % 2 == 0 && sz >= 2, "Must be even size of length");
- for (int i = 0; i < sz; i+= 2) {
- Handle h_name(THREAD, h_array->obj_at(i));
- typeArrayHandle h_bytes(THREAD, (typeArrayOop)h_array->obj_at(i+1));
- assert(h_name != NULL, "Class name is NULL");
- assert(h_bytes != NULL, "Class bytes is NULL");
-
- char *class_name = java_lang_String::as_utf8_string(h_name());
- int len = h_bytes->length();
- // make a copy of class bytes so GC will not affect us.
- char *buf = resource_allocate_bytes(THREAD, len);
- memcpy(buf, (char*)h_bytes->byte_at_addr(0), len);
- ClassFileStream st((u1*)buf, len, NULL, ClassFileStream::verify);
-
- reload_class(class_name, st, THREAD);
- // free buf
- resource_free_bytes(buf, len);
-
- if (HAS_PENDING_EXCEPTION) {
- log_info(cds)("Exception happened: %s", PENDING_EXCEPTION->klass()->name()->as_C_string());
- log_info(cds)("Could not create InstanceKlass for class %s", class_name);
- CLEAR_PENDING_EXCEPTION;
- return;
- }
- }
-}
-
-// class_handle - the class name, bytes_handle - the class bytes
-void LambdaFormInvokers::reload_class(char* name, ClassFileStream& st, TRAPS) {
- Symbol* class_name = SymbolTable::new_symbol((const char*)name);
- // the class must exist
- Klass* klass = SystemDictionary::resolve_or_null(class_name, THREAD);
- if (klass == NULL) {
- log_info(cds)("Class %s not present, skip", name);
- return;
- }
- assert(klass->is_instance_klass(), "Should be");
-
- ClassLoaderData* cld = ClassLoaderData::the_null_class_loader_data();
- Handle protection_domain;
- ClassLoadInfo cl_info(protection_domain);
-
- InstanceKlass* result = KlassFactory::create_from_stream(&st,
- class_name,
- cld,
- cl_info,
- false,
- CHECK);
-
- {
- MutexLocker mu_r(THREAD, Compile_lock); // add_to_hierarchy asserts this.
- SystemDictionary::add_to_hierarchy(result);
- }
- // new class not linked yet.
- MetaspaceShared::try_link_class(THREAD, result);
- assert(!HAS_PENDING_EXCEPTION, "Invariant");
-
- // exclude the existing class from dump
- SystemDictionaryShared::set_excluded(InstanceKlass::cast(klass));
- log_info(cds, lambda)("Replaced class %s, old: %p new: %p", name, klass, result);
-}
--
2.23.0

View File

@@ -0,0 +1,121 @@
#!/bin/bash -x
# The following parameters must be specified:
# JBSDK_VERSION - specifies major version of OpenJDK e.g. 11_0_6 (instead of dots '.' underbars "_" are used)
# JDK_BUILD_NUMBER - specifies update release of OpenJDK build or the value of --with-version-build argument to configure
# build_number - specifies the number of JetBrainsRuntime build
# bundle_type - specifies bundle to be built; possible values:
# <empty> or nomod - the release bundles without any additional modules (jcef)
# jcef - the release bundles with jcef
# fd - the fastdebug bundles which also include the jcef module
#
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
#
# $ ./java --version
# openjdk 11.0.6 2020-01-14
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
#
# Environment variables:
# JCEF_PATH - specifies the path to the directory with JCEF binaries.
# By default JCEF binaries should be located in ./jcef_win_x64
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
bundle_type=$4
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
WORK_DIR=$(pwd)
JCEF_PATH=${JCEF_PATH:=$WORK_DIR/jcef_win_x64}
source jb/project/tools/common/scripts/common.sh
function create_image_bundle {
__bundle_name=$1
__arch_name=$2
__modules_path=$3
__modules=$4
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
echo Running jlink ...
${JSDK}/bin/jlink \
--module-path $__modules_path --no-man-pages --compress=2 \
--add-modules $__modules --output $__arch_name || do_exit $?
grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> $__arch_name/release
if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then
sed 's/JBR/JBRSDK/g' $__arch_name/release > release
mv release $__arch_name/release
copy_jmods "$__modules" "$__modules_path" "$__arch_name"/jmods
fi
}
WITH_DEBUG_LEVEL="--with-debug-level=release"
RELEASE_NAME=windows-x86_64-server-release
case "$bundle_type" in
"jcef")
do_reset_changes=0
;;
"dcevm")
HEAD_REVISION=$(git rev-parse HEAD)
git am jb/project/tools/patches/dcevm/*.patch || do_exit $?
do_reset_dcevm=0
do_reset_changes=0
;;
"nomod" | "")
bundle_type=""
;;
"fd")
do_reset_changes=0
WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
RELEASE_NAME=windows-x86_64-server-fastdebug
;;
esac
sh ./configure \
$WITH_DEBUG_LEVEL \
--with-vendor-name="$VENDOR_NAME" \
--with-vendor-version-string="$VENDOR_VERSION_STRING" \
--with-jvm-features=shenandoahgc \
--with-version-pre= \
--with-version-build=$JDK_BUILD_NUMBER \
--with-version-opt=b${build_number} \
--with-toolchain-version=$TOOLCHAIN_VERSION \
--with-boot-jdk=$BOOT_JDK \
--disable-ccache \
--enable-cds=yes || do_exit $?
if [ -z "$bundle_type" ]; then
make LOG=info CONF=$RELEASE_NAME clean images test-image || do_exit $?
else
make LOG=info CONF=$RELEASE_NAME clean images || do_exit $?
fi
IMAGES_DIR=build/$RELEASE_NAME/images
JSDK=$IMAGES_DIR/jdk
JSDK_MODS_DIR=$IMAGES_DIR/jmods
JBRSDK_BUNDLE=jbrsdk
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "dcevm" ] || [ "$bundle_type" == "fd" ]; then
git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
update_jsdk_mods "$JSDK" "$JCEF_PATH"/jmods "$JSDK"/jmods "$JSDK_MODS_DIR" || do_exit $?
cp $JCEF_PATH/jmods/* ${JSDK_MODS_DIR} # $JSDK/jmods is not unchanged
jbr_name_postfix="_${bundle_type}"
fi
# create runtime image bundle
modules=$(xargs < modules.list | sed s/" "//g) || do_exit $?
create_image_bundle "jbr${jbr_name_postfix}" "jbr" $JSDK_MODS_DIR "$modules" || do_exit $?
# create sdk image bundle
modules=$(cat ${JSDK}/release | grep MODULES | sed s/MODULES=//g | sed s/' '/','/g | sed s/\"//g | sed s/\\r//g | sed s/\\n//g)
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "dcevm" ] || [ "$bundle_type" == "fd" ] || [ "$bundle_type" == "$JBRSDK_BUNDLE" ]; then
modules=${modules},$(get_mods_list "$JCEF_PATH"/jmods)
fi
create_image_bundle "$JBRSDK_BUNDLE${jbr_name_postfix}" "$JBRSDK_BUNDLE" "$JSDK_MODS_DIR" "$modules" || do_exit $?
do_exit 0

View File

@@ -0,0 +1,62 @@
#!/bin/bash -x
# The following parameters must be specified:
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
# build_number - specifies the number of JetBrainsRuntime build
#
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
#
# $ ./java --version
# openjdk 11.0.6 2020-01-14
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
#
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
source jb/project/tools/common/scripts/common.sh
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
WORK_DIR=$(pwd)
[ -z "$bundle_type" ] && (git apply -p0 < jb/project/tools/patches/exclude_jcef_module.patch || exit $?)
PATH="/usr/local/bin:/usr/bin:${PATH}"
./configure \
--with-target-bits=32 \
--with-vendor-name="${VENDOR_NAME}" \
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
--with-version-pre= \
--with-version-build=${JDK_BUILD_NUMBER} \
--with-version-opt=b${build_number} \
--with-toolchain-version=${TOOLCHAIN_VERSION} \
--with-boot-jdk=${BOOT_JDK} \
--disable-ccache \
--enable-cds=yes || exit 1
make clean CONF=windows-x86-server-release || exit 1
make LOG=info images CONF=windows-x86-server-release test-image || exit 1
JBSDK=${JBRSDK_BASE_NAME}-windows-x86-b${build_number}
BASE_DIR=build/windows-x86-server-release/images
JSDK=${BASE_DIR}/jdk
JBRSDK_BUNDLE=jbrsdk
rm -rf ${BASE_DIR}/${JBRSDK_BUNDLE} && rsync -a --exclude demo --exclude sample ${JSDK}/ ${JBRSDK_BUNDLE} || exit 1
sed 's/JBR/JBRSDK/g' ${JSDK}/release > release
mv release ${JBRSDK_BUNDLE}/release
JBR_BUNDLE=jbr
rm -rf ${JBR_BUNDLE}
grep -v javafx modules.list | grep -v "jdk.internal.vm\|jdk.aot\|jcef" > modules.list.x86
${JSDK}/bin/jlink \
--module-path ${JSDK}/jmods --no-man-pages --compress=2 \
--add-modules $(xargs < modules.list.x86 | sed s/" "//g) --output ${JBR_BUNDLE} || exit $?
echo Modifying release info ...
#grep -v \"^JAVA_VERSION\" ${JSDK}/release | grep -v \"^MODULES\" >> ${JBR_BUNDLE}/release

View File

@@ -0,0 +1,59 @@
#!/bin/bash -x
# The following parameters must be specified:
# JBSDK_VERSION - specifies major version of OpenJDK e.g. 11_0_6 (instead of dots '.' underbars "_" are used)
# JDK_BUILD_NUMBER - specifies udate release of OpenJDK build or the value of --with-version-build argument to configure
# build_number - specifies the number of JetBrainsRuntime build
# bundle_type - specifies bundle to be built; possible values:
# <empty> or nomod - the bundles without any additional modules (jcef)
# jcef - the bundles with jcef
# fd - the fastdebug bundles which also include the jcef module
#
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
#
# $ ./java --version
# openjdk 11.0.6 2020-01-14
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
#
source jb/project/tools/common/scripts/common.sh
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
bundle_type=$4
function pack_jbr {
__bundle_name=$1
__arch_name=$2
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
JBR=${__bundle_name}-${JBSDK_VERSION}-windows-x64-${fastdebug_infix}b${build_number}
echo Creating $JBR.tar.gz ...
/usr/bin/tar -czf $JBR.tar.gz -C $BASE_DIR $__arch_name || do_exit $?
}
[ "$bundle_type" == "nomod" ] && bundle_type=""
JBRSDK_BUNDLE=jbrsdk
RELEASE_NAME=windows-x86_64-server-release
IMAGES_DIR=build/$RELEASE_NAME/images
JBSDK=$JBRSDK_BASE_NAME-windows-x64-b$build_number
BASE_DIR=.
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "dcevm" ] || [ "$bundle_type" == "fd" ]; then
jbr_name_postfix="_${bundle_type}"
fi
pack_jbr jbr${jbr_name_postfix} jbr
pack_jbr jbrsdk${jbr_name_postfix} jbrsdk
if [ -z "$bundle_type" ]; then
JBRSDK_TEST=$JBRSDK_BASE_NAME-windows-test-x64-b$build_number
echo Creating $JBRSDK_TEST.tar.gz ...
/usr/bin/tar -czf $JBRSDK_TEST.tar.gz -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
fi

View File

@@ -0,0 +1,42 @@
#!/bin/bash -x
# The following parameters must be specified:
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
# build_number - specifies the number of JetBrainsRuntime build
#
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
#
# $ ./java --version
# openjdk 11.0.6 2020-01-14
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
#
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
JBRSDK_BASE_NAME=jbrsdk-$JBSDK_VERSION
JBR_BASE_NAME=jbr-$JBSDK_VERSION
IMAGES_DIR=build/windows-x86-server-release/images
JSDK=$IMAGES_DIR/jdk
JBSDK=$JBRSDK_BASE_NAME-windows-x86-b$build_number
BASE_DIR=.
JBRSDK_BUNDLE=jbrsdk
echo Creating $JBSDK.tar.gz ...
/usr/bin/tar -czf $JBSDK.tar.gz $JBRSDK_BUNDLE || exit 1
JBR_BUNDLE=jbr
JBR_BASE_NAME=jbr-${JBSDK_VERSION}
JBR=$JBR_BASE_NAME-windows-x86-b$build_number
echo Creating $JBR.tar.gz ...
/usr/bin/tar -czf $JBR.tar.gz -C $BASE_DIR ${JBR_BUNDLE} || exit 1
JBRSDK_TEST=$JBRSDK_BASE_NAME-windows-test-x86-b$build_number
echo Creating $JBRSDK_TEST.tar.gz ...
/usr/bin/tar -czf $JBRSDK_TEST.tar.gz -C $IMAGES_DIR --exclude='test/jdk/demos' test || exit 1

View File

@@ -213,12 +213,12 @@ endif
ifeq ($(call isTargetOs, windows), true)
ifeq ($(SHIP_DEBUG_SYMBOLS), )
JMOD_FLAGS += --exclude '**{_the.*,_*.marker,*.diz,*.pdb,*.map}'
JMOD_FLAGS += --exclude '**{_the.*,_*.marker*,*.diz,*.pdb,*.map}'
else
JMOD_FLAGS += --exclude '**{_the.*,_*.marker,*.diz,*.map}'
JMOD_FLAGS += --exclude '**{_the.*,_*.marker*,*.diz,*.map}'
endif
else
JMOD_FLAGS += --exclude '**{_the.*,_*.marker,*.diz,*.debuginfo,*.dSYM/**,*.dSYM}'
JMOD_FLAGS += --exclude '**{_the.*,_*.marker*,*.diz,*.debuginfo,*.dSYM/**,*.dSYM}'
endif
# Create jmods in the support dir and then move them into place to keep the

20
make/JBRApi.gmk Normal file
View File

@@ -0,0 +1,20 @@
include Makefile
include make/MainSupport.gmk
.PHONY: jbr-api
ifeq ($(SPEC),)
ifneq ($(words $(SPECS)),1)
@echo "Error: Multiple build specification files found. Please select one explicitly."
@exit 2
endif
jbr-api:
@cd $(topdir)
@$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -j 1 -f $(topdir)/make/JBRApi.gmk SPEC=$(SPECS) HAS_SPEC=true ACTUAL_TOPDIR=$(topdir) MODULES="$(MODULES)" jbr-api
else #with SPEC
jbr-api:
$(ECHO) "BUILD_DIR=$(OUTPUTDIR)" > $(OUT)
$(ECHO) "BOOT_JDK=\"$(BOOT_JDK)\"" >> $(OUT)
endif

View File

@@ -857,6 +857,9 @@ else
# virtual target.
jdk.jdwp.agent-libs: jdk.jdwp.agent-gensrc
# jdk.jfr-gendata uses TOOL_JFR_GEN from buildtools-hotspot
jdk.jfr-gendata: buildtools-hotspot
# The swing beans need to have java base properly generated to avoid errors
# in javadoc. The X11 wrappers need the java.base include files to have been
# copied and processed.

View File

@@ -789,6 +789,15 @@ define SetupRunJtregTestBody
$1_JTREG_BASIC_OPTIONS += -ea -esa
endif
ifeq ($$(ASAN_ENABLED), yes)
$1_JTREG_BASIC_OPTIONS += -e:ASAN_OPTIONS=handle_segv=0:handle_sigfpe=0:detect_leaks=false
$1_JTREG_BASIC_OPTIONS += -e:LD_PRELOAD=libasan.so.5
endif
ifeq ($$(USAN_ENABLED), yes)
$1_JTREG_BASIC_OPTIONS += -e:LD_PRELOAD=libubsan.so.1
endif
ifneq ($$($1_JTREG_NATIVEPATH), )
$1_JTREG_BASIC_OPTIONS += -nativepath:$$($1_JTREG_NATIVEPATH)
endif

View File

@@ -217,6 +217,9 @@ JDKOPT_SETUP_CODE_COVERAGE
# AddressSanitizer
JDKOPT_SETUP_ADDRESS_SANITIZER
# UndefinedBehaviorSanitizer
JDKOPT_SETUP_UNDEFINED_BEHAVIOR_SANITIZER
###############################################################################
#
# Check dependencies for external and internal libraries.

View File

@@ -230,7 +230,7 @@ AC_DEFUN([FLAGS_SETUP_OPTIMIZATION],
DISABLE_FORTIFY_CFLAGS="-U_FORTIFY_SOURCE"
# ASan doesn't work well with _FORTIFY_SOURCE
# See https://github.com/google/sanitizers/wiki/AddressSanitizer#faq
if test "x$ASAN_ENABLED" = xyes; then
if test "x$ASAN_ENABLED" = xyes || test "x$USAN_ENABLED" = xyes; then
ENABLE_FORTIFY_CFLAGS="${DISABLE_FORTIFY_CFLAGS}"
else
ENABLE_FORTIFY_CFLAGS="-D_FORTIFY_SOURCE=2"

View File

@@ -436,6 +436,45 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_ADDRESS_SANITIZER],
AC_SUBST(ASAN_ENABLED)
])
###############################################################################
#
# UndefinedBehaviorSanitizer
#
AC_DEFUN_ONCE([JDKOPT_SETUP_UNDEFINED_BEHAVIOR_SANITIZER],
[
UTIL_ARG_ENABLE(NAME: usan, DEFAULT: false,
DESC: [enable UndefinedBehaviorSanitizer],
CHECK_AVAILABLE: [
AC_MSG_CHECKING([if UndefinedBehaviorSanitizer (usan) is available])
if test "x$TOOLCHAIN_TYPE" = "xgcc" ||
test "x$TOOLCHAIN_TYPE" = "xclang"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AVAILABLE=false
fi
],
IF_ENABLED: [
USAN_FLAGS="-fsanitize=undefined"
USAN_CFLAGS="$USAN_FLAGS -fno-omit-frame-pointer"
USAN_LDFLAGS="$USAN_FLAGS"
JVM_CFLAGS="$JVM_CFLAGS $USAN_CFLAGS"
JVM_LDFLAGS="$JVM_LDFLAGS $USAN_LDFLAGS"
CFLAGS_JDKLIB="$CFLAGS_JDKLIB $USAN_CFLAGS"
CFLAGS_JDKEXE="$CFLAGS_JDKEXE $USAN_CFLAGS"
CXXFLAGS_JDKLIB="$CXXFLAGS_JDKLIB $USAN_CFLAGS"
CXXFLAGS_JDKEXE="$CXXFLAGS_JDKEXE $USAN_CFLAGS"
LDFLAGS_JDKLIB="$LDFLAGS_JDKLIB $USAN_LDFLAGS"
LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE $USAN_LDFLAGS"
USAN_ENABLED="yes"
],
IF_DISABLED: [
USAN_ENABLED="no"
])
AC_SUBST(USAN_ENABLED)
])
################################################################################
#
# Static build support. When enabled will generate static

View File

@@ -423,7 +423,16 @@ JCOV_FILTERS=@JCOV_FILTERS@
export ASAN_ENABLED:=@ASAN_ENABLED@
export DEVKIT_LIB_DIR:=@DEVKIT_LIB_DIR@
ifeq ($(ASAN_ENABLED), yes)
export ASAN_OPTIONS=handle_segv=0 detect_leaks=0
export ASAN_OPTIONS=handle_segv=0:handle_sigfpe=0:detect_leaks=false
ifneq ($(DEVKIT_LIB_DIR),)
export LD_LIBRARY_PATH:=$(LD_LIBRARY_PATH):$(DEVKIT_LIB_DIR)
endif
endif
# UndefinedBehaviorSanitizer
export USAN_ENABLED:=@USAN_ENABLED@
export DEVKIT_LIB_DIR:=@DEVKIT_LIB_DIR@
ifeq ($(USAN_ENABLED), yes)
ifneq ($(DEVKIT_LIB_DIR),)
export LD_LIBRARY_PATH:=$(LD_LIBRARY_PATH):$(DEVKIT_LIB_DIR)
endif

View File

@@ -55,6 +55,8 @@ BOOT_MODULES= \
jdk.sctp \
jdk.unsupported \
jdk.naming.rmi \
jetbrains.api \
jetbrains.api.impl \
#
# Modules that directly or indirectly requiring upgradeable modules

View File

@@ -39,4 +39,4 @@ DEFAULT_VERSION_CLASSFILE_MINOR=0
DEFAULT_VERSION_DOCS_API_SINCE=11
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="16 17"
DEFAULT_JDK_SOURCE_TARGET_VERSION=17
DEFAULT_PROMOTED_VERSION_PRE=ea
DEFAULT_PROMOTED_VERSION_PRE=

View File

@@ -52,7 +52,7 @@ allfonts.myanmar=Myanmar Text
allfonts.dingbats=Wingdings
allfonts.symbol=Symbol
allfonts.symbols=Segoe UI Symbol
allfonts.thai=DokChampa
allfonts.thai=Tahoma
allfonts.georgian=Sylfaen
serif.plain.alphabetic=Times New Roman
@@ -60,140 +60,140 @@ serif.plain.chinese-ms950=MingLiU
serif.plain.chinese-ms950-extb=MingLiU-ExtB
serif.plain.hebrew=David
serif.plain.japanese=MS Mincho
serif.plain.korean=Batang
serif.plain.korean=Malgun Gothic
serif.bold.alphabetic=Times New Roman Bold
serif.bold.chinese-ms950=PMingLiU
serif.bold.chinese-ms950-extb=PMingLiU-ExtB
serif.bold.hebrew=David Bold
serif.bold.japanese=MS Mincho
serif.bold.korean=Batang
serif.bold.korean=Malgun Gothic
serif.italic.alphabetic=Times New Roman Italic
serif.italic.chinese-ms950=PMingLiU
serif.italic.chinese-ms950-extb=PMingLiU-ExtB
serif.italic.hebrew=David
serif.italic.japanese=MS Mincho
serif.italic.korean=Batang
serif.italic.korean=Malgun Gothic
serif.bolditalic.alphabetic=Times New Roman Bold Italic
serif.bolditalic.chinese-ms950=PMingLiU
serif.bolditalic.chinese-ms950-extb=PMingLiU-ExtB
serif.bolditalic.hebrew=David Bold
serif.bolditalic.japanese=MS Mincho
serif.bolditalic.korean=Batang
serif.bolditalic.korean=Malgun Gothic
sansserif.plain.alphabetic=Arial
sansserif.plain.chinese-ms950=MingLiU
sansserif.plain.chinese-ms950-extb=MingLiU-ExtB
sansserif.plain.hebrew=David
sansserif.plain.japanese=MS Gothic
sansserif.plain.korean=Gulim
sansserif.plain.korean=Malgun Gothic
sansserif.bold.alphabetic=Arial Bold
sansserif.bold.chinese-ms950=PMingLiU
sansserif.bold.chinese-ms950-extb=PMingLiU-ExtB
sansserif.bold.hebrew=David Bold
sansserif.bold.japanese=MS Gothic
sansserif.bold.korean=Gulim
sansserif.bold.korean=Malgun Gothic
sansserif.italic.alphabetic=Arial Italic
sansserif.italic.chinese-ms950=PMingLiU
sansserif.italic.chinese-ms950-extb=PMingLiU-ExtB
sansserif.italic.hebrew=David
sansserif.italic.japanese=MS Gothic
sansserif.italic.korean=Gulim
sansserif.italic.korean=Malgun Gothic
sansserif.bolditalic.alphabetic=Arial Bold Italic
sansserif.bolditalic.chinese-ms950=PMingLiU
sansserif.bolditalic.chinese-ms950-extb=PMingLiU-ExtB
sansserif.bolditalic.hebrew=David Bold
sansserif.bolditalic.japanese=MS Gothic
sansserif.bolditalic.korean=Gulim
sansserif.bolditalic.korean=Malgun Gothic
monospaced.plain.alphabetic=Courier New
monospaced.plain.chinese-ms950=MingLiU
monospaced.plain.chinese-ms950-extb=MingLiU-ExtB
monospaced.plain.hebrew=Courier New
monospaced.plain.japanese=MS Gothic
monospaced.plain.korean=GulimChe
monospaced.plain.korean=Malgun Gothic
monospaced.bold.alphabetic=Courier New Bold
monospaced.bold.chinese-ms950=PMingLiU
monospaced.bold.chinese-ms950-extb=PMingLiU-ExtB
monospaced.bold.hebrew=Courier New Bold
monospaced.bold.japanese=MS Gothic
monospaced.bold.korean=GulimChe
monospaced.bold.korean=Malgun Gothic
monospaced.italic.alphabetic=Courier New Italic
monospaced.italic.chinese-ms950=PMingLiU
monospaced.italic.chinese-ms950-extb=PMingLiU-ExtB
monospaced.italic.hebrew=Courier New
monospaced.italic.japanese=MS Gothic
monospaced.italic.korean=GulimChe
monospaced.italic.korean=Malgun Gothic
monospaced.bolditalic.alphabetic=Courier New Bold Italic
monospaced.bolditalic.chinese-ms950=PMingLiU
monospaced.bolditalic.chinese-ms950-extb=PMingLiU-ExtB
monospaced.bolditalic.hebrew=Courier New Bold
monospaced.bolditalic.japanese=MS Gothic
monospaced.bolditalic.korean=GulimChe
monospaced.bolditalic.korean=Malgun Gothic
dialog.plain.alphabetic=Arial
dialog.plain.chinese-ms950=MingLiU
dialog.plain.chinese-ms950-extb=MingLiU-ExtB
dialog.plain.hebrew=David
dialog.plain.japanese=MS Gothic
dialog.plain.korean=Gulim
dialog.plain.korean=Malgun Gothic
dialog.bold.alphabetic=Arial Bold
dialog.bold.chinese-ms950=PMingLiU
dialog.bold.chinese-ms950-extb=PMingLiU-ExtB
dialog.bold.hebrew=David Bold
dialog.bold.japanese=MS Gothic
dialog.bold.korean=Gulim
dialog.bold.korean=Malgun Gothic
dialog.italic.alphabetic=Arial Italic
dialog.italic.chinese-ms950=PMingLiU
dialog.italic.chinese-ms950-extb=PMingLiU-ExtB
dialog.italic.hebrew=David
dialog.italic.japanese=MS Gothic
dialog.italic.korean=Gulim
dialog.italic.korean=Malgun Gothic
dialog.bolditalic.alphabetic=Arial Bold Italic
dialog.bolditalic.chinese-ms950=PMingLiU
dialog.bolditalic.chinese-ms950-extb=PMingLiU-ExtB
dialog.bolditalic.hebrew=David Bold
dialog.bolditalic.japanese=MS Gothic
dialog.bolditalic.korean=Gulim
dialog.bolditalic.korean=Malgun Gothic
dialoginput.plain.alphabetic=Courier New
dialoginput.plain.chinese-ms950=MingLiU
dialoginput.plain.chinese-ms950-extb=MingLiU-ExtB
dialoginput.plain.hebrew=David
dialoginput.plain.japanese=MS Gothic
dialoginput.plain.korean=Gulim
dialoginput.plain.korean=Malgun Gothic
dialoginput.bold.alphabetic=Courier New Bold
dialoginput.bold.chinese-ms950=PMingLiU
dialoginput.bold.chinese-ms950-extb=PMingLiU-ExtB
dialoginput.bold.hebrew=David Bold
dialoginput.bold.japanese=MS Gothic
dialoginput.bold.korean=Gulim
dialoginput.bold.korean=Malgun Gothic
dialoginput.italic.alphabetic=Courier New Italic
dialoginput.italic.chinese-ms950=PMingLiU
dialoginput.italic.chinese-ms950-extb=PMingLiU-ExtB
dialoginput.italic.hebrew=David
dialoginput.italic.japanese=MS Gothic
dialoginput.italic.korean=Gulim
dialoginput.italic.korean=Malgun Gothic
dialoginput.bolditalic.alphabetic=Courier New Bold Italic
dialoginput.bolditalic.chinese-ms950=PMingLiU
dialoginput.bolditalic.chinese-ms950-extb=PMingLiU-ExtB
dialoginput.bolditalic.hebrew=David Bold
dialoginput.bolditalic.japanese=MS Gothic
dialoginput.bolditalic.korean=Gulim
dialoginput.bolditalic.korean=Malgun Gothic
# Search Sequences
@@ -230,7 +230,7 @@ sequence.dialog.x-MS950-HKSCS-XP=alphabetic,chinese-ms950,chinese-hkscs,dingbats
sequence.dialoginput.x-MS950-HKSCS-XP=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb
sequence.allfonts.UTF-8.hi=alphabetic/1252,devanagari,dingbats,symbol
sequence.allfonts.UTF-8.ja=alphabetic,japanese,dingbats,symbol
sequence.allfonts.UTF-8.ja=alphabetic,japanese,devanagari,dingbats,symbol
sequence.allfonts.windows-1255=hebrew,alphabetic/1252,dingbats,symbol
@@ -257,7 +257,7 @@ sequence.fallback=symbols,\
# Exclusion Ranges
exclusion.alphabetic=0700-1cff,1d80-1e9f,1f00-2017,2020-20ab,20ad-20b8,20bb-20bc,20be-f8ff
exclusion.alphabetic=0700-1cff,1d80-1e9f,1f00-2017,2020-20ab,20ad-20b8,20bb-20bc,20be-24ff,2501-2501,2503-250b,250d-250f,2511-2513,2515-2517,2519-251b,251d-2523,2525-252b,252d-2533,2535-253b,253d-254f,256d-f8ff
exclusion.chinese-gb18030=0390-03d6,2200-22ef,2701-27be
exclusion.hebrew=0041-005a,0060-007a,007f-00ff,20ac-20ac
@@ -303,21 +303,18 @@ filename.MS_PMincho=MSMINCHO.TTC
filename.MS_Gothic=MSGOTHIC.TTC
filename.MS_PGothic=MSGOTHIC.TTC
filename.Gulim=gulim.TTC
filename.Batang=batang.TTC
filename.GulimChe=gulim.TTC
filename.Gautami=gautami.ttf
filename.Iskoola_Pota=iskpota.ttf
filename.Kalinga=kalinga.ttf
filename.Kartika=kartika.ttf
filename.Latha=latha.ttf
filename.Malgun_Gothic=malgun.ttf
filename.Mangal=MANGAL.TTF
filename.Raavi=raavi.ttf
filename.Shruti=shruti.ttf
filename.Tahoma=tahoma.ttf
filename.Tunga=TUNGA.TTF
filename.Vrinda=vrinda.ttf
filename.DokChampa=dokchamp.ttf
filename.Khmer_UI=KhmerUI.ttf
filename.Mongolian_Baiti=monbaiti.ttf
filename.Myanmar_Text=mmrtext.ttf

View File

@@ -272,12 +272,14 @@ XEvent.xclient 0
XEvent.xcolormap 0
XEvent.xconfigure 0
XEvent.xconfigurerequest 0
XEvent.xcookie 0
XEvent.xcreatewindow 0
XEvent.xcrossing 0
XEvent.xdestroywindow 0
XEvent.xerror 0
XEvent.xexpose 0
XEvent.xfocus 0
XEvent.xgeneric 0
XEvent.xgraphicsexpose 0
XEvent.xgravity 0
XEvent.xkey 0
@@ -370,6 +372,22 @@ XGCValues.subwindow_mode 64
XGCValues.tile 44
XGCValues.ts_x_origin 52
XGCValues.ts_y_origin 56
XGenericEvent 24
XGenericEventCookie 32
XGenericEventCookie.cookie 24
XGenericEventCookie.data 28
XGenericEventCookie.display 12
XGenericEventCookie.evtype 20
XGenericEventCookie.extension 16
XGenericEventCookie.send_event 8
XGenericEventCookie.serial 4
XGenericEventCookie.type 0
XGenericEvent.display 12
XGenericEvent.evtype 20
XGenericEvent.extension 16
XGenericEvent.send_event 8
XGenericEvent.serial 4
XGenericEvent.type 0
XGraphicsExposeEvent 48
XGraphicsExposeEvent.count 36
XGraphicsExposeEvent.display 12
@@ -396,6 +414,9 @@ XHostAddress 12
XHostAddress.address 8
XHostAddress.family 0
XHostAddress.length 4
XIButtonState 8
XIButtonState.mask 4
XIButtonState.mask_len 0
XIconSize 24
XIconSize.height_inc 20
XIconSize.max_height 12
@@ -403,6 +424,29 @@ XIconSize.max_width 8
XIconSize.min_height 4
XIconSize.min_width 0
XIconSize.width_inc 16
XIDeviceEvent 140
XIDeviceEvent.buttons 88
XIDeviceEvent.child 48
XIDeviceEvent.detail 36
XIDeviceEvent.deviceid 28
XIDeviceEvent.display 12
XIDeviceEvent.event 44
XIDeviceEvent.event_x 68
XIDeviceEvent.event_y 76
XIDeviceEvent.evtype 20
XIDeviceEvent.extension 16
XIDeviceEvent.flags 84
XIDeviceEvent.group 124
XIDeviceEvent.mods 108
XIDeviceEvent.root 40
XIDeviceEvent.root_x 52
XIDeviceEvent.root_y 60
XIDeviceEvent.send_event 8
XIDeviceEvent.serial 4
XIDeviceEvent.sourceid 32
XIDeviceEvent.time 24
XIDeviceEvent.type 0
XIDeviceEvent.valuators 96
XImage 88
XImage.bitmap_bit_order 28
XImage.bitmap_pad 32
@@ -436,6 +480,11 @@ XIMHotKeyTrigger.modifier_mask 8
XIMHotKeyTriggers 8
XIMHotKeyTriggers.key 4
XIMHotKeyTriggers.num_hot_key 0
XIModifierState 16
XIModifierState.base 0
XIModifierState.effective 12
XIModifierState.latched 4
XIModifierState.locked 8
XIMPreeditCaretCallbackStruct 12
XIMPreeditCaretCallbackStruct.direction 4
XIMPreeditCaretCallbackStruct.position 0
@@ -472,6 +521,10 @@ XIMText.string 12
XIMValuesList 8
XIMValuesList.count_values 0
XIMValuesList.supported_values 4
XIValuatorState 12
XIValuatorState.mask 4
XIValuatorState.mask_len 0
XIValuatorState.values 8
XkbAccessXNotifyEvent 44
XkbAccessXNotifyEvent.debounce_delay 40
XkbAccessXNotifyEvent.detail 28

View File

@@ -272,12 +272,14 @@ XEvent.xclient 0
XEvent.xcolormap 0
XEvent.xconfigure 0
XEvent.xconfigurerequest 0
XEvent.xcookie 0
XEvent.xcreatewindow 0
XEvent.xcrossing 0
XEvent.xdestroywindow 0
XEvent.xerror 0
XEvent.xexpose 0
XEvent.xfocus 0
XEvent.xgeneric 0
XEvent.xgraphicsexpose 0
XEvent.xgravity 0
XEvent.xkey 0
@@ -370,6 +372,22 @@ XGCValues.subwindow_mode 96
XGCValues.tile 64
XGCValues.ts_x_origin 80
XGCValues.ts_y_origin 84
XGenericEvent 40
XGenericEventCookie 56
XGenericEventCookie.cookie 40
XGenericEventCookie.data 48
XGenericEventCookie.display 24
XGenericEventCookie.evtype 36
XGenericEventCookie.extension 32
XGenericEventCookie.send_event 16
XGenericEventCookie.serial 8
XGenericEventCookie.type 0
XGenericEvent.display 24
XGenericEvent.evtype 36
XGenericEvent.extension 32
XGenericEvent.send_event 16
XGenericEvent.serial 8
XGenericEvent.type 0
XGraphicsExposeEvent 72
XGraphicsExposeEvent.count 56
XGraphicsExposeEvent.display 24
@@ -396,6 +414,9 @@ XHostAddress 16
XHostAddress.address 8
XHostAddress.family 0
XHostAddress.length 4
XIButtonState 16
XIButtonState.mask 8
XIButtonState.mask_len 0
XIconSize 24
XIconSize.height_inc 20
XIconSize.max_height 12
@@ -403,6 +424,29 @@ XIconSize.max_width 8
XIconSize.min_height 4
XIconSize.min_width 0
XIconSize.width_inc 16
XIDeviceEvent 200
XIDeviceEvent.buttons 128
XIDeviceEvent.child 80
XIDeviceEvent.detail 56
XIDeviceEvent.deviceid 48
XIDeviceEvent.display 24
XIDeviceEvent.event 72
XIDeviceEvent.event_x 104
XIDeviceEvent.event_y 112
XIDeviceEvent.evtype 36
XIDeviceEvent.extension 32
XIDeviceEvent.flags 120
XIDeviceEvent.group 184
XIDeviceEvent.mods 168
XIDeviceEvent.root 64
XIDeviceEvent.root_x 88
XIDeviceEvent.root_y 96
XIDeviceEvent.send_event 16
XIDeviceEvent.serial 8
XIDeviceEvent.sourceid 52
XIDeviceEvent.time 40
XIDeviceEvent.type 0
XIDeviceEvent.valuators 144
XImage 136
XImage.bitmap_bit_order 32
XImage.bitmap_pad 36
@@ -436,6 +480,11 @@ XIMHotKeyTrigger.modifier_mask 12
XIMHotKeyTriggers 16
XIMHotKeyTriggers.key 8
XIMHotKeyTriggers.num_hot_key 0
XIModifierState 16
XIModifierState.base 0
XIModifierState.effective 12
XIModifierState.latched 4
XIModifierState.locked 8
XIMPreeditCaretCallbackStruct 12
XIMPreeditCaretCallbackStruct.direction 4
XIMPreeditCaretCallbackStruct.position 0
@@ -472,6 +521,10 @@ XIMText.string 24
XIMValuesList 16
XIMValuesList.count_values 0
XIMValuesList.supported_values 8
XIValuatorState 24
XIValuatorState.mask 8
XIValuatorState.mask_len 0
XIValuatorState.values 16
XkbAccessXNotifyEvent 64
XkbAccessXNotifyEvent.debounce_delay 60
XkbAccessXNotifyEvent.detail 48

View File

@@ -127,6 +127,22 @@ XKeymapEvent
display long
window long
key_vector array byte 32
XGenericEvent
type int
serial long
send_event Bool
display long
extension int
evtype int
XGenericEventCookie
type int
serial long
send_event Bool
display long
extension int
evtype int
cookie int
data pointer
XDestroyWindowEvent
type int
serial long
@@ -814,6 +830,8 @@ XEvent
xmapping struct XMappingEvent
xerror struct XErrorEvent
xkeymap struct XKeymapEvent
xgeneric struct XGenericEvent
xcookie struct XGenericEventCookie
pad array long 24
XkbAnyEvent
@@ -1039,3 +1057,42 @@ XkbEvent
accessx struct XkbAccessXNotifyEvent
device struct XkbExtensionDeviceNotifyEvent
core struct XEvent
XIButtonState
mask_len int
mask pointer byte
XIValuatorState
mask_len int
mask pointer byte
values pointer double
XIModifierState
base int
latched int
locked int
effective int
XIDeviceEvent
type int
serial long
send_event Bool
display long
extension int
evtype int
time ulong
deviceid int
sourceid int
detail int
root long
event long
child long
root_x double
root_y double
event_x double
event_y double
flags int
buttons struct XIButtonState
valuators struct XIValuatorState
mods struct XIModifierState
group struct XIModifierState

View File

@@ -1,42 +0,0 @@
<!-- importing.xml -->
<project name="jdk">
<taskdef name="wrapLogger" classname="idea.IdeaLoggerWrapper" classpath="${idea.dir}/classes"/>
<wrapLogger/>
<macrodef name="call-make">
<attribute name="dir"/>
<attribute name="args"/>
<sequential>
<exec executable="make" dir="@{dir}" failonerror="true">
<arg line="@{args}"/>
<env key="CLASSPATH" value = ""/>
</exec>
</sequential>
</macrodef>
<target name="cond-clean" unless="${intellij.ismake}">
<antcall target="clean"/>
</target>
<target name="post-make" depends="cond-clean, build-module"/>
<!--
**** Global JDK Build Targets
-->
<target name="clean">
<echo message="base = ${basedir}"/>
<call-make dir = "${build.target.dir}" args = "reconfigure"/>
<call-make dir = "${build.target.dir}" args = "clean"/>
</target>
<target name="images">
<call-make dir = "${build.target.dir}" args = "images"/>
</target>
<target name="build-module">
<call-make dir = "${build.target.dir}" args = "${module.name}"/>
</target>
</project>

View File

@@ -46,13 +46,18 @@ else #with SPEC
endif
idea:
$(ECHO) "SUPPORT=$(SUPPORT_OUTPUTDIR)" >> $(OUT)
$(ECHO) "MODULE_ROOTS=\"$(foreach mod, $(SEL_MODULES), $(call FindModuleSrcDirs,$(mod)))\"" >> $(OUT)
$(ECHO) "MODULES=\"$(foreach mod, $(SEL_MODULES), \
module='$(mod)' \
moduleSrcDirs='$(foreach m,$(call FindModuleSrcDirs,$(mod)),$(call RelativePath,$m,$(topdir)))' \
moduleDependencies='$(call FindTransitiveDepsForModule,$(mod))' \
#)\"" > $(OUT)
$(ECHO) "MODULE_NAMES=\"$(strip $(foreach mod, $(SEL_MODULES), $(mod)))\"" >> $(OUT)
$(ECHO) "SEL_MODULES=\"$(SEL_MODULES)\"" >> $(OUT)
$(ECHO) "BOOT_JDK=\"$(BOOT_JDK)\"" >> $(OUT)
$(ECHO) "CYGPATH=\"$(PATHTOOL)\"" >> $(OUT)
$(ECHO) "SPEC=\"$(SPEC)\"" >> $(OUT)
$(ECHO) "RELATIVE_TOPLEVEL_PROJECT_DIR=\"$(call RelativePath,$(TOPLEVEL_DIR),$(IDEA_OUTPUT_PARENT))\"" >> $(OUT)
$(ECHO) "RELATIVE_PROJECT_DIR=\"$(call RelativePath,$(topdir),$(IDEA_OUTPUT_PARENT))\"" >> $(OUT)
$(ECHO) "RELATIVE_BUILD_DIR=\"$(call RelativePath,$(OUTPUTDIR),$(IDEA_OUTPUT_PARENT))\"" >> $(OUT)
$(ECHO) "CLION_RELATIVE_PROJECT_DIR=\"$(call RelativePath,$(topdir),$(IDEA_OUTPUT_PARENT)/.idea/jdk-clion)\"" >> $(OUT)
$(ECHO) "PATHTOOL=\"$(PATHTOOL)\"" >> $(OUT)
$(ECHO) "JT_HOME=\"$(JT_HOME)\"" >> $(OUT)
$(ECHO) "WINENV_ROOT=\"$(WINENV_ROOT)\"" >> $(OUT)
endif

View File

@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AntConfiguration">
<buildFile url="file://###ROOT_DIR###/make/ide/idea/jdk/build.xml">
<properties>
<property name="intellij.ismake" value="$IsMake$" />
<property name="build.target.dir" value="###BUILD_DIR###" />
<property name="module.name" value="###MODULE_NAMES###" />
<property name="idea.dir" value="###IDEA_DIR###" />
</properties>
<executeOn event="afterCompilation" target="post-make" />
</buildFile>
</component>
</project>

View File

@@ -3,10 +3,10 @@
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Javac" />
<excludeFromCompile>
<directory url="file://###ROOT_DIR###/src" includeSubdirectories="true" />
<directory url="file://###ROOT_DIR###/build" includeSubdirectories="true" />
<directory url="file://###ROOT_DIR###/make" includeSubdirectories="true" />
<directory url="file://###ROOT_DIR###/test" includeSubdirectories="true" />
<directory url="file://###PROJECT_DIR###/src" includeSubdirectories="true" />
<directory url="file://###PROJECT_DIR###/build" includeSubdirectories="true" />
<directory url="file://###PROJECT_DIR###/make" includeSubdirectories="true" />
<directory url="file://###PROJECT_DIR###/test" includeSubdirectories="false" />
</excludeFromCompile>
<resourceExtensions />
<wildcardResourcePatterns>

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CidrRootsConfiguration">
<excludeRoots>
<file path="###CLION_PROJECT_DIR###/build" />
<file path="###CLION_PROJECT_DIR###/make" />
</excludeRoots>
</component>
<component name="CompDBSettings">
<option name="linkedExternalProjectsSettings">
<CompDBProjectSettings>
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
</CompDBProjectSettings>
</option>
</component>
<component name="CompDBWorkspace" PROJECT_DIR="$PROJECT_DIR$">
<contentRoot DIR="###CLION_PROJECT_DIR###" />
</component>
<component name="ExternalStorageConfigurationManager" enabled="true" />
</project>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="IssueNavigationConfiguration">
<option name="links">
<list>
<IssueNavigationLink>
<option name="issueRegexp" value="(?:^|\s|\p{Punct})(?:JDK-)?(\d{7})(?=$|\s|\p{Punct})" />
<option name="linkRegexp" value="https://bugs.openjdk.java.net/browse/JDK-$1" />
</IssueNavigationLink>
</list>
</option>
</component>
<component name="VcsDirectoryMappings">
<mapping directory="###CLION_PROJECT_DIR###" vcs="###VCS_TYPE###" />
</component>
</project>

View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ClangdSettings">
<option name="formatViaClangd" value="false" />
</component>
<component name="CompDBLocalSettings">
<option name="availableProjects">
<map>
<entry>
<key>
<ExternalProjectPojo>
<option name="name" value="jdk-clion" />
<option name="path" value="$PROJECT_DIR$" />
</ExternalProjectPojo>
</key>
<value>
<list>
<ExternalProjectPojo>
<option name="name" value="jdk-clion" />
<option name="path" value="$PROJECT_DIR$" />
</ExternalProjectPojo>
</list>
</value>
</entry>
</map>
</option>
<option name="projectSyncType">
<map>
<entry key="$PROJECT_DIR$" value="RE_IMPORT" />
</map>
</option>
</component>
<component name="ExternalProjectsData">
<projectState path="$PROJECT_DIR$">
<ProjectState />
</projectState>
</component>
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="RunOnceActivity.cidr.known.project.marker" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="cf.first.check.clang-format" value="false" />
<property name="cidr.known.project.marker" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="settings.editor.selected.configurable" value="CPPToolchains" />
</component>
</project>

View File

@@ -0,0 +1,29 @@
#!/bin/bash
TOPDIR="###CLION_SCRIPT_TOPDIR###"
BUILD_DIR="###RELATIVE_BUILD_DIR###"
PATHTOOL="###PATHTOOL###"
cd "`dirname $0`"
SCRIPT_DIR="`pwd`"
cd "$TOPDIR"
echo "Updating Clion project files in \"$SCRIPT_DIR\" for project \"`pwd`\""
set -o pipefail
make compile-commands SPEC="$BUILD_DIR/spec.gmk" | sed 's/^/ /' || exit 1
if [ "x$PATHTOOL" != "x" ]; then
CLION_PROJECT_DIR="`$PATHTOOL -am $SCRIPT_DIR`"
sed "s/\\\\\\\\\\\\\\\\/\\\\\\\\/g" "$BUILD_DIR/compile_commands.json" > "$SCRIPT_DIR/compile_commands.json"
else
CLION_PROJECT_DIR="$SCRIPT_DIR"
cp "$BUILD_DIR/compile_commands.json" "$SCRIPT_DIR"
fi
echo "
Now you can open \"$CLION_PROJECT_DIR\" as Clion project
If Clion complains about missing files when loading a project, building it may help:
cd \"`pwd`\" && make SPEC=\"$BUILD_DIR/spec.gmk\""

View File

@@ -2,10 +2,9 @@
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://###ROOT_DIR###">
###SOURCE_ROOTS###
<excludeFolder url="file://###ROOT_DIR###/build" />
<excludeFolder url="file://###ROOT_DIR###/make" />
<content url="file://###TOPLEVEL_MODULE_DIR###">
<excludeFolder url="file://###MODULE_DIR###/build" />
<excludeFolder url="file://###MODULE_DIR###/make" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="inheritedJdk" />

View File

@@ -6,11 +6,8 @@
<component name="JTRegService">
<path>###JTREG_HOME###</path>
<workDir>###BUILD_DIR###</workDir>
<jre alt="true" value="###IMAGES_DIR###" />
<jre alt="true" value="###BUILD_DIR###/images/jdk" />
<options></options>
<ant>
<target file="file://###ROOT_DIR###/make/ide/idea/jdk/build.xml" name="images" />
</ant>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_16" assert-keyword="true" jdk-15="true">
<output url="file://###BUILD_DIR###/idea" />

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
###MODULE_CONTENT_ROOTS###
<orderEntry type="sourceFolder" forTests="false" />
###DEPENDENCIES###
<orderEntry type="inheritedJdk" />
</component>
</module>

View File

@@ -3,6 +3,8 @@
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/jdk.iml" filepath="$PROJECT_DIR$/.idea/jdk.iml" />
###MODULE_IMLS###
<module fileurl="file://$PROJECT_DIR$/.idea/test.iml" filepath="$PROJECT_DIR$/.idea/test.iml" />
</modules>
</component>
</project>

View File

@@ -1,13 +0,0 @@
package idea;
import org.apache.tools.ant.Task;
/**
* This class implements a custom Ant task which replaces the standard Intellij IDEA Ant logger
* with a custom one which generates tighter output.
*/
public class IdeaLoggerWrapper extends Task {
public void execute() {
new JdkIdeaAntLogger(getProject());
}
}

View File

@@ -1,375 +0,0 @@
/*
* Copyright (c) 2014, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package idea;
import org.apache.tools.ant.BuildEvent;
import org.apache.tools.ant.BuildListener;
import org.apache.tools.ant.DefaultLogger;
import org.apache.tools.ant.Project;
import java.util.EnumSet;
import java.util.Stack;
import static org.apache.tools.ant.Project.*;
/**
* This class is used to wrap the IntelliJ ant logger in order to provide more meaningful
* output when building langtools. The basic ant output in IntelliJ can be quite cumbersome to
* work with, as it provides two separate views: (i) a tree view, which is good to display build task
* in a hierarchical fashion as they are processed; and a (ii) plain text view, which gives you
* the full ant output. The main problem is that javac-related messages are buried into the
* ant output (which is made very verbose by IntelliJ in order to support the tree view). It is
* not easy to figure out which node to expand in order to see the error message; switching
* to plain text doesn't help either, as now the output is totally flat.
*
* This logger class removes a lot of verbosity from the IntelliJ ant logger by not propagating
* all the events to the IntelliJ's logger. In addition, certain events are handled in a custom
* fashion, to generate better output during the build.
*/
public final class JdkIdeaAntLogger extends DefaultLogger {
/**
* This is just a way to pass in customized binary string predicates;
*
* TODO: replace with @code{BiPredicate<String, String>} and method reference when moving to 8
*/
enum StringBinaryPredicate {
CONTAINS() {
@Override
boolean apply(String s1, String s2) {
return s1.contains(s2);
}
},
STARTS_WITH {
@Override
boolean apply(String s1, String s2) {
return s1.startsWith(s2);
}
},
MATCHES {
@Override
boolean apply(String s1, String s2) {
return s1.matches(s2);
}
};
abstract boolean apply(String s1, String s2);
}
/**
* Various kinds of ant messages that we shall intercept
*/
enum MessageKind {
/** a make error */
MAKE_ERROR(StringBinaryPredicate.CONTAINS, MSG_ERR, "error:", "compiler.err"),
/** a make warning */
MAKE_WARNING(StringBinaryPredicate.CONTAINS, MSG_WARN, "warning:", "compiler.warn"),
/** a make note */
MAKE_NOTE(StringBinaryPredicate.CONTAINS, MSG_INFO, "note:", "compiler.note"),
/** std make output */
MAKE_OTHER(StringBinaryPredicate.MATCHES, MSG_INFO, ".*"),
/** a javac crash */
JAVAC_CRASH(StringBinaryPredicate.STARTS_WITH, MSG_ERR, "An exception has occurred in the compiler"),
/** jtreg test success */
JTREG_TEST_PASSED(StringBinaryPredicate.STARTS_WITH, MSG_INFO, "Passed: "),
/** jtreg test failure */
JTREG_TEST_FAILED(StringBinaryPredicate.STARTS_WITH, MSG_ERR, "FAILED: "),
/** jtreg test error */
JTREG_TEST_ERROR(StringBinaryPredicate.STARTS_WITH, MSG_ERR, "Error: "),
/** jtreg report */
JTREG_TEST_REPORT(StringBinaryPredicate.STARTS_WITH, MSG_INFO, "Report written");
StringBinaryPredicate sbp;
int priority;
String[] keys;
MessageKind(StringBinaryPredicate sbp, int priority, String... keys) {
this.sbp = sbp;
this.priority = priority;
this.keys = keys;
}
/**
* Does a given message string matches this kind?
*/
boolean matches(String s) {
for (String key : keys) {
if (sbp.apply(s, key)) {
return true;
}
}
return false;
}
}
/**
* This enum is used to represent the list of tasks we need to keep track of during logging.
*/
enum Task {
/** javac task - invoked during compilation */
MAKE("exec", MessageKind.MAKE_ERROR, MessageKind.MAKE_WARNING, MessageKind.MAKE_NOTE,
MessageKind.MAKE_OTHER, MessageKind.JAVAC_CRASH),
/** jtreg task - invoked during test execution */
JTREG("jtreg", MessageKind.JTREG_TEST_PASSED, MessageKind.JTREG_TEST_FAILED, MessageKind.JTREG_TEST_ERROR, MessageKind.JTREG_TEST_REPORT),
/** initial synthetic task when the logger is created */
ROOT("") {
@Override
boolean matches(String s) {
return false;
}
},
/** synthetic task catching any other tasks not in this list */
ANY("") {
@Override
boolean matches(String s) {
return true;
}
};
String taskName;
MessageKind[] msgs;
Task(String taskName, MessageKind... msgs) {
this.taskName = taskName;
this.msgs = msgs;
}
boolean matches(String s) {
return s.equals(taskName);
}
}
/**
* This enum is used to represent the list of targets we need to keep track of during logging.
* A regular expression is used to match a given target name.
*/
enum Target {
/** jtreg target - executed when launching tests */
JTREG("jtreg") {
@Override
String getDisplayMessage(BuildEvent e) {
return "Running jtreg tests: " + e.getProject().getProperty("jtreg.tests");
}
},
/** build selected modules */
BUILD_MODULE("build-module") {
@Override
String getDisplayMessage(BuildEvent e) {
return "Building modules: " + e.getProject().getProperty("module.name") + "...";
}
},
/** build images */
BUILD_IMAGES("images") {
@Override
String getDisplayMessage(BuildEvent e) {
return "Building images...";
}
},
/** build images */
CONFIGURE("-do-configure") {
@Override
String getDisplayMessage(BuildEvent e) {
return "Configuring build...";
}
},
/** synthetic target catching any other target not in this list */
ANY("") {
@Override
String getDisplayMessage(BuildEvent e) {
return "Executing Ant target(s): " + e.getProject().getProperty("ant.project.invoked-targets");
}
@Override
boolean matches(String msg) {
return true;
}
};
String targetRegex;
Target(String targetRegex) {
this.targetRegex = targetRegex;
}
boolean matches(String msg) {
return msg.matches(targetRegex);
}
abstract String getDisplayMessage(BuildEvent e);
}
/**
* A custom build event used to represent status changes which should be notified inside
* Intellij
*/
static class StatusEvent extends BuildEvent {
/** the target to which the status update refers */
Target target;
StatusEvent(BuildEvent e, Target target) {
super(new StatusTask(e, target.getDisplayMessage(e)));
this.target = target;
setMessage(getTask().getTaskName(), 2);
}
/**
* A custom task used to channel info regarding a status change
*/
static class StatusTask extends org.apache.tools.ant.Task {
StatusTask(BuildEvent event, String msg) {
setProject(event.getProject());
setOwningTarget(event.getTarget());
setTaskName(msg);
}
}
}
/** wrapped ant logger (IntelliJ's own logger) */
DefaultLogger logger;
/** flag - is this the first target we encounter? */
boolean firstTarget = true;
/** flag - should subsequenet failures be suppressed ? */
boolean suppressTaskFailures = false;
/** flag - have we ran into a javac crash ? */
boolean crashFound = false;
/** stack of status changes associated with pending targets */
Stack<StatusEvent> statusEvents = new Stack<>();
/** stack of pending tasks */
Stack<Task> tasks = new Stack<>();
public JdkIdeaAntLogger(Project project) {
for (Object o : project.getBuildListeners()) {
if (o instanceof DefaultLogger) {
this.logger = (DefaultLogger)o;
project.removeBuildListener((BuildListener)o);
project.addBuildListener(this);
}
}
tasks.push(Task.ROOT);
}
@Override
public void buildStarted(BuildEvent event) {
//do nothing
}
@Override
public void buildFinished(BuildEvent event) {
//do nothing
}
@Override
public void targetStarted(BuildEvent event) {
EnumSet<Target> statusKinds = firstTarget ?
EnumSet.allOf(Target.class) :
EnumSet.complementOf(EnumSet.of(Target.ANY));
String targetName = event.getTarget().getName();
for (Target statusKind : statusKinds) {
if (statusKind.matches(targetName)) {
StatusEvent statusEvent = new StatusEvent(event, statusKind);
statusEvents.push(statusEvent);
logger.taskStarted(statusEvent);
firstTarget = false;
return;
}
}
}
@Override
public void targetFinished(BuildEvent event) {
if (!statusEvents.isEmpty()) {
StatusEvent lastEvent = statusEvents.pop();
if (lastEvent.target.matches(event.getTarget().getName())) {
logger.taskFinished(lastEvent);
}
}
}
@Override
public void taskStarted(BuildEvent event) {
String taskName = event.getTask().getTaskName();
System.err.println("task started " + taskName);
for (Task task : Task.values()) {
if (task.matches(taskName)) {
tasks.push(task);
return;
}
}
}
@Override
public void taskFinished(BuildEvent event) {
if (tasks.peek() == Task.ROOT) {
//we need to 'close' the root task to get nicer output
logger.taskFinished(event);
} else if (!suppressTaskFailures && event.getException() != null) {
//the first (innermost) task failure should always be logged
event.setMessage(event.getException().toString(), 0);
event.setException(null);
//note: we turn this into a plain message to avoid stack trace being logged by Idea
logger.messageLogged(event);
suppressTaskFailures = true;
}
tasks.pop();
}
@Override
public void messageLogged(BuildEvent event) {
String msg = event.getMessage();
boolean processed = false;
if (!tasks.isEmpty()) {
Task task = tasks.peek();
for (MessageKind messageKind : task.msgs) {
if (messageKind.matches(msg)) {
event.setMessage(msg, messageKind.priority);
processed = true;
if (messageKind == MessageKind.JAVAC_CRASH) {
crashFound = true;
}
break;
}
}
}
if (event.getPriority() == MSG_ERR || crashFound) {
//we log errors regardless of owning task
logger.messageLogged(event);
suppressTaskFailures = true;
} else if (processed) {
logger.messageLogged(event);
}
}
}

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://###MODULE_DIR###/test/jdk"></content>
<orderEntry type="sourceFolder" forTests="true" />
###TEST_MODULE_DEPENDENCIES###
<orderEntry type="inheritedJdk" />
</component>
</module>

View File

@@ -1,6 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="IssueNavigationConfiguration">
<option name="links">
<list>
<IssueNavigationLink>
<option name="issueRegexp" value="(?:^|\s|\p{Punct})(?:JDK-)?(\d{7})(?=$|\s|\p{Punct})" />
<option name="linkRegexp" value="https://bugs.openjdk.java.net/browse/JDK-$1" />
</IssueNavigationLink>
</list>
</option>
</component>
<component name="VcsDirectoryMappings">
<mapping directory="###ROOT_DIR###" vcs="###VCS_TYPE###" />
<mapping directory="###TOPLEVEL_PROJECT_DIR###" vcs="###VCS_TYPE###" />
</component>
</project>

View File

@@ -2,63 +2,62 @@
<project version="4">
<component name="ChangeListManager">
<ignored path="jdk.iws" />
<ignored path="###ROOT_DIR###/build/idea/out/" />
<ignored path="###PROJECT_DIR###/build/idea/out/" />
<ignored path=".idea/" />
</component>
<component name="StructureViewFactory">
<option name="ACTIVE_ACTIONS" value=",ALPHA_COMPARATOR" />
</component>
<component name="antWorkspaceConfiguration">
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
<option name="FILTER_TARGETS" value="false" />
<buildFile url="file://###ROOT_DIR###/make/ide/idea/jdk/build.xml">
<runInBackground value="false" />
<targetFilters>
<filter targetName="clean" isVisible="true" />
<filter targetName="images" isVisible="true" />
</targetFilters>
<treeView value="false" />
<expanded value="true" />
</buildFile>
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
</navigator>
<panes>
<pane id="ProjectPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="jdk" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
<pane id="PackagesPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="jdk" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PackageViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="jdk" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PackageViewModuleNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
<pane id="Scope" />
</panes>
<component name="RunManager" selected="Shell Script.images">
<configuration name="clean" type="ShConfigurationType" folderName="make">
<option name="SCRIPT_TEXT" value="###BASH_RUNNER_PREFIX### make clean" />
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
<option name="SCRIPT_PATH" value="" />
<option name="SCRIPT_OPTIONS" value="" />
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
<option name="SCRIPT_WORKING_DIRECTORY" value="###PROJECT_DIR###" />
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
<option name="INTERPRETER_PATH" value="" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="EXECUTE_IN_TERMINAL" value="true" />
<option name="EXECUTE_SCRIPT_FILE" value="false" />
<envs />
<method v="2" />
</configuration>
<configuration name="images" type="ShConfigurationType" folderName="make">
<option name="SCRIPT_TEXT" value="###BASH_RUNNER_PREFIX### make images" />
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
<option name="SCRIPT_PATH" value="" />
<option name="SCRIPT_OPTIONS" value="" />
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
<option name="SCRIPT_WORKING_DIRECTORY" value="###PROJECT_DIR###" />
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
<option name="INTERPRETER_PATH" value="" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="EXECUTE_IN_TERMINAL" value="true" />
<option name="EXECUTE_SCRIPT_FILE" value="false" />
<envs />
<method v="2" />
</configuration>
<configuration name="reconfigure" type="ShConfigurationType" folderName="make">
<option name="SCRIPT_TEXT" value="###BASH_RUNNER_PREFIX### make reconfigure" />
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
<option name="SCRIPT_PATH" value="" />
<option name="SCRIPT_OPTIONS" value="" />
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
<option name="SCRIPT_WORKING_DIRECTORY" value="###PROJECT_DIR###" />
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
<option name="INTERPRETER_PATH" value="" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="EXECUTE_IN_TERMINAL" value="true" />
<option name="EXECUTE_SCRIPT_FILE" value="false" />
<envs />
<method v="2" />
</configuration>
<list>
<item itemvalue="Shell Script.images" />
<item itemvalue="Shell Script.clean" />
<item itemvalue="Shell Script.reconfigure" />
</list>
</component>
</project>

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