Compare commits

...

478 Commits
800 ... 999

Author SHA1 Message Date
Vitaly Provodin
e13a613646 updated JTreg exclude list
(cherry picked from commit 345329a74c)
2020-07-18 06:00:17 +07:00
Vitaly Provodin
60ce8b7256 updated JTreg exclude list 2020-07-17 10:10:23 +07:00
Vitaly Provodin
db4eb3fbc2 JBR-2566 parametrize paths to modules JCEF, JFX - fix for linux_fastdebug 2020-07-16 18:00:01 +07:00
Vitaly Provodin
109422a2de JBR-2566: parametrize paths to modules JCEF, JFX 2020-07-16 16:32:02 +07:00
Alexey Ushakov
a6f33217c4 JBR-1929 Improve rendering of San Francisco font of macOS Catalina
Implemented gamma correction (gamma=2.2) for grayscale rendering in shader (for font size <= 64). It is controlled by Mac rendering setting "Use font smoothing when available"
2020-07-14 23:02:05 +03:00
Alexey Titov
8de16a2732 JBR-2479: moved new JIT API to com.jetbrains.management 2020-07-14 18:16:11 +07:00
Alexey Titov
34cd1b08f2 JBR-2479: removed public functions due to license restrictions 2020-07-14 18:16:11 +07:00
Alexey Titov
9357e9872c JBR-2479: API for getting JIT compiler state 2020-07-14 18:16:11 +07:00
Vitaly Provodin
a57ed60b88 updated JTreg exclude list 2020-07-14 10:03:29 +07:00
Vitaly Provodin
4f17e1b965 dcevm: G1 Heap parallel iterate method "object_par_iterate" + dcevm timers 2020-07-10 12:19:35 +07:00
Vitaly Provodin
ab97d74692 updated JTreg exclude list 2020-07-09 18:10:36 +07:00
Anton Tarasov
e30a309f92 JBR-2557 use com.jetbrains.cef.JCefAppConfig in JCEF tests 2020-07-07 12:06:12 +03:00
Denis Konoplev
703d77a927 JBR-2554: Proper unicode values in KeyEvent.keyCode 2020-07-03 15:58:33 +03:00
Dmitry Batrak
2f1d317d87 JBR-2533 Popup is not focused on click when switching from another application on macOS
more reliable jtreg test
2020-07-03 10:55:31 +03:00
Vitaly Provodin
f7b4c42e1d JBR-2545 Clean up the list of ignored Render tests 2020-07-03 07:36:07 +07:00
Dmitry Batrak
21af1eba85 JBR-2533 Popup is not focused on click when switching from another application on macOS
makes sure jtreg test cleans up properly
2020-07-02 16:15:39 +03:00
Dmitry Batrak
72b0add80c JBR-2533 Popup is not focused on click when switching from another application on macOS
fix NPE
2020-07-02 15:43:52 +03:00
Dmitry Batrak
67b174dc8c JBR-2533 Popup is not focused on click when switching from another application on macOS
fix main menu activation logic
2020-07-01 19:33:41 +03:00
Anton Tarasov
a41a59a57b [followup] 8238676: jni crashes on accessing it from process exit hook 2020-06-30 20:29:13 +03:00
Anton Tarasov
9c8cffee50 8238676: jni crashes on accessing it from process exit hook 2020-06-30 18:54:09 +03:00
Dmitry Batrak
d9ff151211 JBR-2533 Popup is not focused on click when switching from another application on macOS 2020-06-30 12:37:22 +03:00
Anton Tarasov
0917d89523 JBR-2377 Native crash IU-202.3855 macOS 2020-06-29 17:41:17 +03:00
Konstantin Bulenkov
71e2a8d8ad Update FiraCode to 5.2 2020-06-28 22:20:58 +02:00
Denis Fokin
7d5ac56b6c IDEA-215477 Cursor disappears when PhpStorm loses focus (probably related to Synergy)
Revert of JDK-7150349. The fix was intended to fight popup/applet activation issues.
2020-06-26 18:12:45 +03:00
Dmitry Batrak
2ca834c18e Revert fix for JBR-2533
it causes failure of 6406264 regression test and wrong behaviour in IDEA ('Open Class' popup isn't closed on Esc)
2020-06-26 17:49:56 +03:00
Anton Tarasov
78bd1bbeae JBR-2489 Git branch operations (switch to another branch, rebase) sometimes crash WebStorm 202.5428.27 2020-06-26 15:54:48 +03:00
Denis Fokin
82e6ed7c0b IDEA-215477 Cursor disappears when PhpStorm loses focus (probably related to Synergy)
A flag to workaround Synergy issue. It is only part of the fix. The second part of the fix conflicts with a fix for "JBR-2533 Popup is not focused on click when switching from another application on macOS".
2020-06-26 15:54:11 +03:00
Vitaly Provodin
4c6aa2945a JBR-2531 return release debug level for dcevm bilds 2020-06-26 08:24:42 +07:00
Dmitry Batrak
dc85bb1eab JBR-2533 Popup is not focused on click when switching from another application on macOS
added jtreg test case
2020-06-25 19:16:52 +03:00
Dmitry Batrak
89c80c157c JBR-2533 Popup is not focused on click when switching from another application on macOS 2020-06-25 13:47:02 +03:00
Vitaly Provodin
b8e86892f2 dcevm: add support for G1 gc 2020-06-25 11:02:15 +07:00
Vitaly Provodin
5d97e2253c JBR-2531 add fastdebug level for dcevm bilds 2020-06-24 06:16:18 +07:00
Elena Sayapina
9c3912fe1f JBR-2475 Latency when accepting auto-completion
Revert "8223158: Docked MacBook cannot start any Java Swing applications Reviewed-by: prr, serb"

This reverts commit 7c870c0c from 11.0.7 merge
2020-06-23 12:38:23 +07:00
Alexey Ushakov
c1d644a004 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
2020-06-19 17:43:09 +03:00
Dmitry Batrak
87ad6ac3a0 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
2020-06-18 18:34:46 +03:00
Vitaly Provodin
f016970f5a JBR-2501 create jbr edition excluding any additional modules JFX and JCEF (fix misprint in module.info) 2020-06-18 08:47:25 +07:00
Vitaly Provodin
71dbebd5f5 JBR-2501 create jbr edition excluding any additional modules JFX and JCEF (fix misprint) 2020-06-18 06:45:33 +07:00
Anton Tarasov
ff2936c6fb [followup] JBR-2489 Git branch operations (switch to another branch, rebase) sometimes crash WebStorm 202.5428.27 2020-06-17 14:31:56 +03:00
Dmitry Batrak
8a789e04e9 JBR-2503 Prevent JVM stealing focus during startup on Linux 2020-06-17 12:43:19 +03:00
Vitaly Provodin
eaed7de6bb JBR-2501 create jbr edition excluding any additional modules JFX and JCEF 2020-06-17 09:30:51 +07:00
Jayathirth D V
803ee2f2b5 8241490: Add large text performance tests in RenderPerfTest 2020-06-17 09:30:02 +07:00
Alexey Ushakov
356121b18f 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
2020-06-17 09:30:02 +07:00
Alexey Ushakov
8bd8d2d132 8230657: Create fine grained render perf test for metal pipeline
To run the tests:
cd src/demo/share/java2d/RenderPerfTest

sh gradlew test -i
or
sh gradlew test --tests *testWiredBoxBubbles* -i
2020-06-17 09:30:02 +07:00
Denis Konoplev
9adf77a512 JBR-215: Remove SystemInfo 2020-06-16 15:45:29 +03:00
Dmitry Batrak
73b45fb899 JBR-2498 Fix unexpected window raising under Mutter WM 2020-06-16 13:18:15 +03:00
Dmitry Batrak
66381f0dec JBR-2499 Don't use CurrentTime in SetInputFocus requests to X server 2020-06-16 13:16:48 +03:00
Dmitry Batrak
87525d1d2a JBR-2497 Support _NET_WM_USER_TIME window property on Linux 2020-06-16 13:13:04 +03:00
Anton Tarasov
81d2156fb1 JBR-2489 Git branch operations (switch to another branch, rebase) sometimes crash WebStorm 202.5428.27 2020-06-15 19:29:06 +03:00
Alexey Ushakov
916e68b5b4 Added make target 2020-06-11 17:31:07 +03:00
Alexey Ushakov
5016db518a JBR-1929 Improve rendering of San Francisco font of macOS Catalina
Added gamma correction to match grayscale rendering with subpixel one
2020-06-11 17:28:26 +03:00
Erik Joelsson
9154a8faef JBR-2316 backport the fix for the AbsPathsInImage test from OpenJDK 15
8245401: AbsPathsInImage.java fails on Windows on jdwp.dll

Reviewed-by: mikael, ihse
2020-06-11 16:56:46 +07:00
Erik Joelsson
764ac0decb JBR-2316 backport the fix for the AbsPathsInImage test from OpenJDK 15
8244051: AbsPathsInImage.java still fails on Windows

Reviewed-by: ihse
2020-06-11 16:56:35 +07:00
Erik Joelsson
fe293f0126 JBR-2316 backport the fix for the AbsPathsInImage test from OpenJDK 15
8243510: AbsPathsInImage.java fails on Windows

Reviewed-by: ihse, tbell
2020-06-11 16:56:16 +07:00
Vitaly Provodin
2620c62848 JBR-2473 modify building scripts to add dcevm clauses, add git config to docker image 2020-06-11 14:15:44 +07:00
Vitaly Provodin
c0c0a96cf4 JBR-2473 add initial set of DCEVM patches 2020-06-11 14:14:00 +07:00
Alexey Ushakov
1af5dd4aae JBR-2463 Font rendering problem on macOS Mojave
Use adjusted advances for glyphs
2020-06-09 19:55:51 +03:00
Denis Konoplev
15c4ce1d3e JBR-2444: Turn on IM workaround by default 2020-06-09 16:41:05 +03:00
Nikita Gubarkov
be6895a20b JBR-410 New golden image for emoji test on Fedora 2020-06-02 20:11:28 +03:00
Mikhail Grishchenko
a367f18492 JBR-2259 [jcef] Fixed regression test
Changed EDT awaiting method
2020-06-02 21:13:18 +07:00
Mikhail Grishchenko
dc24658b31 JBR-2430 [jcef] Fixed regression test
Refactoring + changed EDT awaiting method
2020-06-02 16:52:52 +07:00
Vitaly Provodin
a80d45eb31 updated JTreg exclude list 2020-06-02 08:16:02 +07:00
Mikhail Grishchenko
404ff84565 JBR-2430 [jcef] Added Regression test
Checks that JS Query is handled in 2nd opened browser
2020-05-28 22:14:53 +07:00
Vyacheslav Moklev
2dea81a904 JBR-2442 fix memory leak of fileBuffer
fix was suggested by Nikita Gubarkov
2020-05-28 11:55:21 +07:00
Denis Konoplev
6974131eec IDEA-237231: Correct signarute mask 2020-05-27 19:20:43 +03:00
Denis Konoplev
33a8c95d39 IDEA-237231: Possible fix for pen interraction 2020-05-27 19:15:03 +03:00
Vitaly Provodin
5ef4cceb33 updated JTreg exclude list 2020-05-27 12:40:16 +07:00
Nikita Gubarkov
c64faba66e JBR-410 Skip emoji test if font is not available 2020-05-25 16:23:46 +03:00
Alexey Ushakov
c0fd2daf5c JBR-2419 Improve performance of CStrike.getNativeGlyphOutlineBounds
Fixed handling of null bounding box
2020-05-22 20:58:57 +03:00
Alexey Ushakov
2d164c9914 JBR-2417 Fonts with names started with dot does not work in IDEA launched from run configuration
Reverting our approach (commit 12a9361f) and replacing it with backport of OpenJDK fix JDK-8244621
2020-05-22 20:44:05 +03:00
Alexey Ushakov
9f91fe91f5 JBR-2419 Improve performance of CStrike.getNativeGlyphOutlineBounds
Do not pass the result via java object. Use more straight api.
2020-05-22 20:04:22 +03:00
Denis Konoplev
caf366f6f3 JBR-215: Separate LatinNonAlphaNumKeycodes option 2020-05-22 03:15:38 +03:00
Alexey Ushakov
12a9361f7c JBR-2417 Fonts with names started with dot does not work in IDEA launched from run configuration
Used cocoa api to create some .SFNS fonts
2020-05-21 20:22:40 +03:00
Alexey Ushakov
8904e07b7d Added build targets to CMake 2020-05-21 20:20:24 +03:00
Nikita Gubarkov
bf1b017af4 JBR-410 Linux compilation fix: get rid of loop initial declarations 2020-05-21 01:13:27 +03:00
Nikita Gubarkov
e67b5fb257 JBR-410 Linux x86 compilation fix: don't use FT_LONG_MIN 2020-05-20 20:25:01 +03:00
Nikita Gubarkov
7e7b5ccd13 JBR-410 Refactor 2020-05-20 18:32:03 +03:00
Nikita Gubarkov
28b0dbf18c JBR-410 Added emoji support for Linux 2020-05-20 18:32:03 +03:00
Phil Race
9de2d941ef JBR-410 Backport: fixed usage of uninitialized memory
8238942: Rendering artifacts with LCD text and fractional metrics

Reviewed-by: serb, jdv
2020-05-20 18:32:03 +03:00
Elena Sayapina
e9fa7a0882 JBR-2328 [followup] [TESTBUG] Regression test java/awt/keyboard/AllKeyCode/AllKeyCode.java is not correct
Try to increase the test stability during regular runs.
2020-05-20 12:51:24 +07:00
Denis Konoplev
4f60efebe2 JBR-215: Windows non-alphanumeric shortcuts 2020-05-19 17:02:38 +03:00
Vitaly Provodin
cfc3e87f2a updated JTreg exclude list 2020-05-13 16:41:35 +07:00
Alexey Ushakov
4c42f75021 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
2020-05-12 19:22:45 +03:00
Vitaly Provodin
79260bc482 JBR-2291 remove dubbled lines in release file 2020-05-10 18:31:00 +07:00
Vitaly Provodin
e03fb4aac0 JBR-2291 add vendor info into bundles 2020-05-08 16:39:27 +07:00
Vitaly Provodin
c5ec83e083 updated JTreg exclude list 2020-05-07 14:12:51 +07:00
Elena Sayapina
264802cf4b 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
2020-05-07 01:04:36 +07:00
Denis Konoplev
16ca839ed3 JBR-2347: Free memory on other exceptions, rethrow ThreadDead & log it 2020-05-06 20:34:28 +03:00
Denis Konoplev
afb3303db5 JBR-2347: Don't free memory when thread is dead 2020-05-06 15:17:45 +03:00
Denis Konoplev
9f77b65a52 Remove duplicate option from README 2020-04-30 15:42:01 +03:00
Elena Sayapina
08f9ba66f9 JBR-2340 Frequent IDEA 2020.2 crashes on macOS
Revert "8214578: [macos] Problem with backslashes on macOS/JIS keyboard: Java ignores system settings"
This reverts commit ecc31f2ca7.

Revert "8234786: Fix for JDK-8214578 breaks OS X 10.12 compatibility"
This reverts commit 41b4a291.
2020-04-30 14:51:43 +07:00
Vitaly Provodin
39c879f9ad JBR-2324 address new layout in mac jcef
remove Contents/Helpers from signing
2020-04-30 06:14:04 +07:00
Vitaly Provodin
aef29fa705 JBR-2320 update the patch excluding jfx module 2020-04-29 21:46:51 +07:00
Vitaly Provodin
ab073976c4 updated JTreg exclude list 2020-04-29 21:03:00 +07:00
Vitaly Provodin
2491078e1f JBR-2320 update the patch excluding jcef module 2020-04-29 21:02:27 +07:00
Vitaly Provodin
59bcae0bff updated JTreg exclude list 2020-04-29 21:02:27 +07:00
Artem Bochkarev
fc8d9c87d4 JBR-2253: fix compilation (under windows) 2020-04-29 14:48:18 +03:00
Artem Bochkarev
127a2deddf JBR-2253: unset LD_PRELOAD just after VM loaded
workaround for JBR-2253 Preload libjsig.so to fix JNA crashes
2020-04-28 22:42:23 +03:00
Vitaly Provodin
efc504f504 updated JTreg exclude list 2020-04-28 10:16:58 +07:00
Vitaly Provodin
25d3c699eb JBR-2324 address new layout in mac jcef 80.0.4+g74f7b0c+chromium-80.0.3987.122 2020-04-28 10:16:38 +07:00
Elena Sayapina
f4227faf12 JBR-2335 [forward port from jbr8 to jbr11] JBR-206 Mac OS X: Impossible to assign cmd+ß shortcuts
Forward port ddcb719a from jdk8u.
2020-04-25 12:40:49 +07:00
Anton Tarasov
a5adc725df JBR-2282 [jcef] update to JCEF/80.0.4+g74f7b0c+chromium-80.0.3987.122 2020-04-24 14:49:19 +03:00
Elena Sayapina
bfab6a9364 JBR-2328 [followup] [TESTBUG] Regression test java/awt/keyboard/AllKeyCode/AllKeyCode.java is not correct
Updated test comment.
2020-04-24 15:08:57 +07:00
Vitaly Provodin
38f396900c updated JTreg exclude list 2020-04-24 11:11:51 +07:00
Elena Sayapina
861f73c393 JBR-2328 [TESTBUG] Regression test java/awt/keyboard/AllKeyCode/AllKeyCode.java is not correct 2020-04-23 21:41:25 +07:00
Konstantin Aleev
561a7b8def fix memory leaks in AccessibleJTree 2020-04-23 16:38:17 +03:00
Vitaly Provodin
cf3a605a0e JBR-2320 add jdk.attach module into JBR 2020-04-23 06:28:58 +07:00
Prasanta Sadhukhan
7b9a7df27a 8236635: JTabbedPane preferred size calculation is wrong for SCROLL_TAB_LAYOUT
Reviewed-by: serb, pbansal
2020-04-22 21:29:07 +07:00
Prasanta Sadhukhan
eb40ba199b JBR-2207 TitledBorder leaks PropertyChangeListener
Backported:
8204963: javax.swing.border.TitledBorder has a memory leak
Reviewed-by: serb, kaddepalli
2020-04-21 15:18:46 +03:00
Anton Tarasov
f0385f01ec JBR-2305 jcef: jb/java/jcef/JCEFStartupTest.java throws java.lang.ExceptionInInitializerError 2020-04-18 16:01:56 +03:00
Anton Tarasov
ff7d7bd43c JBR-2306 jcef: jb/java/jcef/JCEFStartupTest.java unexpectedly exits with the exit code: 0 2020-04-18 14:32:41 +03:00
Alexey Ushakov
82f7e549ff Merge pull request #17 from bell-sw/update_11.0.7
jdk-11.0.7-ga update
2020-04-18 13:39:51 +03:00
andrew
f8cb5e054b Added tag jdk-11.0.7-ga for changeset 44ce940b344b 2020-04-17 14:49:28 +03:00
ihse
6ef9435c21 8237879: make 4.3 breaks build
Reviewed-by: erikj, tbell
2020-04-17 14:38:52 +03:00
mbalao
375a012a26 8226346: Build better binary builders
Reviewed-by: andrew
2020-04-17 14:38:51 +03:00
andrew
6511ecfac4 8220613: java/util/Arrays/TimSortStackSize2.java times out with fastdebug build
Reviewed-by: mbalao
2020-04-17 14:38:50 +03:00
andrew
723af168a0 8233383: Various minor fixes
Reviewed-by: mbalao
2020-04-17 14:38:48 +03:00
simonis
54565c619d 8223678: Add Visual Studio Code workspace generation support (for native code)
Reviewed-by: andrew, sgehwolf, clanger
2020-04-17 14:38:47 +03:00
clanger
8c42f06815 8189861: Refactor CacheFind
Reviewed-by: sgehwolf
2020-04-17 14:38:46 +03:00
rschmelter
7569fd0bcd 8222264: Windows incremental build is broken with JDK-8217728
Reviewed-by: erikj, clanger
2020-04-17 14:38:45 +03:00
erikj
e10b2a467e 8217728: Speed up incremental rerun of "make hotspot"
Reviewed-by: tbell
2020-04-17 14:38:44 +03:00
simonis
6f5abe0185 8210459: Add support for generating compile_commands.json
Reviewed-by: andrew
2020-04-17 14:38:43 +03:00
erikj
80333614e2 8221851: Use of THIS_FILE in hotspot invalidates precompiled header on Linux/GCC
Reviewed-by: tbell, ysuenaga, andrew
2020-04-17 14:38:42 +03:00
simonis
a8dd501fb2 8214534: Setting of THIS_FILE in the build is broken
Reviewed-by: erikj, ihse
2020-04-17 14:38:41 +03:00
ysuenaga
68231ced3f 8204551: Event descriptions are truncated in logs
Reviewed-by: coleenp, andrew
2020-04-17 14:38:40 +03:00
erikj
a1729c30d9 8160926: FLAGS_COMPILER_CHECK_ARGUMENTS doesn't handle cross-compilation
Reviewed-by: ihse, andrew
2020-04-17 14:38:39 +03:00
erikj
dde28c2dad 8238960: linux-i586 builds are inconsistent as the newly build jdk is not able to reserve enough space for object heap
Reviewed-by: ihse, tbell, ahgross, jwilhelm
2020-04-17 14:38:38 +03:00
igerasim
0dd7e6f7a8 8236201: Better Scanner conversions
Reviewed-by: ahgross, rhalade, rriggs, skoivu, smarks, andrew
2020-04-17 14:38:37 +03:00
xuelei
0ee4046adb 8235691: Enhance TLS connectivity
Reviewed-by: jnimeh, rhalade, ahgross
2020-04-17 14:38:36 +03:00
avoitylov
efb4f9926a 8235274: Enhance typing of methods
Reviewed-by: andrew
2020-04-17 14:38:35 +03:00
robm
89bac530b9 8234841: Enhance buffering of byte buffers
Reviewed-by: alanb, ahgross, rhalade, psandoz
2020-04-17 14:38:34 +03:00
bpb
3b2d324d98 8219597: (bf) Heap buffer state changes could provoke unexpected exceptions
Reviewed-by: alanb, rriggs
2020-04-17 14:38:33 +03:00
michaelm
0f41a5b833 8234825: Better Headings for HTTP Servers
Reviewed-by: chegar, dfuchs, igerasim
2020-04-17 14:38:32 +03:00
xuelei
c2835d836c 8234408: Improve TLS session handling
Reviewed-by: ascarpino, jjiang, ahgross, ssahoo, mullan, andrew
2020-04-17 14:38:31 +03:00
weijun
caf1c6347a 8234027: Better JCEKS key support
Reviewed-by: ahgross, mullan, rriggs, rhalade
2020-04-17 14:38:30 +03:00
erikj
b0443eb9c0 8233410: Better Build Scripting
Reviewed-by: tbell, jwilhelm, andrew
2020-04-17 14:38:29 +03:00
alitvinov
058208e16d 8233250: Better X11 rendering
Reviewed-by: prr, rhalade, mschoene, serb
2020-04-17 14:38:28 +03:00
jnimeh
b6f3bd8c8c 8232581: Improve TLS verification
Reviewed-by: xuelei, rhalade, mschoene
2020-04-17 14:38:27 +03:00
xuelei
acf804d20a 8232424: More constrained algorithms
Reviewed-by: jnimeh, rhalade, ahgross
2020-04-17 14:38:26 +03:00
igerasim
718e099e9d 8231785: Improved socket permissions
Reviewed-by: ahgross, chegar, mullan, rhalade
2020-04-17 14:38:25 +03:00
mullan
4af7092f83 8231415: Better signatures in XML
Reviewed-by: weijun, mschoene, rhalade
2020-04-17 14:38:24 +03:00
bae
2ff44a1671 8229733: TLS message handling improvements
Summary: Includes changes to TransportContext from JDK-8211018
Reviewed-by: andrew
2020-04-17 14:38:22 +03:00
amenkov
2990aa1964 8227542: Manifest improved jar headers
Reviewed-by: sspitsyn, mschoene
2020-04-17 14:38:21 +03:00
robm
add8cde7e9 8227467: Better class method invocations
Reviewed-by: thartmann, dholmes, ahgross, andrew
2020-04-17 14:38:20 +03:00
bpb
b59e5fc306 8225603: Enhancement for big integers
Reviewed-by: darcy, ahgross, rhalade
2020-04-17 14:38:19 +03:00
smarks
59c0a7b335 8224549: Less Blocking Array Queues
Reviewed-by: bchristi, rhalade, rriggs, mschoene, robm
2020-04-17 14:38:18 +03:00
bchristi
a2cfc31f4a 8224541: Better mapping of serial ENUMs
Reviewed-by: mschoene, rhalade, robm, rriggs, smarks, andrew
2020-04-17 14:38:17 +03:00
hannesw
0061c1a8b5 8223904: Improve Nashorn matching
Reviewed-by: jlaskey, sundar, mschoene, rhalade
2020-04-17 14:38:16 +03:00
hannesw
33addafe05 8223898: Forward references to Nashorn
Reviewed-by: sundar, mschoene, rhalade
2020-04-17 14:38:15 +03:00
aph
b696b0ffca 8241296: Segfault in JNIHandleBlock::oops_do()
Reviewed-by: stefank, shade
2020-04-17 14:38:14 +03:00
robm
2d9d8009c4 8223727: com/sun/jndi/ldap/privconn/RunTest.java failed due to hang in LdapRequest.getReplyBer
Reviewed-by: prappo
2020-04-17 14:38:13 +03:00
ccheung
11f4f1f151 8235563: [TESTBUG] appcds/CommandLineFlagComboNegative.java does not handle archive mapping failure
Summary: Use the assertAbnormalExit method of the CDSTestUtils.Result class to handle archive mapping failure.
Reviewed-by: iklam
2020-04-17 14:38:12 +03:00
jjiang
e943bb77d0 8231810: javax/net/ssl/templates/SSLSocketSSLEngineTemplate.java fails intermittently with "java.lang.Exception: Unexpected EOF"
Reviewed-by: xuelei
2020-04-17 14:38:11 +03:00
ssahoo
fb9bc7adfb 8234723: javax/net/ssl/TLS tests support TLSv1.3
Summary: Missing TLSv1.3 test cases
Reviewed-by: xuelei
2020-04-17 14:38:10 +03:00
jjiang
560520877f 8234724: javax/net/ssl/templates/SSLSocketSSLEngineTemplate.java supports TLSv1.3
Reviewed-by: xuelei
2020-04-17 14:38:09 +03:00
dmarkov
d805574217 8232880: Update test documentation with additional settings for client UI tooltip tests
Reviewed-by: aivanov, serb, ihse
2020-04-17 14:38:08 +03:00
mbaesken
62490c7387 8240724: [test] jdk11 downport of 8224475 misses binary file test/jdk/javax/swing/JTextPane/arrow.png
Reviewed-by: sgehwolf
2020-04-17 14:38:07 +03:00
mdoerr
2008716692 8239856: [ntintel] asserts about copying unaligned array element
Reviewed-by: stuefe, sspitsyn
2020-04-17 14:38:06 +03:00
prr
ffb415143a 8233649: Update ProblemList.txt to exclude failing headful tests on macos
Reviewed-by: serb
2020-04-17 14:38:05 +03:00
chagedorn
4606544b93 8238438: SuperWord::co_locate_pack picks memory state of first instead of last load
Summary: Fix selection of first and last memory state in SuperWord::co_locate_pack
Reviewed-by: thartmann, kvn
2020-04-17 14:38:04 +03:00
lancea
2f9060fff7 8229888: (zipfs) Updating an existing zip file does not preserve original permissions
Reviewed-by: clanger, alanb, bpb
2020-04-17 14:38:03 +03:00
coffeys
47a59d4cf7 8223260: NamingManager should cache InitialContextFactory
Reviewed-by: alanb, plevart, dfuchs
2020-04-17 14:38:02 +03:00
serb
d620f89726 8230597: Update GIFlib library to the 5.2.1
Reviewed-by: prr, psadhukhan, jdv
2020-04-17 14:38:01 +03:00
arapte
0d5f4a45b6 4949105: Access Bridge lacks html tags parsing
Reviewed-by: serb, prr, pbansal
2020-04-17 14:38:00 +03:00
pbansal
33e207b792 8224475: JTextPane does not show images in HTML rendering
Reviewed-by: serb, psadhukhan
2020-04-17 14:37:59 +03:00
alitvinov
de3d9de26f 8230926: [macosx] Two apostrophes are entered instead of one with "U.S. International - PC" layout
Reviewed-by: serb, dmarkov
2020-04-17 14:37:58 +03:00
rhalade
cea6bd5d0b 8225130: Add exception for expiring Comodo roots to VerifyCACerts test
Reviewed-by: weijun
2020-04-17 14:37:57 +03:00
michaelm
5cebbb80d6 8234824: java/nio/channels/SocketChannel/AdaptSocket.java fails on Windows 10
Reviewed-by: alanb
2020-04-17 14:37:56 +03:00
prr
a5c225b3d4 8234769: Duplicate attribution in freetype.md
Reviewed-by: psadhukhan
2020-04-17 14:37:55 +03:00
prr
9075bfc468 8227324: Upgrade to freetype 2.10.1
Reviewed-by: serb, jdv
2020-04-17 14:37:54 +03:00
joehw
5aa2bdef67 8233548: Update CUP to v0.11b
Reviewed-by: lancea
2020-04-17 14:37:52 +03:00
serb
a0cfda673b 8232200: [macos 10.15] Windows in fullscreen tests jumps around the screen
Reviewed-by: prr
2020-04-17 14:37:51 +03:00
chagedorn
5a37107d90 8229994: assert(false) failed: Bad graph detected in get_early_ctrl_for_expensive
Summary: Fixes wrong idom information set in loop peeling when a loop strip mined loop is involved.
Reviewed-by: vlivanov, thartmann
2020-04-17 14:37:50 +03:00
stuefe
e86c694176 8220786: Create new switch to redirect error reporting output to stdout or stderr
Reviewed-by: dholmes, goetz
2020-04-17 14:37:49 +03:00
mbaesken
5eb55ccb7d 8201349: build broken when configured with --with-zlib=bundled on gcc 7.3
Reviewed-by: clanger, simonis
2020-04-17 14:37:48 +03:00
dfuchs
3be33c24eb 8193596: java/net/DatagramPacket/ReuseBuf.java failed due to timeout
Summary: The test is changed to bind to InetAddress.getLocalHost() instead of binding to the wildcard.
Reviewed-by: alanb, dfuchs, msheppar
Contributed-by: Patrick Concannon <catrick.concannon@oracle.com>
2020-04-17 14:37:47 +03:00
pconcannon
5e6ea5b7d3 8233018: Add a new test to verify that DatagramSocket is not interruptible
Summary: Test added to check the interruptability of DatagramSocket, MulticastSocket and DatagramSocketAdaptor.
Reviewed-by: chegar, dfuchs
2020-04-17 14:37:46 +03:00
rschuenemann
b170657293 8238534: Deep sign macOS bundles before bundle archive is being created
Reviewed-by: erikj, clanger
2020-04-17 14:37:45 +03:00
clanger
46c2608228 8239466: Loss of precision in counter decay calculation in 11u backport of JDK-8237375
Reviewed-by: mdoerr, simonis
2020-04-17 14:37:44 +03:00
chagedorn
62b96e3966 8238811: C2: assert(i >= req() || i == 0 || is_Region() || is_Phi()) with -XX:+VerifyGraphEdges
Summary: Fix -XX:+VerifyGraphEdges by additionally handling ArrayCopyNodes and UnlockNodes and add some basic flag testing.
Reviewed-by: roland, neliasso
2020-04-17 14:37:43 +03:00
rhalade
b2680a62ad 8225128: Add exception for expiring DocuSign root to VerifyCACerts test
Reviewed-by: clanger
2020-04-17 14:37:42 +03:00
xuelei
bae72e3a96 8221270: Duplicated synchronized keywords in SSLSocketImpl
Reviewed-by: mullan
2020-04-17 14:37:41 +03:00
chagedorn
bf43810d56 8237945: CTW: C2 compilation fails with assert(just_allocated_object(alloc_ctl) == ptr) failed: most recent allo
Summary: Removing too strong assertion about array allocation in LibraryCallKit::tightly_coupled_allocation().
Reviewed-by: thartmann, neliasso
2020-04-17 14:37:40 +03:00
rrich
25a8702317 8239005: [TESTBUG] test/hotspot/jtreg/runtime/StackGuardPages/TestStackGuardPages.java: exeinvoke.c: must initialize static state before calling do_overflow()
Reviewed-by: dholmes, clanger
2020-04-17 14:37:39 +03:00
igerasim
5fe3b55ef8 8163251: Hard coded loop limit prevents reading of smart card data greater than 8k
Reviewed-by: valeriep, rriggs
2020-04-17 14:37:38 +03:00
thartmann
2447ee6729 8230390: Problemlist SA tests with AOT
Summary: Putting tests on the problem list.
Reviewed-by: roland
2020-04-17 14:37:37 +03:00
arapte
97901fa909 8226892: ActionListeners on JRadioButtons don't get notified when selection is changed with arrow keys
Reviewed-by: serb, psadhukhan
2020-04-17 14:37:36 +03:00
gadams
245ea71185 8203364: Some serviceability/sa/ tests intermittently fail with java.io.IOException: LingeredApp terminated with non-zero exit code 3
Reviewed-by: cjplummer, jcbeyler
2020-04-17 14:37:35 +03:00
phh
c80dff1f12 8231387: java.security.Provider.getService returns random result due to race condition with mutating methods in the same class
Summary: Synchronize access to legacyMap in Provider.getService.
Reviewed-by: valeriep
Contributed-by: Tianmin Shi <tianshi@amazon.com>
2020-04-17 14:37:34 +03:00
valeriep
48fc7bfe4c 8228613: java.security.Provider#getServices order is no longer deterministic
Summary: Changed to use SunEntries.DEF_SECURE_RANDOM_ALGO instead of relying on ordering of SecureRandom services
Reviewed-by: weijun
2020-04-17 14:37:33 +03:00
xuelei
5569f3aeb6 4919790: Errors in alert ssl message does not reflect the actual certificate status
Reviewed-by: mullan
2020-04-17 14:37:32 +03:00
rraghavan
cc4ac7ee85 8225567: Wrong file headers with 8202414 fix changeset
Summary: Corrected source file headers
Reviewed-by: thartmann
2020-04-17 14:37:31 +03:00
mbaesken
0909fce097 8234525: enable link-time section-gc for linux s390x to remove unused code
Reviewed-by: erikj, mdoerr
2020-04-17 14:37:30 +03:00
dtitov
c38ea39bbe 8163083: SocketListeningConnector does not allow invocations with port 0
Reviewed-by: sspitsyn, amenkov, gadams, jcbeyler
2020-04-17 14:37:29 +03:00
mdoerr
81883294d8 8237375: SimpleThresholdPolicy misses CounterDecay timestamp initialization
Reviewed-by: simonis, dholmes
2020-04-17 14:37:27 +03:00
thartmann
fa8d9029fe 8226381: ProblemList java/lang/reflect/PublicMethods/PublicMethodsTest.java
Summary: Put test on AOT ProblemList.
Reviewed-by: iignatyev
2020-04-17 14:37:26 +03:00
mikael
a4bb2f47aa 8225305: ProblemList java/lang/invoke/VarHandles tests
Reviewed-by: kvn, iignatyev, mchung, alanb
2020-04-17 14:37:25 +03:00
xuelei
a9b9328252 8218889: Improperly use of the Optional API
Reviewed-by: jnimeh, wetmore
2020-04-17 14:37:24 +03:00
gadams
8d3941cbcb 8169718: nsk/jdb/locals/locals002: ERROR: Cannot find boolVar with expected value: false
Reviewed-by: cjplummer, amenkov
2020-04-17 14:37:23 +03:00
mhalder
96ac35d699 8207938: At step6,Click Add button,case failed automatically.
Reviewed-by: kaddepalli, psadhukhan
2020-04-17 14:37:22 +03:00
naoto
698ab6fe15 8225182: JNI exception pending in DestroyXIMCallback of awt_InputMethod.c:1327
Reviewed-by: serb
2020-04-17 14:37:21 +03:00
chegar
60fbf81d2b 8218662: Allow 204 responses with Content-Length:0
Reviewed-by: michaelm
2020-04-17 14:37:20 +03:00
shade
17346b61bb 8238591: CTW: Split applications/ctw/modules/jdk_localedata.java
Reviewed-by: iignatyev
2020-04-17 14:37:19 +03:00
shade
72434a30ed 8238247: CTW runner should sweep nmethods more aggressively
Reviewed-by: adinn, simonis, iignatyev
2020-04-17 14:37:17 +03:00
shade
98c20f5872 8238366: CTW runner closes standard output on exit
Reviewed-by: adinn, iignatyev
2020-04-17 14:37:16 +03:00
dbuck
f79d1b57f0 8238596: AVX enabled by default for Skylake even when unsupported
Summary: Only default to UseAVX=2 when support is detected
Reviewed-by: shade, vlivanov
2020-04-17 14:37:15 +03:00
erikj
9159f89dfa 8213906: Update arm devkits with libXrandr headers
Reviewed-by: tbell, prr
2020-04-17 14:37:14 +03:00
mgronlun
97de942a66 8230400: Missing constant pool entry for a method in stacktrace
Reviewed-by: egahlin
2020-04-17 14:37:13 +03:00
mbaesken
213614590f 8234501: remove obsolete NET_ReadV
Reviewed-by: alanb, vtewari
2020-04-17 14:37:12 +03:00
bpb
40d00cb735 8218882: NET_Writev is declared, NET_WriteV is defined
Reviewed-by: alanb, chegar
2020-04-17 14:37:11 +03:00
mbaesken
fd3a23d87d 8235671: enhance print_rlimit_info in os_posix
Reviewed-by: clanger, mdoerr
2020-04-17 14:37:10 +03:00
erikj
3585476b88 8238225: Issues reported after replacing symlink at Contents/MacOS/libjli.dylib with binary
Reviewed-by: clanger, alanb, ihse
2020-04-17 14:37:09 +03:00
clanger
bb0883fc21 8236488: Support for configure option --with-native-debug-symbols=internal is impossible on Windows
Reviewed-by: erikj
2020-04-17 14:37:08 +03:00
zgu
92362fa6b9 8216472: (se) Stack overflow during selection operation leads to crash (win)
Reviewed-by: alanb
Contributed-by: akashche@redhat.com
2020-04-17 14:37:07 +03:00
ceisserer
74e3269b24 8235904: Infinite loop when rendering huge lines
Reviewed-by: prr, kizune
2020-04-17 14:37:06 +03:00
redestad
91050d029e 8237508: Simplify JarFile.isInitializing
Reviewed-by: dfuchs, coffeys, lancea
2020-04-17 14:37:05 +03:00
coffeys
3635eebb17 8234466: Class loading deadlock involving X509Factory#commitEvent()
Reviewed-by: alanb, chegar, dfuchs
2020-04-17 14:37:04 +03:00
stuefe
1ea18f7c0f 8233019: java.lang.Class.isPrimitive() (C1) returns wrong result if Klass* is aligned to 32bit
Reviewed-by: mdoerr, dlong, aph
2020-04-17 14:37:03 +03:00
aefimov
2a0a212f9a 8232713: Update BCEL version to 6.3.1 in license file
Reviewed-by: joehw
2020-04-17 14:37:02 +03:00
mbalao
3904664dce 8237600: Test SunJSSEFIPSInit fails on Ubuntu
Reviewed-by: shade
2020-04-17 14:37:00 +03:00
iklam
3d730556e2 8210523: runtime/appcds/cacheObject/DifferentHeapSizes.java crash
Reviewed-by: jiangli, ccheung
2020-04-17 14:36:59 +03:00
mbaesken
009810646c 8237819: s390x - remove unused pd_zero_to_words_large
Reviewed-by: clanger, mdoerr
2020-04-17 14:36:58 +03:00
mbaesken
dc255c55b4 8236709: struct SwitchRange in HS violates C++ One Definition Rule
Reviewed-by: dholmes, kbarrett
2020-04-17 14:36:57 +03:00
roland
dd6f224327 8209686: cleanup arguments to PhaseIdealLoop() constructor
Reviewed-by: thartmann, kvn, pliden
2020-04-17 14:36:56 +03:00
weijun
3722df0853 8238502: sunmscapi.dll causing EXCEPTION_ACCESS_VIOLATION
Reviewed-by: wetmore, coffeys, mullan
2020-04-17 14:36:55 +03:00
mbaesken
6a6b32f053 8237869: exclude jtreg test security/infra/java/security/cert/CertPathValidator/certification/LuxTrustCA.java because of instabilities
Reviewed-by: clanger, mullan
2020-04-17 14:36:54 +03:00
gadams
86ca482b0b 8222741: jdi/EventQueue/remove/remove004 fails due to VMDisconnectedException
Reviewed-by: cjplummer, jcbeyler
2020-04-17 14:36:53 +03:00
ngasson
42be50924e 8220451: jdi/EventQueue/remove/remove004 failed due to "ERROR: thread2 is not alive"
8220456: jdi/EventQueue/remove_l/remove_l004 failed due to "TIMEOUT while waiting for event"
Reviewed-by: sspitsyn, dcubed, gadams
2020-04-17 14:36:52 +03:00
tnakamura
e04fef9581 8234386: [macos] NPE was thrown at expanding Choice from maximized frame
Reviewed-by: serb
2020-04-17 14:36:51 +03:00
sviswanathan
f60adac49c 8234610: MaxVectorSize set wrongly when UseAVX=3 is specified after JDK-8221092
Reviewed-by: kvn, vlivanov
2020-04-17 14:36:50 +03:00
roland
04f5ec40c3 8214344: C2: assert(con.basic_type() != T_ILLEGAL) failed: elembt=byte; loadbt=void; unsigned=0
Reviewed-by: kvn, thartmann
2020-04-17 14:36:49 +03:00
hannesw
edf377c204 8200432: javadoc fails with ClassCastException on {@link byte[]}
Reviewed-by: jjg, sundar
2020-04-17 14:36:48 +03:00
pchilanomate
22d64101b6 8227528: TestAbortVMOnSafepointTimeout.java failed due to "RuntimeException: 'Safepoint sync time longer than' missing from stdout/stderr"
Summary: Biased locking was disable for this test.
Reviewed-by: dcubed, mdoerr, dholmes
2020-04-17 14:36:47 +03:00
weijun
7fe46f7666 8228969: 2019-09-28 public suffix list update
Reviewed-by: mullan
2020-04-17 14:36:46 +03:00
ccheung
353624f1c2 8227646: [TESTBUG] appcds/SharedArchiveConsistency timed out
Summary: Remove the FileChannel.force() calls.
Reviewed-by: dcubed, iklam
2020-04-17 14:36:45 +03:00
ccheung
2a5f45c567 8226406: JVM fails to detect mismatched or corrupt CDS archive
Summary: Check important archive header fields such as _jvm_ident before processing other fields.
Reviewed-by: iklam, jiangli
2020-04-17 14:36:44 +03:00
andrew
1cb3bc25c6 8224851: AArch64: fix warnings and errors with Clang and GCC 8.3
Reviewed-by: shade, aph, sgehwolf
2020-04-17 14:36:43 +03:00
valeriep
5d20ec30d7 7092821: java.security.Provider.getService() is synchronized and became scalability bottleneck
Summary: Changed Provider class to use ConcurrentHashMap and default providers to use putService()
Reviewed-by: weijun, mullan
2020-04-17 14:36:42 +03:00
iklam
9773c4b786 8210289: ArchivedKlassSubGraphInfoRecord is incomplete
Reviewed-by: jiangli, ccheung
2020-04-17 14:36:40 +03:00
iklam
a25a446f84 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
Summary: Relocate and patch archive regions if necessary
Reviewed-by: jiangli, tschatzl
2020-04-17 14:36:39 +03:00
hseigel
94ff4c8db5 8203911: Test runtime/modules/getModuleJNI/GetModule fails with -Xcheck:jni
Summary: Remove unneeded validate_class() check from  checked_jni_GetModule().
Reviewed-by: dholmes, coleenp
2020-04-17 14:36:38 +03:00
rriggs
60dcdc3edb 8237368: Problem with NullPointerException in RMI TCPEndpoint.read
Reviewed-by: mchung, alanb
2020-04-17 14:36:37 +03:00
mgronlun
fabb0ef729 8231081: TestMetadataRetention fails due to missing symbol id
Reviewed-by: egahlin
2020-04-17 14:36:36 +03:00
mgronlun
1afb13bb99 8231025: Incorrect method tag offset for big endian platform
Reviewed-by: egahlin
2020-04-17 14:36:35 +03:00
mgronlun
a27e1b1ee6 8225797: OldObjectSample event creates unexpected amount of checkpoint data
Reviewed-by: egahlin
2020-04-17 14:36:34 +03:00
lancea
338c006e28 7143743: Potential memory leak with zip provider
Reviewed-by: lancea, clanger, alanb
Contributed-by: Jaikiran Pai <jai.forums2013@gmail.com>
2020-04-17 14:36:33 +03:00
sviswanathan
4f15cc2fa6 8235288: AVX 512 instructions inadvertently used on Xeon for small vector width operations
Reviewed-by: kvn, vlivanov
2020-04-17 14:36:32 +03:00
valeriep
405eec558f 8232950: SUNPKCS11 Provider incorrectly check key length for PSS Signatures.
Summary: Fixed to treat the queried key size values as bits instead of bytes
Reviewed-by: ascarpino, xuelei
2020-04-17 14:36:31 +03:00
mbaesken
e73b9b0174 8235489: handle return values of sscanf calls in hotspot
Reviewed-by: clanger, kbarrett
2020-04-17 14:36:30 +03:00
thartmann
14a6a74c55 8223769: Assert triggers with -XX:+StressReflectiveCode
Summary: Fixed too strong assert.
Reviewed-by: kvn, thartmann
Contributed-by: Christian Hagedorn <christian.hagedorn@oracle.com>
2020-04-17 14:36:29 +03:00
sviswanathan
622562faa3 8235510: java.util.zip.CRC32 performance drop after 8200067
Summary: backout 8200067 optimization
Reviewed-by: kvn
2020-04-17 14:36:28 +03:00
chagedorn
a27bb38f53 8236140: assert(!VerifyHashTableKeys || _hash_lock == 0) failed: remove node from hash table before modifying it
Summary: Add missing rehashing for modified node in InitializeNode::complete_stores().
Reviewed-by: neliasso, thartmann
2020-04-17 14:36:27 +03:00
kbarrett
c94c48de71 8189633: Missing -Xcheck:jni checking for DeleteWeakGlobalRef
Summary: Added validity check on the handle before deleting it.
Reviewed-by: dholmes, dcubed
2020-04-17 14:36:26 +03:00
pbansal
1ddd82e7ae 8235744: PIT: test/jdk/javax/swing/text/html/TestJLabelWithHTMLText.java times out in linux-x64
Reviewed-by: psadhukhan, prr
2020-04-17 14:36:25 +03:00
pbansal
13eb920830 8230235: Rendering HTML with empty img attribute and documentBaseKey cause Exception
Reviewed-by: serb, aivanov
2020-04-17 14:36:24 +03:00
mli
55d001ae88 8209824: Improve the code coverage for ThreadLocal
Reviewed-by: dholmes, alanb
2020-04-17 14:36:23 +03:00
rriggs
c6a2df3514 8224905: java/lang/ProcessBuilder/Basic.java#id1 failed with stream closed
Reviewed-by: lancea, bpb, naoto
2020-04-17 14:36:22 +03:00
mchung
c690686d1d 8222448: java/lang/reflect/PublicMethods/PublicMethodsTest.java times out
Summary: Set empty class path for compilation to avoid unnecessary opening/scanning of JAR files
Reviewed-by: alanb, dholmes
2020-04-17 14:36:21 +03:00
sundar
7c9a9f0c42 8216535: tools/jimage/JImageExtractTest.java timed out
Reviewed-by: jlaskey
2020-04-17 14:36:20 +03:00
amlu
e8ec00f9b4 8230004: jdk/internal/jimage/JImageOpenTest.java runs no test
Reviewed-by: alanb
2020-04-17 14:36:19 +03:00
prr
226b019ca3 8232154: Update Mesa 3-D Headers to version 19.2.1
Reviewed-by: serb, kcr
2020-04-17 14:36:18 +03:00
smonteith
5697bbd861 8224187: Refactor arraycopy_prologue to allow ZGC read barriers on arraycopy
Reviewed-by: eosterlund
2020-04-17 14:36:17 +03:00
dtitov
d78caa00d9 8236873: Worker has a deadlock bug
Reviewed-by: dfuchs, dholmes, sspitsyn
2020-04-17 14:36:16 +03:00
clanger
0fa3015ff5 8236500: Windows ucrt.dll should be looked up in versioned WINSDK subdirectory
Reviewed-by: mdoerr
2020-04-17 14:36:15 +03:00
clanger
0b6789c231 8232370: Refactor some com.sun.jdi tests to enable IDE integration
Reviewed-by: amenkov, cjplummer, sspitsyn
2020-04-17 14:36:14 +03:00
jvernee
6d44395f78 8232167: Visual Studio install found through --with-tools-dir value is discarded
Reviewed-by: erikj, ihse
2020-04-17 14:36:13 +03:00
vagarwal
4f2b1cc1b0 8237540: Missing files in backport of JDK-8210910
Summary: Add missing graphic files
Reviewed-by: clanger
2020-04-17 14:36:11 +03:00
akolarkunnu
a7fd30518f 8237541: Missing files in backport of JDK-8236528
Summary: Add missing graphic files
Reviewed-by: clanger
2020-04-17 14:36:10 +03:00
chagedorn
32b14163ec 8233032: assert(in_bb(n)) failed: must be
Summary: Find first and last memory state of a load pack without relying on bb indices.
Reviewed-by: roland, kvn, thartmann
Contributed-by: Roland Westrelin <rwestrel@redhat.com>, Christian Hagedorn <christian.hagedorn@oracle.com>
2020-04-17 14:36:09 +03:00
thartmann
f25c10dcc6 8233656: assert(d->is_CFG() && n->is_CFG()) failed: must have CFG nodes
Summary: Explicitly handle ProjNodes with TOP input.
Reviewed-by: kvn, vlivanov
2020-04-17 14:36:08 +03:00
igerasim
2156f7d402 8234423: Modifying ArrayList.subList().subList() resets modCount of subList
Reviewed-by: rriggs
2020-04-17 14:36:07 +03:00
serb
957aea8d3e 8233657: Intermittent NPE in Component.validate()
Reviewed-by: prr
2020-04-17 14:36:06 +03:00
coleenp
bd6ce25302 8220688: [TESTBUG] runtime/NMT/MallocStressTest.java timed out
Summary: reduce number of threads and iterate rather than sleep.
Reviewed-by: zgu, dholmes
2020-04-17 14:36:05 +03:00
hseigel
f2cf0fd440 8214840: runtime/NMT/MallocStressTest.java timed out
Summary: Add volatile to declaration of static field shared by multiple threads
Reviewed-by: dcubed, dholmes, coleenp
2020-04-17 14:36:04 +03:00
zgu
a08b065749 8214124: [TESTBUG] Bugs in runtime/NMT/MallocStressTest.java
Summary: Fix possible negative size and index that can cause the test to fail
Reviewed-by: stuefe, shade
2020-04-17 14:36:03 +03:00
mdoerr
a297314933 8230459: Test failed to resume JVMCI CompilerThread
Reviewed-by: dholmes, kvn
2020-04-17 14:36:02 +03:00
mbalao
dcbbe655f5 8005819: Support cross-realm MSSFU
Reviewed-by: weijun
2020-04-17 14:36:01 +03:00
jnimeh
ab2fd95872 8236039: JSSE Client does not accept status_request extension in CertificateRequest messages for TLS 1.3
Reviewed-by: xuelei, clanger
2020-04-17 14:36:00 +03:00
prr
5f8f31cf0c 8227662: freetype seeks to index at the end of the font data
Reviewed-by: serb, psadhukhan
2020-04-17 14:35:59 +03:00
mdoerr
cf1112a1cb 8236179: C1 register allocation error with T_ADDRESS
Reviewed-by: rkennke, vlivanov, roland, mdoerr
Contributed-by: Aditya Mandaleeka <adityam@microsoft.com>
2020-04-17 14:35:58 +03:00
shade
b40236cf49 8237217: Incorrect G1StringDedupEntry type used in StringDedupTable destructor
Reviewed-by: kbarrett, zgu
2020-04-17 14:35:57 +03:00
egahlin
3db26f1f66 8219205: JFR file without license header
Reviewed-by: mgronlun
2020-04-17 14:35:56 +03:00
dbuck
728400c64e 8230611: infinite loop in LogOutputList::wait_until_no_readers()
Summary: Add copy constructor and copy assignment operator to ensure reader count remains accurate
Reviewed-by: kbarrett, dholmes
2020-04-17 14:35:55 +03:00
thartmann
20d7648a39 8233491: Crash in AdapterHandlerLibrary::get_adapter with CDS due to code cache exhaustion
Summary: Added null check.
Reviewed-by: kvn, iklam
2020-04-17 14:35:54 +03:00
thartmann
ef40e4826d 8233529: loopTransform.cpp:2984: Error: assert(p_f->Opcode() == Op_IfFalse) failed
Summary: Strengthened asserts in locate_pre_from_main() and added a check for is_main_no_pre_loop().
Reviewed-by: kvn, vlivanov
2020-04-17 14:35:53 +03:00
roland
c335c741c4 8234350: assert(mode == ControlAroundStripMined && (use == sfpt || !use->is_reachable_from_root())) failed: missed a node
Reviewed-by: thartmann, mdoerr
2020-04-17 14:35:52 +03:00
xliu
8e3868bb4d 8235383: C1 compilation fails with -XX:+PrintIRDuringConstruction -XX:+Verbose
Summary: Added check for printable bci.
Reviewed-by: thartmann
2020-04-17 14:35:51 +03:00
thartmann
45ed9508af 8234617: C1: Incorrect result of field load due to missing narrowing conversion
Summary: Emit an explicit conversion to get the correct field value after the write.
Reviewed-by: vlivanov, mdoerr
2020-04-17 14:35:50 +03:00
vlivanov
932e46f1bd 8231430: C2: Memory stomp in max_array_length() for T_ILLEGAL type
Reviewed-by: kvn, thartmann
2020-04-17 14:35:49 +03:00
mbaesken
96ce5882f4 8231753: use more Posix functionality in aix os::print_os_info
Reviewed-by: clanger, dholmes
2020-04-17 14:35:48 +03:00
mbaesken
999e4853c4 8232060: add some initializations using sigemptyset in os_aix.cpp
Reviewed-by: clanger, stuefe
2020-04-17 14:35:47 +03:00
dtitov
fc1c7db7bd 8185005: Improve performance of ThreadMXBean.getThreadInfo(long ids[], int maxDepth)
Reviewed-by: sspitsyn, dholmes, dcubed, rehn
2020-04-17 14:35:46 +03:00
redestad
0157853f41 8232207: Linux os::available_memory re-reads cgroup configuration on every invocation
Reviewed-by: bobv, sgehwolf
2020-04-17 14:35:45 +03:00
goetz
ef3e5297c6 8235998: [c2] Memory leaks during tracing after '8224193: stringStream should not use Resource Area'.
Reviewed-by: dholmes, kvn
2020-04-17 14:35:43 +03:00
pliden
96c4302c11 8217717: ZGC: Broken oop map in C1 load barrier stub
Reviewed-by: eosterlund, neliasso
Contributed-by: erik.osterlund@oracle.com, per.liden@oracle.com
2020-04-17 14:35:42 +03:00
aefimov
5c5c5b56dd 8225430: Replace wildcard address with loopback or local host in tests - part 14
Reviewed-by: dfuchs, chegar, vtewari
2020-04-17 14:35:41 +03:00
sgehwolf
07fb6c6451 8236848: [JDK 11u] make run-test-tier1 fails after backport of JDK-8232834
Summary: Remove extraneous closing brackets
Reviewed-by: neugens, goetz
2020-04-17 14:35:40 +03:00
vjovanovic
a488ed3a63 8232806: Introduce a system property to disable eager lambda initialization
Reviewed-by: briangoetz, mr, psandoz, forax
2020-04-17 14:35:39 +03:00
vagarwal
0815e38add 8216353: Use utility APIs introduced in org/netbeans/jemmy/util/LookAndFeel class in client sanity test cases
Reviewed-by: serb
2020-04-17 14:35:38 +03:00
akolarkunnu
93e146a9e2 8211322: Reduce the timeout of tooltip in SwingSet2DemoTest
Reviewed-by: serb, shurailine
Contributed-by: gauri.patil@oracle.com
2020-04-17 14:35:37 +03:00
mseledtsov
523d7bc43d 8232224: [TESTBUG] problemlist JFR TestLargeRootSet.java
Summary: Problem listed the test
Reviewed-by: egahlin, dcubed
2020-04-17 14:35:36 +03:00
mseledtsov
1991df3d93 8230624: [TESTBUG] Problemlist JFR compiler/TestCodeSweeper.java
Summary: Added the test to the problem list
Reviewed-by: egahlin
2020-04-17 14:35:35 +03:00
erikj
a6080be8fb 8232834: RunTest sometimes fails to produce valid exitcode.txt
Reviewed-by: ihse
2020-04-17 14:35:34 +03:00
dholmes
3b0b45c877 8232571: Add missing SIGINFO signal
Reviewed-by: dholmes, rriggs
Contributed-by: Benoit Daloze <benoit.daloze@oracle.com>
2020-04-17 14:35:33 +03:00
cjplummer
e2635baada 8227645: Some tests in serviceability/sa run with fixed -Xmx values and risk running out of memory
Summary: move tests to seprate directory
Reviewed-by: dtitov, jcbeyler, ctornqvi, sspitsyn
2020-04-17 14:35:32 +03:00
sgehwolf
afbee165de 8217338: [Containers] Improve systemd slice memory limit support
Summary: Use hierachical memory limit in addition to memory_limits_in_bytes
Reviewed-by: bobv, dholmes
2020-04-17 14:35:31 +03:00
pliden
b7d07956af 8232056: GetOwnedMonitorInfoWithEATest.java fails with ZGC: Heap too small
Reviewed-by: dholmes, rrich
2020-04-17 14:35:30 +03:00
rrich
99639a817f 8230677: Should disable Escape Analysis if JVMTI capability can_get_owned_monitor_info was taken
Reviewed-by: sspitsyn, dholmes, kvn
2020-04-17 14:35:29 +03:00
aefimov
9ac6ebb845 8223638: Replace wildcard address with loopback or local host in tests - part 6
Reviewed-by: dfuchs
2020-04-17 14:35:28 +03:00
weijun
cba51c4f2e 8223003: SunMSCAPI keys are not cleaned up
Reviewed-by: igerasim
2020-04-17 14:35:27 +03:00
akolarkunnu
208cc1efeb 8213168: Enable different look and feel tests in SwingSet3 demo test FileChooserDemoTest
Reviewed-by: serb
Contributed-by: abdul.kolarkunnu@oracle.com
2020-04-17 14:35:26 +03:00
akolarkunnu
2f159022be 8211160: Handle different look and feels in JInternalFrameOperator
Reviewed-by: serb
Contributed-by: abdul.kolarkunnu@oracle.com
2020-04-17 14:35:25 +03:00
jjg
f63195b311 8218268: Javac treats Manifest Class-Path entries as Paths instead of URLs
Reviewed-by: mchung, bchristi
2020-04-17 14:35:24 +03:00
jjg
fcf76b8dd5 8232170: FSInfo#getJarClassPath throws an exception not declared in its throws clause
Reviewed-by: jjg
Contributed-by: jai.forums2013@gmail.com
2020-04-17 14:35:23 +03:00
sjohanss
db73257689 8209802: Garbage collectors should register JFR types themselves to avoid build errors.
Reviewed-by: kbarrett, tschatzl
2020-04-17 14:35:22 +03:00
phh
98d37bf202 8234288: Turkey Time Zone returns incorrect time zone name
Summary: Add and use "Turkey Time" time zone.
Reviewed-by: naoto, martin, phh
Contributed-by: letuyang@amazon.com
2020-04-17 14:35:21 +03:00
fmatte
b11198ba11 8235637: jhsdb jmap from OpenJDK 11.0.5 doesn't work if prelink is enabled
Summary: error handling for "lib_base_diff == 0"
Reviewed-by: ysuenaga, cjplummer, kevinw
Contributed-by: suenaga@oss.nttdata.com
2020-04-17 14:35:20 +03:00
mbaesken
f2d5ae698a 8233328: fix minimal VM build on Linux s390x
Reviewed-by: lucy, mdoerr
2020-04-17 14:35:19 +03:00
mbaesken
38c89a5c53 8234809: set relro in linker flags when building with gcc
Reviewed-by: erikj, fweimer
2020-04-17 14:35:18 +03:00
martin
8056459611 8209817: stack is executable when building with Clang on Linux
Reviewed-by: dholmes, martin, mikael, ihse
Contributed-by: Arthur Eubanks <aeubanks@google.com>
2020-04-17 14:35:16 +03:00
tschatzl
41c4cca03f 8214850: Rename vm_operations.?pp files to vmOperations.?pp files
Reviewed-by: dholmes, coleenp
2020-04-17 14:35:15 +03:00
erikj
72821c3537 8223627: jdk-13+20 bundle name contains null instead of ea
Reviewed-by: dholmes, tbell
2020-04-17 14:35:14 +03:00
erikj
645795502d 8223464: Improve version string for Oracle CI builds
Reviewed-by: tbell
2020-04-17 14:35:13 +03:00
akolarkunnu
fc04378e18 8228479: Correct the format of ColorChooserDemoTest
Reviewed-by: serb, psadhukhan
2020-04-17 14:35:12 +03:00
xuelei
d0b371bf3d 8225766: Curve in certificate should not affect signature scheme when using TLSv1.3
Reviewed-by: ascarpino
2020-04-17 14:35:11 +03:00
ihse
d30ad7f4d5 8217634: RunTest documentation and usability update
Reviewed-by: erikj
2020-04-17 14:35:10 +03:00
jjiang
d2222b8e44 8210632: Add key exchange algorithm to javax/net/ssl/TLSCommon/CipherSuite.java
Summary: javax/net/ssl/TLSCommon/CipherSuite.java supports key exchange algorithms
Reviewed-by: xuelei
2020-04-17 14:35:09 +03:00
iignatyev
8260840c79 8227112: exclude compiler/intrinsics/sha/sanity tests from AOT runs
Reviewed-by: kvn
2020-04-17 14:35:08 +03:00
epavlova
6380c6732a 8225684: [AOT] vmTestbase/vm/oom/production/AlwaysOOMProduction tests fail with AOTed java.base
Reviewed-by: kvn
2020-04-17 14:35:07 +03:00
mgronlun
71c55d22f9 8210024: JFR calls virtual is_Java_thread from ~Thread()
Reviewed-by: kbarrett, dholmes, dcubed, egahlin
2020-04-17 14:35:06 +03:00
jiefu
4196fb6da5 8232692: [TESTBUG] compiler/aot/fingerprint/SelfChangedCDS.java fails when cds is disabled
Reviewed-by: kvn
2020-04-17 14:35:05 +03:00
weijun
fc0984d4a5 8225180: SignedObject with invalid Key not throwing the InvalidKeyException in Windows
Reviewed-by: mullan
2020-04-17 14:35:04 +03:00
prr
9f4f55fb95 8225487: giflib legal file is missing attribution for openbsd-reallocarray.c
Reviewed-by: serb, kcr
2020-04-17 14:35:03 +03:00
epavlova
2aa05bc998 8225199: [Graal] compiler/jvmci/compilerToVM/IsMatureVsReprofileTest.java fails with -XX:CompileThresholdScaling=0.1
Reviewed-by: kvn
2020-04-17 14:35:02 +03:00
prr
5807c3e00d 8224778: test/jdk/demo/jfc/J2Ddemo/J2DdemoTest.java cannot find J2Ddemo.jar
Reviewed-by: erikj, psadhukhan
2020-04-17 14:35:01 +03:00
prr
e7199d3e90 8224705: Tests that need to be problem-listed or have printer resources
Reviewed-by: serb, psadhukhan
2020-04-17 14:35:00 +03:00
psadhukhan
f3eb61391b 8211703: JInternalFrame : java.lang.AssertionError: cannot find the internal frame
Reviewed-by: prr, serb
2020-04-17 14:34:59 +03:00
weijun
4a3ba95063 8223063: Support CNG RSA keys
Reviewed-by: mullan
2020-04-17 14:34:58 +03:00
vagarwal
e311789396 8222519: ButtonDemoScreenshotTest fails randomly with "still state to be reached"
Reviewed-by: serb
2020-04-17 14:34:57 +03:00
jjiang
f57bc13d47 8222391: javax/net/ssl/compatibility/Compatibility.java should be more flexible
Reviewed-by: xuelei
2020-04-17 14:34:56 +03:00
serb
4d0b9d556d 8221885: Add intermittent test in the JavaSound to the ProblemList
Reviewed-by: prr
2020-04-17 14:34:55 +03:00
jjiang
a883c43f16 8219723: javax/net/ssl/compatibility/Compatibility.java failed on some SNI cases
Summary: Re-generates RSA and ECDSA certificates and set longer validity period
Reviewed-by: xuelei
2020-04-17 14:34:54 +03:00
iignatyev
abce4f395c 8178798: Two compiler/aot/verification/vmflags tests fail by timeout with UseAVX=3
Reviewed-by: kvn
2020-04-17 14:34:52 +03:00
akolarkunnu
5bd967a0b2 8217297: Add support for multiple look and feel for SwingSet SliderDemoTest
Reviewed-by: serb
Contributed-by: vikrant.v.agarwal@oracle.com
2020-04-17 14:34:51 +03:00
akolarkunnu
bcb6da2141 8214471: Enable different look and feel tests in SwingSet3 demo test ToolTipDemoTest
Reviewed-by: serb, shurailine
2020-04-17 14:34:50 +03:00
iignatyev
8462373f69 8215322: add @file support to jaotc
Reviewed-by: kvn
2020-04-17 14:34:49 +03:00
hseigel
2d8d999aae 8204525: [TESTBUG] runtime/NMT/MallocStressTest.java ran out of java heap
Summary: Handle OutOfMemoryError exception to prevent test aborting
Reviewed-by: zgu, dholmes
2020-04-17 14:34:48 +03:00
sveerabhadra
0200bb9844 8210057: Enable different look and feels in SwingSet3 demo test InternalFrameDemoTest
Reviewed-by: serb
Contributed-by: gauri.patil@oracle.com
2020-04-17 14:34:47 +03:00
sveerabhadra
bb3a29fd7a 8211443: Enable different look and feels in SwingSet3 demo test SplitPaneDemoTest
Reviewed-by: serb
Contributed-by: gauri.patil@oracle.com
2020-04-17 14:34:46 +03:00
kbarrett
7c3815fff5 8209976: Improve iteration over non-JavaThreads
Summary: Add NonJavaThread and move NamedThread iteration to new class.
Reviewed-by: eosterlund, coleenp, rkennke
2020-04-17 14:34:45 +03:00
akolarkunnu
03b7dc9398 8212897: Some improvements in the EditorPaneDemotest
Reviewed-by: serb
Contributed-by: abdul.kolarkunnu@oracle.com
2020-04-17 14:34:44 +03:00
akolarkunnu
b84647c145 8209499: Create test for SwingSet EditorPaneDemo
Reviewed-by: serb
Contributed-by: abdul.kolarkunnu@oracle.com
2020-04-17 14:34:43 +03:00
akolarkunnu
899fe1c183 8211139: Increase timeout value in all tests under jdk/sanity/client/SwingSet/src
Reviewed-by: serb
Contributed-by: abdul.kolarkunnu@oracle.com
2020-04-17 14:34:42 +03:00
psadhukhan
030088a20f 8223158: Docked MacBook cannot start any Java Swing applications
Reviewed-by: prr, serb
2020-04-17 14:34:41 +03:00
eosterlund
cf2ffdb4ac 8229345: Memory leak due to vtable stubs not being shared on SPARC
Reviewed-by: mdoerr, dholmes, kvn
2020-04-17 14:34:40 +03:00
iignatyev
808948cdb5 8209807: improve handling exception in requires.VMProps
Reviewed-by: vlivanov, mseledtsov
2020-04-17 14:34:39 +03:00
weijun
d4f542f35a 8213010: Supporting keys created with certmgr.exe
Reviewed-by: valeriep
2020-04-17 14:34:38 +03:00
weijun
9a87eb6a46 8213009: Refactoring existing SunMSCAPI classes
Reviewed-by: valeriep
2020-04-17 14:34:37 +03:00
akolarkunnu
44068174b7 8210055: Enable different look and feel tests in SwingSet3 demo tests
Reviewed-by: serb
Contributed-by: abdul.kolarkunnu@oracle.com
2020-04-17 14:34:36 +03:00
vagarwal
3f7790cec7 8210910: Create test for FileChooserDemo
Reviewed-by: serb
Contributed-by: vikrant.v.agarwal@oracle.com
2020-04-17 14:34:35 +03:00
akolarkunnu
a23921e59e 8210994: Create test for SwingSet3 FrameDemo
Reviewed-by: serb
Contributed-by: abdul.kolarkunnu@oracle.com
2020-04-17 14:34:34 +03:00
vagarwal
7ff24343bc 8210052: Enable testing for all the available look and feels in SwingSet3 demo tests
Reviewed-by: shurailine, serb
2020-04-17 14:34:33 +03:00
akolarkunnu
890d41ea0d 8209993: Create a test for SwingSet3 ToolTipDemo
Reviewed-by: serb
Contributed-by: abdul.kolarkunnu@oracle.com
2020-04-17 14:34:32 +03:00
akolarkunnu
cbfc1b3323 8209494: Create a test for SwingSet InternalFrameDemo
Reviewed-by: serb
Contributed-by: abdul.kolarkunnu@oracle.com
2020-04-17 14:34:31 +03:00
akolarkunnu
428026ceed 8209789: Synchronize test/jdk/sanity/client/lib/jemmy with code-tools/jemmy/v2
Reviewed-by: serb
Contributed-by: abdul.kolarkunnu@oracle.com
2020-04-17 14:34:30 +03:00
akolarkunnu
aa63381f2c 8209418: Synchronize test/jdk/sanity/client/lib/jemmy with code-tools/jemmy/v2
Reviewed-by: serb
Contributed-by: abdul.kolarkunnu@oracle.com, alexandre.iline@oracle.com
2020-04-17 14:34:29 +03:00
stooke
1c2ee43220 8216354: Syntax error in toolchain_windows.m4
Reviewed-by: erikj, dholmes, clanger
2020-04-17 14:34:28 +03:00
kbarrett
fd68e7b85b 8209850: Allow NamedThreads to use GlobalCounter critical sections
Summary: Add NamedThreads iterator and make GlobalCounter use it.
Reviewed-by: eosterlund, rehn
2020-04-17 14:34:27 +03:00
mbaesken
a8de4a9d70 8234397: add OS uptime information to os::print_os_info output
Reviewed-by: clanger, dholmes, lucy
2020-04-17 14:34:26 +03:00
mbaesken
366377f740 8231445: check ZALLOC return values in awt coding
Reviewed-by: clanger, prr
2020-04-17 14:34:25 +03:00
weijun
cca96f8bfd 8210476: sun/security/mscapi/PrngSlow.java fails with Still too slow
Reviewed-by: xuelei, igerasim, rriggs
2020-04-17 14:34:24 +03:00
jjiang
897c6aa15e 8203687: javax/net/ssl/compatibility/Compatibility.java supports TLS 1.3
Reviewed-by: xuelei
2020-04-17 14:34:22 +03:00
igerasim
5db557a43e 8201355: Avoid native memory allocation in sun.security.mscapi.PRNG.generateSeed
Reviewed-by: weijun
2020-04-17 14:34:21 +03:00
shurailine
332bfe57e9 8208157: requires.VMProps throws NPE for missing properties in "release" file
Reviewed-by: iignatyev, lancea
2020-04-17 14:34:20 +03:00
dlong
92cd17a819 8213348: jdk.internal.vm.compiler.management service providers missing in module descriptor
8211781: re-building fails after changing Graal sources
Reviewed-by: erikj, mchung
2020-04-17 14:34:19 +03:00
rriggs
01ca066b12 8208715: Conversion of milliseconds to nanoseconds in UNIXProcess contains bug
Reviewed-by: martin
2020-04-17 14:34:18 +03:00
psadhukhan
433d15d740 8215396: JTabbedPane preferred size calculation is wrong for SCROLL_TAB_LAYOUT
Reviewed-by: serb
2020-04-17 14:34:17 +03:00
rschmelter
64b5b301ac 8226608: Hide the onjcmd option from the help output
Reviewed-by: sspitsyn, clanger
2020-04-17 14:34:16 +03:00
rschmelter
278ed4e5c6 8224673: Adjust permission for delayed starting of debugging
Summary: Changed permission from monitor to control
Reviewed-by: sspitsyn, clanger
2020-04-17 14:34:15 +03:00
iklam
12a46a64f2 8207832: serviceability/sa/ClhsdbCDSCore.java failed with "Couldn't find core file location"
Summary: Handle %p in /proc/sys/kernel/core_pattern
Reviewed-by: dholmes, hseigel
2020-04-17 14:34:14 +03:00
weijun
be42f1e20d 8231507: Update Apache Santuario (XML Signature) to version 2.1.4
Reviewed-by: weijun
Contributed-by: fedor.burdun@azulsystems.com, weijun.wang@oracle.com
2020-04-17 14:34:13 +03:00
mbaesken
eebeef97c8 8235243: handle VS2017 15.9 and VS2019 in abstract_vm_version
8235325: build failure on Linux after 8235243
Reviewed-by: dholmes, mdoerr
2020-04-17 14:34:12 +03:00
mbaesken
f22f82c584 8234339: replace JLI_StrTok in java_md_solinux.c
Reviewed-by: clanger, rriggs
2020-04-17 14:34:11 +03:00
mbaesken
7c694806dd 8234323: NULL-check return value of SurfaceData_InitOps on macosx
Reviewed-by: clanger
2020-04-17 14:34:10 +03:00
mbaesken
d3c297850e 8233078: fix minimal VM build on Linux ppc64(le)
Reviewed-by: mdoerr, lucy
2020-04-17 14:34:09 +03:00
mbaesken
1a7d83d7ba 8234741: enhance os::get_core_path on macOS
Reviewed-by: clanger, gziemski
2020-04-17 14:34:08 +03:00
psadhukhan
350dfc1510 8224821: java/awt/Focus/NoAutotransferToDisabledCompTest/NoAutotransferToDisabledCompTest.java fails linux-x64
Reviewed-by: jdv
2020-04-17 14:34:07 +03:00
psadhukhan
f3e2dc643b 8224830: test/jdk/java/awt/Focus/ModalExcludedWindowClickTest/ModalExcludedWindowClickTest.java fails on linux-x64
Reviewed-by: jdv
2020-04-17 14:34:06 +03:00
prr
070697d518 8225007: java/awt/print/PrinterJob/LandscapeStackOverflow.java may hang
Reviewed-by: serb, jdv
2020-04-17 14:34:05 +03:00
jdv
355740f62e 8225105: java/awt/Focus/ShowFrameCheckForegroundTest/ShowFrameCheckForegroundTest.java fails in Windows 10
Reviewed-by: prr, serb
2020-04-17 14:34:04 +03:00
bpb
748b0a69a8 8225117: java/math/BigInteger/SymmetricRangeTests.java fails with ParseException
Reviewed-by: darcy
2020-04-17 14:34:03 +03:00
serb
b7ff38e669 8225144: [macos] In Aqua L&F backspace key does not delete when Shift is pressed
Reviewed-by: psadhukhan
2020-04-17 14:34:02 +03:00
naoto
085c9feeca 8225435: Upgrade IANA Language Subtag Registry to the latest for JDK14
Reviewed-by: rriggs
2020-04-17 14:34:01 +03:00
kvn
5fca02ea0c 8225350: compiler/jvmci/compilerToVM/IsCompilableTest.java timed out
Reviewed-by: iignatyev
2020-04-17 14:34:00 +03:00
akolarkunnu
d8725e27d4 8221312: test/jdk/sanity/client/SwingSet/src/ColorChooserDemoTest.java failed
Reviewed-by: serb, psadhukhan
2020-04-17 14:33:59 +03:00
dholmes
4b9df72b42 8215355: Object monitor deadlock with no threads holding the monitor (using jemalloc 5.1)
Reviewed-by: rehn, stuefe, dcubed, sspitsyn
2020-04-17 14:33:57 +03:00
erikj
1aa4f75e8a 8217613: [AOT] TEST_OPTS_AOT_MODULES doesn't work on mac
Reviewed-by: tbell, kvn, iignatyev
2020-04-17 14:33:56 +03:00
epavlova
2315f46feb 8214557: Filter out VM flags which don't affect AOT code generation
Reviewed-by: kvn, erikj
2020-04-17 14:33:55 +03:00
epavlova
b641992810 8152988: [AOT] Update test batch definitions to include aot-ed java.base module mode into hs-comp testing
Reviewed-by: kvn, erikj, ihse
2020-04-17 14:33:54 +03:00
iignatyev
f583b1716c 8210699: Problem list tests which times out in Xcomp mode
Reviewed-by: kvn
2020-04-17 14:33:53 +03:00
mdoerr
9b9a4287ff 8220348: [ntintel] asserts about copying unaligned array
Reviewed-by: clanger, stuefe
2020-04-17 14:33:52 +03:00
bpb
5dc0f41370 8220479: java/nio/channels/Selector/SelectWithConsumer.java failed at testTwoChannels()
Reviewed-by: bpb
Contributed-by: alan.bateman@oracle.com
2020-04-17 14:33:51 +03:00
tschatzl
1558ec7ee9 8211211: vmTestbase/metaspace/stressDictionary/StressDictionary.java timeout
Summary: Disable CMS precleaning to avoid accumulating too many classloaders to unload.
Reviewed-by: kbarrett, sangheki
2020-04-17 14:33:50 +03:00
fyang
4e4eae71f5 8233466: aarch64: remove unnecessary load of mdo when profiling return and parameters type
Reviewed-by: adinn
2020-04-17 14:33:49 +03:00
bsrbnd
892277da5f 8214345: infinite recursion while checking super class
Reviewed-by: vromero
2020-04-17 14:33:48 +03:00
iklam
852c29fd21 8209826: Undefined reference to os::write after JDK-8209657 (filemap.hpp cleanup)
Summary: include os_inline.hpp instead
Reviewed-by: jiangli
2020-04-17 14:33:47 +03:00
jiangli
d59ff38178 8235509: Backport for JDK-8209657 Refactor filemap.hpp to simplify integration with Serviceability Agent.
Summary: Backport for JDK-8209657 Refactor filemap.hpp to simplify integration with Serviceability Agent.
Reviewed-by: clanger
2020-04-17 14:33:46 +03:00
ccheung
52c1608601 8209385: CDS runtime classpath checking is too strict when only classes from the system modules are archived
Summary: skip checking the path entries which are not being referenced during CDS dump time
Reviewed-by: jiangli, iklam
2020-04-17 14:33:45 +03:00
jiangli
5c708d5291 8209389: SIGSEGV in WalkOopAndArchiveClosure::do_oop_work.
Summary: Check the MetaspaceShared::archive_heap_object return value and handle failure accordingly.
Reviewed-by: iklam, coleenp
2020-04-17 14:33:44 +03:00
sgehwolf
a2a1c58ba5 8232003: (fs) Files.write can leak file descriptor in the exception case
Summary: Be sure to close the leaked OutputStream in all cases
Reviewed-by: alanb, bpb, clanger
2020-04-17 14:33:43 +03:00
dholmes
0db347ed3b 8210512: [Testbug] vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects002/referringObjects002.java fails with unexpected size of ClassLoaderReference.referringObjects
Summary: Account for the self-reference that every class has in the constant pool
Reviewed-by: sspitsyn, jcbeyler
2020-04-17 14:33:42 +03:00
cushon
d7e378c704 8213908: AssertionError in DeferredAttr at setOverloadKind
Reviewed-by: mcimadamore
2020-04-17 14:33:41 +03:00
akolarkunnu
179fcd7bba 8217235: Create automated test for SwingSet ColorChooserDemoTest
Reviewed-by: serb, shurailine
Contributed-by: vikrant.v.agarwal@oracle.com
2020-04-17 14:33:40 +03:00
iignatyev
7357529794 8216180: [AOT] compiler/intrinsics/bigInteger/TestMulAdd.java crashed with AOT enabled
Reviewed-by: kvn
2020-04-17 14:33:38 +03:00
iignatyev
d15790b1a2 8214904: Test8004741.java failed due to "Too few ThreadDeath hits; expected at least 6 but saw only 5"
Reviewed-by: kvn, epavlova
2020-04-17 14:33:37 +03:00
psadhukhan
41b4a291da 8234786: Fix for JDK-8214578 breaks OS X 10.12 compatibility
Reviewed-by: jdv
2020-04-17 14:33:36 +03:00
psadhukhan
ecc31f2ca7 8214578: [macos] Problem with backslashes on macOS/JIS keyboard: Java ignores system settings
Reviewed-by: serb, prr
2020-04-17 14:33:35 +03:00
pbansal
6d237ac653 8212903: [TestBug] Tests test/jdk/javax/swing/LookAndFeel/8145547/DemandGTK2.sh and DemandGTK3.sh fail on Ubuntu 18.04 LTS
Reviewed-by: prr, psadhukhan
2020-04-17 14:33:34 +03:00
akozlov
5b549c8bbb 8231584: Deadlock with ClassLoader.findLibrary and System.loadLibrary call
Reviewed-by: mchung
2020-04-17 14:33:33 +03:00
dnsimon
e87ef42ad5 8210793: [JVMCI] AllocateCompileIdTest.java failed to find DiagnosticCommand.class
Reviewed-by: thartmann, kvn
2020-04-17 14:33:32 +03:00
kvn
3da9c3e04d 8210220: [AOT] jdwp test cases are failing with error # ERROR: TEST FAILED: Cought IOException while receiving event packet
Summary: don't register AOT method if corresponding java method has breakpoints.
Reviewed-by: dlong
2020-04-17 14:33:31 +03:00
kvn
191513bdd5 8209574: [AOT] breakpoint events are generated in different threads does not meet expected count
Summary: Disable AOT when debugger is attached.
Reviewed-by: dlong
2020-04-17 14:33:30 +03:00
dlong
15cf6fc02a 8209361: [AOT] Unexpected number of references for JVMTI_HEAP_REFERENCE_CONSTANT_POOL [111-->111]: 0 (expected at least 1)
Reviewed-by: coleenp, dholmes
2020-04-17 14:33:29 +03:00
kvn
0eecd137b1 8208379: compiler/jvmci/events/JvmciNotifyInstallEventTest.java failed with "Got unexpected event count after 2nd install attempt: expected 9 to equal 2"
Reviewed-by: iignatyev
2020-04-17 14:33:28 +03:00
amenkov
0c64716eb5 8201513: nsk/jvmti/IterateThroughHeap/filter-* are broken
Reviewed-by: sspitsyn, cjplummer
2020-04-17 14:33:27 +03:00
valeriep
d314e22a0f 8183107: PKCS11 regression regarding checkKeySize
Summary: Changed key size check in PKCS11 provider to only enforce positive return values
Reviewed-by: jnimeh
2020-04-17 14:33:26 +03:00
dtitov
3a4d69f5f3 8207367: 10 vmTestbase/nsk/jdi tests timed out when running with jtreg
Reviewed-by: sspitsyn, cjplummer
2020-04-17 14:33:25 +03:00
kvn
b7f392bebf 8206963: [AOT] bug with multiple class loaders
Summary: AOT should not support custom class loaders.
Reviewed-by: dlong, iveresov
2020-04-17 14:33:24 +03:00
dcubed
cdfbf233ee 8204529: gc/TestAllocateHeapAtMultiple.java fail with Agent 7 timed out
Summary: Increase default timeout to 360 seconds.
Reviewed-by: erikj, dholmes
2020-04-17 14:33:23 +03:00
psadhukhan
ba7a4a4703 8203904: javax/swing/JSplitPane/4816114/bug4816114.java: The divider location is wrong
Reviewed-by: serb, kaddepalli
2020-04-17 14:33:21 +03:00
mbaesken
3b67eefd91 8230480: check malloc/calloc results in java.desktop
Reviewed-by: rriggs
2020-04-17 14:33:19 +03:00
serb
9ed054c277 8199072: Test javax/swing/GroupLayout/6613904/bug6613904.java is unstable
Reviewed-by: prr, psadhukhan
2020-04-17 14:33:18 +03:00
serb
93500e1787 8198398: Test javax/swing/JColorChooser/Test6199676.java fails in mach5
Reviewed-by: kaddepalli, prr
2020-04-17 14:33:17 +03:00
serb
467c36ad0a 8198321: javax/swing/JEditorPane/5076514/bug5076514.java fails
Reviewed-by: psadhukhan
2020-04-17 14:33:16 +03:00
pkbalakr
5f805555b8 8196467: javax/swing/JInternalFrame/Test6325652.java fails
Reviewed-by: jdv, psadhukhan
Contributed-by: tejpal.rebari@oracle.com
2020-04-17 14:33:15 +03:00
trebari
b3cd894715 8194944: Regression automated test 'open/test/jdk/javax/swing/JInternalFrame/8145896/TestJInternalFrameMaximize.java' fails
Reviewed-by: jdv, arapte
2020-04-17 14:33:14 +03:00
jdv
a37852ce5b 8176556: java/awt/dnd/ImageTransferTest/ImageTransferTest.java fails for JFIF
Reviewed-by: serb
2020-04-17 14:33:13 +03:00
iignatyev
4ef91e7719 8167276: jvmci/compilerToVM/MaterializeVirtualObjectTest.java fails with -XX:-EliminateAllocations
Reviewed-by: kvn
2020-04-17 14:33:12 +03:00
iignatyev
56a2bd226c 8145845: [AOT] NullPointerException in compiler/whitebox/GetCodeHeapEntriesTest.java
Reviewed-by: kvn, thartmann
2020-04-17 14:33:11 +03:00
pkbalakr
5c84c58d2e 8042383: [TEST_BUG] Test javax/swing/plaf/basic/BasicMenuUI/4983388/bug4983388.java fails with shortcuts on menus do not work
Reviewed-by: jdv, psadhukhan
Contributed-by: tejpal.rebari@oracle.com
2020-04-17 14:33:10 +03:00
sgehwolf
d88c26b3b6 8196969: JTreg Failure: serviceability/sa/ClhsdbJstack.java causes NPE
Summary: Account for serialized null scopes in NMethod
Reviewed-by: aph, never
2020-04-17 14:33:09 +03:00
mdoerr
84a3c800c9 8229236: CriticalJNINatives: dll handling should be done in native thread state
Summary: Temporarily switch thread state from _thread_in_vm to _thread_in_native to execute I/O.
Reviewed-by: dlong, dholmes
2020-04-17 14:33:06 +03:00
thartmann
e26685d09a 8193042: NativeLookup::lookup_critical_entry() should only load shared library once
Summary: Avoids repeated loads/unloads of the same shared library.
Reviewed-by: dholmes, dlong, thartmann
Contributed-by: Christian Hagedorn <christian.hagedorn@oracle.com>
2020-04-17 14:33:05 +03:00
alitvinov
cf8960ff4d 8068184: Fix for JDK-8032832 caused a deadlock
Reviewed-by: dfuchs, chegar
2020-04-17 14:33:04 +03:00
goetz
1f716d6c8d 8234340: Bump update version for OpenJDK: jdk-11.0.7
Reviewed-by: clanger
2020-04-17 14:32:48 +03:00
dbatrak
b4a552301a 8210058: Algorithmic Italic font leans opposite angle in Printing
Reviewed-by: prr, jdv, psadhukhan

Funtional fix already applied by JBR-1761: Printing a comment block in landscape mode results in oddly rotated italic letters.
Applying test only:
  http://github.com/JetBrains/JetBrainsRuntime/commit/5d35e720
  http://hg.openjdk.java.net/jdk-updates/jdk11u/rev/5242fe7dcf86
2020-04-17 14:32:47 +03:00
aivanov
33c882ecb9 8223558: Java does not render Myanmar script correctly
Reviewed-by: prr, serb

Already backported by 9b80ea79: JBR-1945 Backport JDK-8223558 from OpenJDK:
  http://github.com/JetBrains/JetBrainsRuntime/commit/9b80ea79
  http://hg.openjdk.java.net/jdk-updates/jdk11u/rev/df554438702e
2020-04-17 14:32:46 +03:00
Anton Tarasov
dd1334a352 JBR-2299 [mac] jcef requests for "chromium safe storage" keychain access 2020-04-17 11:29:59 +03:00
Vitaly Provodin
bab3f47f70 updated JTreg exclude list 2020-04-17 07:03:30 +07:00
Anton Tarasov
d0c367b31f JBR-2222 Crash during closing IDE 2020-04-16 23:43:43 +03:00
Mikhail Grishchenko
e875bf72c9 JBR-2259 WebSite isn't loaded with .loadUrl method if browser isn't shown in UI
Added reproducer
2020-04-16 14:14:06 +07:00
Nikita Gubarkov
3c55329056 JBR-2288 Fixed build failing with "multiple exports" errors when building with JFX
Related to 44cf597dc9
See https://bugs.openjdk.java.net/browse/JDK-8167314?focusedCommentId=14025789
and https://bugs.openjdk.java.net/browse/JDK-8195798
2020-04-15 19:57:16 +03:00
Denis Konoplev
a3e3c23cb1 JBR-2280: Fix regression. Mode compatible with old option. 2020-04-15 17:26:06 +03:00
Anton Tarasov
fa961d1769 JBR-2287 [jcef] add CefBrowser wrapper to jtreg tests 2020-04-15 16:00:04 +03:00
Mandy Chung
44cf597dc9 8202941: GenModuleInfoSource build tool does not detect missing semicolons
Reviewed-by: erikj
2020-04-15 14:44:12 +03:00
Nikita Gubarkov
2e3d5300bd Added --disable-warnings-as-errors to ./configure and fixed typo in java-common.cmake 2020-04-15 14:43:49 +03:00
Sergey Bylokhov
cb80ce396b JBR-1583 Fight MAC OS X "Please call TIS/TSM in main thread!!!" message
Backported fix for JDK-8226806 from jdk15-b16:
8226806: [macOS 10.14] Methods of Java Robot should be called from appropriate thread

Reviewed-by: psadhukhan, prr
2020-04-14 16:24:41 +07:00
Alexey Ushakov
900ae19a31 JBR-2213 Clicking on pipette crashes IDE
Provide pixel buffer with right size for screen grabbing operation
2020-04-13 20:56:18 +03:00
Alexey Ushakov
72f742d99b JBR-2213 Clicking on pipette crashes IDE
Move CGWindowListCreateImage call to AppKit thread
2020-04-13 13:19:58 +03:00
Pengfei Li
d7dbec973c 8208623: [TESTBUG] runtime/LoadClass/LongBCP.java fails in AUFS file system
Limit the maximal file name length to 242 for AUFS file system

Reviewed-by: dholmes, redestad
2020-04-12 07:06:13 +07:00
Elena Sayapina
266309ea51 JBR-2235 JBR 11.0.6 doesn't start from a directory with a non-ASCII name
Changed CP_THREAD_ACP to CP_ACP to fix JDK-8242283: Can't start JVM when java home path includes non-ASCII character.

Complete fix for JBR-2235 includes the following commits:
- cherry-pick 3490262a: JDK-8240197: Cannot start JVM when $JAVA_HOME includes CJK characters
- cherry-pick 04e885b4: JDK-8232168: Fix non wide char canonicalization on Windows
- cherry-pick 77ae10cd: JDK-8218547: Simplify JLI_Open on Windows in native code (libjli)
- cherry-pick 99b28daf: JDK-8240725: Some functions might not work with CJK character
2020-04-11 13:34:31 +07:00
Yasumasa Suenaga
9dfc4da688 8240725: Some functions might not work with CJK character
Reviewed-by: naoto

Backported the fix to jbr11.
Resolved conflicts in src/java.base/windows/native/libjava/canonicalize_md.c.
2020-04-11 13:34:22 +07:00
Matthias Baesken
7f134e331a 8218547: Simplify JLI_Open on Windows in native code (libjli)
Reviewed-by: alanb, clanger
2020-04-11 13:34:16 +07:00
Ralf Schmelter
87f9c8a005 8232168: Fix non wide char canonicalization on Windows
Reviewed-by: clanger, alanb, ccheung
2020-04-11 13:34:10 +07:00
Denis Konoplev
d4faba8e34 JBR-216: National keyboards shortcuts 2020-04-09 04:00:35 +03:00
Denis Konoplev
727cb87c4d JBR-1108: Fix numpad keycodes 2020-04-07 06:40:01 +03:00
Vitaly Provodin
9d568c7811 JBR-2217 provide JCEF-only (no JavaFX) bundle for master/202 branches
modify checkout targets, repair TC remote runs
2020-04-07 06:33:47 +07:00
Mikhail Grishchenko
529a188b8b JBR-2256 JEditorPane with test/html type and zero margins is not shown
Updated reproducer
2020-04-06 16:33:07 +07:00
Denis Konoplev
02fad83ca3 Remove public constants from KeyEvent 2020-04-03 18:14:32 +03:00
Mikhail Grishchenko
41578a40b5 JBR-2256 JEditorPane with test/html type and zero margins is not shown
Added reproducer
2020-04-03 21:27:15 +07:00
Denis Konoplev
231315cd11 JBR-1559: Fix NumPad keycodes 2020-04-02 20:43:51 +03:00
Mikhail Grishchenko
4e1f5a43b3 JBR-2210 IDEA fails to start (JVM crashes) when using the -Dfile.encoding=UTF-8in IDEA's vmoptions file
Added regression test
2020-04-02 17:51:13 +07:00
Vitaly Provodin
45aae6f25c JBR-1611 Slow class loading when running JVM in debug mode
8241750: x86_32 build failure after JDK-8227269
2020-04-01 16:43:11 +07:00
Vitaly Provodin
9d0b715ddf JBR-1611 Slow class loading when running JVM in debug mode
backport of 8227269: Slow class loading when running with JDWP
2020-04-01 16:43:06 +07:00
Dmitry Batrak
ff2e915371 JBR-2248 Support text wrapping in a <pre> tag in JEditorPane 2020-04-01 11:54:06 +03:00
Elena Sayapina
f2ee9a2e2a JBR-2235 JBR 11.0.6 doesn't start from a directory with a non-ASCII name
Apply JDK-8240823 fix from 11.0.8 (which is a backport of JDK-8240197 to jdk11)
8240197: Cannot start JVM when $JAVA_HOME includes CJK characters
2020-03-31 18:54:54 +03:00
Alexey Ushakov
b51254a975 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.
2020-03-31 18:53:42 +03:00
Dmitry Batrak
6003abc15f JBR-2234 Support CSS setting overflow-wrap:anywhere in JEditorPane
simplify the code
2020-03-31 16:55:51 +03:00
Dmitry Batrak
b6583d0a71 JBR-2234 Support CSS setting overflow-wrap:anywhere in JEditorPane 2020-03-31 15:36:16 +03:00
1356 changed files with 65138 additions and 24423 deletions

11
.hgtags
View File

@@ -576,3 +576,14 @@ aa260c24480a2bd7d21ad1c863e6fe9a3973011e jdk-11.0.6+6
1859de77ee6cd7e10ac0b9e71027d9f974a6e481 jdk-11.0.6+9
837b7afec083aaddeef0a6c3e6501b2200eaf1d4 jdk-11.0.6+10
837b7afec083aaddeef0a6c3e6501b2200eaf1d4 jdk-11.0.6-ga
8cdfd6139b1efc9064b10f24a82848b1bb4a0550 jdk-11.0.7+1
15cc1c8a63718c394e9cd1f35d735bb74a850084 jdk-11.0.7+2
f2d8162261ae3c1e50eb0667b3c9669caa67c652 jdk-11.0.7+3
d3d1f7f67de13fd5c227424b9ddc514c0ca32aff jdk-11.0.7+4
f03574cfc0d728ca7b5146ca22c707717f9f899f jdk-11.0.7+5
17d2e0c27889a00a3df7de9bcea0e8caf0d1771a jdk-11.0.7+6
f56b853d452bd339e3f4360cf4be42cc90f9284c jdk-11.0.7+7
3c570d183ab2afc0b204a8e980be69e7fbe761ef jdk-11.0.7+8
7201cd0c64776aa574d252b03a4c92b25d0a7d7f jdk-11.0.7+9
44ce940b344b9f240be4807f5b8f06e178e3aecd jdk-11.0.7+10
44ce940b344b9f240be4807f5b8f06e178e3aecd jdk-11.0.7-ga

View File

@@ -75,7 +75,7 @@ First command will set env vars, the second will run cygwin shell with proper en
In cygwin shell
```
cd JetBrainsRuntime
bash configure --enable-option-checking=fatal --enable-option-checking=fatal --with-toolchain-version=2015 --with-boot-jdk="/cygdrive/c/Program Files/Java/jdk-11.0.5" --disable-warnings-as-errors
bash configure --enable-option-checking=fatal --with-toolchain-version=2015 --with-boot-jdk="/cygdrive/c/Program Files/Java/jdk-11.0.5" --disable-warnings-as-errors
make images
```

View File

@@ -369,10 +369,10 @@ CC: Sun C++ 5.13 SunOS_i386 151846-10 2015/10/30</code></pre>
<p>On Linux you can also get a JDK from the Linux distribution. On apt-based distros (like Debian and Ubuntu), <code>sudo apt-get install openjdk-&lt;VERSION&gt;-jdk</code> is typically enough to install a JDK &lt;VERSION&gt;. On rpm-based distros (like Fedora and Red Hat), try <code>sudo yum install java-&lt;VERSION&gt;-openjdk-devel</code>.</p>
<h2 id="external-library-requirements">External Library Requirements</h2>
<p>Different platforms require different external libraries. In general, libraries are not optional - that is, they are either required or not used.</p>
<p>If a required library is not detected by <code>configure</code>, you need to provide the path to it. There are two forms of the <code>configure</code> arguments to point to an external library: <code>--with-&lt;LIB&gt;=&lt;path&gt;</code> or <code>--with-&lt;LIB&gt;-include=&lt;path to include&gt; --with-&lt;LIB&gt;-lib=&lt;path to lib&gt;</code>. The first variant is more concise, but require the include files an library files to reside in a default hierarchy under this directory. In most cases, it works fine.</p>
<p>If a required library is not detected by <code>configure</code>, you need to provide the path to it. There are two forms of the <code>configure</code> arguments to point to an external library: <code>--with-&lt;LIB&gt;=&lt;path&gt;</code> or <code>--with-&lt;LIB&gt;-include=&lt;path to include&gt; --with-&lt;LIB&gt;-lib=&lt;path to lib&gt;</code>. The first variant is more concise, but require the include files and library files to reside in a default hierarchy under this directory. In most cases, it works fine.</p>
<p>As a fallback, the second version allows you to point to the include directory and the lib directory separately.</p>
<h3 id="freetype">FreeType</h3>
<p>FreeType2 from <a href="http://www.freetype.org/">The FreeType Project</a> is not required on any platform. The exception is on Unix-based platforms when configuring such that the build artifacts will reference a system installed library, rather than bundling the JDKs own copy.</p>
<p>FreeType2 from <a href="http://www.freetype.org/">The FreeType Project</a> is not required on any platform. The exception is on Unix-based platforms when configuring such that the build artifacts will reference a system installed library, rather than bundling the JDK's own copy.</p>
<ul>
<li>To install on an apt-based Linux, try running <code>sudo apt-get install libfreetype6-dev</code>.</li>
<li>To install on an rpm-based Linux, try running <code>sudo yum install freetype-devel</code>.</li>
@@ -433,7 +433,7 @@ CC: Sun C++ 5.13 SunOS_i386 151846-10 2015/10/30</code></pre>
<p>To build the JDK, you need a &quot;configuration&quot;, which consists of a directory where to store the build output, coupled with information about the platform, the specific build machine, and choices that affect how the JDK is built.</p>
<p>The configuration is created by the <code>configure</code> script. The basic invocation of the <code>configure</code> script looks like this:</p>
<pre><code>bash configure [options]</code></pre>
<p>This will create an output directory containing the configuration and setup an area for the build result. This directory typically looks like <code>build/linux-x64-normal-server-release</code>, but the actual name depends on your specific configuration. (It can also be set directly, see <a href="#using-multiple-configurations">Using Multiple Configurations</a>). This directory is referred to as <code>$BUILD</code> in this documentation.</p>
<p>This will create an output directory containing the configuration and setup an area for the build result. This directory typically looks like <code>build/linux-x64-server-release</code>, but the actual name depends on your specific configuration. (It can also be set directly, see <a href="#using-multiple-configurations">Using Multiple Configurations</a>). This directory is referred to as <code>$BUILD</code> in this documentation.</p>
<p><code>configure</code> will try to figure out what system you are running on and where all necessary build components are. If you have all prerequisites for building installed, it should find everything. If it fails to detect any component automatically, it will exit and inform you about the problem.</p>
<p>Some command line examples:</p>
<ul>

View File

@@ -436,8 +436,8 @@ If a required library is not detected by `configure`, you need to provide the
path to it. There are two forms of the `configure` arguments to point to an
external library: `--with-<LIB>=<path>` or `--with-<LIB>-include=<path to
include> --with-<LIB>-lib=<path to lib>`. The first variant is more concise,
but require the include files an library files to reside in a default hierarchy
under this directory. In most cases, it works fine.
but require the include files and library files to reside in a default
hierarchy under this directory. In most cases, it works fine.
As a fallback, the second version allows you to point to the include directory
and the lib directory separately.
@@ -447,7 +447,7 @@ and the lib directory separately.
FreeType2 from [The FreeType Project](http://www.freetype.org/) is not required
on any platform. The exception is on Unix-based platforms when configuring such
that the build artifacts will reference a system installed library,
rather than bundling the JDKs own copy.
rather than bundling the JDK's own copy.
* To install on an apt-based Linux, try running `sudo apt-get install
libfreetype6-dev`.
@@ -586,8 +586,8 @@ bash configure [options]
This will create an output directory containing the configuration and setup an
area for the build result. This directory typically looks like
`build/linux-x64-normal-server-release`, but the actual name depends on your
specific configuration. (It can also be set directly, see [Using Multiple
`build/linux-x64-server-release`, but the actual name depends on your specific
configuration. (It can also be set directly, see [Using Multiple
Configurations](#using-multiple-configurations)). This directory is referred to
as `$BUILD` in this documentation.

54
doc/ide.html Normal file
View File

@@ -0,0 +1,54 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>IDE support in the JDK</title>
<style type="text/css">
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
</style>
<link rel="stylesheet" href="../make/data/docs-resources/resources/jdk-default.css" />
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
</head>
<body>
<header id="title-block-header">
<h1 class="title">IDE support in the JDK</h1>
</header>
<nav id="TOC">
<ul>
<li><a href="#introduction">Introduction</a><ul>
<li><a href="#ide-support-for-native-code">IDE support for native code</a></li>
<li><a href="#ide-support-for-java-code">IDE support for Java code</a></li>
</ul></li>
</ul>
</nav>
<h2 id="introduction">Introduction</h2>
<p>When you are familiar with building and testing the JDK, you may want to configure an IDE to work with the source code. The instructions differ a bit depending on whether you are interested in working with the native (C/C++) or the Java code.</p>
<h3 id="ide-support-for-native-code">IDE support for native code</h3>
<p>There are a few ways to generate IDE configuration for the native sources, depending on which IDE to use.</p>
<h4 id="visual-studio-code">Visual Studio Code</h4>
<p>The make system can generate a <a href="https://code.visualstudio.com">Visual Studio Code</a> workspace that has C/C++ source indexing configured correctly, as well as launcher targets for tests and the Java launcher. After configuring, a workspace for the configuration can be generated using:</p>
<pre class="shell"><code>make vscode-project</code></pre>
<p>This creates a file called <code>jdk.code-workspace</code> in the build output folder. The full location will be printed after the workspace has been generated. To use it, choose <code>File -&gt; Open Workspace...</code> in Visual Studio Code.</p>
<h5 id="alternative-indexers">Alternative indexers</h5>
<p>The main <code>vscode-project</code> target configures the default C++ support in Visual Studio Code. There are also other source indexers that can be installed, that may provide additional features. It's currently possible to generate configuration for two such indexers, <a href="https://clang.llvm.org/extra/clangd/">clangd</a> and <a href="https://github.com/Andersbakken/rtags">rtags</a>. These can be configured by appending the name of the indexer to the make target, such as:</p>
<pre class="shell"><code>make vscode-project-clangd</code></pre>
<p>Additional instructions for configuring the given indexer will be displayed after the workspace has been generated.</p>
<h4 id="visual-studio">Visual Studio</h4>
<p>This section is a work in progress.</p>
<pre class="shell"><code>make ide-project</code></pre>
<h4 id="compilation-database">Compilation Database</h4>
<p>The make system can generate generic native code indexing support in the form of a <a href="https://clang.llvm.org/docs/JSONCompilationDatabase.html">Compilation Database</a> that can be used by many different IDEs and source code indexers.</p>
<pre class="shell"><code>make compile-commands</code></pre>
<p>It's also possible to generate the Compilation Database for the HotSpot source code only, which is a bit faster as it includes less information.</p>
<pre class="shell"><code>make compile-commands-hotspot</code></pre>
<h3 id="ide-support-for-java-code">IDE support for Java code</h3>
<p>This section is a work in progress.</p>
</body>
</html>

73
doc/ide.md Normal file
View File

@@ -0,0 +1,73 @@
% IDE support in the JDK
## Introduction
When you are familiar with building and testing the JDK, you may want to
configure an IDE to work with the source code. The instructions differ a bit
depending on whether you are interested in working with the native (C/C++) or
the Java code.
### IDE support for native code
There are a few ways to generate IDE configuration for the native sources,
depending on which IDE to use.
#### Visual Studio Code
The make system can generate a [Visual Studio Code](https://code.visualstudio.com)
workspace that has C/C++ source indexing configured correctly, as well as
launcher targets for tests and the Java launcher. After configuring, a workspace
for the configuration can be generated using:
```shell
make vscode-project
```
This creates a file called `jdk.code-workspace` in the build output folder. The
full location will be printed after the workspace has been generated. To use it,
choose `File -> Open Workspace...` in Visual Studio Code.
##### Alternative indexers
The main `vscode-project` target configures the default C++ support in Visual
Studio Code. There are also other source indexers that can be installed, that
may provide additional features. It's currently possible to generate
configuration for two such indexers, [clangd](https://clang.llvm.org/extra/clangd/)
and [rtags](https://github.com/Andersbakken/rtags). These can be configured by
appending the name of the indexer to the make target, such as:
```shell
make vscode-project-clangd
```
Additional instructions for configuring the given indexer will be displayed
after the workspace has been generated.
#### Visual Studio
This section is a work in progress.
```shell
make ide-project
```
#### Compilation Database
The make system can generate generic native code indexing support in the form of
a [Compilation Database](https://clang.llvm.org/docs/JSONCompilationDatabase.html)
that can be used by many different IDEs and source code indexers.
```shell
make compile-commands
```
It's also possible to generate the Compilation Database for the HotSpot source
code only, which is a bit faster as it includes less information.
```shell
make compile-commands-hotspot
```
### IDE support for Java code
This section is a work in progress.

View File

@@ -11,14 +11,14 @@
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
</style>
<link rel="stylesheet" href="../make/data/docs-resources/resources/jdk-default.css">
<link rel="stylesheet" href="../make/data/docs-resources/resources/jdk-default.css" />
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
<style type="text/css">pre, code, tt { color: #1d6ae5; }</style>
</head>
<body>
<header>
<header id="title-block-header">
<h1 class="title">Testing the JDK</h1>
</header>
<nav id="TOC">
@@ -32,11 +32,13 @@
</ul></li>
<li><a href="#test-results-and-summary">Test results and summary</a></li>
<li><a href="#test-suite-control">Test suite control</a><ul>
<li><a href="#general-keywords-test_opts">General keywords (TEST_OPTS)</a></li>
<li><a href="#jtreg-keywords">JTReg keywords</a></li>
<li><a href="#gtest-keywords">Gtest keywords</a></li>
</ul></li>
<li><a href="#notes-for-specific-tests">Notes for Specific Tests</a><ul>
<li><a href="#docker-tests">Docker Tests</a></li>
<li><a href="#client-ui-tests">Client UI Tests</a></li>
</ul></li>
</ul>
</nav>
@@ -89,11 +91,24 @@ TEST FAILURE</code></pre>
<p>To separate multiple keyword=value pairs, use <code>;</code> (semicolon). Since the shell normally eats <code>;</code>, the recommended usage is to write the assignment inside qoutes, e.g. <code>JTREG=&quot;...;...&quot;</code>. This will also make sure spaces are preserved, as in <code>JTREG=&quot;VM_OPTIONS=-XshowSettings -Xlog:gc+ref=debug&quot;</code>.</p>
<p>(Other ways are possible, e.g. using backslash: <code>JTREG=JOBS=1\;TIMEOUT=8</code>. Also, as a special technique, the string <code>%20</code> will be replaced with space for certain options, e.g. <code>JTREG=VM_OPTIONS=-XshowSettings%20-Xlog:gc+ref=debug</code>. This can be useful if you have layers of scripts and have trouble getting proper quoting of command line arguments through.)</p>
<p>As far as possible, the names of the keywords have been standardized between test suites.</p>
<h3 id="jtreg-keywords">JTReg keywords</h3>
<h3 id="general-keywords-test_opts">General keywords (TEST_OPTS)</h3>
<p>Some keywords are valid across different test suites. If you want to run tests from multiple test suites, or just dont want to care which test suite specific control variable to use, then you can use the general TEST_OPTS control variable.</p>
<p>There are also some keywords that applies globally to the test runner system, not to any specific test suites. These are also available as TEST_OPTS keywords.</p>
<h4 id="jobs">JOBS</h4>
<p>Currently only applies to JTReg.</p>
<h4 id="timeout_factor">TIMEOUT_FACTOR</h4>
<p>Currently only applies to JTReg.</p>
<h4 id="vm_options">VM_OPTIONS</h4>
<p>Applies to JTReg, GTest and Micro.</p>
<h4 id="java_options">JAVA_OPTIONS</h4>
<p>Applies to JTReg, GTest and Micro.</p>
<h4 id="aot_modules">AOT_MODULES</h4>
<p>Applies to JTReg and GTest.</p>
<h3 id="jtreg-keywords">JTReg keywords</h3>
<h4 id="jobs-1">JOBS</h4>
<p>The test concurrency (<code>-concurrency</code>).</p>
<p>Defaults to TEST_JOBS (if set by <code>--with-test-jobs=</code>), otherwise it defaults to JOBS, except for Hotspot, where the default is <em>number of CPU cores/2</em>, but never more than 12.</p>
<h4 id="timeout">TIMEOUT</h4>
<h4 id="timeout_factor-1">TIMEOUT_FACTOR</h4>
<p>The timeout factor (<code>-timeoutFactor</code>).</p>
<p>Defaults to 4.</p>
<h4 id="test_mode">TEST_MODE</h4>
@@ -112,13 +127,21 @@ TEST FAILURE</code></pre>
<p>Limit memory consumption (<code>-Xmx</code> and <code>-vmoption:-Xmx</code>, or none).</p>
<p>Limit memory consumption for JTReg test framework and VM under test. Set to 0 to disable the limits.</p>
<p>Defaults to 512m, except for hotspot, where it defaults to 0 (no limit).</p>
<h4 id="keywords">KEYWORDS</h4>
<p>JTReg kewords sent to JTReg using <code>-k</code>. Please be careful in making sure that spaces and special characters (like <code>!</code>) are properly quoted. To avoid some issues, the special value <code>%20</code> can be used instead of space.</p>
<h4 id="extra_problem_lists">EXTRA_PROBLEM_LISTS</h4>
<p>Use additional problem lists file or files, in addition to the default ProblemList.txt located at the JTReg test roots.</p>
<p>If multiple file names are specified, they should be separated by space (or, to help avoid quoting issues, the special value <code>%20</code>).</p>
<p>The file names should be either absolute, or relative to the JTReg test root of the tests to be run.</p>
<h4 id="options">OPTIONS</h4>
<p>Additional options to the JTReg test framework.</p>
<p>Use <code>JTREG=&quot;OPTIONS=--help all&quot;</code> to see all available JTReg options.</p>
<h4 id="java_options">JAVA_OPTIONS</h4>
<h4 id="java_options-1">JAVA_OPTIONS</h4>
<p>Additional Java options to JTReg (<code>-javaoption</code>).</p>
<h4 id="vm_options">VM_OPTIONS</h4>
<h4 id="vm_options-1">VM_OPTIONS</h4>
<p>Additional VM options to JTReg (<code>-vmoption</code>).</p>
<h4 id="aot_modules-1">AOT_MODULES</h4>
<p>Generate AOT modules before testing for the specified module, or set of modules. If multiple modules are specified, they should be separated by space (or, to help avoid quoting issues, the special value <code>%20</code>).</p>
<h3 id="gtest-keywords">Gtest keywords</h3>
<h4 id="repeat">REPEAT</h4>
<p>The number of times to repeat the tests (<code>--gtest_repeat</code>).</p>
@@ -126,11 +149,23 @@ TEST FAILURE</code></pre>
<h4 id="options-1">OPTIONS</h4>
<p>Additional options to the Gtest test framework.</p>
<p>Use <code>GTEST=&quot;OPTIONS=--help&quot;</code> to see all available Gtest options.</p>
<h4 id="aot_modules-2">AOT_MODULES</h4>
<p>Generate AOT modules before testing for the specified module, or set of modules. If multiple modules are specified, they should be separated by space (or, to help avoid quoting issues, the special value <code>%20</code>).</p>
<h2 id="notes-for-specific-tests">Notes for Specific Tests</h2>
<h3 id="docker-tests">Docker Tests</h3>
<p>Docker tests with default parameters may fail on systems with glibc versions not compatible with the one used in the default docker image (e.g., Oracle Linux 7.6 for x86). For example, they pass on Ubuntu 16.04 but fail on Ubuntu 18.04 if run like this on x86:</p>
<pre><code>$ make run-test TEST=&quot;jtreg:test/hotspot/jtreg/containers/docker&quot;</code></pre>
<p>To run these tests correctly, additional parameters for the correct docker image are required on Ubuntu 18.04 by using <code>JAVA_OPTIONS</code>.</p>
<pre><code>$ make run-test TEST=&quot;jtreg:test/hotspot/jtreg/containers/docker&quot; JTREG=&quot;JAVA_OPTIONS=-Djdk.test.docker.image.name=ubuntu -Djdk.test.docker.image.version=latest&quot;</code></pre>
<h3 id="client-ui-tests">Client UI Tests</h3>
<p>Some Client UI tests use key sequences which may be reserved by the operating system. Usually that causes the test failure. So it is highly recommended to disable system key shortcuts prior testing. The steps to access and disable system key shortcuts for various platforms are provided below.</p>
<h4 id="macos">MacOS</h4>
<p>Choose Apple menu; System Preferences, click Keyboard, then click Shortcuts; select or deselect desired shortcut.</p>
<p>For example, test/jdk/javax/swing/TooltipManager/JMenuItemToolTipKeyBindingsTest/JMenuItemToolTipKeyBindingsTest.java fails on MacOS because it uses <code>CTRL + F1</code> key sequence to show or hide tooltip message but the key combination is reserved by the operating system. To run the test correctly the default global key shortcut should be disabled using the steps described above, and then deselect “Turn keyboard access on or off” option which is responsible for <code>CTRL + F1</code> combination.</p>
<h4 id="linux">Linux</h4>
<p>Open the Activities overview and start typing Settings; Choose Settings, click Devices, then click Keyboard; set or override desired shortcut.</p>
<h4 id="windows">Windows</h4>
<p>Type <code>gpedit</code> in the Search and then click Edit group policy; navigate to User Configuration -&gt; Administrative Templates -&gt; Windows Components -&gt; File Explorer; in the right-side pane look for “Turn off Windows key hotkeys” and double click on it; enable or disable hotkeys.</p>
<p>Note: restart is required to make the settings take effect.</p>
</body>
</html>

View File

@@ -162,6 +162,35 @@ proper quoting of command line arguments through.)
As far as possible, the names of the keywords have been standardized between
test suites.
### General keywords (TEST_OPTS)
Some keywords are valid across different test suites. If you want to run
tests from multiple test suites, or just don't want to care which test suite specific
control variable to use, then you can use the general TEST_OPTS control variable.
There are also some keywords that applies globally to the test runner system,
not to any specific test suites. These are also available as TEST_OPTS keywords.
#### JOBS
Currently only applies to JTReg.
#### TIMEOUT_FACTOR
Currently only applies to JTReg.
#### VM_OPTIONS
Applies to JTReg, GTest and Micro.
#### JAVA_OPTIONS
Applies to JTReg, GTest and Micro.
#### AOT_MODULES
Applies to JTReg and GTest.
### JTReg keywords
#### JOBS
@@ -171,7 +200,7 @@ Defaults to TEST_JOBS (if set by `--with-test-jobs=`), otherwise it defaults to
JOBS, except for Hotspot, where the default is *number of CPU cores/2*, but
never more than 12.
#### TIMEOUT
#### TIMEOUT_FACTOR
The timeout factor (`-timeoutFactor`).
Defaults to 4.
@@ -205,6 +234,24 @@ to disable the limits.
Defaults to 512m, except for hotspot, where it defaults to 0 (no limit).
#### KEYWORDS
JTReg kewords sent to JTReg using `-k`. Please be careful in making sure that
spaces and special characters (like `!`) are properly quoted. To avoid some
issues, the special value `%20` can be used instead of space.
#### EXTRA_PROBLEM_LISTS
Use additional problem lists file or files, in addition to the default
ProblemList.txt located at the JTReg test roots.
If multiple file names are specified, they should be separated by space (or, to
help avoid quoting issues, the special value `%20`).
The file names should be either absolute, or relative to the JTReg test root of
the tests to be run.
#### OPTIONS
Additional options to the JTReg test framework.
@@ -216,6 +263,12 @@ Additional Java options to JTReg (`-javaoption`).
#### VM_OPTIONS
Additional VM options to JTReg (`-vmoption`).
#### AOT_MODULES
Generate AOT modules before testing for the specified module, or set of
modules. If multiple modules are specified, they should be separated by space
(or, to help avoid quoting issues, the special value `%20`).
### Gtest keywords
#### REPEAT
@@ -230,6 +283,12 @@ Additional options to the Gtest test framework.
Use `GTEST="OPTIONS=--help"` to see all available Gtest options.
#### AOT_MODULES
Generate AOT modules before testing for the specified module, or set of
modules. If multiple modules are specified, they should be separated by space
(or, to help avoid quoting issues, the special value `%20`).
## Notes for Specific Tests
### Docker Tests
@@ -245,6 +304,35 @@ required on Ubuntu 18.04 by using `JAVA_OPTIONS`.
$ make run-test TEST="jtreg:test/hotspot/jtreg/containers/docker" JTREG="JAVA_OPTIONS=-Djdk.test.docker.image.name=ubuntu -Djdk.test.docker.image.version=latest"
### Client UI Tests
Some Client UI tests use key sequences which may be reserved by the operating
system. Usually that causes the test failure. So it is highly recommended to disable
system key shortcuts prior testing. The steps to access and disable system key shortcuts
for various platforms are provided below.
#### MacOS
Choose Apple menu; System Preferences, click Keyboard, then click Shortcuts;
select or deselect desired shortcut.
For example, test/jdk/javax/swing/TooltipManager/JMenuItemToolTipKeyBindingsTest/JMenuItemToolTipKeyBindingsTest.java fails
on MacOS because it uses `CTRL + F1` key sequence to show or hide tooltip message
but the key combination is reserved by the operating system. To run the test correctly
the default global key shortcut should be disabled using the steps described above, and then deselect
"Turn keyboard access on or off" option which is responsible for `CTRL + F1` combination.
#### Linux
Open the Activities overview and start typing Settings; Choose Settings, click Devices,
then click Keyboard; set or override desired shortcut.
#### Windows
Type `gpedit` in the Search and then click Edit group policy; navigate to
User Configuration -> Administrative Templates -> Windows Components -> File Explorer;
in the right-side pane look for "Turn off Windows key hotkeys" and double click on it;
enable or disable hotkeys.
Note: restart is required to make the settings take effect.
---
# Override some definitions in the global css file that are not optimal for
# this document.

View File

@@ -8,3 +8,6 @@ RUN wget https://bintray.com/jetbrains/intellij-jbr/download_file?file_path=jbrs
-O - | tar xz -C /
ENV JAVA_HOME /jbrsdk
ENV PATH $JAVA_HOME/bin:/opt/rh/devtoolset-8/root/usr/bin:$PATH
RUN mkdir .git
RUN git config user.email "builduser@jetbrains.com"
RUN git config user.name "builduser"

View File

@@ -2,6 +2,7 @@
set(CMAKE_CXX_STANDARD 98)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GNU_SOURCE -D_REENTRANT -DVM_LITTLE_ENDIAN -D_LP64 -DTARGET_ARCH_x86 ")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DINCLUDE_SUFFIX_CPU=_x86 -DAMD64 -DHOTSPOT_LIB_ARCH='amd64' -DCOMPILER1 -DCOMPILER2")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DFT2_BUILD_LIBRARY")
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTARGET_COMPILER_gcc")
@@ -16,15 +17,44 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_ALLBSD_SOURCE -DTARGET_OS_FAMILY_bsd")
endif ()
if ("${CMAKE_SYSTEM_NAME}" MATCHES "CYGWIN") #not shure about TARGET_COMPILER
if ("${CMAKE_SYSTEM_NAME}" MATCHES "CYGWIN") #not sure about TARGET_COMPILER
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTARGET_COMPILER_visCPP -DWIN64 -D_WINDOWS -DTARGET_OS_FAMILY_windows")
endif ()
add_custom_target(configure
COMMAND bash configure
COMMAND bash configure --disable-warnings-as-errors
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/../../../)
add_custom_target(build_images
COMMAND make COMPILER_WARNINGS_FATAL=false images
add_custom_target(configure_debug
COMMAND bash configure --disable-warnings-as-errors --enable-debug
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/../../../)
add_custom_target(build
COMMAND make CONF=macosx-x86_64-normal-server-release
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/../../../
DEPENDS ${SOURCE_FILES})
DEPENDS ${SOURCE_FILES})
add_custom_target(build_images
COMMAND make images CONF=macosx-x86_64-normal-server-release
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/../../../
DEPENDS ${SOURCE_FILES})
add_custom_target(build_debug
COMMAND make CONF=macosx-x86_64-normal-server-fastdebug
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/../../../
DEPENDS ${SOURCE_FILES})
add_custom_target(build_images_debug
COMMAND make images CONF=macosx-x86_64-normal-server-fastdebug
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/../../../
DEPENDS ${SOURCE_FILES})
add_custom_target(make_clean
COMMAND make clean CONF=macosx-x86_64-normal-server-release
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/../../../
DEPENDS ${SOURCE_FILES})
add_custom_target(make_clean_debug
COMMAND make clean CONF=macosx-x86_64-normal-server-fastdebug
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/../../../
DEPENDS ${SOURCE_FILES})

View File

@@ -6,6 +6,7 @@ include(../java-common.cmake)
include_directories(
../../../src/java.base/share/native/include
../../../src/java.base/share/native/libjava
../../../src/java.base/share/native/libzip/zlib
../../../src/java.desktop/share/native/common
../../../src/java.desktop/share/native/common/awt/debug
../../../src/java.desktop/share/native/common/font
@@ -58,6 +59,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR ${CMAKE_SYSTEM_NAME} MATCHES "Linux"
../../../src/java.desktop/unix/native/common/font
../../../src/java.desktop/unix/native/common/java2d/opengl
../../../src/java.desktop/unix/native/common/java2d/opengl/J2D_GL
../../../src/java.desktop/unix/native/common/java2d/x11
../../../src/java.desktop/unix/native/common
../../../src/java.desktop/unix/native/include
../../../src/java.desktop/unix/native/libawt/java2d
@@ -1026,7 +1028,10 @@ set(SOURCE_FILES
../../../src/jdk.jdwp.agent/share/native/include/jdwpTransport.h
../../../src/hotspot/share/include/jmm.h
../../../src/java.base/share/native/include/jni.h
../../../src/java.base/share/native/include/jvmticmlr.h)
../../../src/java.base/share/native/include/jvmticmlr.h
../../../src/java.base/share/native/libzip/zlib/zutil.c
../../../src/java.base/share/native/libzip/zlib/inflate.c)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(SOURCE_FILES
@@ -1356,6 +1361,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR ${CMAKE_SYSTEM_NAME} MATCHES "Linux"
../../../src/java.desktop/unix/native/libawt_xawt/awt/sun_awt_X11_GtkFileDialogPeer.c
../../../src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c
../../../src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c
../../../src/java.desktop/unix/native/libawt_xawt/java2d/x11/XRBackendNative.c
../../../src/java.desktop/unix/native/libfontmanager/X11FontScaler.c
../../../src/java.desktop/unix/native/libfontmanager/X11TextRenderer.c
../../../src/java.desktop/unix/native/libsplashscreen/splashscreen_config.h

View File

@@ -0,0 +1,3 @@
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}"

View File

@@ -6,4 +6,5 @@ build_number=$3
script_dir=jb/project/tools/linux/scripts
${script_dir}/mkimages_x64.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "jcef" || exit $?
${script_dir}/mkimages_x64.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "jfx" || exit $?
${script_dir}/mkimages_x64.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "dcevm" || exit $?
${script_dir}/mkimages_x64.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "jfx_jcef" || exit $?

View File

@@ -21,16 +21,22 @@ 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.sh
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
sh configure \
--disable-warnings-as-errors \
--with-debug-level=release \
--with-version-build=$JDK_BUILD_NUMBER \
--with-vendor-name="${VENDOR_NAME}" \
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
--with-version-pre= \
--with-version-opt=b$build_number \
--with-boot-jdk=amazon-corretto-11.0.5.10.1-linux-aarch64 \
--with-version-build=${JDK_BUILD_NUMBER} \
--with-version-opt=b${build_number} \
--with-import-modules=./modular-sdk \
--with-boot-jdk=amazon-corretto-11.0.5.10.1-linux-aarch64 \
--enable-cds=yes || exit $?
make clean CONF=linux-aarch64-normal-server-release || exit $?
make images CONF=linux-aarch64-normal-server-release test-image || exit $?
@@ -47,6 +53,9 @@ 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 $?

View File

@@ -16,11 +16,21 @@
# 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:
# MODULAR_SDK_PATH - specifies the path to the directory where imported modules are located.
# By default imported modules should be located in ./modular-sdk
# JCEF_PATH - specifies the path to the directory where JCEF binaries are located.
# By default imported modules 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')
WITH_IMPORT_MODULES="--with-import-modules=${MODULAR_SDK_PATH:=./modular-sdk}"
JCEF_PATH=${JCEF_PATH:=./jcef_linux_x64}
source jb/project/tools/common.sh
function create_jbr {
@@ -29,7 +39,7 @@ function create_jbr {
JBR_BASE_NAME=jbr_${bundle_type}_lw-${JBSDK_VERSION}
grep -v "jdk.compiler\|jdk.hotspot.agent" modules.list > modules_tmp.list
;;
"jfx" | "jcef")
"jfx" | "jcef" | "dcevm" | "nomod")
JBR_BASE_NAME=jbr_${bundle_type}-${JBSDK_VERSION}
cat modules.list > modules_tmp.list
;;
@@ -50,9 +60,9 @@ function create_jbr {
--module-path $JSDK/jmods --no-man-pages --compress=2 \
--add-modules $(xargs < modules_tmp.list | sed s/" "//g) --output $BASE_DIR/$JBR_BUNDLE
if [[ "$bundle_type" == *jcef* ]]; then
if [[ "$bundle_type" == *jcef* ]] || [[ "$bundle_type" == *dcevm* ]]; then
cp -R $BASE_DIR/$JBR_BUNDLE $BASE_DIR/jbr
cp -R jcef_linux_x64/* $BASE_DIR/$JBR_BUNDLE/lib || exit $?
cp -R ${JCEF_PATH}/* $BASE_DIR/$JBR_BUNDLE/lib || exit $?
fi
grep -v "^JAVA_VERSION" $JSDK/release | grep -v "^MODULES" >> $BASE_DIR/$JBR_BUNDLE/release
@@ -65,45 +75,59 @@ function create_jbr {
}
JBRSDK_BASE_NAME=jbrsdk-$JBSDK_VERSION
git checkout -- modules.list src
WITH_DEBUG_LEVEL="--with-debug-level=release"
RELEASE_NAME=linux-x86_64-normal-server-release
git checkout -- modules.list src/java.desktop/share/classes/module-info.java
case "$bundle_type" in
"jfx")
git apply -p0 < jb/project/tools/exclude_jcef_module.patch
git apply -p0 < jb/project/tools/patches/exclude_jcef_module.patch
;;
"jcef")
git apply -p0 < jb/project/tools/exclude_jfx_module.patch
git apply -p0 < jb/project/tools/patches/exclude_jfx_module.patch
;;
"dcevm")
git am jb/project/tools/patches/dcevm/*.patch
;;
"nomod")
git apply -p0 < jb/project/tools/patches/exclude_jcef_module.patch
git apply -p0 < jb/project/tools/patches/exclude_jfx_module.patch
WITH_IMPORT_MODULES=""
;;
esac
sh configure \
--disable-warnings-as-errors \
--with-debug-level=release \
$WITH_DEBUG_LEVEL \
--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-import-modules=./modular-sdk \
$WITH_IMPORT_MODULES \
--enable-cds=yes || exit $?
make images CONF=linux-x86_64-normal-server-release || exit $?
make images CONF=$RELEASE_NAME || exit $?
JSDK=build/linux-x86_64-normal-server-release/images/jdk
JSDK=build/$RELEASE_NAME/images/jdk
JBSDK=$JBRSDK_BASE_NAME-linux-x64-b$build_number
echo Fixing permissions
chmod -R a+r $JSDK
BASE_DIR=build/linux-x86_64-normal-server-release/images
BASE_DIR=build/$RELEASE_NAME/images
JBRSDK_BUNDLE=jbrsdk
rm -rf $BASE_DIR/$JBRSDK_BUNDLE
cp -r $JSDK $BASE_DIR/$JBRSDK_BUNDLE || exit $?
if [[ "$bundle_type" == *jcef* ]]; then
cp -R jcef_linux_x64/* $BASE_DIR/$JBRSDK_BUNDLE/lib || exit $?
if [[ "$bundle_type" == *jcef* ]] || [[ "$bundle_type" == *dcevm* ]]; then
cp -R ${JCEF_PATH}/* $BASE_DIR/$JBRSDK_BUNDLE/lib || exit $?
fi
if [ "$bundle_type" == "jfx_jcef" ]; then
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 $?

View File

@@ -16,19 +16,34 @@
# 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:
# MODULAR_SDK_PATH - specifies the path to the directory where imported modules are located.
# By default imported modules should be located in ./modular-sdk
# JCEF_PATH - specifies the path to the directory where JCEF binaries are located.
# By default imported modules should be located in ./jcef_linux_x64
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
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_linux_x64}
source jb/project/tools/common.sh
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
sh configure \
--disable-warnings-as-errors \
--with-debug-level=fastdebug \
--with-version-build=$JDK_BUILD_NUMBER \
$WITH_DEBUG_LEVEL \
--with-vendor-name="${VENDOR_NAME}" \
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
--with-version-pre= \
--with-version-opt=b$build_number \
--with-version-build=${JDK_BUILD_NUMBER} \
--with-version-opt=b${build_number} \
--with-import-modules=./modular-sdk \
--enable-cds=yes || exit $?
make clean CONF=linux-x86_64-normal-server-fastdebug || exit $?
@@ -47,6 +62,9 @@ cp -r $JSDK $BASE_DIR/$JBRSDK_BUNDLE || exit $?
cp -R jcef_linux_x64/* $BASE_DIR/$JBRSDK_BUNDLE/lib || 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 $?

View File

@@ -21,14 +21,20 @@ 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.sh
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
linux32 bash configure \
--disable-warnings-as-errors \
--with-debug-level=release \
--with-version-build=$JDK_BUILD_NUMBER \
--with-vendor-name="${VENDOR_NAME}" \
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
--with-version-pre= \
--with-version-opt=b$build_number \
--with-version-build=$JDK_BUILD_NUMBER \
--with-version-opt=b${build_number} \
--with-boot-jdk=/jbrsdk-11.0.5-b1 \
--enable-cds=yes || exit $?
make clean CONF=linux-x86-normal-server-release || exit $?
@@ -46,6 +52,9 @@ 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 $?

View File

@@ -6,4 +6,5 @@ build_number=$3
script_dir=jb/project/tools/mac/scripts
${script_dir}/mkimages.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "jcef" || exit $?
${script_dir}/mkimages.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "jfx" || exit $?
${script_dir}/mkimages.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "dcevm" || exit $?
${script_dir}/mkimages.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "jfx_jcef" || exit $?

View File

@@ -16,11 +16,21 @@
# 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:
# MODULAR_SDK_PATH - specifies the path to the directory where imported modules are located.
# By default imported modules should be located in ./modular-sdk
# JCEF_PATH - specifies the path to the directory where JCEF binaries are located.
# By default imported modules should be located in ./jcef_mac
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
bundle_type=$4
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}
source jb/project/tools/common.sh
function create_jbr {
@@ -29,7 +39,7 @@ function create_jbr {
JBR_BASE_NAME=jbr_${bundle_type}_lw-${JBSDK_VERSION}
grep -v "jdk.compiler\|jdk.hotspot.agent" modules.list > modules_tmp.list
;;
"jfx" | "jcef")
"jfx" | "jcef" | "dcevm" | "nomod")
JBR_BASE_NAME=jbr_${bundle_type}-${JBSDK_VERSION}
cat modules.list > modules_tmp.list
;;
@@ -59,11 +69,9 @@ function create_jbr {
cp -R ${BASE_DIR}/${JBRSDK_BUNDLE}/Contents/MacOS ${JRE_CONTENTS}
cp ${BASE_DIR}/${JBRSDK_BUNDLE}/Contents/Info.plist ${JRE_CONTENTS}
if [[ "${bundle_type}" == *jcef* ]]; then
if [[ "${bundle_type}" == *jcef* ]] || [[ "${bundle_type}" == *dcevm* ]]; then
rm -rf ${JRE_CONTENTS}/Frameworks || exit $?
rm -rf ${JRE_CONTENTS}/Helpers || exit $?
cp -a jcef_mac/Frameworks ${JRE_CONTENTS} || exit $?
cp -a jcef_mac/Helpers ${JRE_CONTENTS} || exit $?
cp -a ${JCEF_PATH}/Frameworks ${JRE_CONTENTS} || exit $?
fi
echo Creating ${JBR}.tar.gz ...
@@ -74,30 +82,41 @@ function create_jbr {
}
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
git checkout -- modules.list src
WITH_DEBUG_LEVEL="--with-debug-level=release"
RELEASE_NAME=macosx-x86_64-normal-server-release
git checkout -- modules.list src/java.desktop/share/classes/module-info.java
case "$bundle_type" in
"jfx")
git apply -p0 < jb/project/tools/exclude_jcef_module.patch
git apply -p0 < jb/project/tools/patches/exclude_jcef_module.patch
;;
"jcef")
git apply -p0 < jb/project/tools/exclude_jfx_module.patch
git apply -p0 < jb/project/tools/patches/exclude_jfx_module.patch
;;
"dcevm")
git am jb/project/tools/patches/dcevm/*.patch
;;
"nomod")
git apply -p0 < jb/project/tools/patches/exclude_jcef_module.patch
git apply -p0 < jb/project/tools/patches/exclude_jfx_module.patch
WITH_IMPORT_MODULES=""
;;
esac
sh configure \
--disable-warnings-as-errors \
--with-debug-level=release \
$WITH_DEBUG_LEVEL \
--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-import-modules=./modular-sdk \
$WITH_IMPORT_MODULES \
--with-boot-jdk=`/usr/libexec/java_home -v 11` \
--enable-cds=yes || exit $?
make images CONF=macosx-x86_64-normal-server-release || exit $?
make clean images CONF=$RELEASE_NAME || exit $?
JSDK=build/macosx-x86_64-normal-server-release/images/jdk-bundle
JSDK=build/$RELEASE_NAME/images/jdk-bundle
JBSDK=${JBRSDK_BASE_NAME}-osx-x64-b${build_number}
BASE_DIR=jre
@@ -105,15 +124,15 @@ JBRSDK_BUNDLE=jbrsdk
rm -rf $BASE_DIR
mkdir $BASE_DIR || exit $?
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
cp -a $JSDK/jdk-$JBSDK_VERSION_WITH_DOTS.jdk $BASE_DIR/$JBRSDK_BUNDLE || exit $?
if [[ "$bundle_type" == *jcef* ]]; then
cp -a jcef_mac/Frameworks $BASE_DIR/$JBRSDK_BUNDLE/Contents/
cp -a jcef_mac/Helpers $BASE_DIR/$JBRSDK_BUNDLE/Contents/
if [[ "$bundle_type" == *jcef* ]] || [[ "$bundle_type" == *dcevm* ]]; then
cp -a ${JCEF_PATH}/Frameworks $BASE_DIR/$JBRSDK_BUNDLE/Contents/
fi
if [ "$bundle_type" == "jfx_jcef" ]; then
echo Creating $JBSDK.tar.gz ...
sed 's/JBR/JBRSDK/g' ${BASE_DIR}/${JBRSDK_BUNDLE}/Contents/Home/release > release
mv release ${BASE_DIR}/${JBRSDK_BUNDLE}/Contents/Home/release
COPYFILE_DISABLE=1 tar -pczf $JBSDK.tar.gz -C $BASE_DIR \
--exclude='._*' --exclude='.DS_Store' --exclude='*~' \
--exclude='Home/demo' --exclude='Home/man' --exclude='Home/sample' \

View File

@@ -16,20 +16,35 @@
# 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:
# MODULAR_SDK_PATH - specifies the path to the directory where imported modules are located.
# By default imported modules should be located in ./modular-sdk
# JCEF_PATH - specifies the path to the directory where JCEF binaries are located.
# By default imported modules should be located in ./jcef_mac
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
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}
source jb/project/tools/common.sh
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
sh configure \
--disable-warnings-as-errors \
--with-debug-level=fastdebug \
--with-version-build=$JDK_BUILD_NUMBER \
$WITH_DEBUG_LEVEL \
--with-vendor-name="${VENDOR_NAME}" \
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
--with-version-pre= \
--with-version-opt=b$build_number \
--with-import-modules=./modular-sdk \
--with-version-build=${JDK_BUILD_NUMBER} \
--with-version-opt=b${build_number} \
$WITH_IMPORT_MODULES \
--with-boot-jdk=`/usr/libexec/java_home -v 11` \
--enable-cds=yes || exit $?
make clean CONF=macosx-x86_64-normal-server-fastdebug || exit $?
@@ -47,8 +62,10 @@ JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
cp -a $JSDK/jdk-$JBSDK_VERSION_WITH_DOTS.jdk $BASE_DIR/$JBRSDK_BUNDLE || exit $?
echo Creating $JBSDK.tar.gz ...
cp -a jcef_mac/Frameworks $BASE_DIR/$JBRSDK_BUNDLE/Contents/
cp -a jcef_mac/Helpers $BASE_DIR/$JBRSDK_BUNDLE/Contents
cp -a ${JCEF_PATH}/Frameworks $BASE_DIR/$JBRSDK_BUNDLE/Contents/
sed 's/JBR/JBRSDK/g' ${BASE_DIR}/${JBRSDK_BUNDLE}/Contents/Home/release > release
mv release ${BASE_DIR}/${JBRSDK_BUNDLE}/Contents/Home/release
COPYFILE_DISABLE=1 \
tar -pczf ${JBSDK}.tar.gz -C ${BASE_DIR} \
@@ -75,8 +92,7 @@ $BASE_DIR/$JBRSDK_BUNDLE/Contents/Home/bin/jlink \
grep -v "^JAVA_VERSION" $BASE_DIR/$JBRSDK_BUNDLE/Contents/Home/release | grep -v "^MODULES" >> $JRE_HOME/release
cp -R $BASE_DIR/$JBRSDK_BUNDLE/Contents/MacOS $JRE_CONTENTS
cp $BASE_DIR/$JBRSDK_BUNDLE/Contents/Info.plist $JRE_CONTENTS
cp -a jcef_mac/Frameworks ${JRE_CONTENTS} || exit $?
cp -a jcef_mac/Helpers ${JRE_CONTENTS} || exit $?
cp -a ${JCEF_PATH}/Frameworks ${JRE_CONTENTS} || exit $?
echo Creating $JBR.tar.gz ...

View File

@@ -27,8 +27,7 @@ log "Signing libraries and executables..."
for f in \
"Contents/Home/bin" \
"Contents/Home/lib" \
"Contents/Frameworks" \
"Contents/Helpers"; do
"Contents/Frameworks"; do
if [ -d "$APP_DIRECTORY/$f" ]; then
find "$APP_DIRECTORY/$f" \
-type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" -o -perm +111 \) \

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,26 @@
From a4b2a34a6c9d477ce339bece718abe992cdd5002 Mon Sep 17 00:00:00 2001
From: skybber <lada.dvorak7@gmail.com>
Date: Wed, 14 Nov 2018 21:18:22 +0100
Subject: [PATCH 02/50] We need to set classRedefinitionCount on new class, not
old class.
---
src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index 83c0952de37..83cf0be090b 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -1904,7 +1904,7 @@ void VM_EnhancedRedefineClasses::increment_class_counter(InstanceKlass *ik, TRAP
oop class_mirror = ik->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(class_mirror, new_count);
+ java_lang_Class::set_classRedefinedCount(ik->new_version()->java_mirror(), new_count);
if (class_oop != _the_class_oop) {
// _the_class_oop count is printed at end of redefine_single_class()
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,30 @@
From e5c0b2d69ab024ec0469f5c105f13f889b598815 Mon Sep 17 00:00:00 2001
From: skybber <lada.dvorak7@gmail.com>
Date: Wed, 14 Nov 2018 21:22:01 +0100
Subject: [PATCH 03/50] Fix crashes in MetadataOnStackMark::~MetadataOnSta
MetadataOnStackMark shoukld not remove dcevm stuff. It was added
accidentaly in dcevm9,
and never was part of doit() in previous versions.
---
src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index 83cf0be090b..61af07d0f86 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -470,7 +470,9 @@ void VM_EnhancedRedefineClasses::doit() {
// Mark methods seen on stack and everywhere else so old methods are not
// cleaned up if they're on the stack.
- MetadataOnStackMark md_on_stack(true);
+
+ // FIXME: fails in enhanced redefinition
+ // MetadataOnStackMark md_on_stack(true);
HandleMark hm(thread); // make sure any handles created are deleted
// before the stack walk again.
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,25 @@
From 360fbbd15357fb3cb19abc6ffb40320efadce616 Mon Sep 17 00:00:00 2001
From: skybber <lada.dvorak7@gmail.com>
Date: Mon, 3 Dec 2018 19:34:53 +0100
Subject: [PATCH 04/50] Fix problem with nested members
Reported at : https://stackoverflow.com/questions/53370380/hotswapagent-incompatibleclasschangeerror-type-headerpanel1-is-not-a-nest-mem
---
src/hotspot/share/oops/instanceKlass.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
index 8a262bc3735..9b6ba7e9304 100644
--- a/src/hotspot/share/oops/instanceKlass.cpp
+++ b/src/hotspot/share/oops/instanceKlass.cpp
@@ -178,6 +178,7 @@ bool InstanceKlass::has_nest_member(InstanceKlass* k, TRAPS) const {
}
Klass* k2 = _constants->klass_at(cp_index, CHECK_false);
+ k2 = k2->newest_version();
if (k2 == k) {
log_trace(class, nestmates)("- class is listed as a nest member");
return true;
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,26 @@
From 4e2aef4c3b201e9639acdd39aa9e7ecdc9fb6a86 Mon Sep 17 00:00:00 2001
From: skybber <lada.dvorak7@gmail.com>
Date: Mon, 10 Dec 2018 20:12:07 +0100
Subject: [PATCH 05/50] Use init_mark_raw()
method changed since j8 - it used init_mark()
---
src/hotspot/share/gc/shared/space.inline.hpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/hotspot/share/gc/shared/space.inline.hpp b/src/hotspot/share/gc/shared/space.inline.hpp
index 4394eff00c5..75d7e685edf 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 {
MarkSweep::update_fields(oop(cur_obj), oop(compaction_top));
}
- oop(compaction_top)->init_mark();
+ oop(compaction_top)->init_mark_raw();
assert(oop(compaction_top)->klass() != NULL, "should have a class");
debug_only(prev_obj = cur_obj);
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,25 @@
From 15194627b2573f109aef2cacc6ebfb600d0a20f0 Mon Sep 17 00:00:00 2001
From: skybber <lada.dvorak7@gmail.com>
Date: Thu, 13 Dec 2018 20:51:09 +0100
Subject: [PATCH 06/50] Fix methodHandles
---
src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index 61af07d0f86..1c7595787a1 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -248,7 +248,7 @@ class ChangePointersOopClosure : public BasicOopIterateClosure {
int ref_kind = (flags >> REFERENCE_KIND_SHIFT) & REFERENCE_KIND_MASK;
if (MethodHandles::ref_kind_is_method(ref_kind)) {
Method* m = (Method*) java_lang_invoke_MemberName::vmtarget(obj);
- if (m != NULL && m->method_holder()->new_version() != NULL) {
+ if (m != NULL && m->method_holder()->is_redefining()) {
// Let's try to re-resolve method
InstanceKlass* newest = InstanceKlass::cast(m->method_holder()->newest_version());
Method* new_method = newest->find_method(m->name(), m->signature());
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,58 @@
From 23a83be457df96d519db8de59a49dd65731efcc4 Mon Sep 17 00:00:00 2001
From: skybber <lada.dvorak7@gmail.com>
Date: Sat, 15 Dec 2018 18:23:30 +0100
Subject: [PATCH 07/50] Fix field method
---
.../prims/jvmtiEnhancedRedefineClasses.cpp | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index 1c7595787a1..a3b65b273e5 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -264,21 +264,26 @@ class ChangePointersOopClosure : public BasicOopIterateClosure {
}
}
} else if (MethodHandles::ref_kind_is_field(ref_kind)) {
- Klass* k = (Klass*) java_lang_invoke_MemberName::vmtarget(obj);
+ oop clazz = java_lang_invoke_MemberName::clazz(obj);
+ if (clazz == NULL) {
+ return false;
+ }
+ Klass* k = java_lang_Class::as_Klass(clazz);
if (k == NULL) {
return false; // Was cleared before, this MemberName is invalid.
}
- if (k != NULL && k->new_version() != NULL) {
+ if (k->is_redefining()) {
// Let's try to re-resolve field
+ InstanceKlass* old = InstanceKlass::cast(k->old_version());
fieldDescriptor fd;
int offset = java_lang_invoke_MemberName::vmindex(obj);
bool is_static = MethodHandles::ref_kind_is_static(ref_kind);
- InstanceKlass* ik = InstanceKlass::cast(k);
- if (ik->find_local_field_from_offset(offset, is_static, &fd)) {
- InstanceKlass* newest = InstanceKlass::cast(k->newest_version());
+ InstanceKlass* ik_old = InstanceKlass::cast(old);
+ if (ik_old->find_local_field_from_offset(offset, is_static, &fd)) {
+ InstanceKlass* ik_new = InstanceKlass::cast(k->newest_version());
fieldDescriptor fd_new;
- if (newest->find_local_field(fd.name(), fd.signature(), &fd_new)) {
+ if (ik_new->find_local_field(fd.name(), fd.signature(), &fd_new)) {
Handle objHandle(Thread::current(), obj); // TODO : review thread
MethodHandles::init_field_MemberName(objHandle, fd_new, MethodHandles::ref_kind_is_setter(ref_kind));
} else {
@@ -288,7 +293,7 @@ class ChangePointersOopClosure : public BasicOopIterateClosure {
// Eventually, we probably want to replace them with something more meaningful,
// like instance throwing NoSuchFieldError or DMH that will resort to dynamic
// field resolution (with possibility of type conversion)
- java_lang_invoke_MemberName::set_method(obj, NULL);
+ java_lang_invoke_MemberName::set_clazz(obj, NULL);
java_lang_invoke_MemberName::set_vmindex(obj, 0);
return false;
}
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,43 @@
From 1fe56253f7e63d69f9a12963316889c5e87111eb Mon Sep 17 00:00:00 2001
From: skybber <lada.dvorak7@gmail.com>
Date: Sat, 15 Dec 2018 20:16:37 +0100
Subject: [PATCH 08/50] Fix nonstatic field handles
---
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 a3b65b273e5..c64d6bb1bb5 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -337,6 +337,7 @@ class ChangePointersOopClosure : public BasicOopIterateClosure {
if (obj == NULL) {
return;
}
+ bool oop_updated = false;
if (obj->is_instance() && InstanceKlass::cast(obj->klass())->is_mirror_instance_klass()) {
Klass* klass = java_lang_Class::as_Klass(obj);
if (klass != NULL && klass->is_instance_klass()) {
@@ -344,13 +345,17 @@ class ChangePointersOopClosure : public BasicOopIterateClosure {
if (klass->new_version() != NULL) {
obj = InstanceKlass::cast(klass->new_version())->java_mirror();
S::oop_store(p, obj);
+ oop_updated = true;
}
}
}
+
// JSR 292 support, uptade java.lang.invoke.MemberName instances
if (java_lang_invoke_MemberName::is_instance(obj)) {
- update_member_name(obj);
+ if (oop_updated) {
+ update_member_name(obj);
+ }
} else if (java_lang_invoke_DirectMethodHandle::is_instance(obj)) {
if (!update_direct_method_handle(obj)) {
// DMH is no longer valid, replace it with null reference.
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,488 @@
From cbe52ffcde1851f2c3527825f37145428aeedc67 Mon Sep 17 00:00:00 2001
From: skybber <lada.dvorak7@gmail.com>
Date: Wed, 12 Dec 2018 19:38:28 +0100
Subject: [PATCH 09/50] Support for Concurrent Mark Sweep (CMS) collector
---
.../share/gc/cms/compactibleFreeListSpace.cpp | 139 ++++++++++++------
.../share/gc/cms/compactibleFreeListSpace.hpp | 5 +-
.../gc/cms/concurrentMarkSweepThread.cpp | 10 +-
src/hotspot/share/gc/serial/markSweep.cpp | 2 +-
src/hotspot/share/gc/shared/gcConfig.cpp | 2 +-
src/hotspot/share/gc/shared/space.cpp | 16 +-
src/hotspot/share/gc/shared/space.hpp | 6 +-
src/hotspot/share/gc/shared/space.inline.hpp | 16 +-
.../prims/jvmtiEnhancedRedefineClasses.cpp | 12 +-
src/hotspot/share/runtime/arguments.cpp | 6 +-
10 files changed, 135 insertions(+), 79 deletions(-)
diff --git a/src/hotspot/share/gc/cms/compactibleFreeListSpace.cpp b/src/hotspot/share/gc/cms/compactibleFreeListSpace.cpp
index a93f764f1b9..efaa09473a9 100644
--- a/src/hotspot/share/gc/cms/compactibleFreeListSpace.cpp
+++ b/src/hotspot/share/gc/cms/compactibleFreeListSpace.cpp
@@ -376,55 +376,58 @@ CompactibleFreeListSpace::CompactibleFreeListSpace(BlockOffsetSharedArray* bs, M
_used_stable = 0;
}
+#define forward_compact_top_DEFN() \
+ assert(this == cp->space, "'this' should be current compaction space."); \
+ size_t compaction_max_size = pointer_delta(end(), compact_top); \
+ assert(adjustObjectSize(size) == cp->space->adjust_object_size_v(size), \
+ "virtual adjustObjectSize_v() method is not correct"); \
+ size_t adjusted_size = adjustObjectSize(size); \
+ assert(compaction_max_size >= MinChunkSize || compaction_max_size == 0, \
+ "no small fragments allowed"); \
+ assert(minimum_free_block_size() == MinChunkSize, \
+ "for de-virtualized reference below"); \
+ /* Can't leave a nonzero size, residual fragment smaller than MinChunkSize */ \
+ if (adjusted_size + MinChunkSize > compaction_max_size && \
+ adjusted_size != compaction_max_size) { \
+ do { \
+ /* switch to next compaction space*/ \
+ cp->space->set_compaction_top(compact_top); \
+ cp->space = cp->space->next_compaction_space(); \
+ if (cp->space == NULL) { \
+ cp->gen = CMSHeap::heap()->young_gen(); \
+ assert(cp->gen != NULL, "compaction must succeed"); \
+ cp->space = cp->gen->first_compaction_space(); \
+ assert(cp->space != NULL, "generation must have a first compaction space"); \
+ } \
+ compact_top = cp->space->bottom(); \
+ cp->space->set_compaction_top(compact_top); \
+ /* The correct adjusted_size may not be the same as that for this method */ \
+ /* (i.e., cp->space may no longer be "this" so adjust the size again. */ \
+ /* Use the virtual method which is not used above to save the virtual */ \
+ /* dispatch. */ \
+ adjusted_size = cp->space->adjust_object_size_v(size); \
+ compaction_max_size = pointer_delta(cp->space->end(), compact_top); \
+ assert(cp->space->minimum_free_block_size() == 0, "just checking"); \
+ } while (adjusted_size > compaction_max_size); \
+ }
+
+
HeapWord* CompactibleFreeListSpace::forward_compact_top(size_t size,
CompactPoint* cp, HeapWord* compact_top) {
- ShouldNotReachHere();
- return NULL;
+ forward_compact_top_DEFN()
+ return compact_top;
}
// Like CompactibleSpace forward() but always calls cross_threshold() to
// update the block offset table. Removed initialize_threshold call because
// CFLS does not use a block offset array for contiguous spaces.
HeapWord* CompactibleFreeListSpace::forward(oop q, size_t size,
- CompactPoint* cp, HeapWord* compact_top) {
- // q is alive
- // First check if we should switch compaction space
- assert(this == cp->space, "'this' should be current compaction space.");
- size_t compaction_max_size = pointer_delta(end(), compact_top);
- assert(adjustObjectSize(size) == cp->space->adjust_object_size_v(size),
- "virtual adjustObjectSize_v() method is not correct");
- size_t adjusted_size = adjustObjectSize(size);
- assert(compaction_max_size >= MinChunkSize || compaction_max_size == 0,
- "no small fragments allowed");
- assert(minimum_free_block_size() == MinChunkSize,
- "for de-virtualized reference below");
- // Can't leave a nonzero size, residual fragment smaller than MinChunkSize
- if (adjusted_size + MinChunkSize > compaction_max_size &&
- adjusted_size != compaction_max_size) {
- do {
- // switch to next compaction space
- cp->space->set_compaction_top(compact_top);
- cp->space = cp->space->next_compaction_space();
- if (cp->space == NULL) {
- cp->gen = CMSHeap::heap()->young_gen();
- assert(cp->gen != NULL, "compaction must succeed");
- cp->space = cp->gen->first_compaction_space();
- assert(cp->space != NULL, "generation must have a first compaction space");
- }
- compact_top = cp->space->bottom();
- cp->space->set_compaction_top(compact_top);
- // The correct adjusted_size may not be the same as that for this method
- // (i.e., cp->space may no longer be "this" so adjust the size again.
- // Use the virtual method which is not used above to save the virtual
- // dispatch.
- adjusted_size = cp->space->adjust_object_size_v(size);
- compaction_max_size = pointer_delta(cp->space->end(), compact_top);
- assert(cp->space->minimum_free_block_size() == 0, "just checking");
- } while (adjusted_size > compaction_max_size);
- }
+ CompactPoint* cp, HeapWord* compact_top, bool force_forward) {
+ forward_compact_top_DEFN()
// store the forwarding pointer into the mark word
- if ((HeapWord*)q != compact_top) {
+ // the size of object changed for: new_version() != NULL
+ if (force_forward || (HeapWord*)q != compact_top || q->klass()->new_version() != NULL) {
q->forward_to(oop(compact_top));
assert(q->is_gc_marked(), "encoding the pointer should preserve the mark");
} else {
@@ -2196,13 +2199,60 @@ CompactibleFreeListSpace::refillLinearAllocBlock(LinearAllocBlock* blk) {
// Support for compaction
void CompactibleFreeListSpace::prepare_for_compaction(CompactPoint* cp) {
- scan_and_forward(this, cp, false);
- // of the free lists doesn't work after.
+ if (!Universe::is_redefining_gc_run()) {
+ scan_and_forward(this, cp, false);
+ } else {
+ // Redefinition run
+ scan_and_forward(this, cp, true);
+ }
// Prepare_for_compaction() uses the space between live objects
// so that later phase can skip dead space quickly. So verification
// of the free lists doesn't work after.
}
+bool CompactibleFreeListSpace::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) return false;
+
+ int new_size = adjustObjectSize(old_obj->size_given_klass(oop(old_obj)->klass()->new_version()));
+ int original_size = adjustObjectSize(old_obj->size());
+
+ Generation* tenured_gen = CMSHeap::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);
+ if (old_in_tenured == new_in_tenured) {
+ // Rescue if object may overlap with a higher memory address.
+ bool overlap = ((HeapWord*)old_obj + original_size < (HeapWord*)new_obj + new_size);
+ if (old_in_tenured) {
+ // Old and new address are in same space, so just compare the address.
+ // Must rescue if object moves towards the top of the space.
+ assert(space_index(old_obj) == space_index(new_obj), "old_obj and new_obj must be in same space");
+ } else {
+ // In the new generation, eden is located before the from space, so a
+ // simple pointer comparison is sufficient.
+ assert(CMSHeap::heap()->young_gen()->is_in_reserved(old_obj), "old_obj must be in DefNewGeneration");
+ assert(CMSHeap::heap()->young_gen()->is_in_reserved(new_obj), "new_obj must be in DefNewGeneration");
+ assert(overlap == (space_index(old_obj) < space_index(new_obj)), "slow and fast computation must yield same result");
+ }
+ return overlap;
+
+ } else {
+ assert(space_index(old_obj) != space_index(new_obj), "old_obj and new_obj must be in different spaces");
+ if (new_in_tenured) {
+ // Must never rescue when moving from the new into the old generation.
+ assert(CMSHeap::heap()->young_gen()->is_in_reserved(old_obj), "old_obj must be in DefNewGeneration");
+ assert(space_index(old_obj) > space_index(new_obj), "must be");
+ return false;
+
+ } else /* if (tenured_gen->is_in_reserved(old_obj)) */ {
+ // Must always rescue when moving from the old into the new generation.
+ assert(CMSHeap::heap()->young_gen()->is_in_reserved(new_obj), "new_obj must be in DefNewGeneration");
+ assert(space_index(old_obj) < space_index(new_obj), "must be");
+ return true;
+ }
+ }
+}
+
void CompactibleFreeListSpace::adjust_pointers() {
// In other versions of adjust_pointers(), a bail out
// based on the amount of live data in the generation
@@ -2215,7 +2265,12 @@ void CompactibleFreeListSpace::adjust_pointers() {
}
void CompactibleFreeListSpace::compact() {
- scan_and_compact(this, false);
+ if(!Universe::is_redefining_gc_run()) {
+ scan_and_compact(this, false);
+ } else {
+ // Redefinition run
+ scan_and_compact(this, true);
+ }
}
// Fragmentation metric = 1 - [sum of (fbs**2) / (sum of fbs)**2]
diff --git a/src/hotspot/share/gc/cms/compactibleFreeListSpace.hpp b/src/hotspot/share/gc/cms/compactibleFreeListSpace.hpp
index 9fd2ea58320..d29b81f6fca 100644
--- a/src/hotspot/share/gc/cms/compactibleFreeListSpace.hpp
+++ b/src/hotspot/share/gc/cms/compactibleFreeListSpace.hpp
@@ -201,7 +201,7 @@ class CompactibleFreeListSpace: public CompactibleSpace {
// Support for compacting cms
HeapWord* cross_threshold(HeapWord* start, HeapWord* end);
HeapWord* forward_compact_top(size_t size, CompactPoint* cp, HeapWord* compact_top);
- HeapWord* forward(oop q, size_t size, CompactPoint* cp, HeapWord* compact_top);
+ HeapWord* forward(oop q, size_t size, CompactPoint* cp, HeapWord* compact_top, bool force_forward);
// Initialization helpers.
void initializeIndexedFreeListArray();
@@ -576,6 +576,9 @@ class CompactibleFreeListSpace: public CompactibleSpace {
// Support for compaction.
void prepare_for_compaction(CompactPoint* cp);
+
+ bool must_rescue(oop old_obj, oop new_obj);
+
void adjust_pointers();
void compact();
// Reset the space to reflect the fact that a compaction of the
diff --git a/src/hotspot/share/gc/cms/concurrentMarkSweepThread.cpp b/src/hotspot/share/gc/cms/concurrentMarkSweepThread.cpp
index 3ada5755875..b6e930922d7 100644
--- a/src/hotspot/share/gc/cms/concurrentMarkSweepThread.cpp
+++ b/src/hotspot/share/gc/cms/concurrentMarkSweepThread.cpp
@@ -78,10 +78,12 @@ void ConcurrentMarkSweepThread::run_service() {
while (!should_terminate()) {
sleepBeforeNextCycle();
if (should_terminate()) break;
- GCIdMark gc_id_mark;
- GCCause::Cause cause = _collector->_full_gc_requested ?
- _collector->_full_gc_cause : GCCause::_cms_concurrent_mark;
- _collector->collect_in_background(cause);
+ if (!Universe::is_redefining_gc_run()) {
+ GCIdMark gc_id_mark;
+ GCCause::Cause cause = _collector->_full_gc_requested ?
+ _collector->_full_gc_cause : GCCause::_cms_concurrent_mark;
+ _collector->collect_in_background(cause);
+ }
}
// Check that the state of any protocol for synchronization
diff --git a/src/hotspot/share/gc/serial/markSweep.cpp b/src/hotspot/share/gc/serial/markSweep.cpp
index d0ff86c8215..b4ed59f020c 100644
--- a/src/hotspot/share/gc/serial/markSweep.cpp
+++ b/src/hotspot/share/gc/serial/markSweep.cpp
@@ -247,7 +247,7 @@ void MarkSweep::copy_rescued_objects_back() {
FREE_RESOURCE_ARRAY(HeapWord, rescued_ptr, size);
- new_obj->init_mark();
+ new_obj->init_mark_raw();
assert(oopDesc::is_oop(new_obj), "must be a valid oop");
}
_rescued_oops->clear();
diff --git a/src/hotspot/share/gc/shared/gcConfig.cpp b/src/hotspot/share/gc/shared/gcConfig.cpp
index 8aac2b39e1e..39364a64cb2 100644
--- a/src/hotspot/share/gc/shared/gcConfig.cpp
+++ b/src/hotspot/share/gc/shared/gcConfig.cpp
@@ -101,7 +101,7 @@ void GCConfig::fail_if_unsupported_gc_is_selected() {
}
void GCConfig::select_gc_ergonomically() {
- if (AllowEnhancedClassRedefinition) {
+ if (AllowEnhancedClassRedefinition && !UseConcMarkSweepGC) {
// Enhanced class redefinition only supports serial GC at the moment
FLAG_SET_ERGO(bool, UseSerialGC, true);
} else if (os::is_server_class_machine()) {
diff --git a/src/hotspot/share/gc/shared/space.cpp b/src/hotspot/share/gc/shared/space.cpp
index 763abc91a39..947dff8ae0c 100644
--- a/src/hotspot/share/gc/shared/space.cpp
+++ b/src/hotspot/share/gc/shared/space.cpp
@@ -388,11 +388,11 @@ HeapWord* CompactibleSpace::forward_compact_top(size_t size, CompactPoint* cp, H
}
HeapWord* CompactibleSpace::forward(oop q, size_t size,
- CompactPoint* cp, HeapWord* compact_top) {
+ CompactPoint* cp, HeapWord* compact_top, bool force_forward) {
compact_top = forward_compact_top(size, cp, compact_top);
// store the forwarding pointer into the mark word
- if ((HeapWord*)q != compact_top || (size_t)q->size() != size) {
+ if (force_forward || (HeapWord*)q != compact_top || (size_t)q->size() != size) {
q->forward_to(oop(compact_top));
assert(q->is_gc_marked(), "encoding the pointer should preserve the mark");
} else {
@@ -514,7 +514,7 @@ bool CompactibleSpace::must_rescue(oop old_obj, oop new_obj) {
} else {
assert(space_index(old_obj) != space_index(new_obj), "old_obj and new_obj must be in different spaces");
- if (tenured_gen->is_in_reserved(new_obj)) {
+ if (new_in_tenured) {
// Must never rescue when moving from the new into the old generation.
assert(GenCollectedHeap::heap()->young_gen()->is_in_reserved(old_obj), "old_obj must be in DefNewGeneration");
assert(space_index(old_obj) > space_index(new_obj), "must be");
@@ -858,14 +858,14 @@ void OffsetTableContigSpace::verify() const {
// Compute the forward sizes and leave out objects whose position could
// possibly overlap other objects.
HeapWord* CompactibleSpace::forward_with_rescue(HeapWord* q, size_t size,
- CompactPoint* cp, HeapWord* compact_top) {
+ CompactPoint* cp, HeapWord* compact_top, bool force_forward) {
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 && oop(q)->klass()->new_version()->update_information() != NULL) {
size_t new_size = oop(q)->size_given_klass(oop(q)->klass()->new_version());
- assert(size != new_size, "instances without changed size have to be updated prior to GC run");
+ // assert(size != new_size, "instances without changed size have to be updated prior to GC run");
forward_size = new_size;
}
@@ -879,7 +879,7 @@ HeapWord* CompactibleSpace::forward_with_rescue(HeapWord* q, size_t size,
return compact_top;
}
- return forward(oop(q), forward_size, cp, compact_top);
+ return forward(oop(q), forward_size, cp, compact_top, force_forward);
}
// Compute the forwarding addresses for the objects that need to be rescued.
@@ -895,11 +895,11 @@ HeapWord* CompactibleSpace::forward_rescued(CompactPoint* cp, HeapWord* compact_
// (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());
- assert(size != new_size, "instances without changed size have to be updated prior to GC run");
+ // 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);
+ compact_top = cp->space->forward(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.hpp b/src/hotspot/share/gc/shared/space.hpp
index 8eb5669fb79..901c89d8a30 100644
--- a/src/hotspot/share/gc/shared/space.hpp
+++ b/src/hotspot/share/gc/shared/space.hpp
@@ -421,7 +421,7 @@ public:
virtual void prepare_for_compaction(CompactPoint* cp) = 0;
// MarkSweep support phase3
DEBUG_ONLY(int space_index(oop obj));
- bool must_rescue(oop old_obj, oop new_obj);
+ virtual bool must_rescue(oop old_obj, oop new_obj);
HeapWord* rescue(HeapWord* old_obj);
virtual void adjust_pointers();
// MarkSweep support phase4
@@ -452,11 +452,11 @@ public:
// function of the then-current compaction space, and updates "cp->threshold
// accordingly".
virtual HeapWord* forward(oop q, size_t size, CompactPoint* cp,
- HeapWord* compact_top);
+ HeapWord* compact_top, bool force_forward);
// (DCEVM) same as forwad, but can rescue objects. Invoked only during
// redefinition runs
HeapWord* forward_with_rescue(HeapWord* q, size_t size, CompactPoint* cp,
- HeapWord* compact_top);
+ HeapWord* compact_top, bool force_forward);
HeapWord* forward_rescued(CompactPoint* cp, HeapWord* compact_top);
diff --git a/src/hotspot/share/gc/shared/space.inline.hpp b/src/hotspot/share/gc/shared/space.inline.hpp
index 75d7e685edf..26e56ae6f7e 100644
--- a/src/hotspot/share/gc/shared/space.inline.hpp
+++ b/src/hotspot/share/gc/shared/space.inline.hpp
@@ -163,6 +163,8 @@ inline void CompactibleSpace::scan_and_forward(SpaceType* space, CompactPoint* c
HeapWord* cur_obj = space->bottom();
HeapWord* scan_limit = space->scan_limit();
+ bool force_forward = false;
+
while (cur_obj < scan_limit) {
assert(!space->scanned_block_is_obj(cur_obj) ||
oop(cur_obj)->mark_raw()->is_marked() || oop(cur_obj)->mark_raw()->is_unlocked() ||
@@ -174,14 +176,15 @@ inline void CompactibleSpace::scan_and_forward(SpaceType* space, CompactPoint* c
size_t size = space->scanned_block_size(cur_obj);
if (redefinition_run) {
- compact_top = cp->space->forward_with_rescue(cur_obj, size, cp, compact_top);
+ compact_top = cp->space->forward_with_rescue(cur_obj, size, cp, compact_top, force_forward);
if (first_dead == NULL && oop(cur_obj)->is_gc_marked()) {
/* Was moved (otherwise, forward would reset mark),
set first_dead to here */
first_dead = cur_obj;
+ force_forward = true;
}
} else {
- compact_top = cp->space->forward(oop(cur_obj), size, cp, compact_top);
+ compact_top = cp->space->forward(oop(cur_obj), size, cp, compact_top, false);
}
cur_obj += size;
@@ -197,9 +200,9 @@ inline void CompactibleSpace::scan_and_forward(SpaceType* space, CompactPoint* c
// see if we might want to pretend this object is alive so that
// we don't have to compact quite as often.
- if (cur_obj == compact_top && dead_spacer.insert_deadspace(cur_obj, end)) {
+ if (!redefinition_run && cur_obj == compact_top && dead_spacer.insert_deadspace(cur_obj, end)) {
oop obj = oop(cur_obj);
- compact_top = cp->space->forward(obj, obj->size(), cp, compact_top);
+ compact_top = cp->space->forward(obj, obj->size(), cp, compact_top, force_forward);
end_of_live = end;
} else {
// otherwise, it really is a free region.
@@ -351,7 +354,7 @@ inline void CompactibleSpace::scan_and_compact(SpaceType* space, bool redefiniti
HeapWord* compaction_top = (HeapWord*)oop(cur_obj)->forwardee();
if (redefinition_run && space->must_rescue(oop(cur_obj), oop(cur_obj)->forwardee())) {
- space->rescue(cur_obj);
+ space->rescue(cur_obj);
debug_only(Copy::fill_to_words(cur_obj, size, 0));
cur_obj += size;
continue;
@@ -361,8 +364,7 @@ inline void CompactibleSpace::scan_and_compact(SpaceType* space, bool redefiniti
Prefetch::write(compaction_top, copy_interval);
// copy object and reinit its mark
- assert(cur_obj != compaction_top || oop(cur_obj)->klass()->new_version() != NULL,
- "everything in this pass should be moving");
+ 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 (new_version->update_information() == NULL) {
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index c64d6bb1bb5..9b8678a53fb 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -52,6 +52,7 @@
#include "prims/jvmtiThreadState.inline.hpp"
#include "utilities/events.hpp"
#include "oops/constantPool.inline.hpp"
+#include "gc/cms/cmsHeap.hpp"
Array<Method*>* VM_EnhancedRedefineClasses::_old_methods = NULL;
Array<Method*>* VM_EnhancedRedefineClasses::_new_methods = NULL;
@@ -420,13 +421,11 @@ public:
Klass* new_klass = obj->klass()->new_version();
if (new_klass->update_information() != NULL) {
- int size_diff = obj->size() - obj->size_given_klass(new_klass);
-
- // Either new size is bigger or gap is to small to be filled
- if (size_diff < 0 || (size_diff > 0 && (size_t) size_diff < CollectedHeap::min_fill_size())) {
+ if (obj->size() - obj->size_given_klass(new_klass) != 0) {
// We need an instance update => set back to old klass
_needs_instance_update = true;
} else {
+ // Either new size is bigger or gap is to small to be filled
oop src = obj;
if (new_klass->is_copying_backwards()) {
copy_to_tmp(obj);
@@ -436,11 +435,6 @@ public:
// FIXME: instance updates...
//guarantee(false, "instance updates!");
MarkSweep::update_fields(obj, src, new_klass->update_information());
-
- if (size_diff > 0) {
- HeapWord* dead_space = ((HeapWord *)obj) + obj->size();
- CollectedHeap::fill_with_object(dead_space, size_diff);
- }
}
} else {
obj->set_klass(obj->klass()->new_version());
diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp
index ca57b524593..2ca6dde069d 100644
--- a/src/hotspot/share/runtime/arguments.cpp
+++ b/src/hotspot/share/runtime/arguments.cpp
@@ -2047,14 +2047,14 @@ bool Arguments::check_gc_consistency() {
if (AllowEnhancedClassRedefinition) {
// Must use serial GC. This limitation applies because the instance size changing GC modifications
// are only built into the mark and compact algorithm.
- if (!UseSerialGC && i >= 1) {
+ if ((!UseSerialGC && !UseConcMarkSweepGC) && i >= 1) {
jio_fprintf(defaultStream::error_stream(),
- "Must use the serial GC with enhanced class redefinition\n");
+ "Must use the serial or concurrent mark sweep GC with enhanced class redefinition.\n");
return false;
}
}
- if (i > 1) {
+ if (i > 2) {
jio_fprintf(defaultStream::error_stream(),
"Conflicting collector combinations in option list; "
"please refer to the release notes for the combinations "
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,257 @@
From 11d10158d77512795b1b8ab8378620b95b67f175 Mon Sep 17 00:00:00 2001
From: skybber <lada.dvorak7@gmail.com>
Date: Sat, 29 Dec 2018 13:22:29 +0100
Subject: [PATCH 10/50] Code cleanup
---
.../prims/jvmtiEnhancedRedefineClasses.cpp | 125 ++++++------------
.../prims/jvmtiEnhancedRedefineClasses.hpp | 3 -
2 files changed, 40 insertions(+), 88 deletions(-)
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index 9b8678a53fb..0aa1ac4ff80 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -35,7 +35,7 @@
#include "memory/metaspaceShared.hpp"
#include "memory/resourceArea.hpp"
#include "memory/iterator.inline.hpp"
-#include "gc/serial/markSweep.hpp" // FIXME: other GC?
+#include "gc/serial/markSweep.hpp"
#include "oops/fieldStreams.hpp"
#include "oops/klassVtable.hpp"
#include "oops/oop.inline.hpp"
@@ -485,7 +485,9 @@ void VM_EnhancedRedefineClasses::doit() {
}
// Deoptimize all compiled code that depends on this class (do only once, because it clears whole cache)
- flush_dependent_code(NULL, thread);
+ //if (_max_redefinition_flags > Klass::ModifyClass) {
+ flush_dependent_code(NULL, thread);
+ //}
// JSR-292 support
if (_any_class_has_resolved_methods) {
@@ -593,17 +595,28 @@ void VM_EnhancedRedefineClasses::doit() {
// See jvmtiExport.hpp for detailed explanation.
JvmtiExport::set_has_redefined_a_class();
- // check_class() is optionally called for product bits, but is
- // always called for non-product bits.
#ifdef PRODUCT
if (log_is_enabled(Trace, redefine, class, obsolete, metadata)) {
#endif
- log_trace(redefine, class, obsolete, metadata)("calling check_class");
- CheckClass check_class(thread);
- ClassLoaderDataGraph::classes_do(&check_class);
+ for (int i=0; i<_affected_klasses->length(); i++) {
+ Klass* the_class = _affected_klasses->at(i);
+ assert(the_class->new_version() != NULL, "Must have been redefined");
+ Klass* new_version = the_class->new_version();
+ assert(new_version->new_version() == NULL, "Must be newest version");
+
+ if (!(new_version->super() == NULL || new_version->super()->new_version() == NULL)) {
+ new_version->print();
+ new_version->super()->print();
+ }
+ 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");
+ CheckClass check_class(thread);
+ ClassLoaderDataGraph::classes_do(&check_class);
#ifdef PRODUCT
}
#endif
+
}
/**
@@ -1279,24 +1292,23 @@ void VM_EnhancedRedefineClasses::calculate_instance_update_information(Klass* ne
GrowableArray<int> result = cl.finish();
ik->store_update_information(result);
ik->set_copying_backwards(cl.does_copy_backwards());
-/* TODO logging
- if (RC_TRACE_ENABLED(0x00000001)) {
- RC_TRACE(0x00000001, ("Instance update information for %s:", new_version->name()->as_C_string()));
+ if (log_is_enabled(Trace, redefine, class, obsolete, metadata)) {
+ log_trace(redefine, class, obsolete, metadata)("Instance update information for %s:", new_version->name()->as_C_string());
if (cl.does_copy_backwards()) {
- RC_TRACE(0x00000001, ("\tDoes copy backwards!"));
+ log_trace(redefine, class, obsolete, metadata)("\tDoes copy backwards!");
}
for (int i=0; i<result.length(); i++) {
int curNum = result.at(i);
if (curNum < 0) {
- RC_TRACE(0x00000001, ("\t%d CLEAN", curNum));
+ log_trace(redefine, class, obsolete, metadata)("\t%d CLEAN", curNum);
} else if (curNum > 0) {
- RC_TRACE(0x00000001, ("\t%d COPY from %d", curNum, result.at(i + 1)));
+ log_trace(redefine, class, obsolete, metadata)("\t%d COPY from %d", curNum, result.at(i + 1));
i++;
} else {
- RC_TRACE(0x00000001, ("\tEND"));
+ log_trace(redefine, class, obsolete, metadata)("\tEND");
}
}
- }*/
+ }
}
/**
@@ -1813,6 +1825,7 @@ void VM_EnhancedRedefineClasses::compute_added_deleted_matching_methods() {
/**
FIXME - swap_annotations is never called, check that annotations work
*/
+// TODO : delete it
void VM_EnhancedRedefineClasses::swap_annotations(InstanceKlass* the_class,
InstanceKlass* new_class) {
// FIXME - probably original implementation only
@@ -1822,7 +1835,6 @@ void VM_EnhancedRedefineClasses::swap_annotations(InstanceKlass* the_class,
new_class->set_annotations(old_annotations);
}
-
// Install the redefinition of a class:
// - house keeping (flushing breakpoints and caches, deoptimizing
// dependent compiled code)
@@ -1853,7 +1865,9 @@ void VM_EnhancedRedefineClasses::redefine_single_class(InstanceKlass* new_class_
// DCEVM Deoptimization is always for whole java world, call only once after all classes are redefined
// Deoptimize all compiled code that depends on this class
- // flush_dependent_code(the_class, THREAD);
+ //if (_max_redefinition_flags <= Klass::ModifyClass) {
+ //flush_dependent_code(the_class, THREAD);
+ //}
_old_methods = the_class->methods();
_new_methods = new_class->methods();
@@ -1928,64 +1942,15 @@ void VM_EnhancedRedefineClasses::increment_class_counter(InstanceKlass *ik, TRAP
}
}
-// FIXME - class check is currently disabled
void VM_EnhancedRedefineClasses::CheckClass::do_klass(Klass* k) {
- return;
- bool no_old_methods = true; // be optimistic
-
- // Both array and instance classes have vtables.
- // a vtable should never contain old or obsolete methods
- ResourceMark rm(_thread);
- if (k->vtable_length() > 0 &&
- !k->vtable().check_no_old_or_obsolete_entries()) {
- if (log_is_enabled(Trace, redefine, class, obsolete, metadata)) {
- log_trace(redefine, class, obsolete, metadata)
- ("klassVtable::check_no_old_or_obsolete_entries failure -- OLD or OBSOLETE method found -- class: %s",
- k->signature_name());
- k->vtable().dump_vtable();
- }
- no_old_methods = false;
- }
-
- if (k->is_instance_klass()) {
- HandleMark hm(_thread);
- InstanceKlass *ik = InstanceKlass::cast(k);
+ HandleMark hm(_thread);
+ InstanceKlass *ik = (InstanceKlass *) k;
+ assert(ik->new_version() == NULL, "must be latest version in system dictionary");
- // an itable should never contain old or obsolete methods
- if (ik->itable_length() > 0 &&
- !ik->itable().check_no_old_or_obsolete_entries()) {
- if (log_is_enabled(Trace, redefine, class, obsolete, metadata)) {
- log_trace(redefine, class, obsolete, metadata)
- ("klassItable::check_no_old_or_obsolete_entries failure -- OLD or OBSOLETE method found -- class: %s",
- ik->signature_name());
- ik->itable().dump_itable();
- }
- no_old_methods = false;
- }
-
- // the constant pool cache should never contain non-deleted old or obsolete methods
- if (ik->constants() != NULL &&
- ik->constants()->cache() != NULL &&
- !ik->constants()->cache()->check_no_old_or_obsolete_entries()) {
- if (log_is_enabled(Trace, redefine, class, obsolete, metadata)) {
- log_trace(redefine, class, obsolete, metadata)
- ("cp-cache::check_no_old_or_obsolete_entries failure -- OLD or OBSOLETE method found -- class: %s",
- ik->signature_name());
- ik->constants()->cache()->dump_cache();
- }
- no_old_methods = false;
- }
- }
-
- // print and fail guarantee if old methods are found.
- if (!no_old_methods) {
- if (log_is_enabled(Trace, redefine, class, obsolete, metadata)) {
- dump_methods();
- } else {
- log_trace(redefine, class)("Use the '-Xlog:redefine+class*:' option "
- "to see more info about the following guarantee() failure.");
- }
- guarantee(false, "OLD and/or OBSOLETE method(s) found");
+ if (ik->vtable_length() > 0) {
+ ResourceMark rm(_thread);
+ assert(ik->vtable().check_no_old_or_obsolete_entries(), "old method found");
+ ik->vtable().verify(tty, true);
}
}
@@ -2051,15 +2016,6 @@ void VM_EnhancedRedefineClasses::dump_methods() {
}
}
-// TODO - is it called anywhere?
-void VM_EnhancedRedefineClasses::print_on_error(outputStream* st) const {
- VM_Operation::print_on_error(st);
- if (_the_class_oop != NULL) {
- ResourceMark rm;
- st->print_cr(", redefining class %s", _the_class_oop->external_name());
- }
-}
-
/**
Helper class to traverse all loaded classes and figure out if the class is affected by redefinition.
*/
@@ -2093,7 +2049,7 @@ class AffectedKlassClosure : public KlassClosure {
log_trace(redefine, class, load)("found affected class: %s", klass->name()->as_C_string());
klass->set_redefinition_flag(Klass::MarkedAsAffected);
_affected_klasses->append(klass);
- return;
+ return;
}
}
@@ -2125,7 +2081,7 @@ 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);
- // TODO: j10 - review chancge from SystemDictionary::classes_do(&closure);
+ // Updated in j10, from original SystemDictionary::classes_do
ClassLoaderDataGraph::dictionary_classes_do(&closure);
log_trace(redefine, class, load)("%d classes affected", _affected_klasses->length());
@@ -2160,7 +2116,6 @@ static bool match_second(void* value, KlassPair elem) {
For each class to be redefined parse the bytecode and figure out the superclass and all interfaces.
First newly introduced classes (_class_defs) are scanned and then affected classed (_affected_klasses).
Affected flag is cleared (clear_redefinition_flag(Klass::MarkedAsAffected))
-
For each dependency create a KlassPair instance. Finnaly, affected classes (_affected_klasses) are sorted according to pairs.
TODO - the class file is potentionally parsed multiple times - introduce a cache?
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
index b712d69a193..37e63a1810f 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
@@ -195,8 +195,5 @@ class VM_EnhancedRedefineClasses: public VM_GC_Operation {
// Modifiable test must be shared between IsModifiableClass query
// and redefine implementation
static bool is_modifiable_class(oop klass_mirror);
-
- // Error printing
- void print_on_error(outputStream* st) const;
};
#endif // SHARE_VM_PRIMS_JVMTIREDEFINECLASSES2_HPP
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,118 @@
From 1765f4c1b2e8958b458fa17d329be98ad025069c Mon Sep 17 00:00:00 2001
From: skybber <lada.dvorak7@gmail.com>
Date: Sat, 29 Dec 2018 16:05:25 +0100
Subject: [PATCH 11/50] Fix check_class
---
.../prims/jvmtiEnhancedRedefineClasses.cpp | 39 +++++++------------
.../prims/jvmtiEnhancedRedefineClasses.hpp | 5 +--
2 files changed, 16 insertions(+), 28 deletions(-)
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index 0aa1ac4ff80..c08b3e82b2e 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -1,4 +1,4 @@
-/*
+ /*
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -28,6 +28,7 @@
#include "classfile/metadataOnStackMark.hpp"
#include "classfile/systemDictionary.hpp"
#include "classfile/verifier.hpp"
+#include "classfile/dictionary.hpp"
#include "interpreter/oopMapCache.hpp"
#include "interpreter/rewriter.hpp"
#include "logging/logStream.hpp"
@@ -611,8 +612,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");
- CheckClass check_class(thread);
- ClassLoaderDataGraph::classes_do(&check_class);
+ ClassLoaderData::the_null_class_loader_data()->dictionary()->classes_do(check_class, thread);
#ifdef PRODUCT
}
#endif
@@ -1822,19 +1822,6 @@ void VM_EnhancedRedefineClasses::compute_added_deleted_matching_methods() {
assert(_matching_methods_length + _added_methods_length == _new_methods->length(), "sanity");
}
-/**
- FIXME - swap_annotations is never called, check that annotations work
-*/
-// TODO : delete it
-void VM_EnhancedRedefineClasses::swap_annotations(InstanceKlass* the_class,
- InstanceKlass* new_class) {
- // FIXME - probably original implementation only
- // Swap annotation fields values
- Annotations* old_annotations = the_class->annotations();
- the_class->set_annotations(new_class->annotations());
- new_class->set_annotations(old_annotations);
-}
-
// Install the redefinition of a class:
// - house keeping (flushing breakpoints and caches, deoptimizing
// dependent compiled code)
@@ -1942,15 +1929,17 @@ void VM_EnhancedRedefineClasses::increment_class_counter(InstanceKlass *ik, TRAP
}
}
-void VM_EnhancedRedefineClasses::CheckClass::do_klass(Klass* k) {
- HandleMark hm(_thread);
- InstanceKlass *ik = (InstanceKlass *) k;
- assert(ik->new_version() == NULL, "must be latest version in system dictionary");
+void VM_EnhancedRedefineClasses::check_class(InstanceKlass* ik, TRAPS) {
+ if (ik->is_instance_klass() && ik->old_version() != NULL) {
+ HandleMark hm(THREAD);
+
+ assert(ik->new_version() == NULL, "must be latest version in system dictionary");
- if (ik->vtable_length() > 0) {
- ResourceMark rm(_thread);
- assert(ik->vtable().check_no_old_or_obsolete_entries(), "old method found");
- ik->vtable().verify(tty, true);
+ if (ik->vtable_length() > 0) {
+ ResourceMark rm(THREAD);
+ assert(ik->vtable().check_no_old_or_obsolete_entries(), "old method found");
+ ik->vtable().verify(tty, true);
+ }
}
}
@@ -2017,7 +2006,7 @@ void VM_EnhancedRedefineClasses::dump_methods() {
}
/**
- Helper class to traverse all loaded classes and figure out if the class is affected by redefinition.
+ Helper class to traverse all loaded classes and figure out if the class is affected by redefinition.
*/
class AffectedKlassClosure : public KlassClosure {
private:
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
index 37e63a1810f..5b3ebc13661 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
@@ -144,15 +144,14 @@ class VM_EnhancedRedefineClasses: public VM_GC_Operation {
// Install the redefinition of a class
void redefine_single_class(InstanceKlass* new_class_oop, TRAPS);
- void swap_annotations(InstanceKlass* new_class,
- InstanceKlass* scratch_class);
-
// Increment the classRedefinedCount field in the specific InstanceKlass
// and in all direct and indirect subclasses.
void increment_class_counter(InstanceKlass *ik, TRAPS);
void flush_dependent_code(InstanceKlass* k_h, TRAPS);
+ static void check_class(InstanceKlass* k_oop, TRAPS);
+
static void dump_methods();
// Check that there are no old or obsolete methods
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,24 @@
From 0851d437a65dc9ac6d8355b54689d36e77e104b3 Mon Sep 17 00:00:00 2001
From: skybber <lada.dvorak7@gmail.com>
Date: Sat, 29 Dec 2018 17:58:39 +0100
Subject: [PATCH 12/50] Fix force_forward in dead space
---
src/hotspot/share/gc/shared/space.inline.hpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/hotspot/share/gc/shared/space.inline.hpp b/src/hotspot/share/gc/shared/space.inline.hpp
index 26e56ae6f7e..8c255d6d428 100644
--- a/src/hotspot/share/gc/shared/space.inline.hpp
+++ b/src/hotspot/share/gc/shared/space.inline.hpp
@@ -213,6 +213,7 @@ inline void CompactibleSpace::scan_and_forward(SpaceType* space, CompactPoint* c
// see if this is the first dead region.
if (first_dead == NULL) {
first_dead = cur_obj;
+ force_forward = true;
}
}
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,25 @@
From 35aba247d8a3e25f5d19403ba5f293bfdaf6539c Mon Sep 17 00:00:00 2001
From: skybber <lada.dvorak7@gmail.com>
Date: Fri, 1 Mar 2019 18:45:13 +0100
Subject: [PATCH 13/50] Cleanup
---
src/hotspot/share/gc/shared/space.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/hotspot/share/gc/shared/space.cpp b/src/hotspot/share/gc/shared/space.cpp
index 947dff8ae0c..56b144b46f1 100644
--- a/src/hotspot/share/gc/shared/space.cpp
+++ b/src/hotspot/share/gc/shared/space.cpp
@@ -862,7 +862,7 @@ 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 && oop(q)->klass()->new_version()->update_information() != NULL) {
+ if (oop(q)->klass()->new_version() != NULL) {
size_t new_size = oop(q)->size_given_klass(oop(q)->klass()->new_version());
// assert(size != new_size, "instances without changed size have to be updated prior to GC run");
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,61 @@
From 26a5079eb61a2e23328fbd8ca59ffc2ab6b6193b Mon Sep 17 00:00:00 2001
From: skybber <lada.dvorak7@gmail.com>
Date: Sat, 29 Dec 2018 17:38:27 +0100
Subject: [PATCH 14/50] Add codecache flush optimization, but just flush all
cache.
Redefined class can define a new method that overrides
method in superclass which is already used in codecache for
optimized non-virtual calls, etc...
---
.../prims/jvmtiEnhancedRedefineClasses.cpp | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index c08b3e82b2e..4ca638548dc 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -486,9 +486,9 @@ 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) {
+ // if (_max_redefinition_flags > Klass::ModifyClass) {
flush_dependent_code(NULL, thread);
- //}
+ // }
// JSR-292 support
if (_any_class_has_resolved_methods) {
@@ -1736,8 +1736,14 @@ void VM_EnhancedRedefineClasses::flush_dependent_code(InstanceKlass* k_h, TRAPS)
// All dependencies have been recorded from startup or this is a second or
// subsequent use of RedefineClasses
// FIXME: for now, deoptimize all!
- if (0 && JvmtiExport::all_dependencies_are_recorded()) {
+ if (0 && k_h != NULL && JvmtiExport::all_dependencies_are_recorded()) {
CodeCache::flush_evol_dependents_on(k_h);
+ Klass* superCl = k_h->super();
+ // Deoptimize super classes since redefined class can has a new method override
+ while (superCl != NULL && !superCl->is_redefining()) {
+ CodeCache::flush_evol_dependents_on(InstanceKlass::cast(superCl));
+ superCl = superCl->super();
+ }
} else {
CodeCache::mark_all_nmethods_for_deoptimization();
@@ -1852,9 +1858,9 @@ void VM_EnhancedRedefineClasses::redefine_single_class(InstanceKlass* new_class_
// DCEVM Deoptimization is always for whole java world, call only once after all classes are redefined
// Deoptimize all compiled code that depends on this class
- //if (_max_redefinition_flags <= Klass::ModifyClass) {
- //flush_dependent_code(the_class, THREAD);
- //}
+// if (_max_redefinition_flags <= Klass::ModifyClass) {
+// flush_dependent_code(the_class, THREAD);
+// }
_old_methods = the_class->methods();
_new_methods = new_class->methods();
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,484 @@
From 24a60477aef7098ea23ab50a573332957741ea7b Mon Sep 17 00:00:00 2001
From: skybber <lada.dvorak7@gmail.com>
Date: Wed, 14 Nov 2018 21:20:08 +0100
Subject: [PATCH 15/50] HotswapAgent integration
It include:
- option to compile DCEVM only version with -DDCEVM_ONLY added
to CFLAGS (bash configure --with-extra-cflags="-DDCEVM_ONLY"), by
default compilation goes with HotswapAgent
Add --add-opens for necessary modules/packages
- java.base/java.lang - for reflection access to Proxy.proxyCache
- java.base/jdk.internal.loader - for access proxyCache class
- java.desktop/java.beans - for reflection access to Introspector
- be quiet if HotswapAgent is not found in lib/, it is compatible with
old DCEVM
- disable hotswapagent for -Xshare:dump
- disable HotswapAgent in jvm tools
---
make/launcher/Launcher-java.rmi.gmk | 2 +
make/launcher/Launcher-java.scripting.gmk | 3 +-
make/launcher/Launcher-java.security.jgss.gmk | 3 +
make/launcher/Launcher-jdk.aot.gmk | 2 +
make/launcher/Launcher-jdk.compiler.gmk | 5 +-
make/launcher/Launcher-jdk.hotspot.agent.gmk | 1 +
make/launcher/Launcher-jdk.jartool.gmk | 2 +
make/launcher/Launcher-jdk.javadoc.gmk | 3 +-
make/launcher/Launcher-jdk.jcmd.gmk | 13 +++-
make/launcher/Launcher-jdk.jconsole.gmk | 3 +-
make/launcher/Launcher-jdk.jdeps.gmk | 3 +
make/launcher/Launcher-jdk.jdi.gmk | 1 +
make/launcher/Launcher-jdk.jlink.gmk | 5 +-
make/launcher/Launcher-jdk.jshell.gmk | 1 +
make/launcher/Launcher-jdk.jstatd.gmk | 1 +
make/launcher/Launcher-jdk.pack.gmk | 1 +
make/launcher/Launcher-jdk.rmic.gmk | 1 +
.../Launcher-jdk.scripting.nashorn.shell.gmk | 3 +-
src/hotspot/share/runtime/arguments.cpp | 59 +++++++++++++++++++
src/hotspot/share/runtime/arguments.hpp | 3 +
src/hotspot/share/runtime/globals.hpp | 12 +++-
21 files changed, 117 insertions(+), 10 deletions(-)
diff --git a/make/launcher/Launcher-java.rmi.gmk b/make/launcher/Launcher-java.rmi.gmk
index a69a90bcc81..07046232275 100644
--- a/make/launcher/Launcher-java.rmi.gmk
+++ b/make/launcher/Launcher-java.rmi.gmk
@@ -27,8 +27,10 @@ include LauncherCommon.gmk
$(eval $(call SetupBuildLauncher, rmid, \
MAIN_CLASS := sun.rmi.server.Activation, \
+ JAVA_ARGS := -XX:+DisableHotswapAgent, \
))
$(eval $(call SetupBuildLauncher, rmiregistry, \
MAIN_CLASS := sun.rmi.registry.RegistryImpl, \
+ JAVA_ARGS := -XX:+DisableHotswapAgent, \
))
diff --git a/make/launcher/Launcher-java.scripting.gmk b/make/launcher/Launcher-java.scripting.gmk
index 057d2bf3aca..cf100e20789 100644
--- a/make/launcher/Launcher-java.scripting.gmk
+++ b/make/launcher/Launcher-java.scripting.gmk
@@ -27,5 +27,6 @@ include LauncherCommon.gmk
$(eval $(call SetupBuildLauncher, jrunscript, \
MAIN_CLASS := com.sun.tools.script.shell.Main, \
- JAVA_ARGS := --add-modules ALL-DEFAULT, \
+ JAVA_ARGS := --add-modules ALL-DEFAULT \
+ -XX:+DisableHotswapAgent, \
))
diff --git a/make/launcher/Launcher-java.security.jgss.gmk b/make/launcher/Launcher-java.security.jgss.gmk
index 7411e1a21c4..2b856bfccb4 100644
--- a/make/launcher/Launcher-java.security.jgss.gmk
+++ b/make/launcher/Launcher-java.security.jgss.gmk
@@ -28,13 +28,16 @@ include LauncherCommon.gmk
ifeq ($(OPENJDK_TARGET_OS), windows)
$(eval $(call SetupBuildLauncher, kinit, \
MAIN_CLASS := sun.security.krb5.internal.tools.Kinit, \
+ JAVA_ARGS := -XX:+DisableHotswapAgent, \
))
$(eval $(call SetupBuildLauncher, klist, \
MAIN_CLASS := sun.security.krb5.internal.tools.Klist, \
+ JAVA_ARGS := -XX:+DisableHotswapAgent, \
))
$(eval $(call SetupBuildLauncher, ktab, \
MAIN_CLASS := sun.security.krb5.internal.tools.Ktab, \
+ JAVA_ARGS := -XX:+DisableHotswapAgent, \
))
endif
diff --git a/make/launcher/Launcher-jdk.aot.gmk b/make/launcher/Launcher-jdk.aot.gmk
index 10717a5e1c5..2c52c31a555 100644
--- a/make/launcher/Launcher-jdk.aot.gmk
+++ b/make/launcher/Launcher-jdk.aot.gmk
@@ -31,6 +31,7 @@ include LauncherCommon.gmk
$(eval $(call SetupBuildLauncher, jaotc, \
MAIN_CLASS := jdk.tools.jaotc.Main, \
EXTRA_JAVA_ARGS := -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI \
+ -XX:+DisableHotswapAgent \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.aarch64=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.amd64=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.code=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \
@@ -40,6 +41,7 @@ $(eval $(call SetupBuildLauncher, jaotc, \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \
, \
JAVA_ARGS := --add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot.aarch64=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \
+ -XX:+DisableHotswapAgent \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot.amd64=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot.aarch64=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot.sparc=$(call CommaList, jdk.internal.vm.compiler jdk.aot) \
diff --git a/make/launcher/Launcher-jdk.compiler.gmk b/make/launcher/Launcher-jdk.compiler.gmk
index f71c37adf74..744969546de 100644
--- a/make/launcher/Launcher-jdk.compiler.gmk
+++ b/make/launcher/Launcher-jdk.compiler.gmk
@@ -27,12 +27,14 @@ include LauncherCommon.gmk
$(eval $(call SetupBuildLauncher, javac, \
MAIN_CLASS := com.sun.tools.javac.Main, \
- JAVA_ARGS := --add-modules ALL-DEFAULT, \
+ JAVA_ARGS := --add-modules ALL-DEFAULT \
+ -XX:+DisableHotswapAgent, \
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
))
$(eval $(call SetupBuildLauncher, serialver, \
MAIN_CLASS := sun.tools.serialver.SerialVer, \
+ JAVA_ARGS := -XX:+DisableHotswapAgent, \
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
))
@@ -41,6 +43,7 @@ ifeq ($(ENABLE_SJAVAC), yes)
# into any real images
$(eval $(call SetupBuildLauncher, sjavac, \
MAIN_CLASS := com.sun.tools.sjavac.Main, \
+ JAVA_ARGS := -XX:+DisableHotswapAgent, \
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
OUTPUT_DIR := $(JDK_OUTPUTDIR)/bin, \
))
diff --git a/make/launcher/Launcher-jdk.hotspot.agent.gmk b/make/launcher/Launcher-jdk.hotspot.agent.gmk
index 76da3600368..9f12b05b172 100644
--- a/make/launcher/Launcher-jdk.hotspot.agent.gmk
+++ b/make/launcher/Launcher-jdk.hotspot.agent.gmk
@@ -27,5 +27,6 @@ include LauncherCommon.gmk
$(eval $(call SetupBuildLauncher, jhsdb, \
MAIN_CLASS := sun.jvm.hotspot.SALauncher, \
+ JAVA_ARGS := -XX:+DisableHotswapAgent, \
MACOSX_PRIVILEGED := true, \
))
diff --git a/make/launcher/Launcher-jdk.jartool.gmk b/make/launcher/Launcher-jdk.jartool.gmk
index f74e82bfdae..647d82b65b1 100644
--- a/make/launcher/Launcher-jdk.jartool.gmk
+++ b/make/launcher/Launcher-jdk.jartool.gmk
@@ -27,8 +27,10 @@ include LauncherCommon.gmk
$(eval $(call SetupBuildLauncher, jar, \
MAIN_CLASS := sun.tools.jar.Main, \
+ JAVA_ARGS := -XX:+DisableHotswapAgent, \
))
$(eval $(call SetupBuildLauncher, jarsigner, \
MAIN_CLASS := sun.security.tools.jarsigner.Main, \
+ JAVA_ARGS := -XX:+DisableHotswapAgent, \
))
diff --git a/make/launcher/Launcher-jdk.javadoc.gmk b/make/launcher/Launcher-jdk.javadoc.gmk
index 889028a2b17..c3d2093be04 100644
--- a/make/launcher/Launcher-jdk.javadoc.gmk
+++ b/make/launcher/Launcher-jdk.javadoc.gmk
@@ -27,6 +27,7 @@ include LauncherCommon.gmk
$(eval $(call SetupBuildLauncher, javadoc, \
MAIN_CLASS := jdk.javadoc.internal.tool.Main, \
- JAVA_ARGS := --add-modules ALL-DEFAULT, \
+ JAVA_ARGS := --add-modules ALL-DEFAULT \
+ -XX:+DisableHotswapAgent, \
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
))
diff --git a/make/launcher/Launcher-jdk.jcmd.gmk b/make/launcher/Launcher-jdk.jcmd.gmk
index 7117fa78059..761a52d8466 100644
--- a/make/launcher/Launcher-jdk.jcmd.gmk
+++ b/make/launcher/Launcher-jdk.jcmd.gmk
@@ -30,6 +30,7 @@ $(eval $(call SetupBuildLauncher, jinfo, \
JAVA_ARGS := \
-Dsun.jvm.hotspot.debugger.useProcDebugger \
-Dsun.jvm.hotspot.debugger.useWindbgDebugger, \
+ -XX:+DisableHotswapAgent, \
MACOSX_PRIVILEGED := true, \
))
@@ -37,28 +38,36 @@ $(eval $(call SetupBuildLauncher, jmap, \
MAIN_CLASS := sun.tools.jmap.JMap, \
JAVA_ARGS := \
-Dsun.jvm.hotspot.debugger.useProcDebugger \
- -Dsun.jvm.hotspot.debugger.useWindbgDebugger, \
+ -Dsun.jvm.hotspot.debugger.useWindbgDebugger \
+ -XX:+DisableHotswapAgent, \
MACOSX_PRIVILEGED := true, \
))
$(eval $(call SetupBuildLauncher, jps, \
MAIN_CLASS := sun.tools.jps.Jps, \
+ JAVA_ARGS := \
+ -XX:+DisableHotswapAgent, \
))
$(eval $(call SetupBuildLauncher, jstack, \
MAIN_CLASS := sun.tools.jstack.JStack, \
JAVA_ARGS := \
-Dsun.jvm.hotspot.debugger.useProcDebugger \
- -Dsun.jvm.hotspot.debugger.useWindbgDebugger, \
+ -Dsun.jvm.hotspot.debugger.useWindbgDebugger \
+ -XX:+DisableHotswapAgent, \
MACOSX_PRIVILEGED := true, \
))
$(eval $(call SetupBuildLauncher, jstat, \
MAIN_CLASS := sun.tools.jstat.Jstat, \
+ JAVA_ARGS := \
+ -XX:+DisableHotswapAgent, \
))
$(eval $(call SetupBuildLauncher, jcmd, \
MAIN_CLASS := sun.tools.jcmd.JCmd, \
+ JAVA_ARGS := \
+ -XX:+DisableHotswapAgent, \
))
# Hook to include the corresponding custom file, if present.
diff --git a/make/launcher/Launcher-jdk.jconsole.gmk b/make/launcher/Launcher-jdk.jconsole.gmk
index 6205ae63d16..5ca6a0c123b 100644
--- a/make/launcher/Launcher-jdk.jconsole.gmk
+++ b/make/launcher/Launcher-jdk.jconsole.gmk
@@ -28,7 +28,8 @@ include LauncherCommon.gmk
$(eval $(call SetupBuildLauncher, jconsole, \
MAIN_CLASS := sun.tools.jconsole.JConsole, \
JAVA_ARGS := --add-opens java.base/java.io=jdk.jconsole \
- -Djconsole.showOutputViewer, \
+ -Djconsole.showOutputViewer \
+ -XX:+DisableHotswapAgent, \
CFLAGS_windows := -DJAVAW, \
LIBS_windows := user32.lib, \
))
diff --git a/make/launcher/Launcher-jdk.jdeps.gmk b/make/launcher/Launcher-jdk.jdeps.gmk
index 217523c48cc..5448278dae7 100644
--- a/make/launcher/Launcher-jdk.jdeps.gmk
+++ b/make/launcher/Launcher-jdk.jdeps.gmk
@@ -27,15 +27,18 @@ include LauncherCommon.gmk
$(eval $(call SetupBuildLauncher, javap, \
MAIN_CLASS := com.sun.tools.javap.Main, \
+ JAVA_ARGS := -XX:+DisableHotswapAgent, \
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
))
$(eval $(call SetupBuildLauncher, jdeps, \
MAIN_CLASS := com.sun.tools.jdeps.Main, \
+ JAVA_ARGS := -XX:+DisableHotswapAgent, \
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
))
$(eval $(call SetupBuildLauncher, jdeprscan, \
MAIN_CLASS := com.sun.tools.jdeprscan.Main, \
+ JAVA_ARGS := -XX:+DisableHotswapAgent, \
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
))
diff --git a/make/launcher/Launcher-jdk.jdi.gmk b/make/launcher/Launcher-jdk.jdi.gmk
index fcce98cf430..27bd448e3ae 100644
--- a/make/launcher/Launcher-jdk.jdi.gmk
+++ b/make/launcher/Launcher-jdk.jdi.gmk
@@ -27,4 +27,5 @@ include LauncherCommon.gmk
$(eval $(call SetupBuildLauncher, jdb, \
MAIN_CLASS := com.sun.tools.example.debug.tty.TTY, \
+ JAVA_ARGS := -XX:+DisableHotswapAgent, \
))
diff --git a/make/launcher/Launcher-jdk.jlink.gmk b/make/launcher/Launcher-jdk.jlink.gmk
index df2173996d7..9e61edeb2c8 100644
--- a/make/launcher/Launcher-jdk.jlink.gmk
+++ b/make/launcher/Launcher-jdk.jlink.gmk
@@ -27,18 +27,21 @@ include LauncherCommon.gmk
$(eval $(call SetupBuildLauncher, jimage,\
MAIN_CLASS := jdk.tools.jimage.Main, \
+ JAVA_ARGS := -XX:+DisableHotswapAgent, \
CFLAGS := -DENABLE_ARG_FILES, \
))
$(eval $(call SetupBuildLauncher, jlink,\
MAIN_CLASS := jdk.tools.jlink.internal.Main, \
- JAVA_ARGS := --add-modules ALL-DEFAULT, \
+ JAVA_ARGS := --add-modules ALL-DEFAULT \
+ -XX:+DisableHotswapAgent, \
CFLAGS := -DENABLE_ARG_FILES \
-DEXPAND_CLASSPATH_WILDCARDS, \
))
$(eval $(call SetupBuildLauncher, jmod,\
MAIN_CLASS := jdk.tools.jmod.Main, \
+ JAVA_ARGS := -XX:+DisableHotswapAgent, \
CFLAGS := -DENABLE_ARG_FILES \
-DEXPAND_CLASSPATH_WILDCARDS, \
))
diff --git a/make/launcher/Launcher-jdk.jshell.gmk b/make/launcher/Launcher-jdk.jshell.gmk
index 349eb88e9eb..7287f8f998a 100644
--- a/make/launcher/Launcher-jdk.jshell.gmk
+++ b/make/launcher/Launcher-jdk.jshell.gmk
@@ -27,5 +27,6 @@ include LauncherCommon.gmk
$(eval $(call SetupBuildLauncher, jshell, \
MAIN_CLASS := jdk.internal.jshell.tool.JShellToolProvider, \
+ JAVA_ARGS := -XX:+DisableHotswapAgent, \
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
))
diff --git a/make/launcher/Launcher-jdk.jstatd.gmk b/make/launcher/Launcher-jdk.jstatd.gmk
index e9286d63094..e1657910c67 100644
--- a/make/launcher/Launcher-jdk.jstatd.gmk
+++ b/make/launcher/Launcher-jdk.jstatd.gmk
@@ -27,6 +27,7 @@ include LauncherCommon.gmk
$(eval $(call SetupBuildLauncher, jstatd, \
MAIN_CLASS := sun.tools.jstatd.Jstatd, \
+ JAVA_ARGS := -XX:+DisableHotswapAgent, \
))
# Hook to include the corresponding custom file, if present.
diff --git a/make/launcher/Launcher-jdk.pack.gmk b/make/launcher/Launcher-jdk.pack.gmk
index a93fd2a9017..64bbbb7c949 100644
--- a/make/launcher/Launcher-jdk.pack.gmk
+++ b/make/launcher/Launcher-jdk.pack.gmk
@@ -28,6 +28,7 @@ include LauncherCommon.gmk
$(eval $(call SetupBuildLauncher, pack200, \
MAIN_MODULE := java.base, \
MAIN_CLASS := com.sun.java.util.jar.pack.Driver, \
+ JAVA_ARGS := -XX:+DisableHotswapAgent, \
))
################################################################################
diff --git a/make/launcher/Launcher-jdk.rmic.gmk b/make/launcher/Launcher-jdk.rmic.gmk
index d60c3d9b60b..b8a55900b0e 100644
--- a/make/launcher/Launcher-jdk.rmic.gmk
+++ b/make/launcher/Launcher-jdk.rmic.gmk
@@ -27,5 +27,6 @@ include LauncherCommon.gmk
$(eval $(call SetupBuildLauncher, rmic, \
MAIN_CLASS := sun.rmi.rmic.Main, \
+ JAVA_ARGS := -XX:+DisableHotswapAgent, \
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
))
diff --git a/make/launcher/Launcher-jdk.scripting.nashorn.shell.gmk b/make/launcher/Launcher-jdk.scripting.nashorn.shell.gmk
index 82311e69fd6..bd39f8595b2 100644
--- a/make/launcher/Launcher-jdk.scripting.nashorn.shell.gmk
+++ b/make/launcher/Launcher-jdk.scripting.nashorn.shell.gmk
@@ -27,6 +27,7 @@ include LauncherCommon.gmk
$(eval $(call SetupBuildLauncher, jjs, \
MAIN_CLASS := jdk.nashorn.tools.jjs.Main, \
- JAVA_ARGS := --add-modules ALL-DEFAULT, \
+ JAVA_ARGS := --add-modules ALL-DEFAULT \
+ -XX:+DisableHotswapAgent, \
CFLAGS := -DENABLE_ARG_FILES, \
))
diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp
index 2ca6dde069d..c75bb5d8f49 100644
--- a/src/hotspot/share/runtime/arguments.cpp
+++ b/src/hotspot/share/runtime/arguments.cpp
@@ -3937,6 +3937,8 @@ jint Arguments::parse(const JavaVMInitArgs* initial_cmd_args) {
// Set object alignment values.
set_object_alignment();
+ setup_hotswap_agent();
+
#if !INCLUDE_CDS
if (DumpSharedSpaces || RequireSharedSpaces) {
jio_fprintf(defaultStream::error_stream(),
@@ -4270,3 +4272,60 @@ 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 (!AllowEnhancedClassRedefinition)
+ return;
+
+ // Set HotswapAgent
+ if (!DisableHotswapAgent) {
+
+ 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) {
+ 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());
+ }
+
+ 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_property("jdk.module.addopens", "java.base/java.lang=ALL-UNNAMED", addopens_count++);
+ // Class of field java.lang.reflect.Proxy/proxyCache
+ create_numbered_property("jdk.module.addopens", "java.base/jdk.internal.loader=ALL-UNNAMED", addopens_count++);
+ // java.beans.Introspector access
+ create_numbered_property("jdk.module.addopens", "java.desktop/java.beans=ALL-UNNAMED", addopens_count++);
+
+}
diff --git a/src/hotspot/share/runtime/arguments.hpp b/src/hotspot/share/runtime/arguments.hpp
index 46450cce5c9..3dc5b3d4bae 100644
--- a/src/hotspot/share/runtime/arguments.hpp
+++ b/src/hotspot/share/runtime/arguments.hpp
@@ -506,6 +506,9 @@ 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/globals.hpp b/src/hotspot/share/runtime/globals.hpp
index f3cf08fffb6..5f6c7b8e388 100644
--- a/src/hotspot/share/runtime/globals.hpp
+++ b/src/hotspot/share/runtime/globals.hpp
@@ -32,6 +32,12 @@
#include <float.h> // for DBL_MAX
+#ifdef DCEVM_ONLY
+#define DISABLED_HOTSWAP_AGENT true
+#else
+#define DISABLED_HOTSWAP_AGENT false
+#endif
+
// The larger HeapWordSize for 64bit requires larger heaps
// for the same application running in 64bit. See bug 4967770.
// The minimum alignment to a heap word size is done. Other
@@ -2675,8 +2681,10 @@ define_pd_global(uint64_t,MaxRAM, 1ULL*G);
\
product(bool, AllowEnhancedClassRedefinition, true, \
"Allow enhanced class redefinition beyond swapping method " \
- "bodies")
-
+ "bodies") \
+ \
+ product(bool, DisableHotswapAgent, DISABLED_HOTSWAP_AGENT, \
+ "Disable integrated Hotswap Agent (HotswapVM only)")
#define VM_FLAGS(develop, \
develop_pd, \
product, \
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,25 @@
From dc397b652d9810f6f261070afbb8519f1c2964ee Mon Sep 17 00:00:00 2001
From: skybber <lada.dvorak7@gmail.com>
Date: Sun, 16 Dec 2018 09:55:31 +0100
Subject: [PATCH 16/50] Add dcevm distro name
---
make/autoconf/version-numbers | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/make/autoconf/version-numbers b/make/autoconf/version-numbers
index b5a23138213..5c0a3242c80 100644
--- a/make/autoconf/version-numbers
+++ b/make/autoconf/version-numbers
@@ -43,7 +43,7 @@ PRODUCT_NAME=OpenJDK
PRODUCT_SUFFIX="Runtime Environment"
JDK_RC_PLATFORM_NAME=Platform
COMPANY_NAME=N/A
-HOTSPOT_VM_DISTRO="OpenJDK"
+HOTSPOT_VM_DISTRO="Dynamic Code Evolution"
# Might need better names for these
MACOSX_BUNDLE_NAME_BASE="OpenJDK"
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,24 @@
From 987645d54a6682f28a733731965d6b377e892974 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
Date: Tue, 19 Nov 2019 19:58:27 +0100
Subject: [PATCH 17/50] java.desktop/com.sun.beans=ALL-UNNAMED
---
src/hotspot/share/runtime/arguments.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp
index c75bb5d8f49..ba6e78d6daa 100644
--- a/src/hotspot/share/runtime/arguments.cpp
+++ b/src/hotspot/share/runtime/arguments.cpp
@@ -4327,5 +4327,7 @@ void Arguments::setup_hotswap_agent() {
create_numbered_property("jdk.module.addopens", "java.base/jdk.internal.loader=ALL-UNNAMED", addopens_count++);
// java.beans.Introspector access
create_numbered_property("jdk.module.addopens", "java.desktop/java.beans=ALL-UNNAMED", addopens_count++);
+ // java.beans.Introspector access
+ create_numbered_property("jdk.module.addopens", "java.desktop/com.sun.beans=ALL-UNNAMED", addopens_count++);
}
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,113 @@
From 60569257636a2d0b31b04ab2638d81f840d75e58 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
Date: Tue, 19 Nov 2019 21:07:59 +0100
Subject: [PATCH 18/50] increment_class_counter() using orig dcevm code
Probably it is cause of SISEGV on:
_
VM_EnhancedRedefineClasses::redefine_single_class->java_mirror()
---
.../prims/jvmtiEnhancedRedefineClasses.cpp | 39 ++++++-------------
1 file changed, 12 insertions(+), 27 deletions(-)
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index 4ca638548dc..efb9e806508 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -1146,9 +1146,9 @@ int VM_EnhancedRedefineClasses::calculate_redefinition_flags(InstanceKlass* new_
}
-/**
+/**
Searches for the class bytecode of the given class and returns it as a byte array.
-
+
@param the_class definition of a class, either existing class or new_class
@param class_bytes - if the class is redefined, it contains new class definition, otherwise just original class bytecode.
@param class_byte_count - size of class_bytes
@@ -1460,7 +1460,7 @@ void VM_EnhancedRedefineClasses::ClearCpoolCacheAndUnpatch::do_klass(Klass* k) {
//
// ik->itable()->adjust_method_entries(the_class, &trace_name_printed);
// }
-
+
constantPoolHandle other_cp = constantPoolHandle(ik->constants());
// Update host klass of anonymous classes (for example, produced by lambdas) to newest version.
@@ -1764,7 +1764,7 @@ void VM_EnhancedRedefineClasses::flush_dependent_code(InstanceKlass* k_h, TRAPS)
/**
Compare _old_methods and _new_methods arrays and store the result into
_matching_old_methods, _matching_new_methods, _added_methods, _deleted_methods
-
+
Setup _old_methods and _new_methods before the call - it should be called for one class only!
*/
void VM_EnhancedRedefineClasses::compute_added_deleted_matching_methods() {
@@ -1898,13 +1898,13 @@ void VM_EnhancedRedefineClasses::redefine_single_class(InstanceKlass* new_class_
ResourceMark rm(THREAD);
// increment the classRedefinedCount field in the_class and in any
// direct and indirect subclasses of the_class
- increment_class_counter(the_class, THREAD);
+ increment_class_counter(new_class, THREAD);
log_info(redefine, class, load)
("redefined name=%s, count=%d (avail_mem=" UINT64_FORMAT "K)",
- the_class->external_name(), java_lang_Class::classRedefinedCount(the_class->java_mirror()), os::available_memory() >> 10);
+ 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",
- the_class->external_name(),
- java_lang_Class::classRedefinedCount(the_class->java_mirror()));
+ new_class->external_name(),
+ java_lang_Class::classRedefinedCount(new_class->java_mirror()));
}
_timer_rsc_phase2.stop();
@@ -1914,25 +1914,10 @@ 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) {
- oop class_mirror = ik->java_mirror();
+ 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->new_version()->java_mirror(), new_count);
-
- if (class_oop != _the_class_oop) {
- // _the_class_oop count is printed at end of redefine_single_class()
- log_debug(redefine, class, subclass)("updated count in subclass=%s to %d", ik->external_name(), new_count);
- }
-
- for (Klass *subk = ik->subklass(); subk != NULL;
- subk = subk->next_sibling()) {
- if (subk->is_instance_klass()) {
- // Only update instanceKlasses
- InstanceKlass *subik = InstanceKlass::cast(subk);
- // recursively do subclasses of the current subclass
- increment_class_counter(subik, THREAD);
- }
- }
+ java_lang_Class::set_classRedefinedCount(ik->java_mirror(), new_count);
}
void VM_EnhancedRedefineClasses::check_class(InstanceKlass* ik, TRAPS) {
@@ -2063,7 +2048,7 @@ class AffectedKlassClosure : public KlassClosure {
/**
Find all affected classes by current redefinition (either because of redefine, class hierarchy or interface change).
- Affected classes are stored in _affected_klasses and parent classes always precedes child class.
+ Affected classes are stored in _affected_klasses and parent classes always precedes child class.
*/
jvmtiError VM_EnhancedRedefineClasses::find_sorted_affected_classes(TRAPS) {
for (int i = 0; i < _class_count; i++) {
@@ -2112,7 +2097,7 @@ static bool match_second(void* value, KlassPair elem) {
First newly introduced classes (_class_defs) are scanned and then affected classed (_affected_klasses).
Affected flag is cleared (clear_redefinition_flag(Klass::MarkedAsAffected))
For each dependency create a KlassPair instance. Finnaly, affected classes (_affected_klasses) are sorted according to pairs.
-
+
TODO - the class file is potentionally parsed multiple times - introduce a cache?
*/
jvmtiError VM_EnhancedRedefineClasses::do_topological_class_sorting(TRAPS) {
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,38 @@
From 41d2963b54490601e22cf5309ed73f78566d35ae Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
Date: Thu, 21 Nov 2019 19:30:07 +0100
Subject: [PATCH 19/50] Allow 11715ha class initializer calls
---
src/hotspot/share/classfile/vmSymbols.hpp | 1 +
src/hotspot/share/interpreter/linkResolver.cpp | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/hotspot/share/classfile/vmSymbols.hpp b/src/hotspot/share/classfile/vmSymbols.hpp
index e2bac31b27f..6eeda3b8f68 100644
--- a/src/hotspot/share/classfile/vmSymbols.hpp
+++ b/src/hotspot/share/classfile/vmSymbols.hpp
@@ -340,6 +340,7 @@
/* common method and field names */ \
template(object_initializer_name, "<init>") \
template(class_initializer_name, "<clinit>") \
+ template(ha_class_initializer_name, "$$ha$clinit") \
template(println_name, "println") \
template(printStackTrace_name, "printStackTrace") \
template(main_name, "main") \
diff --git a/src/hotspot/share/interpreter/linkResolver.cpp b/src/hotspot/share/interpreter/linkResolver.cpp
index b9ccdee8cca..cb76d2ef50c 100644
--- a/src/hotspot/share/interpreter/linkResolver.cpp
+++ b/src/hotspot/share/interpreter/linkResolver.cpp
@@ -1009,7 +1009,7 @@ void LinkResolver::resolve_field(fieldDescriptor& fd,
assert(!m.is_null(), "information about the current method must be available for 'put' bytecodes");
bool is_initialized_static_final_update = (byte == Bytecodes::_putstatic &&
fd.is_static() &&
- !m()->is_static_initializer());
+ !(m()->is_static_initializer() || m()->name() == vmSymbols::ha_class_initializer_name()));
bool is_initialized_instance_final_update = ((byte == Bytecodes::_putfield || byte == Bytecodes::_nofast_putfield) &&
!fd.is_static() &&
!m->is_object_initializer());
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,24 @@
From 09799f079ef1148248ca60c917205003d2a565b3 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
Date: Tue, 26 Nov 2019 22:13:07 +0100
Subject: [PATCH 20/50] Disable HA in keytool
---
make/launcher/Launcher-java.base.gmk | 1 +
1 file changed, 1 insertion(+)
diff --git a/make/launcher/Launcher-java.base.gmk b/make/launcher/Launcher-java.base.gmk
index 5ee4530004b..88c1a14b2aa 100644
--- a/make/launcher/Launcher-java.base.gmk
+++ b/make/launcher/Launcher-java.base.gmk
@@ -63,6 +63,7 @@ endif
$(eval $(call SetupBuildLauncher, keytool, \
MAIN_CLASS := sun.security.tools.keytool.Main, \
+ JAVA_ARGS := -XX:+DisableHotswapAgent, \
))
################################################################################
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,24 @@
From e1d8f42f428d7d18f09f1a7098f56fdce808c3fe Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
Date: Thu, 28 Nov 2019 18:53:11 +0100
Subject: [PATCH 21/50] Open jdk module to access ClassInfo.CACHE
---
src/hotspot/share/runtime/arguments.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp
index ba6e78d6daa..0081f688120 100644
--- a/src/hotspot/share/runtime/arguments.cpp
+++ b/src/hotspot/share/runtime/arguments.cpp
@@ -4329,5 +4329,7 @@ void Arguments::setup_hotswap_agent() {
create_numbered_property("jdk.module.addopens", "java.desktop/java.beans=ALL-UNNAMED", addopens_count++);
// java.beans.Introspector access
create_numbered_property("jdk.module.addopens", "java.desktop/com.sun.beans=ALL-UNNAMED", addopens_count++);
+ // com.sun.beans.introspect.ClassInfo access
+ create_numbered_property("jdk.module.addopens", "java.desktop/com.sun.beans.introspect=ALL-UNNAMED", addopens_count++);
}
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,25 @@
From 8b7323c57ee07c03a02ba951ce6d453ec4cc1a54 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
Date: Sun, 8 Dec 2019 17:55:01 +0100
Subject: [PATCH 22/50] Open java.base/java.io module
---
src/hotspot/share/runtime/arguments.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp
index 0081f688120..0cdd8c88315 100644
--- a/src/hotspot/share/runtime/arguments.cpp
+++ b/src/hotspot/share/runtime/arguments.cpp
@@ -4325,6 +4325,8 @@ void Arguments::setup_hotswap_agent() {
create_numbered_property("jdk.module.addopens", "java.base/java.lang=ALL-UNNAMED", addopens_count++);
// Class of field java.lang.reflect.Proxy/proxyCache
create_numbered_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_property("jdk.module.addopens", "java.base/java.io=ALL-UNNAMED", addopens_count++);
// java.beans.Introspector access
create_numbered_property("jdk.module.addopens", "java.desktop/java.beans=ALL-UNNAMED", addopens_count++);
// java.beans.Introspector access
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,54 @@
From 14c82a29cbf8254f8da626753ea34086d38e71b4 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@mailprofiler.com>
Date: Fri, 6 Mar 2020 09:28:24 +0100
Subject: [PATCH 23/50] Fix fieldDescriptor.inline.hpp
---
.../share/prims/jvmtiEnhancedRedefineClasses.cpp | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index efb9e806508..a404fd3f016 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -49,6 +49,7 @@
#include "runtime/deoptimization.hpp"
#include "runtime/jniHandles.inline.hpp"
#include "runtime/relocator.hpp"
+#include "runtime/fieldDescriptor.inline.hpp"
#include "utilities/bitMap.inline.hpp"
#include "prims/jvmtiThreadState.inline.hpp"
#include "utilities/events.hpp"
@@ -490,6 +491,11 @@ void VM_EnhancedRedefineClasses::doit() {
flush_dependent_code(NULL, 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);
+
+
// JSR-292 support
if (_any_class_has_resolved_methods) {
bool trace_name_printed = false;
@@ -1890,9 +1896,6 @@ void VM_EnhancedRedefineClasses::redefine_single_class(InstanceKlass* new_class_
}
*/
- // Adjust constantpool caches for all classes that reference methods of the evolved class.
- ClearCpoolCacheAndUnpatch clear_cpool_cache(THREAD);
- ClassLoaderDataGraph::classes_do(&clear_cpool_cache);
{
ResourceMark rm(THREAD);
@@ -1905,7 +1908,6 @@ void VM_EnhancedRedefineClasses::redefine_single_class(InstanceKlass* new_class_
Events::log_redefinition(THREAD, "redefined class name=%s, count=%d",
new_class->external_name(),
java_lang_Class::classRedefinedCount(new_class->java_mirror()));
-
}
_timer_rsc_phase2.stop();
} // end redefine_single_class()
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,38 @@
From 5a56f2278c0a79f4a26f369a55f4c1c4dab2621e Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@mailprofiler.com>
Date: Fri, 6 Mar 2020 15:46:51 +0100
Subject: [PATCH 24/50] Fix clear_cpool_cache
---
src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index a404fd3f016..1f5a67f8866 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -491,11 +491,6 @@ void VM_EnhancedRedefineClasses::doit() {
flush_dependent_code(NULL, 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);
-
-
// JSR-292 support
if (_any_class_has_resolved_methods) {
bool trace_name_printed = false;
@@ -1896,6 +1891,9 @@ void VM_EnhancedRedefineClasses::redefine_single_class(InstanceKlass* new_class_
}
*/
+ // Adjust constantpool caches for all classes that reference methods of the evolved class.
+ ClearCpoolCacheAndUnpatch clear_cpool_cache(THREAD);
+ ClassLoaderDataGraph::classes_do(&clear_cpool_cache);
{
ResourceMark rm(THREAD);
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,163 @@
From c1aafaafaf15780d6bca1312162d551da4f63036 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@mailprofiler.com>
Date: Mon, 9 Mar 2020 09:54:04 +0100
Subject: [PATCH 25/50] Refactor ClearCpoolCacheAndUnpatch
Call it after redefinition of all classes
---
make/common/MakeBase.gmk | 4 +-
.../prims/jvmtiEnhancedRedefineClasses.cpp | 98 ++++---------------
2 files changed, 21 insertions(+), 81 deletions(-)
diff --git a/make/common/MakeBase.gmk b/make/common/MakeBase.gmk
index a040effe83a..c33a7d52ddb 100644
--- a/make/common/MakeBase.gmk
+++ b/make/common/MakeBase.gmk
@@ -1044,7 +1044,9 @@ DependOnVariableHelper = \
$(info NewVariable $1: >$(strip $($1))<) \
$(info OldVariable $1: >$(strip $($1_old))<)) \
$(call WriteFile, $1_old:=$(call DoubleDollar,$(call EscapeHash,$($1))), \
- $($1_filename))) \
+ $($1_filename)) \
+ $(eval $($1_filename): ) \
+ ) \
$($1_filename) \
)
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index 1f5a67f8866..24fb76b6de4 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -491,6 +491,11 @@ void VM_EnhancedRedefineClasses::doit() {
flush_dependent_code(NULL, 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);
+
+
// JSR-292 support
if (_any_class_has_resolved_methods) {
bool trace_name_printed = false;
@@ -1383,86 +1388,23 @@ void VM_EnhancedRedefineClasses::unpatch_bytecode(Method* method) {
}
}
-// Unevolving classes may point to methods of the_class directly
+// Unevolving classes may point to old methods directly
// from their constant pool caches, itables, and/or vtables. We
-// use the ClassLoaderDataGraph::classes_do() facility and this helper
-// to fix up these pointers.
-// Adjust cpools and vtables closure
+// use the SystemDictionary::classes_do() facility and this helper
+// to fix up these pointers. Additional field offsets and vtable indices
+// in the constant pool cache entries are fixed.
+//
+// Note: We currently don't support updating the vtable in
+// arrayKlassOops. See Open Issues in jvmtiRedefineClasses.hpp.
void VM_EnhancedRedefineClasses::ClearCpoolCacheAndUnpatch::do_klass(Klass* k) {
- // This is a very busy routine. We don't want too much tracing
- // printed out.
- bool trace_name_printed = false;
- InstanceKlass *the_class = InstanceKlass::cast(_the_class_oop);
-
- // If the class being redefined is java.lang.Object, we need to fix all
- // array class vtables also
- if (k->is_array_klass() && _the_class_oop == SystemDictionary::Object_klass()) {
- k->vtable().adjust_method_entries(the_class, &trace_name_printed);
- } else if (k->is_instance_klass()) {
- HandleMark hm(_thread);
- InstanceKlass *ik = InstanceKlass::cast(k);
+ if (!k->is_instance_klass()) {
+ return;
+ }
- // HotSpot specific optimization! HotSpot does not currently
- // support delegation from the bootstrap class loader to a
- // user-defined class loader. This means that if the bootstrap
- // class loader is the initiating class loader, then it will also
- // be the defining class loader. This also means that classes
- // loaded by the bootstrap class loader cannot refer to classes
- // loaded by a user-defined class loader. Note: a user-defined
- // class loader can delegate to the bootstrap class loader.
- //
- // If the current class being redefined has a user-defined class
- // loader as its defining class loader, then we can skip all
- // classes loaded by the bootstrap class loader.
- bool is_user_defined =
- InstanceKlass::cast(_the_class_oop)->class_loader() != NULL;
- if (is_user_defined && ik->class_loader() == NULL) {
- return;
- }
-
- // Fix the vtable embedded in the_class and subclasses of the_class,
- // if one exists. We discard scratch_class and we don't keep an
- // InstanceKlass around to hold obsolete methods so we don't have
- // any other InstanceKlass embedded vtables to update. The vtable
- // holds the Method*s for virtual (but not final) methods.
- // Default methods, or concrete methods in interfaces are stored
- // in the vtable, so if an interface changes we need to check
- // adjust_method_entries() for every InstanceKlass, which will also
- // adjust the default method vtable indices.
- // We also need to adjust any default method entries that are
- // not yet in the vtable, because the vtable setup is in progress.
- // This must be done after we adjust the default_methods and
- // default_vtable_indices for methods already in the vtable.
- // If redefining Unsafe, walk all the vtables looking for entries.
-// FIXME - code from standard redefine - if needed, it should switch to new_class
-// if (ik->vtable_length() > 0 && (_the_class_oop->is_interface()
-// || _the_class_oop == SystemDictionary::internal_Unsafe_klass()
-// || ik->is_subtype_of(_the_class_oop))) {
-// // ik->vtable() creates a wrapper object; rm cleans it up
-// ResourceMark rm(_thread);
-//
-// ik->vtable()->adjust_method_entries(the_class, &trace_name_printed);
-// ik->adjust_default_methods(the_class, &trace_name_printed);
-// }
-
- // If the current class has an itable and we are either redefining an
- // interface or if the current class is a subclass of the_class, then
- // we potentially have to fix the itable. If we are redefining an
- // interface, then we have to call adjust_method_entries() for
- // every InstanceKlass that has an itable since there isn't a
- // subclass relationship between an interface and an InstanceKlass.
- // If redefining Unsafe, walk all the itables looking for entries.
-// FIXME - code from standard redefine - if needed, it should switch to new_class
-// if (ik->itable_length() > 0 && (_the_class_oop->is_interface()
-// || _the_class_oop == SystemDictionary::internal_Unsafe_klass()
-// || ik->is_subclass_of(_the_class_oop))) {
-// // ik->itable() creates a wrapper object; rm cleans it up
-// ResourceMark rm(_thread);
-//
-// ik->itable()->adjust_method_entries(the_class, &trace_name_printed);
-// }
+ HandleMark hm(_thread);
+ InstanceKlass *ik = InstanceKlass::cast(k);
- constantPoolHandle other_cp = constantPoolHandle(ik->constants());
+ constantPoolHandle other_cp = constantPoolHandle(ik->constants());
// Update host klass of anonymous classes (for example, produced by lambdas) to newest version.
if (ik->is_anonymous() && ik->host_klass()->new_version() != NULL) {
@@ -1491,7 +1433,6 @@ void VM_EnhancedRedefineClasses::ClearCpoolCacheAndUnpatch::do_klass(Klass* k) {
if (RewriteBytecodes) {
ik->methods_do(unpatch_bytecode);
}
- }
}
// Clean method data for this class
@@ -1891,9 +1832,6 @@ void VM_EnhancedRedefineClasses::redefine_single_class(InstanceKlass* new_class_
}
*/
- // Adjust constantpool caches for all classes that reference methods of the evolved class.
- ClearCpoolCacheAndUnpatch clear_cpool_cache(THREAD);
- ClassLoaderDataGraph::classes_do(&clear_cpool_cache);
{
ResourceMark rm(THREAD);
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,29 @@
From d6a3286b9b57df4c09d859e38833f2e3dc1574d9 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <vladimir.dvorak@mailprofiler.com>
Date: Wed, 11 Mar 2020 14:19:34 +0100
Subject: [PATCH 26/50] 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 9b6ba7e9304..8cbd4b8edf2 100644
--- a/src/hotspot/share/oops/instanceKlass.cpp
+++ b/src/hotspot/share/oops/instanceKlass.cpp
@@ -788,7 +788,10 @@ bool InstanceKlass::link_class_impl(bool throw_verifyerror, TRAPS) {
if (!is_linked()) {
if (!is_rewritten()) {
- {
+ // In cases, 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 (!newest_version()->is_redefining()) {
bool verify_ok = verify_code(throw_verifyerror, THREAD);
if (!verify_ok) {
return false;
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,60 @@
From a4ab453f532839ea3b09027736bb6e74d288bf1d Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
Date: Fri, 10 Apr 2020 23:28:07 +0200
Subject: [PATCH 27/50] Update klass reference in Klass.implementor()
If interface X is removed from class Y then old reference to Y could be
stored in X.implementor()
---
.../share/prims/jvmtiEnhancedRedefineClasses.cpp | 12 ++++++++++++
.../share/prims/jvmtiEnhancedRedefineClasses.hpp | 11 -----------
2 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index 24fb76b6de4..f6d2d3a40fe 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -1411,6 +1411,18 @@ void VM_EnhancedRedefineClasses::ClearCpoolCacheAndUnpatch::do_klass(Klass* k) {
ik->set_host_klass(InstanceKlass::cast(ik->host_klass()->newest_version()));
}
+ // Update implementor if there is only one, in this case implementor() can reference old class
+ if (ik->is_interface()) {
+ Klass* implKlass = ik->implementor();
+ if (implKlass != NULL && implKlass != ik && implKlass->new_version() != NULL) {
+ InstanceKlass* newest_impl = InstanceKlass::cast(implKlass->newest_version());
+ ik->init_implementor();
+ if (newest_impl->implements_interface(ik)) {
+ ik->add_implementor(newest_impl);
+ }
+ }
+ }
+
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);
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
index 5b3ebc13661..2d114635ee5 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
@@ -69,17 +69,6 @@ class VM_EnhancedRedefineClasses: public VM_GC_Operation {
// RetransformClasses. Indicate which.
JvmtiClassLoadKind _class_load_kind;
- // _index_map_count is just an optimization for knowing if
- // _index_map_p contains any entries.
- int _index_map_count;
- intArray * _index_map_p;
-
- // _operands_index_map_count is just an optimization for knowing if
- // _operands_index_map_p contains any entries.
- int _operands_cur_length;
- int _operands_index_map_count;
- intArray * _operands_index_map_p;
-
GrowableArray<InstanceKlass*>* _new_classes;
jvmtiError _res;
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,96 @@
From 015c9c88e63f2dde4b8b2a09d2832a8c2a3caf25 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
Date: Fri, 10 Apr 2020 23:30:21 +0200
Subject: [PATCH 28/50] Fix DirectMethodHandle accessors klasses
---
src/hotspot/share/classfile/javaClasses.cpp | 28 +++++++++++++++------
src/hotspot/share/classfile/javaClasses.hpp | 4 +++
2 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/src/hotspot/share/classfile/javaClasses.cpp b/src/hotspot/share/classfile/javaClasses.cpp
index a89443d22ea..ea0588e5388 100644
--- a/src/hotspot/share/classfile/javaClasses.cpp
+++ b/src/hotspot/share/classfile/javaClasses.cpp
@@ -3641,14 +3641,20 @@ void java_lang_invoke_DirectMethodHandle_StaticAccessor::set_static_offset(oop d
dmh->long_field_put(_static_offset_offset, static_offset);
}
+#define DIRECTMETHODHANDLE_STATIC_ACCESSOR_FIELDS_DO(macro) \
+ macro(_static_offset_offset, k, vmSymbols::static_offset_name(), long_signature, false)
void java_lang_invoke_DirectMethodHandle_StaticAccessor::compute_offsets() {
- Klass* klass_oop = SystemDictionary::DirectMethodHandle_StaticAccessor_klass();
- if (klass_oop != NULL) {
- compute_offset(_static_offset_offset, InstanceKlass::cast(klass_oop), vmSymbols::static_offset_name(), vmSymbols::long_signature());
- }
+ InstanceKlass* k = SystemDictionary::DirectMethodHandle_StaticAccessor_klass();
+ DIRECTMETHODHANDLE_STATIC_ACCESSOR_FIELDS_DO(FIELD_COMPUTE_OFFSET);
}
+#if INCLUDE_CDS
+void java_lang_invoke_DirectMethodHandle_StaticAccessor::serialize_offsets(SerializeClosure* f) {
+ DIRECTMETHODHANDLE_STATIC_ACCESSOR_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
+}
+#endif
+
// Support for java_lang_invoke_DirectMethodHandle$Accessor
int java_lang_invoke_DirectMethodHandle_Accessor::_field_offset_offset;
@@ -3663,14 +3669,20 @@ void java_lang_invoke_DirectMethodHandle_Accessor::set_field_offset(oop dmh, int
dmh->int_field_put(_field_offset_offset, field_offset);
}
+#define DIRECTMETHODHANDLE_ACCESSOR_FIELDS_DO(macro) \
+ macro(_field_offset_offset, k, vmSymbols::field_offset_name(), int_signature, false)
void java_lang_invoke_DirectMethodHandle_Accessor::compute_offsets() {
- Klass* klass_oop = SystemDictionary::DirectMethodHandle_Accessor_klass();
- if (klass_oop != NULL) {
- compute_offset(_field_offset_offset, InstanceKlass::cast(klass_oop), vmSymbols::field_offset_name(), vmSymbols::int_signature());
- }
+ InstanceKlass* k = SystemDictionary::DirectMethodHandle_Accessor_klass();
+ DIRECTMETHODHANDLE_ACCESSOR_FIELDS_DO(FIELD_COMPUTE_OFFSET);
}
+#if INCLUDE_CDS
+void java_lang_invoke_DirectMethodHandle_Accessor::serialize_offsets(SerializeClosure* f) {
+ DIRECTMETHODHANDLE_ACCESSOR_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
+}
+#endif
+
// Support for java_lang_invoke_MethodHandle
int java_lang_invoke_MethodHandle::_type_offset;
diff --git a/src/hotspot/share/classfile/javaClasses.hpp b/src/hotspot/share/classfile/javaClasses.hpp
index ceb1670df5d..55f9fa62e2b 100644
--- a/src/hotspot/share/classfile/javaClasses.hpp
+++ b/src/hotspot/share/classfile/javaClasses.hpp
@@ -67,6 +67,8 @@
f(java_lang_invoke_LambdaForm) \
f(java_lang_invoke_MethodType) \
f(java_lang_invoke_CallSite) \
+ f(java_lang_invoke_DirectMethodHandle_StaticAccessor) \
+ f(java_lang_invoke_DirectMethodHandle_Accessor) \
f(java_lang_invoke_MethodHandleNatives_CallSiteContext) \
f(java_security_AccessControlContext) \
f(java_lang_reflect_AccessibleObject) \
@@ -1077,6 +1079,7 @@ class java_lang_invoke_DirectMethodHandle_StaticAccessor: AllStatic {
static bool is_instance(oop obj) {
return obj != NULL && is_subclass(obj->klass());
}
+ static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
};
// Interface to java.lang.invoke.DirectMethodHandle$Accessor objects
@@ -1101,6 +1104,7 @@ class java_lang_invoke_DirectMethodHandle_Accessor: AllStatic {
static bool is_instance(oop obj) {
return obj != NULL && is_subclass(obj->klass());
}
+ static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
};
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,60 @@
From 14005f6176420c16fa1d152c78a3dacd26ecb647 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
Date: Sat, 11 Apr 2020 12:07:43 +0200
Subject: [PATCH 29/50] cleanup direct method handles code
---
src/hotspot/share/classfile/javaClasses.hpp | 10 ++++------
src/hotspot/share/classfile/javaClasses.inline.hpp | 8 ++++++++
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/src/hotspot/share/classfile/javaClasses.hpp b/src/hotspot/share/classfile/javaClasses.hpp
index 55f9fa62e2b..da004d1b307 100644
--- a/src/hotspot/share/classfile/javaClasses.hpp
+++ b/src/hotspot/share/classfile/javaClasses.hpp
@@ -1076,9 +1076,8 @@ class java_lang_invoke_DirectMethodHandle_StaticAccessor: AllStatic {
static bool is_subclass(Klass* klass) {
return klass->is_subclass_of(SystemDictionary::DirectMethodHandle_StaticAccessor_klass());
}
- static bool is_instance(oop obj) {
- return obj != NULL && is_subclass(obj->klass());
- }
+ static bool is_instance(oop obj);
+
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
};
@@ -1101,9 +1100,8 @@ class java_lang_invoke_DirectMethodHandle_Accessor: AllStatic {
static bool is_subclass(Klass* klass) {
return klass->is_subclass_of(SystemDictionary::DirectMethodHandle_Accessor_klass());
}
- static bool is_instance(oop obj) {
- return obj != NULL && is_subclass(obj->klass());
- }
+ static bool is_instance(oop obj);
+
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
};
diff --git a/src/hotspot/share/classfile/javaClasses.inline.hpp b/src/hotspot/share/classfile/javaClasses.inline.hpp
index 6c5787f4b70..ba9cffa8c62 100644
--- a/src/hotspot/share/classfile/javaClasses.inline.hpp
+++ b/src/hotspot/share/classfile/javaClasses.inline.hpp
@@ -175,6 +175,14 @@ inline bool java_lang_invoke_DirectMethodHandle::is_instance(oop obj) {
return obj != NULL && is_subclass(obj->klass());
}
+inline bool java_lang_invoke_DirectMethodHandle_StaticAccessor::is_instance(oop obj) {
+ return obj != NULL && is_subclass(obj->klass());
+}
+
+inline bool java_lang_invoke_DirectMethodHandle_Accessor::is_instance(oop obj) {
+ return obj != NULL && is_subclass(obj->klass());
+}
+
inline bool java_lang_Module::is_instance(oop obj) {
return obj != NULL && obj->klass() == SystemDictionary::Module_klass();
}
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,68 @@
From 990ffe4111fe73c3a183f8d35402cbf9e81bd587 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
Date: Sat, 11 Apr 2020 17:52:13 +0200
Subject: [PATCH 30/50] Add init_implementor_from_redefine, that skips compiler
lock assert
---
src/hotspot/share/oops/instanceKlass.cpp | 10 +++++++++-
src/hotspot/share/oops/instanceKlass.hpp | 1 +
.../share/prims/jvmtiEnhancedRedefineClasses.cpp | 2 +-
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
index 8cbd4b8edf2..c04bdf5abfc 100644
--- a/src/hotspot/share/oops/instanceKlass.cpp
+++ b/src/hotspot/share/oops/instanceKlass.cpp
@@ -789,7 +789,7 @@ bool InstanceKlass::link_class_impl(bool throw_verifyerror, TRAPS) {
if (!is_linked()) {
if (!is_rewritten()) {
// In cases, 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
+ // then second redefinition fails with cannot cast klass exception. So we currently turn off bytecode verification
// on redefinition.
if (!newest_version()->is_redefining()) {
bool verify_ok = verify_code(throw_verifyerror, THREAD);
@@ -1139,6 +1139,14 @@ void InstanceKlass::init_implementor() {
}
}
+void InstanceKlass::init_implementor_from_redefine() {
+ assert(is_interface(), "not interface");
+ Klass** addr = adr_implementor();
+ assert(addr != NULL, "null addr");
+ if (addr != NULL) {
+ *addr = NULL;
+ }
+}
void InstanceKlass::process_interfaces(Thread *thread) {
// link this class into the implementors list of every interface it implements
diff --git a/src/hotspot/share/oops/instanceKlass.hpp b/src/hotspot/share/oops/instanceKlass.hpp
index 2cc98b636f1..e8107a39813 100644
--- a/src/hotspot/share/oops/instanceKlass.hpp
+++ b/src/hotspot/share/oops/instanceKlass.hpp
@@ -1020,6 +1020,7 @@ public:
int nof_implementors() const;
void add_implementor(Klass* k); // k is a new class that implements this interface
void init_implementor(); // initialize
+ void init_implementor_from_redefine(); // initialize
// link this class into the implementors list of every interface it implements
void process_interfaces(Thread *thread);
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index f6d2d3a40fe..aac9ba0911f 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -1416,7 +1416,7 @@ void VM_EnhancedRedefineClasses::ClearCpoolCacheAndUnpatch::do_klass(Klass* k) {
Klass* implKlass = ik->implementor();
if (implKlass != NULL && implKlass != ik && implKlass->new_version() != NULL) {
InstanceKlass* newest_impl = InstanceKlass::cast(implKlass->newest_version());
- ik->init_implementor();
+ ik->init_implementor_from_redefine();
if (newest_impl->implements_interface(ik)) {
ik->add_implementor(newest_impl);
}
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,73 @@
From 9dcddc7c2573c34579161e3ad1240b029dda1e96 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
Date: Mon, 13 Apr 2020 20:59:35 +0200
Subject: [PATCH 31/50] not nullable oop_store_not_null() method+handle NULL in
mem_name in dmh
---
.../share/prims/jvmtiEnhancedRedefineClasses.cpp | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index aac9ba0911f..8d861ef43c9 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -225,13 +225,15 @@ void VM_EnhancedRedefineClasses::mark_as_scavengable(nmethod* nm) {
// TODO comment
struct StoreBarrier {
// TODO: j10 review change ::oop_store -> HeapAccess<>::oop_store
- template <class T> static void oop_store(T* p, oop v) { HeapAccess<>::oop_store(p, v); }
+ template <class T> static void oop_store_not_null(T* p, oop v) { HeapAccess<IS_NOT_NULL>::oop_store(p, v); }
+ template <class T> static void oop_store(T* p) { HeapAccess<>::oop_store(p, oop(NULL)); }
};
// TODO comment
struct StoreNoBarrier {
- template <class T> static void oop_store(T* p, oop v) { RawAccess<IS_NOT_NULL>::oop_store(p, v); }
+ template <class T> static void oop_store_not_null(T* p, oop v) { RawAccess<IS_NOT_NULL>::oop_store(p, v); }
+ template <class T> static void oop_store(T* p) { RawAccess<>::oop_store(p, oop(NULL)); }
};
/**
@@ -309,6 +311,9 @@ class ChangePointersOopClosure : public BasicOopIterateClosure {
bool update_direct_method_handle(oop obj) {
// Always update member name first.
oop mem_name = java_lang_invoke_DirectMethodHandle::member(obj);
+ if (mem_name == NULL) {
+ return true;
+ }
if (!update_member_name(mem_name)) {
return false;
}
@@ -347,7 +352,7 @@ class ChangePointersOopClosure : public BasicOopIterateClosure {
assert(obj == InstanceKlass::cast(klass)->java_mirror(), "just checking");
if (klass->new_version() != NULL) {
obj = InstanceKlass::cast(klass->new_version())->java_mirror();
- S::oop_store(p, obj);
+ S::oop_store_not_null(p, obj);
oop_updated = true;
}
}
@@ -363,7 +368,7 @@ class ChangePointersOopClosure : public BasicOopIterateClosure {
if (!update_direct_method_handle(obj)) {
// DMH is no longer valid, replace it with null reference.
// See note above. We probably want to replace this with something more meaningful.
- S::oop_store(p, NULL);
+ S::oop_store(p);
}
}
}
@@ -1430,8 +1435,7 @@ void VM_EnhancedRedefineClasses::ClearCpoolCacheAndUnpatch::do_klass(Klass* k) {
// Constant pool entry points to redefined class -- update to the new version
other_cp->klass_at_put(i, klass->newest_version());
}
- klass = other_cp->resolved_klass_at(i);
- assert(klass->new_version() == NULL, "Must be new klass!");
+ assert(other_cp->resolved_klass_at(i)->new_version() == NULL, "Must be new klass!");
}
}
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,32 @@
From 800b44f545c7b99026d203690def30ec4b9ed08e Mon Sep 17 00:00:00 2001
From: Artem Khvastunov <artem.khvastunov@jetbrains.com>
Date: Tue, 14 Apr 2020 19:11:35 +0200
Subject: [PATCH 32/50] add jvmtiEnhancedRedefineClasses.* to CMakeLists.txt
---
jb/project/hotspot-cmake/CMakeLists.txt | 2 ++
1 file changed, 2 insertions(+)
diff --git a/jb/project/hotspot-cmake/CMakeLists.txt b/jb/project/hotspot-cmake/CMakeLists.txt
index 8b552c27206..6516e39058f 100644
--- a/jb/project/hotspot-cmake/CMakeLists.txt
+++ b/jb/project/hotspot-cmake/CMakeLists.txt
@@ -1663,6 +1663,7 @@ set(SOURCE_FILES
../../../src/hotspot/share/prims/jvmtiGetLoadedClasses.hpp
../../../src/hotspot/share/prims/jvmtiAgentThread.hpp
../../../src/hotspot/share/prims/jvmtiCodeBlobEvents.cpp
+../../../src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
../../../src/hotspot/share/prims/stackwalk.cpp
../../../src/hotspot/share/prims/privilegedStack.hpp
../../../src/hotspot/share/prims/jvmtiUtil.hpp
@@ -1684,6 +1685,7 @@ set(SOURCE_FILES
../../../src/hotspot/share/prims/stackwalk.hpp
../../../src/hotspot/share/prims/privilegedStack.cpp
../../../src/hotspot/share/prims/jvmtiCodeBlobEvents.hpp
+../../../src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
../../../src/hotspot/share/prims/jvmtiUtil.cpp
../../../src/hotspot/share/prims/jvmtiEnvBase.cpp
../../../src/hotspot/share/prims/methodHandles.cpp
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,25 @@
From e009b4fcc48e9719b5b896f7f3838fbc7c579ba7 Mon Sep 17 00:00:00 2001
From: Artem Khvastunov <artem.khvastunov@jetbrains.com>
Date: Sun, 19 Apr 2020 11:36:12 +0200
Subject: [PATCH 33/50] migrate DCEVM to 11.0.7
---
src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
index 2d114635ee5..6cabdca9c27 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
@@ -30,7 +30,7 @@
#include "memory/resourceArea.hpp"
#include "oops/objArrayKlass.hpp"
#include "oops/objArrayOop.hpp"
-#include "runtime/vm_operations.hpp"
+#include "runtime/vmOperations.hpp"
#include "gc/shared/vmGCOperations.hpp"
#include "../../../java.base/unix/native/include/jni_md.h"
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,33 @@
From 5653e2a5f05a9693f934b0f9c4d9286c01576807 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
Date: Fri, 8 May 2020 21:07:50 +0200
Subject: [PATCH 34/50] Fix 11.0.7 compilation issues
---
src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
index 6cabdca9c27..ed44f0e27ce 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
@@ -16,6 +16,8 @@
* 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.
@@ -30,7 +32,6 @@
#include "memory/resourceArea.hpp"
#include "oops/objArrayKlass.hpp"
#include "oops/objArrayOop.hpp"
-#include "runtime/vmOperations.hpp"
#include "gc/shared/vmGCOperations.hpp"
#include "../../../java.base/unix/native/include/jni_md.h"
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,33 @@
From 0b9b021f889ec001d579d192f1bd9a7a43f63871 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
Date: Sat, 9 May 2020 10:08:17 +0200
Subject: [PATCH 35/50] Use INCLUDE_CDS condition on "UseSharedSpaces" block
from master
---
src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index 8d861ef43c9..660bf3a2e97 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -467,6 +467,7 @@ public:
void VM_EnhancedRedefineClasses::doit() {
Thread *thread = Thread::current();
+#if INCLUDE_CDS
if (UseSharedSpaces) {
// Sharing is enabled so we remap the shared readonly space to
// shared readwrite, private just in case we need to redefine
@@ -478,6 +479,7 @@ void VM_EnhancedRedefineClasses::doit() {
return;
}
}
+#endif
// Mark methods seen on stack and everywhere else so old methods are not
// cleaned up if they're on the stack.
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,141 @@
From 9f4b84339b55187b742682bd84fdb0e6e121917c Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
Date: Sat, 16 May 2020 15:11:40 +0200
Subject: [PATCH 36/50] Access com.sun.beans.util - HotswapAgent patch
---
src/hotspot/share/runtime/arguments.cpp | 2 ++
.../sun/beans/introspect/package-info.java | 26 +++++++++++++++++++
.../classes/com/sun/beans/package-info.java | 26 +++++++++++++++++++
.../com/sun/beans/util/package-info.java | 26 +++++++++++++++++++
.../share/classes/module-info.java | 3 +++
5 files changed, 83 insertions(+)
create mode 100644 src/java.desktop/share/classes/com/sun/beans/introspect/package-info.java
create mode 100644 src/java.desktop/share/classes/com/sun/beans/package-info.java
create mode 100644 src/java.desktop/share/classes/com/sun/beans/util/package-info.java
diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp
index 0cdd8c88315..72580b384dd 100644
--- a/src/hotspot/share/runtime/arguments.cpp
+++ b/src/hotspot/share/runtime/arguments.cpp
@@ -4333,5 +4333,7 @@ void Arguments::setup_hotswap_agent() {
create_numbered_property("jdk.module.addopens", "java.desktop/com.sun.beans=ALL-UNNAMED", addopens_count++);
// com.sun.beans.introspect.ClassInfo access
create_numbered_property("jdk.module.addopens", "java.desktop/com.sun.beans.introspect=ALL-UNNAMED", addopens_count++);
+ // com.sun.beans.introspect.util.Cache access
+ create_numbered_property("jdk.module.addopens", "java.desktop/com.sun.beans.util=ALL-UNNAMED", addopens_count++);
}
diff --git a/src/java.desktop/share/classes/com/sun/beans/introspect/package-info.java b/src/java.desktop/share/classes/com/sun/beans/introspect/package-info.java
new file mode 100644
index 00000000000..6636e4dd62a
--- /dev/null
+++ b/src/java.desktop/share/classes/com/sun/beans/introspect/package-info.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 1998, 2017, 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 com.sun.beans.introspect;
diff --git a/src/java.desktop/share/classes/com/sun/beans/package-info.java b/src/java.desktop/share/classes/com/sun/beans/package-info.java
new file mode 100644
index 00000000000..5c097eeaa53
--- /dev/null
+++ b/src/java.desktop/share/classes/com/sun/beans/package-info.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 1998, 2017, 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 com.sun.beans;
diff --git a/src/java.desktop/share/classes/com/sun/beans/util/package-info.java b/src/java.desktop/share/classes/com/sun/beans/util/package-info.java
new file mode 100644
index 00000000000..2d5d735ffa8
--- /dev/null
+++ b/src/java.desktop/share/classes/com/sun/beans/util/package-info.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 1998, 2017, 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 com.sun.beans.util;
diff --git a/src/java.desktop/share/classes/module-info.java b/src/java.desktop/share/classes/module-info.java
index f9cf021311f..e61ba7572cf 100644
--- a/src/java.desktop/share/classes/module-info.java
+++ b/src/java.desktop/share/classes/module-info.java
@@ -104,6 +104,9 @@ module java.desktop {
exports javax.swing.text.rtf;
exports javax.swing.tree;
exports javax.swing.undo;
+ exports com.sun.beans;
+ exports com.sun.beans.introspect;
+ exports com.sun.beans.util;
// qualified exports may be inserted at build time
// see make/GensrcModuleInfo.gmk
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,29 @@
From 9a662b1367860920095efe79116ef9a2d53fc2c6 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
Date: Sun, 17 May 2020 12:19:18 +0200
Subject: [PATCH 37/50] Skip verifier only in AllowEnhancedClassRedefinition
---
src/hotspot/share/oops/instanceKlass.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
index c04bdf5abfc..e14aaee21c4 100644
--- a/src/hotspot/share/oops/instanceKlass.cpp
+++ b/src/hotspot/share/oops/instanceKlass.cpp
@@ -788,10 +788,10 @@ bool InstanceKlass::link_class_impl(bool throw_verifyerror, TRAPS) {
if (!is_linked()) {
if (!is_rewritten()) {
- // In cases, if class A is being redefined and class B->A (B is extended from A) and B is host class of anonymous class C
+ // (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 (!newest_version()->is_redefining()) {
+ if (!AllowEnhancedClassRedefinition || !newest_version()->is_redefining()) {
bool verify_ok = verify_code(throw_verifyerror, THREAD);
if (!verify_ok) {
return false;
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,98 @@
From a58ed678218bfb80af164cfe98cdf4a3ab74a682 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
Date: Sun, 17 May 2020 18:18:52 +0200
Subject: [PATCH 38/50] Use original code for adjust_method_entries in standard
redefinition
---
.../prims/jvmtiEnhancedRedefineClasses.cpp | 2 +-
.../share/prims/resolvedMethodTable.cpp | 46 ++++++++++++++++++-
.../share/prims/resolvedMethodTable.hpp | 1 +
3 files changed, 47 insertions(+), 2 deletions(-)
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index 660bf3a2e97..0ca675e8ee6 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -506,7 +506,7 @@ void VM_EnhancedRedefineClasses::doit() {
// JSR-292 support
if (_any_class_has_resolved_methods) {
bool trace_name_printed = false;
- ResolvedMethodTable::adjust_method_entries(&trace_name_printed);
+ ResolvedMethodTable::adjust_method_entries_dcevm(&trace_name_printed);
}
ChangePointersOopClosure<StoreNoBarrier> oopClosureNoBarrier;
diff --git a/src/hotspot/share/prims/resolvedMethodTable.cpp b/src/hotspot/share/prims/resolvedMethodTable.cpp
index a9057893368..af2ec48c2e1 100644
--- a/src/hotspot/share/prims/resolvedMethodTable.cpp
+++ b/src/hotspot/share/prims/resolvedMethodTable.cpp
@@ -197,8 +197,52 @@ void ResolvedMethodTable::print() {
#endif // PRODUCT
#if INCLUDE_JVMTI
-// It is called at safepoint only for RedefineClasses
+
void ResolvedMethodTable::adjust_method_entries(bool * trace_name_printed) {
+ assert(SafepointSynchronize::is_at_safepoint(), "only called at safepoint");
+ // For each entry in RMT, change to new method
+ for (int i = 0; i < _the_table->table_size(); ++i) {
+ for (ResolvedMethodEntry* entry = _the_table->bucket(i);
+ entry != NULL;
+ entry = entry->next()) {
+
+ oop mem_name = entry->object_no_keepalive();
+ // except ones removed
+ if (mem_name == NULL) {
+ continue;
+ }
+ Method* old_method = (Method*)java_lang_invoke_ResolvedMethodName::vmtarget(mem_name);
+
+ if (old_method->is_old()) {
+
+ Method* new_method;
+ if (old_method->is_deleted()) {
+ new_method = Universe::throw_no_such_method_error();
+ } else {
+ InstanceKlass* holder = old_method->method_holder();
+ new_method = holder->method_with_idnum(old_method->orig_method_idnum());
+ assert(holder == new_method->method_holder(), "call after swapping redefined guts");
+ assert(new_method != NULL, "method_with_idnum() should not be NULL");
+ assert(old_method != new_method, "sanity check");
+ }
+
+ java_lang_invoke_ResolvedMethodName::set_vmtarget(mem_name, new_method);
+
+ ResourceMark rm;
+ if (!(*trace_name_printed)) {
+ log_info(redefine, class, update)("adjust: name=%s", old_method->method_holder()->external_name());
+ *trace_name_printed = true;
+ }
+ log_debug(redefine, class, update, constantpool)
+ ("ResolvedMethod method update: %s(%s)",
+ new_method->name()->as_C_string(), new_method->signature()->as_C_string());
+ }
+ }
+ }
+}
+
+// (DCEVM) It is called at safepoint only for RedefineClasses
+void ResolvedMethodTable::adjust_method_entries_dcevm(bool * trace_name_printed) {
assert(SafepointSynchronize::is_at_safepoint(), "only called at safepoint");
// For each entry in RMT, change to new method
GrowableArray<oop>* oops_to_add = new GrowableArray<oop>();
diff --git a/src/hotspot/share/prims/resolvedMethodTable.hpp b/src/hotspot/share/prims/resolvedMethodTable.hpp
index 841ae4ae585..543d4ffa485 100644
--- a/src/hotspot/share/prims/resolvedMethodTable.hpp
+++ b/src/hotspot/share/prims/resolvedMethodTable.hpp
@@ -93,6 +93,7 @@ public:
#if INCLUDE_JVMTI
// It is called at safepoint only for RedefineClasses
static void adjust_method_entries(bool * trace_name_printed);
+ static void adjust_method_entries_dcevm(bool * trace_name_printed);
#endif // INCLUDE_JVMTI
// Cleanup cleared entries
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,54 @@
From c1e814f2f7d4f2b37abd667d0bec516474f2a119 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
Date: Tue, 19 May 2020 09:41:36 +0200
Subject: [PATCH 39/50] Revert code for !AllowEnhancedClassRedefinition
---
.../share/classfile/classLoaderData.cpp | 23 ++++++++++---------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/src/hotspot/share/classfile/classLoaderData.cpp b/src/hotspot/share/classfile/classLoaderData.cpp
index 25103fff2c0..f5b877b432b 100644
--- a/src/hotspot/share/classfile/classLoaderData.cpp
+++ b/src/hotspot/share/classfile/classLoaderData.cpp
@@ -1387,12 +1387,13 @@ bool ClassLoaderDataGraph::do_unloading(bool clean_previous_versions) {
// Klassesoto delete.
// FIXME: dcevm - block asserts in MetadataOnStackMark
- /*
- bool walk_all_metadata = clean_previous_versions &&
- JvmtiExport::has_redefined_a_class() &&
- InstanceKlass::has_previous_versions_and_reset();
- MetadataOnStackMark md_on_stack(walk_all_metadata);
- */
+ bool walk_all_metadata = false;
+ if (!AllowEnhancedClassRedefinition) {
+ walk_all_metadata = clean_previous_versions &&
+ JvmtiExport::has_redefined_a_class() &&
+ InstanceKlass::has_previous_versions_and_reset();
+ MetadataOnStackMark md_on_stack(walk_all_metadata);
+ }
// Save previous _unloading pointer for CMS which may add to unloading list before
// purging and we don't want to rewalk the previously unloaded class loader data.
@@ -1402,12 +1403,12 @@ bool ClassLoaderDataGraph::do_unloading(bool clean_previous_versions) {
while (data != NULL) {
if (data->is_alive()) {
// clean metaspace
- /*
- if (walk_all_metadata) {
- data->classes_do(InstanceKlass::purge_previous_versions);
+ if (!AllowEnhancedClassRedefinition) {
+ if (walk_all_metadata) {
+ data->classes_do(InstanceKlass::purge_previous_versions);
+ }
+ data->free_deallocate_list();
}
- data->free_deallocate_list();
- */
prev = data;
data = data->next();
loaders_processed++;
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,278 @@
From 5b36c4798869c5cd4d65f7765a8447b9cf09d76b Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
Date: Tue, 19 May 2020 09:29:39 +0200
Subject: [PATCH 40/50] Code cleanup
---
src/hotspot/share/classfile/classFileParser.cpp | 4 +++-
src/hotspot/share/classfile/classFileParser.hpp | 2 +-
src/hotspot/share/classfile/classLoaderData.cpp | 2 ++
src/hotspot/share/classfile/dictionary.cpp | 4 ++++
src/hotspot/share/classfile/dictionary.hpp | 1 +
src/hotspot/share/classfile/loaderConstraints.cpp | 3 ++-
src/hotspot/share/classfile/systemDictionary.cpp | 8 +++++---
src/hotspot/share/interpreter/linkResolver.cpp | 1 +
src/hotspot/share/memory/universe.cpp | 4 ++--
src/hotspot/share/oops/instanceKlass.cpp | 13 ++++++++-----
10 files changed, 29 insertions(+), 13 deletions(-)
diff --git a/src/hotspot/share/classfile/classFileParser.cpp b/src/hotspot/share/classfile/classFileParser.cpp
index ea150df9104..c2cd35da4e6 100644
--- a/src/hotspot/share/classfile/classFileParser.cpp
+++ b/src/hotspot/share/classfile/classFileParser.cpp
@@ -954,6 +954,7 @@ void ClassFileParser::parse_interfaces(const ClassFileStream* const stream,
CHECK);
}
+ // (DCEVM) pick newest
interf = (Klass *) maybe_newest(interf);
if (!interf->is_interface()) {
@@ -3749,6 +3750,7 @@ const InstanceKlass* ClassFileParser::parse_super_class(ConstantPool* const cp,
// However, make sure it is not an array type.
bool is_array = false;
if (cp->tag_at(super_class_index).is_klass()) {
+ // (DCEVM) pick newest
super_klass = InstanceKlass::cast(maybe_newest(cp->resolved_klass_at(super_class_index)));
if (need_verify)
is_array = super_klass->is_array_klass();
@@ -4417,7 +4419,7 @@ void ClassFileParser::set_precomputed_flags(InstanceKlass* ik) {
if (!_has_empty_finalizer) {
if (_has_finalizer ||
(super != NULL && super->has_finalizer())) {
- // FIXME - condition from previous DCEVM version, however after reload new finelize() method is not active
+ // FIXME - (DCEVM) this is condition from previous DCEVM version, however after reload a new finalize() method is not active
if (ik->old_version() == NULL || ik->old_version()->has_finalizer()) {
ik->set_has_finalizer();
}
diff --git a/src/hotspot/share/classfile/classFileParser.hpp b/src/hotspot/share/classfile/classFileParser.hpp
index 3db14b678f3..93ed54d8f70 100644
--- a/src/hotspot/share/classfile/classFileParser.hpp
+++ b/src/hotspot/share/classfile/classFileParser.hpp
@@ -499,7 +499,7 @@ class ClassFileParser {
FieldLayoutInfo* info,
TRAPS);
- // Enhanced class redefinition
+ // (DCEVM) Enhanced class redefinition
inline const Klass* maybe_newest(const Klass* klass) const { return klass != NULL && _pick_newest ? klass->newest_version() : klass; }
public:
diff --git a/src/hotspot/share/classfile/classLoaderData.cpp b/src/hotspot/share/classfile/classLoaderData.cpp
index f5b877b432b..ab2615da0ed 100644
--- a/src/hotspot/share/classfile/classLoaderData.cpp
+++ b/src/hotspot/share/classfile/classLoaderData.cpp
@@ -1242,6 +1242,7 @@ void ClassLoaderDataGraph::dictionary_classes_do(void f(InstanceKlass*)) {
}
}
+// (DCEVM) - iterate over dict classes
void ClassLoaderDataGraph::dictionary_classes_do(KlassClosure* klass_closure) {
FOR_ALL_DICTIONARY(cld) {
cld->dictionary()->classes_do(klass_closure);
@@ -1257,6 +1258,7 @@ void ClassLoaderDataGraph::dictionary_classes_do(void f(InstanceKlass*, TRAPS),
}
}
+// (DCEVM) rollback redefined classes
void ClassLoaderDataGraph::rollback_redefinition() {
FOR_ALL_DICTIONARY(cld) {
cld->dictionary()->rollback_redefinition();
diff --git a/src/hotspot/share/classfile/dictionary.cpp b/src/hotspot/share/classfile/dictionary.cpp
index 118730f1b83..dda5188c370 100644
--- a/src/hotspot/share/classfile/dictionary.cpp
+++ b/src/hotspot/share/classfile/dictionary.cpp
@@ -245,6 +245,8 @@ void Dictionary::classes_do(void f(InstanceKlass*)) {
}
}
+
+// (DCEVM) iterate over dict entry
void Dictionary::classes_do(KlassClosure* closure) {
for (int index = 0; index < table_size(); index++) {
for (DictionaryEntry* probe = bucket(index);
@@ -342,6 +344,7 @@ DictionaryEntry* Dictionary::get_entry(int index, unsigned int hash,
return NULL;
}
+// (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) {
// 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;
@@ -356,6 +359,7 @@ bool Dictionary::update_klass(unsigned int hash, Symbol* name, ClassLoaderData*
return found;
}
+// (DCEVM) rollback redefinition
void Dictionary::rollback_redefinition() {
for (int index = 0; index < table_size(); index++) {
for (DictionaryEntry* entry = bucket(index);
diff --git a/src/hotspot/share/classfile/dictionary.hpp b/src/hotspot/share/classfile/dictionary.hpp
index fd4b134d7a7..5eaa741d500 100644
--- a/src/hotspot/share/classfile/dictionary.hpp
+++ b/src/hotspot/share/classfile/dictionary.hpp
@@ -119,6 +119,7 @@ public:
void rollback_redefinition();
+ // (DCEVM) return old class if redefining in AllowEnhancedClassRedefinition, otherwise return "k"
static InstanceKlass* old_if_redefined(InstanceKlass* k) {
return (k != NULL && k->is_redefining()) ? ((InstanceKlass* )k->old_version()) : k;
}
diff --git a/src/hotspot/share/classfile/loaderConstraints.cpp b/src/hotspot/share/classfile/loaderConstraints.cpp
index e4a23e8a27c..bca73b5e0dc 100644
--- a/src/hotspot/share/classfile/loaderConstraints.cpp
+++ b/src/hotspot/share/classfile/loaderConstraints.cpp
@@ -4,7 +4,7 @@
*
* 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.
+ * published by the Free Software Foundation) replace old_class by new class in dictionary.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@@ -87,6 +87,7 @@ LoaderConstraintEntry** LoaderConstraintTable::find_loader_constraint(
return pp;
}
+// (DCEVM) update constraint entries to new classes, called from dcevm redefinition code only
void LoaderConstraintTable::update_after_redefinition() {
for (int index = 0; index < table_size(); index++) {
LoaderConstraintEntry** p = bucket_addr(index);
diff --git a/src/hotspot/share/classfile/systemDictionary.cpp b/src/hotspot/share/classfile/systemDictionary.cpp
index 9dbd6cc9c12..e70865109dd 100644
--- a/src/hotspot/share/classfile/systemDictionary.cpp
+++ b/src/hotspot/share/classfile/systemDictionary.cpp
@@ -876,7 +876,8 @@ Klass* SystemDictionary::resolve_instance_class_or_null(Symbol* name,
ClassLoaderData* loader_data = k->class_loader_data();
MutexLocker mu(SystemDictionary_lock, THREAD);
Klass* kk = find_class(name, loader_data);
- // FIXME: (kk == k() && !k->is_redefining()) || (k->is_redefining() && kk == k->old_version())
+ // FIXME: (DCEVM)
+ // assert(kk == k() && !k->is_redefining()) || (k->is_redefining() && kk == k->old_version())
assert(kk == k, "should be present in dictionary");
}
#endif
@@ -1083,7 +1084,7 @@ InstanceKlass* SystemDictionary::resolve_from_stream(Symbol* class_name,
InstanceKlass* k = NULL;
#if INCLUDE_CDS
- // FIXME: what to do during redefinition?
+ // FIXME: (DCEVM) what to do during redefinition?
if (!DumpSharedSpaces) {
k = SystemDictionaryShared::lookup_from_stream(class_name,
class_loader,
@@ -1836,7 +1837,7 @@ void SystemDictionary::add_to_hierarchy(InstanceKlass* k, TRAPS) {
CodeCache::flush_dependents_on(k);
}
-// Enhanced class redefinition
+// (DCEVM) - remove from klass hierarchy
void SystemDictionary::remove_from_hierarchy(InstanceKlass* k) {
assert(k != NULL, "just checking");
@@ -1844,6 +1845,7 @@ void SystemDictionary::remove_from_hierarchy(InstanceKlass* k) {
k->remove_from_sibling_list();
}
+// (DCEVM)
void SystemDictionary::update_constraints_after_redefinition() {
constraints()->update_after_redefinition();
}
diff --git a/src/hotspot/share/interpreter/linkResolver.cpp b/src/hotspot/share/interpreter/linkResolver.cpp
index cb76d2ef50c..9dc184d02f5 100644
--- a/src/hotspot/share/interpreter/linkResolver.cpp
+++ b/src/hotspot/share/interpreter/linkResolver.cpp
@@ -1384,6 +1384,7 @@ void LinkResolver::runtime_resolve_virtual_method(CallInfo& result,
assert(resolved_method->can_be_statically_bound(), "cannot override this method");
selected_method = resolved_method;
} else {
+ // TODO: (DCEVM) explain
assert(recv_klass->is_subtype_of(resolved_method->method_holder()), "receiver and resolved method holder are inconsistent");
selected_method = methodHandle(THREAD, recv_klass->method_at_vtable(vtable_index));
}
diff --git a/src/hotspot/share/memory/universe.cpp b/src/hotspot/share/memory/universe.cpp
index 7ecb950b231..d0a6d665aa0 100644
--- a/src/hotspot/share/memory/universe.cpp
+++ b/src/hotspot/share/memory/universe.cpp
@@ -176,7 +176,7 @@ void Universe::basic_type_classes_do(void f(Klass*)) {
f(doubleArrayKlassObj());
}
-// FIXME: This method should iterate all pointers that are not within heap objects.
+// 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 {
@@ -203,7 +203,7 @@ void Universe::root_oops_do(OopClosure *oopClosure) {
CodeBlobToOopClosure blobClosure(oopClosure, CodeBlobToOopClosure::FixRelocations);
CodeCache::blobs_do(&blobClosure);
StringTable::oops_do(oopClosure);
-
+
// (DCEVM) TODO: Check if this is correct?
//CodeCache::scavenge_root_nmethods_oops_do(oopClosure);
//Management::oops_do(oopClosure);
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
index e14aaee21c4..c860371d2fc 100644
--- a/src/hotspot/share/oops/instanceKlass.cpp
+++ b/src/hotspot/share/oops/instanceKlass.cpp
@@ -1139,6 +1139,7 @@ void InstanceKlass::init_implementor() {
}
}
+// (DCEVM) - init_implementor() for dcevm
void InstanceKlass::init_implementor_from_redefine() {
assert(is_interface(), "not interface");
Klass** addr = adr_implementor();
@@ -1209,6 +1210,8 @@ bool InstanceKlass::implements_interface(Klass* k) const {
return false;
}
+
+// (DCEVM)
bool InstanceKlass::implements_interface_any_version(Klass* k) const {
k = k->newest_version();
if (this->newest_version() == k) return true;
@@ -1491,10 +1494,8 @@ void InstanceKlass::methods_do(void f(Method* method)) {
}
}
-/**
- 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.
-*/
+// (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) {
int *arr = NEW_C_HEAP_ARRAY(int, values.length(), mtClass);
for (int i = 0; i < values.length(); i++) {
@@ -2162,6 +2163,7 @@ void InstanceKlass::add_dependent_nmethod(nmethod* nm) {
dependencies().add_dependent_nmethod(nm);
}
+// DCEVM - update jmethod ids
bool InstanceKlass::update_jmethod_id(Method* method, jmethodID newMethodID) {
size_t idnum = (size_t)method->method_idnum();
jmethodID* jmeths = methods_jmethod_ids_acquire();
@@ -2177,7 +2179,7 @@ bool InstanceKlass::update_jmethod_id(Method* method, jmethodID newMethodID) {
void InstanceKlass::remove_dependent_nmethod(nmethod* nm, bool delete_immediately) {
dependencies().remove_dependent_nmethod(nm, delete_immediately);
- // (DCEVM) Hack as dependencies get wrong version of Klass*
+ // FIXME: (DCEVM) Hack as dependencies get wrong version of Klass*
// if (this->old_version() != NULL) {
// InstanceKlass::cast(this->old_version())->remove_dependent_nmethod(nm, true);
// return;
@@ -3594,6 +3596,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");
}
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,36 @@
From 71f35c41b569f72a1674ccd57118c4fe76ba3d68 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
Date: Tue, 19 May 2020 10:31:15 +0200
Subject: [PATCH 41/50] Activate cpCache definition asserts for !dcevm
---
src/hotspot/share/oops/cpCache.cpp | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/hotspot/share/oops/cpCache.cpp b/src/hotspot/share/oops/cpCache.cpp
index 47040d51f0c..4318df227d1 100644
--- a/src/hotspot/share/oops/cpCache.cpp
+++ b/src/hotspot/share/oops/cpCache.cpp
@@ -436,8 +436,7 @@ void ConstantPoolCacheEntry::set_method_handle_common(const constantPoolHandle&
if (has_appendix) {
const int appendix_index = f2_as_index() + _indy_resolved_references_appendix_offset;
assert(appendix_index >= 0 && appendix_index < resolved_references->length(), "oob");
- // FIXME (DCEVM) relaxing for now...
- //assert(resolved_references->obj_at(appendix_index) == NULL, "init just once");
+ assert(AllowEnhancedClassRedefinition || resolved_references->obj_at(appendix_index) == NULL, "init just once");
resolved_references->obj_at_put(appendix_index, appendix());
}
@@ -445,8 +444,7 @@ void ConstantPoolCacheEntry::set_method_handle_common(const constantPoolHandle&
if (has_method_type) {
const int method_type_index = f2_as_index() + _indy_resolved_references_method_type_offset;
assert(method_type_index >= 0 && method_type_index < resolved_references->length(), "oob");
- // FIXME (DCEVM) relaxing for now...
- //assert(resolved_references->obj_at(method_type_index) == NULL, "init just once");
+ assert(AllowEnhancedClassRedefinition || resolved_references->obj_at(method_type_index) == NULL, "init just once");
resolved_references->obj_at_put(method_type_index, method_type());
}
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,29 @@
From 961018a29ddb7eba96aca7fbc385f3c4f29e3a03 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
Date: Tue, 19 May 2020 10:54:38 +0200
Subject: [PATCH 42/50] iterate old method version only in dcevm
---
src/hotspot/share/prims/jvmtiImpl.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/hotspot/share/prims/jvmtiImpl.cpp b/src/hotspot/share/prims/jvmtiImpl.cpp
index 2a92ece916e..d2044541d38 100644
--- a/src/hotspot/share/prims/jvmtiImpl.cpp
+++ b/src/hotspot/share/prims/jvmtiImpl.cpp
@@ -294,8 +294,10 @@ void JvmtiBreakpoint::each_method_version_do(method_action meth_act) {
Symbol* m_signature = _method->signature();
// (DCEVM) Go through old versions of method
- for (Method* m = _method->old_version(); m != NULL; m = m->old_version()) {
- (m->*meth_act)(_bci);
+ if (AllowEnhancedClassRedefinition) {
+ for (Method* m = _method->old_version(); m != NULL; m = m->old_version()) {
+ (m->*meth_act)(_bci);
+ }
}
// search previous versions if they exist
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,258 @@
From 2ab70b495c43c4699ad402a714710566400de99d Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
Date: Fri, 22 May 2020 21:23:01 +0200
Subject: [PATCH 43/50] Support for Lambda class redefinition
---
.../share/classfile/classLoaderData.cpp | 9 +++
.../share/classfile/classLoaderData.hpp | 1 +
.../share/classfile/systemDictionary.cpp | 12 +++-
.../share/classfile/systemDictionary.hpp | 2 +
.../prims/jvmtiEnhancedRedefineClasses.cpp | 65 +++++++++++++++++--
.../prims/jvmtiEnhancedRedefineClasses.hpp | 1 +
.../share/prims/resolvedMethodTable.cpp | 4 +-
src/hotspot/share/prims/unsafe.cpp | 1 +
8 files changed, 85 insertions(+), 10 deletions(-)
diff --git a/src/hotspot/share/classfile/classLoaderData.cpp b/src/hotspot/share/classfile/classLoaderData.cpp
index ab2615da0ed..1bc67adf5a7 100644
--- a/src/hotspot/share/classfile/classLoaderData.cpp
+++ b/src/hotspot/share/classfile/classLoaderData.cpp
@@ -663,6 +663,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 7e357929971..00a84610b43 100644
--- a/src/hotspot/share/classfile/classLoaderData.hpp
+++ b/src/hotspot/share/classfile/classLoaderData.hpp
@@ -292,6 +292,7 @@ class ClassLoaderData : public CHeapObj<mtClass> {
void accumulate_modified_oops() { if (has_modified_oops()) _accumulated_modified_oops = true; }
void clear_accumulated_modified_oops() { _accumulated_modified_oops = false; }
bool has_accumulated_modified_oops() { return _accumulated_modified_oops; }
+ void exchange_holders(ClassLoaderData* cld);
private:
void unload();
diff --git a/src/hotspot/share/classfile/systemDictionary.cpp b/src/hotspot/share/classfile/systemDictionary.cpp
index e70865109dd..cc9f1fa7831 100644
--- a/src/hotspot/share/classfile/systemDictionary.cpp
+++ b/src/hotspot/share/classfile/systemDictionary.cpp
@@ -971,12 +971,16 @@ InstanceKlass* SystemDictionary::parse_stream(Symbol* class_name,
Handle protection_domain,
ClassFileStream* st,
const InstanceKlass* host_klass,
+ InstanceKlass* old_klass,
GrowableArray<Handle>* cp_patches,
TRAPS) {
EventClassLoad class_load_start_event;
ClassLoaderData* loader_data;
+
+ bool is_redefining = (old_klass != NULL);
+
if (host_klass != NULL) {
// Create a new CLD for anonymous class, that uses the same class loader
// as the host_klass
@@ -1000,8 +1004,12 @@ InstanceKlass* SystemDictionary::parse_stream(Symbol* class_name,
protection_domain,
host_klass,
cp_patches,
- false, // pick_newest
+ is_redefining, // pick_newest
CHECK_NULL);
+ if (is_redefining && k != NULL) {
+ k->set_redefining(true);
+ k->set_old_version(old_klass);
+ }
if (host_klass != NULL && k != NULL) {
// Anonymous classes must update ClassLoaderData holder (was host_klass loader)
@@ -1845,7 +1853,7 @@ void SystemDictionary::remove_from_hierarchy(InstanceKlass* k) {
k->remove_from_sibling_list();
}
-// (DCEVM)
+// (DCEVM)
void SystemDictionary::update_constraints_after_redefinition() {
constraints()->update_after_redefinition();
}
diff --git a/src/hotspot/share/classfile/systemDictionary.hpp b/src/hotspot/share/classfile/systemDictionary.hpp
index 717f34ce9a0..dc111846c12 100644
--- a/src/hotspot/share/classfile/systemDictionary.hpp
+++ b/src/hotspot/share/classfile/systemDictionary.hpp
@@ -301,6 +301,7 @@ public:
protection_domain,
st,
NULL, // host klass
+ NULL, // old class
NULL, // cp_patches
THREAD);
}
@@ -309,6 +310,7 @@ public:
Handle protection_domain,
ClassFileStream* st,
const InstanceKlass* host_klass,
+ InstanceKlass* old_klass,
GrowableArray<Handle>* cp_patches,
TRAPS);
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index 0ca675e8ee6..08fe42d5c28 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -503,6 +503,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;
@@ -774,12 +776,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();
@@ -1469,6 +1493,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];
@@ -2018,7 +2066,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 ed44f0e27ce..7e2afd49650 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
@@ -119,6 +119,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 af2ec48c2e1..7741328979f 100644
--- a/src/hotspot/share/prims/resolvedMethodTable.cpp
+++ b/src/hotspot/share/prims/resolvedMethodTable.cpp
@@ -200,7 +200,7 @@ void ResolvedMethodTable::print() {
void ResolvedMethodTable::adjust_method_entries(bool * trace_name_printed) {
assert(SafepointSynchronize::is_at_safepoint(), "only called at safepoint");
- // For each entry in RMT, change to new method
+ // For each entry in RMT, change to new methodadjust_method_entries_dcevm
for (int i = 0; i < _the_table->table_size(); ++i) {
for (ResolvedMethodEntry* entry = _the_table->bucket(i);
entry != NULL;
@@ -271,6 +271,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");
diff --git a/src/hotspot/share/prims/unsafe.cpp b/src/hotspot/share/prims/unsafe.cpp
index 2f14e01ce0d..d0e0367d8eb 100644
--- a/src/hotspot/share/prims/unsafe.cpp
+++ b/src/hotspot/share/prims/unsafe.cpp
@@ -818,6 +818,7 @@ Unsafe_DefineAnonymousClass_impl(JNIEnv *env,
host_domain,
&st,
InstanceKlass::cast(host_klass),
+ NULL,
cp_patches,
CHECK_NULL);
if (anonk == NULL) {
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,34 @@
From 3f53bb48682b17cfbf4781d4fa47055be88baea0 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
Date: Fri, 22 May 2020 21:43:22 +0200
Subject: [PATCH 44/50] Skip GC runs for redefinitions without instance size
change
---
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 08fe42d5c28..a785a43d352 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -578,14 +578,14 @@ void VM_EnhancedRedefineClasses::doit() {
}
}
-// if (objectClosure.needs_instance_update()) {
+ if (objectClosure.needs_instance_update()) {
// Do a full garbage collection to update the instance sizes accordingly
Universe::set_redefining_gc_run(true);
notify_gc_begin(true);
Universe::heap()->collect_as_vm_thread(GCCause::_heap_inspection);
notify_gc_end();
Universe::set_redefining_gc_run(false);
-// }
+ }
// Unmark Klass*s as "redefining"
for (int i = 0; i < _new_classes->length(); i++) {
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,135 @@
From d0d6602fe3d664cb2322d7066bf46fa7e20d5d4e Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
Date: Sat, 23 May 2020 10:02:15 +0200
Subject: [PATCH 45/50] Fix "no original bytecode found" error if method with
bkp is missing
Sometimes IDE can deploy class with erroneous method, such method has
no 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 e377e36b88c..262ecc021b2 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 f367e658879..71bbd15a4f5 100644
--- a/src/hotspot/share/interpreter/interpreterRuntime.cpp
+++ b/src/hotspot/share/interpreter/interpreterRuntime.cpp
@@ -834,7 +834,7 @@ IRT_END
// Invokes
IRT_ENTRY(Bytecodes::Code, InterpreterRuntime::get_original_bytecode_at(JavaThread* thread, Method* method, address bcp))
- return method->orig_bytecode_at(method->bci_from(bcp));
+ return method->orig_bytecode_at(method->bci_from(bcp), false);
IRT_END
IRT_ENTRY(void, InterpreterRuntime::set_original_bytecode_at(JavaThread* thread, 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 bee69f9cec6..f1e22db70d6 100644
--- a/src/hotspot/share/oops/method.cpp
+++ b/src/hotspot/share/oops/method.cpp
@@ -1747,14 +1747,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);
}
@@ -1900,7 +1900,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;
}
@@ -1909,7 +1909,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 4533476ff8f..193e1845b23 100644
--- a/src/hotspot/share/oops/method.hpp
+++ b/src/hotspot/share/oops/method.hpp
@@ -230,7 +230,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;
}
@@ -239,7 +239,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 a785a43d352..2321483dcbd 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -1389,14 +1389,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.24.3 (Apple Git-128)

View File

@@ -0,0 +1,421 @@
From 585f1cb56766be837a34114b1ee5c743aa4e6801 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
Date: Sat, 23 May 2020 10:17:56 +0200
Subject: [PATCH 46/50] Fix comments according hotspot formatting conventions
---
.../prims/jvmtiEnhancedRedefineClasses.cpp | 191 +++++++-----------
.../prims/jvmtiEnhancedRedefineClasses.hpp | 41 ++--
2 files changed, 90 insertions(+), 142 deletions(-)
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index 2321483dcbd..8d00203fd9a 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -67,21 +67,19 @@ int VM_EnhancedRedefineClasses::_deleted_methods_length = 0;
int VM_EnhancedRedefineClasses::_added_methods_length = 0;
Klass* VM_EnhancedRedefineClasses::_the_class_oop = NULL;
-/**
- * Create new instance of enhanced class redefiner.
- *
- * This class implements VM_GC_Operation - the usual usage should be:
- * VM_EnhancedRedefineClasses op(class_count, class_definitions, jvmti_class_load_kind_redefine);
- * VMThread::execute(&op);
- * Which
- *
- * @param class_count size of class_defs
- * @param class_defs class definition - either new class or redefined class
- * note that this is not the final array of classes to be redefined
- * we need to scan for all affected classes (e.g. subclasses) and
- * caculcate redefinition for them as well.
- * @param class_load_kind always jvmti_class_load_kind_redefine
- */
+//
+// Create new instance of enhanced class redefiner.
+//
+// This class implements VM_GC_Operation - the usual usage should be:
+// VM_EnhancedRedefineClasses op(class_count, class_definitions, jvmti_class_load_kind_redefine);
+// VMThread::execute(&op);
+// Which
+// - class_count size of class_defs
+// - class_defs class definition - either new class or redefined class
+// note that this is not the final array of classes to be redefined
+// we need to scan for all affected classes (e.g. subclasses) and
+// caculcate redefinition for them as well.
+// @param class_load_kind always jvmti_class_load_kind_redefine
VM_EnhancedRedefineClasses::VM_EnhancedRedefineClasses(jint class_count, const jvmtiClassDefinition *class_defs, JvmtiClassLoadKind class_load_kind) :
VM_GC_Operation(Universe::heap()->total_collections(), GCCause::_heap_inspection, Universe::heap()->total_full_collections(), true) {
_affected_klasses = NULL;
@@ -97,12 +95,10 @@ static inline InstanceKlass* get_ik(jclass def) {
return InstanceKlass::cast(java_lang_Class::as_Klass(mirror));
}
-/**
- * Start the redefinition:
- * - Load new class definitions - @see load_new_class_versions
- * - Start mark&sweep GC.
- * @return true if success, otherwise all chnages are rollbacked.
- */
+// Start the redefinition:
+// - Load new class definitions - @see load_new_class_versions
+// - Start mark&sweep GC.
+// - true if success, otherwise all chnages are rollbacked.
bool VM_EnhancedRedefineClasses::doit_prologue() {
if (_class_count == 0) {
@@ -175,9 +171,7 @@ bool VM_EnhancedRedefineClasses::doit_prologue() {
return true;
}
-/**
- * Closer for static fields - copy value from old class to the new class.
- */
+// Closer for static fields - copy value from old class to the new class.
class FieldCopier : public FieldClosure {
public:
void do_field(fieldDescriptor* fd) {
@@ -236,9 +230,7 @@ struct StoreNoBarrier {
template <class T> static void oop_store(T* p) { RawAccess<>::oop_store(p, oop(NULL)); }
};
-/**
- Closure to scan all heap objects and update method handles
-*/
+// Closure to scan all heap objects and update method handles
template <class S>
class ChangePointersOopClosure : public BasicOopIterateClosure {
// import java_lang_invoke_MemberName.*
@@ -247,7 +239,6 @@ class ChangePointersOopClosure : public BasicOopIterateClosure {
REFERENCE_KIND_MASK = java_lang_invoke_MemberName::MN_REFERENCE_KIND_MASK,
};
-
bool update_member_name(oop obj) {
int flags = java_lang_invoke_MemberName::flags(obj);
int ref_kind = (flags >> REFERENCE_KIND_SHIFT) & REFERENCE_KIND_MASK;
@@ -382,14 +373,12 @@ class ChangePointersOopClosure : public BasicOopIterateClosure {
}
};
-/**
- * Closure to scan all objects on heap for objects of changed classes
- * - if the fields are compatible, only update class definition reference
- * - otherwise if the new object size is smaller then old size, reshufle
- * the fields and fill the gap with "dead_space"
- * - otherwise set the _needs_instance_update flag, we need to do full GC
- * and reshuffle object positions durring mark&sweep
- */
+// Closure to scan all objects on heap for objects of changed classes
+// - if the fields are compatible, only update class definition reference
+// - otherwise if the new object size is smaller then old size, reshufle
+// the fields and fill the gap with "dead_space"
+// - otherwise set the _needs_instance_update flag, we need to do full GC
+// and reshuffle object positions durring mark&sweep
class ChangePointersObjectClosure : public ObjectClosure {
private:
@@ -451,19 +440,16 @@ public:
};
-/**
- Main transformation method - runs in VM thread.
-
- - UseSharedSpaces - TODO what does it mean?
- - for each sratch class call redefine_single_class
- - clear code cache (flush_dependent_code)
- - iterate the heap and update object defintions, check it old/new class fields
- are compatible. If new class size is smaller then old, it can be solved directly here.
- - iterate the heap and update method handles to new version
- - Swap marks to have same hashcodes
- - copy static fields
- - notify JVM of the modification
-*/
+// Main transformation method - runs in VM thread.
+// - UseSharedSpaces - TODO what does it mean?
+// - for each sratch class call redefine_single_class
+// - clear code cache (flush_dependent_code)
+// - iterate the heap and update object defintions, check it old/new class fields
+// are compatible. If new class size is smaller then old, it can be solved directly here.
+// - iterate the heap and update method handles to new version
+// - Swap marks to have same hashcodes
+// - copy static fields
+// - notify JVM of the modification
void VM_EnhancedRedefineClasses::doit() {
Thread *thread = Thread::current();
@@ -634,11 +620,9 @@ void VM_EnhancedRedefineClasses::doit() {
}
-/**
- * Cleanup - runs in JVM thread
- * - free used memory
- * - end GC
- */
+// Cleanup - runs in JVM thread
+// - free used memory
+// - end GC
void VM_EnhancedRedefineClasses::doit_epilogue() {
VM_GC_Operation::doit_epilogue();
@@ -670,11 +654,9 @@ void VM_EnhancedRedefineClasses::doit_epilogue() {
}
}
-/**
- * Exclude java primitives and arrays from redefinition
- * @param klass_mirror pointer to the klass
- * @return true if is modifiable
- */
+// Exclude java primitives and arrays from redefinition
+// - klass_mirror pointer to the klass
+// - true if is modifiable
bool VM_EnhancedRedefineClasses::is_modifiable_class(oop klass_mirror) {
// classes for primitives cannot be redefined
if (java_lang_Class::is_primitive(klass_mirror)) {
@@ -693,17 +675,12 @@ bool VM_EnhancedRedefineClasses::is_modifiable_class(oop klass_mirror) {
return true;
}
-/**
- Load and link new classes (either redefined or affected by redefinition - subclass, ...)
-
- - find sorted affected classes
- - resolve new class
- - calculate redefine flags (field change, method change, supertype change, ...)
- - calculate modified fields and mapping to old fields
- - link new classes
-
- The result is sotred in _affected_klasses(old definitions) and _new_classes(new definitions) arrays.
-*/
+// Load and link new classes (either redefined or affected by redefinition - subclass, ...)
+// - find sorted affected classes
+// - resolve new class
+// - calculate redefine flags (field change, method change, supertype change, ...)
+// - calculate modified fields and mapping to old fields
+// - link new classes
jvmtiError VM_EnhancedRedefineClasses::load_new_class_versions(TRAPS) {
_affected_klasses = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<Klass*>(_class_count, true);
@@ -898,9 +875,7 @@ jvmtiError VM_EnhancedRedefineClasses::load_new_class_versions(TRAPS) {
return JVMTI_ERROR_NONE;
}
-/**
- Calculated the difference between new and old class (field change, method change, supertype change, ...).
-*/
+ // 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());
@@ -1183,14 +1158,11 @@ int VM_EnhancedRedefineClasses::calculate_redefinition_flags(InstanceKlass* new_
}
-/**
- Searches for the class bytecode of the given class and returns it as a byte array.
-
- @param the_class definition of a class, either existing class or new_class
- @param class_bytes - if the class is redefined, it contains new class definition, otherwise just original class bytecode.
- @param class_byte_count - size of class_bytes
- @param not_changed - new_class not available or same as current class
-*/
+// Searches for the class bytecode of the given class and returns it as a byte array.
+// - the_class definition of a class, either existing class or new_class
+// - class_bytes - if the class is redefined, it contains new class definition, otherwise just original class bytecode.
+// - class_byte_count - size of class_bytes
+// - not_changed - new_class not available or same as current class
jvmtiError VM_EnhancedRedefineClasses::find_class_bytes(InstanceKlass* the_class, const unsigned char **class_bytes, jint *class_byte_count, jboolean *not_changed) {
*not_changed = false;
@@ -1233,11 +1205,9 @@ jvmtiError VM_EnhancedRedefineClasses::find_class_bytes(InstanceKlass* the_class
return JVMTI_ERROR_NONE;
}
-/**
- Calculate difference between non static fields of old and new class and store the info into new class:
- instanceKlass->store_update_information
- instanceKlass->copy_backwards
-*/
+// Calculate difference between non static fields of old and new class and store the info into new class:
+// instanceKlass->store_update_information
+// instanceKlass->copy_backwards
void VM_EnhancedRedefineClasses::calculate_instance_update_information(Klass* new_version) {
class CalculateFieldUpdates : public FieldClosure {
@@ -1348,9 +1318,7 @@ 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.
-*/
+// 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::rollback_redefinition();
@@ -1547,9 +1515,7 @@ void VM_EnhancedRedefineClasses::update_jmethod_ids() {
}
}
-/**
- Set method as obsolete / old / deleted.
-*/
+// Set method as obsolete / old / deleted.
void VM_EnhancedRedefineClasses::check_methods_and_mark_as_obsolete() {
for (int j = 0; j < _matching_methods_length; ++j/*, ++old_index*/) {
Method* old_method = _matching_old_methods[j];
@@ -1771,12 +1737,9 @@ void VM_EnhancedRedefineClasses::flush_dependent_code(InstanceKlass* k_h, TRAPS)
}
}
-/**
- Compare _old_methods and _new_methods arrays and store the result into
- _matching_old_methods, _matching_new_methods, _added_methods, _deleted_methods
-
- Setup _old_methods and _new_methods before the call - it should be called for one class only!
-*/
+// Compare _old_methods and _new_methods arrays and store the result into
+// _matching_old_methods, _matching_new_methods, _added_methods, _deleted_methods
+// Setup _old_methods and _new_methods before the call - it should be called for one class only!
void VM_EnhancedRedefineClasses::compute_added_deleted_matching_methods() {
Method* old_method;
Method* new_method;
@@ -1900,7 +1863,6 @@ void VM_EnhancedRedefineClasses::redefine_single_class(InstanceKlass* new_class_
}
*/
-
{
ResourceMark rm(THREAD);
// increment the classRedefinedCount field in the_class and in any
@@ -1940,9 +1902,7 @@ void VM_EnhancedRedefineClasses::check_class(InstanceKlass* ik, TRAPS) {
}
}
-/**
- * Logging of all methods (old, new, changed, ...)
- */
+// Logging of all methods (old, new, changed, ...)
void VM_EnhancedRedefineClasses::dump_methods() {
int j;
log_trace(redefine, class, dump)("_old_methods --");
@@ -2002,9 +1962,7 @@ void VM_EnhancedRedefineClasses::dump_methods() {
}
}
-/**
- Helper class to traverse all loaded classes and figure out if the class is affected by redefinition.
-*/
+// Helper class to traverse all loaded classes and figure out if the class is affected by redefinition.
class AffectedKlassClosure : public KlassClosure {
private:
GrowableArray<Klass*>* _affected_klasses;
@@ -2052,10 +2010,8 @@ class AffectedKlassClosure : public KlassClosure {
}
};
-/**
- Find all affected classes by current redefinition (either because of redefine, class hierarchy or interface change).
- Affected classes are stored in _affected_klasses and parent classes always precedes child class.
-*/
+// Find all affected classes by current redefinition (either because of redefine, class hierarchy or interface change).
+// Affected classes are stored in _affected_klasses and parent classes always precedes child class.
jvmtiError VM_EnhancedRedefineClasses::find_sorted_affected_classes(TRAPS) {
for (int i = 0; i < _class_count; i++) {
InstanceKlass* klass_handle = get_ik(_class_defs[i].klass);
@@ -2086,9 +2042,7 @@ jvmtiError VM_EnhancedRedefineClasses::find_sorted_affected_classes(TRAPS) {
return JVMTI_ERROR_NONE;
}
-/**
- Pairs of class dependencies (for topological sort)
-*/
+// Pairs of class dependencies (for topological sort)
struct KlassPair {
const Klass* _left;
const Klass* _right;
@@ -2101,14 +2055,11 @@ static bool match_second(void* value, KlassPair elem) {
return elem._right == value;
}
-/**
- For each class to be redefined parse the bytecode and figure out the superclass and all interfaces.
- First newly introduced classes (_class_defs) are scanned and then affected classed (_affected_klasses).
- Affected flag is cleared (clear_redefinition_flag(Klass::MarkedAsAffected))
- For each dependency create a KlassPair instance. Finnaly, affected classes (_affected_klasses) are sorted according to pairs.
-
- TODO - the class file is potentionally parsed multiple times - introduce a cache?
-*/
+// For each class to be redefined parse the bytecode and figure out the superclass and all interfaces.
+// First newly introduced classes (_class_defs) are scanned and then affected classed (_affected_klasses).
+// Affected flag is cleared (clear_redefinition_flag(Klass::MarkedAsAffected))
+// For each dependency create a KlassPair instance. Finnaly, affected classes (_affected_klasses) are sorted according to pairs.
+// TODO - the class file is potentionally parsed multiple times - introduce a cache?
jvmtiError VM_EnhancedRedefineClasses::do_topological_class_sorting(TRAPS) {
ResourceMark mark(THREAD);
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
index 7e2afd49650..d8a11b51fe9 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
@@ -35,17 +35,16 @@
#include "gc/shared/vmGCOperations.hpp"
#include "../../../java.base/unix/native/include/jni_md.h"
-/**
- * Enhanced class redefiner.
- *
- * This class implements VM_GC_Operation - the usual usage should be:
- * VM_EnhancedRedefineClasses op(class_count, class_definitions, jvmti_class_load_kind_redefine);
- * VMThread::execute(&op);
- * Which in turn runs:
- * - doit_prologue() - calculate all affected classes (add subclasses etc) and load new class versions
- * - doit() - main redefition, adjust existing objects on the heap, clear caches
- * - doit_epilogue() - cleanup
-*/
+//
+// Enhanced class redefiner.
+//
+// This class implements VM_GC_Operation - the usual usage should be:
+// VM_EnhancedRedefineClasses op(class_count, class_definitions, jvmti_class_load_kind_redefine);
+// VMThread::execute(&op);
+// Which in turn runs:
+// - doit_prologue() - calculate all affected classes (add subclasses etc) and load new class versions
+// - doit() - main redefition, adjust existing objects on the heap, clear caches
+// - doit_epilogue() - cleanup
class VM_EnhancedRedefineClasses: public VM_GC_Operation {
private:
// These static fields are needed by ClassLoaderDataGraph::classes_do()
@@ -93,17 +92,15 @@ class VM_EnhancedRedefineClasses: public VM_GC_Operation {
// These routines are roughly in call order unless otherwise noted.
- /**
- Load and link new classes (either redefined or affected by redefinition - subclass, ...)
-
- - find sorted affected classes
- - resolve new class
- - calculate redefine flags (field change, method change, supertype change, ...)
- - calculate modified fields and mapping to old fields
- - link new classes
-
- The result is sotred in _affected_klasses(old definitions) and _new_classes(new definitions) arrays.
- */
+ // Load and link new classes (either redefined or affected by redefinition - subclass, ...)
+ //
+ // - find sorted affected classes
+ // - resolve new class
+ // - calculate redefine flags (field change, method change, supertype change, ...)
+ // - calculate modified fields and mapping to old fields
+ // - link new classes
+ //
+ // The result is sotred in _affected_klasses(old definitions) and _new_classes(new definitions) arrays.
jvmtiError load_new_class_versions(TRAPS);
// Searches for all affected classes and performs a sorting such tha
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,47 @@
From 79c80c48da4d52f4616f1c6ef37e838d29be9be1 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
Date: Sun, 24 May 2020 12:07:09 +0200
Subject: [PATCH 47/50] Review threads, cleanup
---
src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index 8d00203fd9a..1fbba406087 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -253,7 +253,7 @@ 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); // TODO : review thread
+ Handle objHandle(thread, obj);
MethodHandles::init_method_MemberName(objHandle, info);
} else {
java_lang_invoke_MemberName::set_method(obj, NULL);
@@ -280,7 +280,7 @@ class ChangePointersOopClosure : public BasicOopIterateClosure {
InstanceKlass* ik_new = InstanceKlass::cast(k->newest_version());
fieldDescriptor fd_new;
if (ik_new->find_local_field(fd.name(), fd.signature(), &fd_new)) {
- Handle objHandle(Thread::current(), obj); // TODO : review thread
+ Handle objHandle(Thread::current(), obj);
MethodHandles::init_field_MemberName(objHandle, fd_new, MethodHandles::ref_kind_is_setter(ref_kind));
} else {
// Matching field is not found in new version, not much we can do here.
@@ -441,10 +441,9 @@ public:
// Main transformation method - runs in VM thread.
-// - UseSharedSpaces - TODO what does it mean?
-// - for each sratch class call redefine_single_class
+// - for each scratch class call redefine_single_class
// - clear code cache (flush_dependent_code)
-// - iterate the heap and update object defintions, check it old/new class fields
+// - iterate the heap and update object definitions, check it old/new class fields
// are compatible. If new class size is smaller then old, it can be solved directly here.
// - iterate the heap and update method handles to new version
// - Swap marks to have same hashcodes
--
2.24.3 (Apple Git-128)

View File

@@ -0,0 +1,57 @@
From 8b79e673a3a9d12c97b8b7dd2f4d79c2d4cdd1d6 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
Date: Sun, 24 May 2020 12:07:42 +0200
Subject: [PATCH 48/50] Replace deleted method with
Universe::throw_no_such_method_error
---
.../share/prims/resolvedMethodTable.cpp | 28 +++++++++----------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/src/hotspot/share/prims/resolvedMethodTable.cpp b/src/hotspot/share/prims/resolvedMethodTable.cpp
index 7741328979f..06581643c3b 100644
--- a/src/hotspot/share/prims/resolvedMethodTable.cpp
+++ b/src/hotspot/share/prims/resolvedMethodTable.cpp
@@ -261,25 +261,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_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");
+ 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);
--
2.24.3 (Apple Git-128)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,214 @@
From 55e30de9a54b2f3bec995a2df42fe14b09d16f06 Mon Sep 17 00:00:00 2001
From: Vladimir Dvorak <lada.dvorak7@gmail.com>
Date: Sun, 21 Jun 2020 13:38:45 +0200
Subject: [PATCH 50/50] G1 Heap parallel iterate method "object_par_iterate" +
dcevm timers
G1 Heap does not have parallel iterate method, that is usefull in dcevm
iterate phase. According performance tests the parallel iteration is up
~25% faster then serial iteration, ratio depends on the size of heap.
Dcevm's timers did not make sense. Now, there are timers fo prologue,
doit, gc itarate and full gc phases. Iterate+fullgc time make up most
the total doit time.
---
src/hotspot/share/gc/g1/g1CollectedHeap.cpp | 20 ++++++++
src/hotspot/share/gc/g1/g1CollectedHeap.hpp | 2 +
.../prims/jvmtiEnhancedRedefineClasses.cpp | 46 +++++++++++++------
.../prims/jvmtiEnhancedRedefineClasses.hpp | 5 +-
4 files changed, 58 insertions(+), 15 deletions(-)
diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
index dea8d9fdb0e..33664a30519 100644
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
@@ -2108,6 +2108,21 @@ public:
}
};
+class G1IterateObjectClosureTask : public AbstractGangTask {
+ private:
+ ObjectClosure* _cl;
+ G1CollectedHeap* _g1h;
+ HeapRegionClaimer _hrclaimer;
+ public:
+ G1IterateObjectClosureTask(ObjectClosure* cl, G1CollectedHeap* g1h) : AbstractGangTask("IterateObject Closure"),
+ _cl(cl), _g1h(g1h), _hrclaimer(g1h->workers()->active_workers()) { }
+
+ virtual void work(uint worker_id) {
+ IterateObjectClosureRegionClosure blk(_cl);
+ _g1h->heap_region_par_iterate_from_worker_offset(&blk, &_hrclaimer, worker_id);
+ }
+};
+
void G1CollectedHeap::object_iterate(ObjectClosure* cl) {
IterateObjectClosureRegionClosure blk(cl);
heap_region_iterate(&blk);
@@ -2117,6 +2132,11 @@ void G1CollectedHeap::heap_region_iterate(HeapRegionClosure* cl) const {
_hrm.iterate(cl);
}
+void G1CollectedHeap::object_par_iterate(ObjectClosure* cl) {
+ G1IterateObjectClosureTask iocl_task(cl, this);
+ workers()->run_task(&iocl_task);
+}
+
void G1CollectedHeap::heap_region_par_iterate_from_worker_offset(HeapRegionClosure* cl,
HeapRegionClaimer *hrclaimer,
uint worker_id) const {
diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp
index 0735eef0da8..05a068bb2e0 100644
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp
@@ -1117,6 +1117,8 @@ public:
// Iteration functions.
+ void object_par_iterate(ObjectClosure* cl);
+
// Iterate over all objects, calling "cl.do_object" on each.
virtual void object_iterate(ObjectClosure* cl);
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
index 32929b3d7a0..5be9bb74305 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.cpp
@@ -54,6 +54,7 @@
#include "utilities/events.hpp"
#include "oops/constantPool.inline.hpp"
#include "gc/cms/cmsHeap.hpp"
+#include "gc/g1/g1CollectedHeap.hpp"
#include "gc/shared/dcevmSharedGC.hpp"
Array<Method*>* VM_EnhancedRedefineClasses::_old_methods = NULL;
@@ -459,6 +460,10 @@ public:
void VM_EnhancedRedefineClasses::doit() {
Thread *thread = Thread::current();
+ if (log_is_enabled(Info, redefine, class, timer)) {
+ _timer_vm_op_doit.start();
+ }
+
#if INCLUDE_CDS
if (UseSharedSpaces) {
// Sharing is enabled so we remap the shared readonly space to
@@ -523,8 +528,22 @@ void VM_EnhancedRedefineClasses::doit() {
}
Universe::heap()->ensure_parsability(false);
- Universe::heap()->object_iterate(&objectClosure);
+ if (UseG1GC) {
+ if (log_is_enabled(Info, redefine, class, timer)) {
+ _timer_heap_iterate.start();
+ }
+ G1CollectedHeap::heap()->object_par_iterate(&objectClosure);
+ _timer_heap_iterate.stop();
+ } else {
+ if (log_is_enabled(Info, redefine, class, timer)) {
+ _timer_heap_iterate.start();
+ }
+ Universe::heap()->object_iterate(&objectClosure);
+ _timer_heap_iterate.stop();
+ }
+
Universe::root_oops_do(&oopClosureNoBarrier);
+
}
log_trace(redefine, class, obsolete, metadata)("After updating instances");
@@ -577,12 +596,19 @@ void VM_EnhancedRedefineClasses::doit() {
if (objectClosure.needs_instance_update()) {
// Do a full garbage collection to update the instance sizes accordingly
+
+ if (log_is_enabled(Info, redefine, class, timer)) {
+ _timer_heap_full_gc.start();
+ }
+
Universe::set_redefining_gc_run(true);
notify_gc_begin(true);
// TODO: check _metadata_GC_clear_soft_refs with ScavengeRootsInCode
Universe::heap()->collect_as_vm_thread(GCCause::_heap_inspection);
notify_gc_end();
Universe::set_redefining_gc_run(false);
+
+ _timer_heap_full_gc.stop();
}
// Unmark Klass*s as "redefining"
@@ -630,6 +656,7 @@ void VM_EnhancedRedefineClasses::doit() {
}
#endif
+ _timer_vm_op_doit.stop();
}
// Cleanup - runs in JVM thread
@@ -653,16 +680,14 @@ void VM_EnhancedRedefineClasses::doit_epilogue() {
if (log_is_enabled(Info, redefine, class, timer)) {
// Used to have separate timers for "doit" and "all", but the timer
// overhead skewed the measurements.
- jlong doit_time = _timer_rsc_phase1.milliseconds() +
- _timer_rsc_phase2.milliseconds();
- jlong all_time = _timer_vm_op_prologue.milliseconds() + doit_time;
+ jlong all_time = _timer_vm_op_prologue.milliseconds() + _timer_vm_op_doit.milliseconds();
log_info(redefine, class, timer)
("vm_op: all=" JLONG_FORMAT " prologue=" JLONG_FORMAT " doit=" JLONG_FORMAT,
- all_time, _timer_vm_op_prologue.milliseconds(), doit_time);
+ all_time, _timer_vm_op_prologue.milliseconds(), _timer_vm_op_doit.milliseconds());
log_info(redefine, class, timer)
- ("redefine_single_class: phase1=" JLONG_FORMAT " phase2=" JLONG_FORMAT,
- _timer_rsc_phase1.milliseconds(), _timer_rsc_phase2.milliseconds());
+ ("doit: heap iterate=" JLONG_FORMAT " fullgc=" JLONG_FORMAT,
+ _timer_heap_iterate.milliseconds(), _timer_heap_full_gc.milliseconds());
}
}
@@ -1411,7 +1436,7 @@ void VM_EnhancedRedefineClasses::unpatch_bytecode(Method* method) {
// arrayKlassOops. See Open Issues in jvmtiRedefineClasses.hpp.
void VM_EnhancedRedefineClasses::ClearCpoolCacheAndUnpatch::do_klass(Klass* k) {
if (!k->is_instance_klass()) {
- return;
+ return;
}
HandleMark hm(_thread);
@@ -1829,10 +1854,6 @@ void VM_EnhancedRedefineClasses::redefine_single_class(InstanceKlass* new_class_
HandleMark hm(THREAD); // make sure handles from this call are freed
- if (log_is_enabled(Info, redefine, class, timer)) {
- _timer_rsc_phase1.start();
- }
-
InstanceKlass* new_class = new_class_oop;
InstanceKlass* the_class = InstanceKlass::cast(new_class_oop->old_version());
assert(the_class != NULL, "must have old version");
@@ -1887,7 +1908,6 @@ void VM_EnhancedRedefineClasses::redefine_single_class(InstanceKlass* new_class_
new_class->external_name(),
java_lang_Class::classRedefinedCount(new_class->java_mirror()));
}
- _timer_rsc_phase2.stop();
} // end redefine_single_class()
diff --git a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
index 030852b160a..9755944d70b 100644
--- a/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
+++ b/src/hotspot/share/prims/jvmtiEnhancedRedefineClasses.hpp
@@ -86,9 +86,10 @@ class VM_EnhancedRedefineClasses: public VM_GC_Operation {
// Performance measurement support. These timers do not cover all
// the work done for JVM/TI RedefineClasses() but they do cover
// the heavy lifting.
- elapsedTimer _timer_rsc_phase1;
- elapsedTimer _timer_rsc_phase2;
+ elapsedTimer _timer_vm_op_doit;
elapsedTimer _timer_vm_op_prologue;
+ elapsedTimer _timer_heap_iterate;
+ elapsedTimer _timer_heap_full_gc;
// These routines are roughly in call order unless otherwise noted.
--
2.24.3 (Apple Git-128)

View File

@@ -3,8 +3,8 @@ IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/java.desktop/share/classes/module-info.java (revision 08d1926f8b7c74da0e1144e0ce5912e7589c4688)
+++ src/java.desktop/share/classes/module-info.java (date 1583207610780)
--- src/java.desktop/share/classes/module-info.java (revision 5ae6630e3ebc71beb9f9df63b1b5bc19c9405d1f)
+++ src/java.desktop/share/classes/module-info.java (date 1588168285537)
@@ -109,10 +109,7 @@
// see make/GensrcModuleInfo.gmk
exports sun.awt to
@@ -14,7 +14,7 @@ Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
-
- exports java.awt.peer to jcef;
+ jdk.unsupported.desktop;
exports java.awt.dnd.peer to jdk.unsupported.desktop;
exports sun.awt.dnd to jdk.unsupported.desktop;
Index: modules.list
@@ -22,9 +22,9 @@ IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- modules.list (revision 08d1926f8b7c74da0e1144e0ce5912e7589c4688)
+++ modules.list (date 1583207610776)
@@ -60,5 +60,4 @@
--- modules.list (revision 5ae6630e3ebc71beb9f9df63b1b5bc19c9405d1f)
+++ modules.list (date 1588168285505)
@@ -61,5 +61,4 @@
jdk.unsupported,
jdk.xml.dom,
jdk.zipfs,

View File

@@ -3,8 +3,8 @@ IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- modules.list (revision 57ff1dba25206f9f078b48995aa8744e51b1dd2a)
+++ modules.list (date 1584500341724)
--- modules.list (revision ab073976c4f85f154ff1421b7ac888eee86b6595)
+++ modules.list (date 1588171510146)
@@ -20,13 +20,6 @@
java.transaction.xa,
java.xml,
@@ -18,4 +18,4 @@ Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
-javafx.web,
jdk.accessibility,
jdk.aot,
jdk.charsets,
jdk.attach,

View File

@@ -6,4 +6,5 @@ build_number=$3
script_dir=jb/project/tools/windows/scripts
${script_dir}/mkimages_x64.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "jcef" || exit $?
${script_dir}/mkimages_x64.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "jfx" || exit $?
${script_dir}/mkimages_x64.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "dcevm" || exit $?
${script_dir}/mkimages_x64.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "jfx_jcef" || exit $?

View File

@@ -16,11 +16,21 @@
# 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:
# MODULAR_SDK_PATH - specifies the path to the directory where imported modules are located.
# By default imported modules should be located in ./modular-sdk
# JCEF_PATH - specifies the path to the directory where JCEF binaries are located.
# By default imported modules 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')
WITH_IMPORT_MODULES="--with-import-modules=${MODULAR_SDK_PATH:=${WORK_DIR}/modular-sdk}"
JCEF_PATH=${JCEF_PATH:=./jcef_win_x64}
source jb/project/tools/common.sh
function create_jbr {
@@ -28,7 +38,7 @@ function create_jbr {
"${bundle_type}_lw")
grep -v "jdk.compiler\|jdk.hotspot.agent" modules.list > modules_tmp.list
;;
"jfx" | "jcef" | "jfx_jcef")
"jfx" | "jcef" | "jfx_jcef" | "dcevm" | "nomod")
cat modules.list > modules_tmp.list
;;
*)
@@ -40,61 +50,73 @@ function create_jbr {
${JSDK}/bin/jlink \
--module-path ${JSDK}/jmods --no-man-pages --compress=2 \
--add-modules $(xargs < modules_tmp.list | sed s/" "//g) --output ${JBR_BUNDLE} || exit $?
if [[ "${bundle_type}" == *jcef* ]]
if [[ "${bundle_type}" == *jcef* ]] || [[ "${bundle_type}" == *dcevm* ]]
then
cp -R jcef_win_x64/* ${JBR_BUNDLE}/bin
cp -R ${JCEF_PATH}/* ${JBR_BUNDLE}/bin
fi
echo Modifying release info ...
grep -v \"^JAVA_VERSION\" ${JSDK}/release | grep -v \"^MODULES\" >> ${JBR_BUNDLE}/release
cat ${JSDK}/release | tr -d '\r' | grep -v 'JAVA_VERSION' | grep -v 'MODULES' >> ${JBR_BUNDLE}/release
}
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
WORK_DIR=$(pwd)
git checkout -- modules.list src
WITH_DEBUG_LEVEL="--with-debug-level=release"
RELEASE_NAME=windows-x86_64-normal-server-release
git checkout -- modules.list src/java.desktop/share/classes/module-info.java
case "$bundle_type" in
"jfx")
echo "Excluding jcef modules"
git apply -p0 < jb/project/tools/exclude_jcef_module.patch
git apply -p0 < jb/project/tools/patches/exclude_jcef_module.patch
;;
"jcef")
echo "Excluding jfx modules"
git apply -p0 < jb/project/tools/exclude_jfx_module.patch
git apply -p0 < jb/project/tools/patches/exclude_jfx_module.patch
;;
"dcevm")
echo "Adding dcevm patches"
git am jb/project/tools/patches/dcevm/*.patch
;;
"nomod")
git apply -p0 < jb/project/tools/patches/exclude_jcef_module.patch
git apply -p0 < jb/project/tools/patches/exclude_jfx_module.patch
WITH_IMPORT_MODULES=""
;;
esac
PATH="/usr/local/bin:/usr/bin:${PATH}"
./configure \
--disable-warnings-as-errors \
--disable-debug-symbols \
$WITH_DEBUG_LEVEL \
--with-target-bits=64 \
--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-import-modules=${WORK_DIR}/modular-sdk \
$WITH_IMPORT_MODULES \
--with-toolchain-version=2015 \
--with-boot-jdk=${BOOT_JDK} \
--disable-ccache \
--enable-cds=yes || exit 1
if [ "$bundle_type" == "jfx_jcef" ]; then
make LOG=info images CONF=windows-x86_64-normal-server-release test-image || exit 1
make LOG=info clean images CONF=$RELEASE_NAME test-image || exit 1
else
make LOG=info images CONF=windows-x86_64-normal-server-release || exit 1
make LOG=info clean images CONF=$RELEASE_NAME || exit 1
fi
JSDK=build/windows-x86_64-normal-server-release/images/jdk
JSDK=build/$RELEASE_NAME/images/jdk
if [[ "$bundle_type" == *jcef* ]]; then
JBSDK=${JBRSDK_BASE_NAME}-windows-x64-b${build_number}
fi
BASE_DIR=build/windows-x86_64-normal-server-release/images
BASE_DIR=build/$RELEASE_NAME/images
JBRSDK_BUNDLE=jbrsdk
rm -rf ${BASE_DIR}/${JBRSDK_BUNDLE} && rsync -a --exclude demo --exclude sample ${JSDK}/ ${JBRSDK_BUNDLE} || exit 1
cp -R jcef_win_x64/* ${JBRSDK_BUNDLE}/bin
cp -R ${JCEF_PATH}/* ${JBRSDK_BUNDLE}/bin
sed 's/JBR/JBRSDK/g' ${JSDK}/release > release
mv release ${JBRSDK_BUNDLE}/release
JBR_BUNDLE=jbr_${bundle_type}
create_jbr ${bundle_type}
#JBR_BUNDLE=jbr_${bundle_type}_lw
#create_jbr ${bundle_type}_lw

View File

@@ -21,6 +21,10 @@ 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.sh
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
WORK_DIR=$(pwd)
@@ -29,6 +33,8 @@ PATH="/usr/local/bin:/usr/bin:${PATH}"
--disable-warnings-as-errors \
--disable-debug-symbols \
--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} \
@@ -45,6 +51,8 @@ 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}
@@ -54,4 +62,4 @@ ${JSDK}/bin/jlink \
--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
#grep -v \"^JAVA_VERSION\" ${JSDK}/release | grep -v \"^MODULES\" >> ${JBR_BUNDLE}/release

View File

@@ -28,7 +28,7 @@ function pack_jbr {
"${bundle_type}_lw")
JBR_BASE_NAME=jbr_${bundle_type}_lw-${JBSDK_VERSION}
;;
"jfx" | "jcef")
"jfx" | "jcef" | "dcevm" | "nomod")
JBR_BASE_NAME=jbr_${bundle_type}-${JBSDK_VERSION}
;;
"jfx_jcef")
@@ -48,10 +48,12 @@ function pack_jbr {
#rm -rf ${BASE_DIR}/${JBR_BUNDLE}
}
RELEASE_NAME=windows-x86_64-normal-server-release
JBRSDK_BASE_NAME=jbrsdk-$JBSDK_VERSION
JBR_BASE_NAME=jbr-$JBSDK_VERSION
IMAGES_DIR=build/windows-x86_64-normal-server-release/images
IMAGES_DIR=build/$RELEASE_NAME/images
JSDK=$IMAGES_DIR/jdk
JBSDK=$JBRSDK_BASE_NAME-windows-x64-b$build_number
BASE_DIR=.

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016, 2020, 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
@@ -71,7 +71,7 @@ define SetupBundleFileBody
$$(call SetIfEmpty, $1_UNZIP_DEBUGINFO, false)
$(BUNDLES_OUTPUTDIR)/$$($1_BUNDLE_NAME): $$($1_FILES)
# If any of the files contain a space in the file name, CacheFind
# If any of the files contain a space in the file name, FindFiles
# will have replaced it with ?. Tar does not accept that so need to
# switch it back.
$$(foreach d, $$($1_BASE_DIRS), \
@@ -166,11 +166,12 @@ endif
################################################################################
ifneq ($(filter product-bundles legacy-bundles, $(MAKECMDGOALS)), )
$(eval $(call FillCacheFind, $(IMAGES_OUTPUTDIR)))
SYMBOLS_EXCLUDE_PATTERN := %.debuginfo %.diz %.pdb %.map
ALL_JDK_FILES := $(call CacheFind, $(JDK_IMAGE_DIR))
# There may be files with spaces in the names, so use ShellFindFiles
# explicitly.
ALL_JDK_FILES := $(call ShellFindFiles, $(JDK_IMAGE_DIR))
# Create special filter rules when dealing with unzipped .dSYM directories on
# macosx
@@ -201,11 +202,11 @@ ifneq ($(filter product-bundles legacy-bundles, $(MAKECMDGOALS)), )
$(ALL_JDK_FILES) \
) \
) \
$(call CacheFind, $(SYMBOLS_IMAGE_DIR))
$(call FindFiles, $(SYMBOLS_IMAGE_DIR))
TEST_DEMOS_BUNDLE_FILES := $(filter $(JDK_IMAGE_HOMEDIR)/demo/%, $(ALL_JDK_FILES))
ALL_JRE_FILES := $(call CacheFind, $(JRE_IMAGE_DIR))
ALL_JRE_FILES := $(call ShellFindFiles, $(JRE_IMAGE_DIR))
# Create special filter rules when dealing with unzipped .dSYM directories on
# macosx
@@ -221,24 +222,96 @@ ifneq ($(filter product-bundles legacy-bundles, $(MAKECMDGOALS)), )
$(SYMBOLS_EXCLUDE_PATTERN), \
$(ALL_JRE_FILES))
$(eval $(call SetupBundleFile, BUILD_JDK_BUNDLE, \
BUNDLE_NAME := $(JDK_BUNDLE_NAME), \
FILES := $(JDK_BUNDLE_FILES), \
SPECIAL_INCLUDES := $(JDK_SPECIAL_INCLUDES), \
BASE_DIRS := $(JDK_IMAGE_DIR), \
SUBDIR := $(JDK_BUNDLE_SUBDIR), \
))
# On Macosx release builds, when there is a code signing certificate available,
# the final bundle layout can be signed.
SIGN_BUNDLE := false
ifeq ($(OPENJDK_TARGET_OS)-$(DEBUG_LEVEL), macosx-release)
ifneq ($(CODESIGN), )
SIGN_BUNDLE := true
endif
endif
PRODUCT_TARGETS += $(BUILD_JDK_BUNDLE)
ifeq ($(SIGN_BUNDLE), true)
# Macosx release build and code signing available.
$(eval $(call SetupBundleFile, BUILD_JRE_BUNDLE, \
BUNDLE_NAME := $(JRE_BUNDLE_NAME), \
FILES := $(JRE_BUNDLE_FILES), \
BASE_DIRS := $(JRE_IMAGE_DIR), \
SUBDIR := $(JRE_BUNDLE_SUBDIR), \
))
################################################################################
# JDK bundle
$(eval $(call SetupCopyFiles, CREATE_JDK_BUNDLE_DIR_SIGNED, \
SRC := $(JDK_IMAGE_DIR), \
FILES := $(JDK_BUNDLE_FILES), \
DEST := $(JDK_MACOSX_BUNDLE_DIR_SIGNED), \
))
LEGACY_TARGETS += $(BUILD_JRE_BUNDLE)
JDK_SIGNED_CODE_RESOURCES := \
$(JDK_MACOSX_BUNDLE_DIR_SIGNED)/$(JDK_MACOSX_CONTENTS_SUBDIR)/_CodeSignature/CodeResources
$(JDK_SIGNED_CODE_RESOURCES): $(CREATE_JDK_BUNDLE_DIR_SIGNED)
$(call LogWarn, Signing $(JDK_BUNDLE_NAME))
$(CODESIGN) -s "$(MACOSX_CODESIGN_IDENTITY)" \
--timestamp --options runtime --deep --force \
$(JDK_MACOSX_BUNDLE_DIR_SIGNED)/$(JDK_MACOSX_BUNDLE_TOP_DIR) $(LOG_DEBUG)
$(TOUCH) $@
$(eval $(call SetupBundleFile, BUILD_JDK_BUNDLE, \
BUNDLE_NAME := $(JDK_BUNDLE_NAME), \
FILES := \
$(CREATE_JDK_BUNDLE_DIR_SIGNED) \
$(JDK_SIGNED_CODE_RESOURCES), \
BASE_DIRS := $(JDK_MACOSX_BUNDLE_DIR_SIGNED), \
SUBDIR := $(JDK_BUNDLE_SUBDIR), \
))
PRODUCT_TARGETS += $(BUILD_JDK_BUNDLE)
################################################################################
# JRE bundle
$(eval $(call SetupCopyFiles, CREATE_JRE_BUNDLE_DIR_SIGNED, \
SRC := $(JRE_IMAGE_DIR), \
FILES := $(JRE_BUNDLE_FILES), \
DEST := $(JRE_MACOSX_BUNDLE_DIR_SIGNED), \
))
JRE_SIGNED_CODE_RESOURCES := \
$(JRE_MACOSX_BUNDLE_DIR_SIGNED)/$(JRE_MACOSX_CONTENTS_SUBDIR)/_CodeSignature/CodeResources
$(JRE_SIGNED_CODE_RESOURCES): $(CREATE_JRE_BUNDLE_DIR_SIGNED)
$(call LogWarn, Signing $(JRE_BUNDLE_NAME))
$(CODESIGN) -s "$(MACOSX_CODESIGN_IDENTITY)" \
--timestamp --options runtime --deep --force \
$(JRE_MACOSX_BUNDLE_DIR_SIGNED)/$(JRE_MACOSX_BUNDLE_TOP_DIR) $(LOG_DEBUG)
$(TOUCH) $@
$(eval $(call SetupBundleFile, BUILD_JRE_BUNDLE, \
BUNDLE_NAME := $(JRE_BUNDLE_NAME), \
FILES := \
$(CREATE_JRE_BUNDLE_DIR_SIGNED) \
$(JRE_SIGNED_CODE_RESOURCES), \
BASE_DIRS := $(JRE_MACOSX_BUNDLE_DIR_SIGNED), \
SUBDIR := $(JRE_BUNDLE_SUBDIR), \
))
LEGACY_TARGETS += $(BUILD_JRE_BUNDLE)
else
# Not a Macosx release build or code signing not available.
$(eval $(call SetupBundleFile, BUILD_JDK_BUNDLE, \
BUNDLE_NAME := $(JDK_BUNDLE_NAME), \
FILES := $(JDK_BUNDLE_FILES), \
SPECIAL_INCLUDES := $(JDK_SPECIAL_INCLUDES), \
BASE_DIRS := $(JDK_IMAGE_DIR), \
SUBDIR := $(JDK_BUNDLE_SUBDIR), \
))
PRODUCT_TARGETS += $(BUILD_JDK_BUNDLE)
$(eval $(call SetupBundleFile, BUILD_JRE_BUNDLE, \
BUNDLE_NAME := $(JRE_BUNDLE_NAME), \
FILES := $(JRE_BUNDLE_FILES), \
BASE_DIRS := $(JRE_IMAGE_DIR), \
SUBDIR := $(JRE_BUNDLE_SUBDIR), \
))
LEGACY_TARGETS += $(BUILD_JRE_BUNDLE)
endif
$(eval $(call SetupBundleFile, BUILD_JDK_SYMBOLS_BUNDLE, \
BUNDLE_NAME := $(JDK_SYMBOLS_BUNDLE_NAME), \
@@ -266,7 +339,7 @@ endif
################################################################################
ifneq ($(filter test-bundles, $(MAKECMDGOALS)), )
TEST_BUNDLE_FILES := $(call CacheFind, $(TEST_IMAGE_DIR))
TEST_BUNDLE_FILES := $(call FindFiles, $(TEST_IMAGE_DIR))
$(eval $(call SetupBundleFile, BUILD_TEST_BUNDLE, \
BUNDLE_NAME := $(TEST_BUNDLE_NAME), \
@@ -280,7 +353,7 @@ endif
################################################################################
ifneq ($(filter docs-bundles, $(MAKECMDGOALS)), )
DOCS_BUNDLE_FILES := $(call CacheFind, $(DOCS_IMAGE_DIR))
DOCS_BUNDLE_FILES := $(call FindFiles, $(DOCS_IMAGE_DIR))
$(eval $(call SetupBundleFile, BUILD_DOCS_BUNDLE, \
BUNDLE_NAME := $(DOCS_BUNDLE_NAME), \

60
make/CompileCommands.gmk Normal file
View File

@@ -0,0 +1,60 @@
#
# Copyright (c) 2018, 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: all
include $(SPEC)
include MakeBase.gmk
# When FIXPATH is set, let it process the file to make sure all paths are usable
# by system native tools. The FIXPATH tool assumes arguments preceeded by an @
# character points to a text file containing further arguments (similar to a
# linker). It replaces any such arguments with a different temporary filename,
# whose contents has been processed to make any paths native. To obtain a
# properly processed compile_commands.json, FIXPATH is then made to invoke an
# AWK script with the unprocessed json file as the only argument, prepended with
# an @ character. The AWK script simply copies the contents of this processed
# file.
#
# The sed command encloses the fragments inside brackets and removes the final
# trailing comma.
$(OUTPUTDIR)/compile_commands.json: $(wildcard $(MAKESUPPORT_OUTPUTDIR)/compile-commands/*.json)
$(call LogWarn, Updating compile_commands.json)
$(RM) $@
$(FIND) $(MAKESUPPORT_OUTPUTDIR)/compile-commands/ -name \*.json | \
$(SORT) | $(XARGS) $(CAT) >> $@.tmp
$(if $(FIXPATH),$(FIXPATH) $(AWK) 'BEGIN { \
tmpfile = substr(ARGV[2],2); \
cmd = "$(CP) " "\047" tmpfile "\047" " $@.tmp"; \
system(cmd); \
}' -- @$@.tmp)
$(SED) -e '1s/^/[\$(NEWLINE)/' -e '$(DOLLAR)s/,\s\{0,\}$(DOLLAR)/\$(NEWLINE)]/' $@.tmp > $@
$(RM) $@.tmp
TARGETS += $(OUTPUTDIR)/compile_commands.json
all: $(TARGETS)
.PHONY: all

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
# 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
@@ -43,7 +43,7 @@ $(eval $(call IncludeCustomExtension, CompileDemos-pre.gmk))
# Prepare the find cache.
DEMO_SRC_DIRS += $(TOPDIR)/src/demo
$(eval $(call FillCacheFind, $(wildcard $(DEMO_SRC_DIRS))))
$(call FillFindCache, $(DEMO_SRC_DIRS))
# Append demo goals to this variable.
TARGETS =
@@ -237,11 +237,11 @@ $(SUPPORT_OUTPUTDIR)/demos/image/nbproject/%: $(DEMO_SHARE_SRC)/nbproject/%
ifeq ($(OPENJDK_TARGET_OS), solaris)
TARGETS += $(patsubst $(DEMO_SHARE_SRC)/nbproject/%, \
$(SUPPORT_OUTPUTDIR)/demos/image/nbproject/%, \
$(call CacheFind, $(DEMO_SHARE_SRC)/nbproject))
$(call FindFiles, $(DEMO_SHARE_SRC)/nbproject))
else
TARGETS += $(patsubst $(DEMO_SHARE_SRC)/nbproject/%, \
$(SUPPORT_OUTPUTDIR)/demos/image/nbproject/%, \
$(call CacheFind, $(DEMO_SHARE_SRC)/nbproject))
$(call FindFiles, $(DEMO_SHARE_SRC)/nbproject))
endif
################################################################################
@@ -250,7 +250,7 @@ ifneq ($(filter images, $(MAKECMDGOALS)), )
$(eval $(call SetupCopyFiles, COPY_TO_TEST_IMAGE, \
SRC := $(SUPPORT_OUTPUTDIR)/demos/image, \
DEST := $(TEST_IMAGE_DIR)/jdk/demos, \
FILES := $(call CacheFind, $(SUPPORT_OUTPUTDIR)/demos/image), \
FILES := $(call FindFiles, $(SUPPORT_OUTPUTDIR)/demos/image), \
))
IMAGES_TARGETS := $(COPY_TO_TEST_IMAGE)

View File

@@ -644,7 +644,7 @@ endif
ifneq ($(wildcard $(IMPORT_MODULES_CLASSES)/$(MODULE)), )
$(JDK_OUTPUTDIR)/modules/$(MODULE)/_imported.marker: \
$(call CacheFind, $(IMPORT_MODULES_CLASSES)/$(MODULE))
$(call FindFiles, $(IMPORT_MODULES_CLASSES)/$(MODULE))
$(call MakeDir, $(@D))
# Do not delete marker and build meta data files
$(RM) -r $(filter-out $(@D)/_%, $(wildcard $(@D)/*))

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2015, 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
@@ -35,7 +35,7 @@ LIBS_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_LIBS)))
CMDS_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_CMDS)))
CONF_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_CONF)))
$(eval $(call FillCacheFind, $(LIBS_DIR) $(CMDS_DIR) $(CONF_DIR)))
$(call FillFindCache, $(LIBS_DIR) $(CMDS_DIR) $(CONF_DIR))
ifneq ($(LIBS_DIR), )
ifeq ($(OPENJDK_TARGET_OS), windows)
@@ -45,21 +45,21 @@ ifneq ($(LIBS_DIR), )
SRC := $(LIBS_DIR), \
DEST := $(JDK_OUTPUTDIR)/bin, \
FILES := $(filter $(TO_BIN_FILTER), \
$(call CacheFind, $(LIBS_DIR))) \
$(call FindFiles, $(LIBS_DIR))) \
))
$(eval $(call SetupCopyFiles, COPY_LIBS_TO_LIB, \
SRC := $(LIBS_DIR), \
DEST := $(JDK_OUTPUTDIR)/lib, \
FILES := $(filter-out $(TO_BIN_FILTER), \
$(call CacheFind, $(LIBS_DIR))) \
$(call FindFiles, $(LIBS_DIR))) \
))
TARGETS += $(COPY_LIBS_TO_BIN) $(COPY_LIBS_TO_LIB)
else
$(eval $(call SetupCopyFiles, COPY_LIBS, \
SRC := $(LIBS_DIR), \
DEST := $(JDK_OUTPUTDIR)/lib, \
FILES := $(filter %$(SHARED_LIBRARY_SUFFIX), $(call CacheFind, $(LIBS_DIR))), \
FILES := $(filter %$(SHARED_LIBRARY_SUFFIX), $(call FindFiles, $(LIBS_DIR))), \
))
# Use relative links if the import dir is inside the OUTPUTDIR, otherwise
@@ -75,7 +75,7 @@ ifneq ($(LIBS_DIR), )
$(eval $(call SetupCopyFiles, LINK_LIBS, \
SRC := $(LIBS_DIR), \
DEST := $(JDK_OUTPUTDIR)/lib, \
FILES := $(filter-out %$(SHARED_LIBRARY_SUFFIX), $(call CacheFind, $(LIBS_DIR))), \
FILES := $(filter-out %$(SHARED_LIBRARY_SUFFIX), $(call FindFiles, $(LIBS_DIR))), \
MACRO := $(LINK_MACRO), \
LOG_ACTION := $(LOG_ACTION), \
))
@@ -87,7 +87,7 @@ ifneq ($(CMDS_DIR), )
$(eval $(call SetupCopyFiles, COPY_CMDS, \
SRC := $(CMDS_DIR), \
DEST := $(JDK_OUTPUTDIR)/bin, \
FILES := $(call CacheFind, $(CMDS_DIR)), \
FILES := $(call FindFiles, $(CMDS_DIR)), \
))
TARGETS += $(COPY_CMDS)
endif
@@ -96,7 +96,7 @@ ifneq ($(CONF_DIR), )
$(eval $(call SetupCopyFiles, COPY_CONF, \
SRC := $(CONF_DIR), \
DEST := $(JDK_OUTPUTDIR)/lib, \
FILES := $(call CacheFind, $(CONF_DIR)), \
FILES := $(call FindFiles, $(CONF_DIR)), \
))
TARGETS += $(COPY_CONF)
endif

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2015, 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
@@ -39,7 +39,7 @@ MODULES_TO_COPY := $(sort \
COPY_CLASSES_TARGET := $(BUILDJDK_OUTPUTDIR)/jdk/modules/java.base/_the.buildjdk-copy-marker
$(COPY_CLASSES_TARGET): $(call CacheFind, $(wildcard \
$(COPY_CLASSES_TARGET): $(call FindFiles, $(wildcard \
$(addprefix $(JDK_OUTPUTDIR)/modules/, $(MODULES_TO_COPY))))
$(ECHO) $(LOG_INFO) "Copying java modules to buildjdk: $(MODULES_TO_COPY)"
$(RM) -r $(BUILDJDK_OUTPUTDIR)/jdk/modules
@@ -56,7 +56,7 @@ TARGETS += $(COPY_CLASSES_TARGET)
$(eval $(call SetupCopyFiles, COPY_SUPPORT_HEADERS, \
SRC := $(OUTPUTDIR), \
DEST := $(BUILDJDK_OUTPUTDIR), \
FILES := $(call CacheFind, $(wildcard \
FILES := $(call FindFiles, $(wildcard \
$(addprefix $(SUPPORT_OUTPUTDIR)/headers/, $(MODULES_TO_COPY)))), \
))

View File

@@ -51,33 +51,33 @@ INCLUDE_HEADERS_DIR ?= $(firstword $(wildcard $(addsuffix /$(MODULE), \
MAN_DIR ?= $(firstword $(wildcard $(addsuffix /$(MODULE), \
$(SUPPORT_OUTPUTDIR)/modules_man $(IMPORT_MODULES_MAN))))
$(eval $(call FillCacheFind, \
$(call FillFindCache, \
$(LIBS_DIR) $(CMDS_DIR) $(CONF_DIR) $(CLASSES_DIR) \
))
)
ifneq ($(LIBS_DIR), )
JMOD_FLAGS += --libs $(LIBS_DIR)
DEPS += $(call CacheFind, $(LIBS_DIR))
DEPS += $(call FindFiles, $(LIBS_DIR))
endif
ifneq ($(CMDS_DIR), )
JMOD_FLAGS += --cmds $(CMDS_DIR)
DEPS += $(call CacheFind, $(CMDS_DIR))
DEPS += $(call FindFiles, $(CMDS_DIR))
endif
ifneq ($(CONF_DIR), )
JMOD_FLAGS += --config $(CONF_DIR)
DEPS += $(call CacheFind, $(CONF_DIR))
DEPS += $(call FindFiles, $(CONF_DIR))
endif
ifneq ($(CLASSES_DIR), )
JMOD_FLAGS += --class-path $(CLASSES_DIR)
DEPS += $(call CacheFind, $(CLASSES_DIR))
DEPS += $(call FindFiles, $(CLASSES_DIR))
endif
ifneq ($(INCLUDE_HEADERS_DIR), )
JMOD_FLAGS += --header-files $(INCLUDE_HEADERS_DIR)
DEPS += $(call CacheFind, $(INCLUDE_HEADERS_DIR))
DEPS += $(call FindFiles, $(INCLUDE_HEADERS_DIR))
endif
ifneq ($(MAN_DIR), )
JMOD_FLAGS += --man-pages $(MAN_DIR)
DEPS += $(call CacheFind, $(MAN_DIR))
DEPS += $(call FindFiles, $(MAN_DIR))
endif
# If a specific modules_legal dir exists for this module, only pick up files
@@ -91,7 +91,7 @@ LEGAL_NOTICES := \
)
LEGAL_NOTICES_PATH := $(call PathList, $(LEGAL_NOTICES))
DEPS += $(call CacheFind, $(LEGAL_NOTICES))
DEPS += $(call FindFiles, $(LEGAL_NOTICES))
JMOD_FLAGS += --legal-notices $(LEGAL_NOTICES_PATH)
@@ -145,7 +145,7 @@ endif
# the actual command. Filter that out using wildcard before adding to DEPS.
DEPS += $(wildcard $(JMOD_CMD))
ifeq ($(EXTERNAL_BUILDJDK), false)
DEPS += $(call CacheFind, $(JDK_OUTPUTDIR)/modules/jdk.jlink/jdk/tools/jmod)
DEPS += $(call FindFiles, $(JDK_OUTPUTDIR)/modules/jdk.jlink/jdk/tools/jmod)
endif
# If creating interim versions of jmods, certain files need to be filtered out

View File

@@ -341,7 +341,7 @@ define SetupApiDocsGenerationBody
$$(SUPPORT_OUTPUTDIR)/docs/$1.vardeps)
# Get a list of all files in all the source dirs for all included modules
$1_SOURCE_DEPS := $$(call CacheFind, $$(wildcard $$(foreach module, \
$1_SOURCE_DEPS := $$(call FindFiles, $$(wildcard $$(foreach module, \
$$($1_ALL_MODULES), $$(call FindModuleSrcDirs, $$(module)))))
# Javadoc creates a lot of files but use index.html as a marker
@@ -496,7 +496,7 @@ JDK_INDEX_TARGETS += $(JDK_INDEX_HTML)
GLOBAL_SPECS_RESOURCES_DIR := $(TOPDIR)/make/data/docs-resources/
$(eval $(call SetupCopyFiles, COPY_GLOBAL_RESOURCES, \
SRC := $(GLOBAL_SPECS_RESOURCES_DIR), \
FILES := $(call CacheFind, $(GLOBAL_SPECS_RESOURCES_DIR)), \
FILES := $(call FindFiles, $(GLOBAL_SPECS_RESOURCES_DIR)), \
DEST := $(DOCS_OUTPUTDIR), \
))
JDK_INDEX_TARGETS += $(COPY_GLOBAL_RESOURCES)
@@ -521,10 +521,10 @@ COPY_SPEC_FILTER := %.html %.gif %.jpg %.mib %.css
$(foreach m, $(ALL_MODULES), \
$(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
$(foreach d, $(SPECS_$m), \
$(if $(filter $(COPY_SPEC_FILTER), $(call CacheFind, $d)), \
$(if $(filter $(COPY_SPEC_FILTER), $(call FindFiles, $d)), \
$(eval $(call SetupCopyFiles, COPY_$m, \
SRC := $d, \
FILES := $(filter $(COPY_SPEC_FILTER), $(call CacheFind, $d)), \
FILES := $(filter $(COPY_SPEC_FILTER), $(call FindFiles, $d)), \
DEST := $(DOCS_OUTPUTDIR)/specs/, \
)) \
$(eval JDK_SPECS_TARGETS += $(COPY_$m)) \
@@ -541,11 +541,11 @@ ifeq ($(ENABLE_FULL_DOCS), true)
$(foreach m, $(ALL_MODULES), \
$(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
$(foreach d, $(SPECS_$m), \
$(if $(filter %.md, $(call CacheFind, $d)), \
$(if $(filter %.md, $(call FindFiles, $d)), \
$(eval $m_$d_NAME := CONVERT_MARKDOWN_$m_$(strip $(call RelativePath, $d, $(TOPDIR)))) \
$(eval $(call SetupProcessMarkdown, $($m_$d_NAME), \
SRC := $d, \
FILES := $(filter %.md, $(call CacheFind, $d)), \
FILES := $(filter %.md, $(call FindFiles, $d)), \
DEST := $(DOCS_OUTPUTDIR)/specs/, \
CSS := $(GLOBAL_SPECS_DEFAULT_CSS_FILE), \
)) \

View File

@@ -276,21 +276,14 @@ endif
ifeq ($(GCOV_ENABLED), true)
GCOV_FIND_EXPR := -type f -name "*.gcno"
$(eval $(call SetupCopyFiles,COPY_HOTSPOT_GCOV_GCNO, \
$(eval $(call SetupCopyFiles,COPY_GCOV_GCNO, \
SRC := $(OUTPUTDIR), \
DEST := $(SYMBOLS_IMAGE_DIR)/gcov, \
FILES := $(shell $(FIND) $(HOTSPOT_OUTPUTDIR) $(GCOV_FIND_EXPR))))
FILES := $(call FindFiles, $(HOTSPOT_OUTPUTDIR) \
$(SUPPORT_OUTPUTDIR)/native, *.gcno) \
))
SYMBOLS_TARGETS += $(COPY_HOTSPOT_GCOV_GCNO)
$(eval $(call SetupCopyFiles,COPY_JDK_GCOV_GCNO, \
SRC := $(OUTPUTDIR), \
DEST := $(SYMBOLS_IMAGE_DIR)/gcov, \
FILES := $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/native $(GCOV_FIND_EXPR))))
SYMBOLS_TARGETS += $(COPY_JDK_GCOV_GCNO)
SYMBOLS_TARGETS += $(COPY_GCOV_GCNO)
endif
@@ -323,10 +316,10 @@ else
# On Macosx, if debug symbols have not been zipped, find all files inside *.dSYM
# dirs.
ifeq ($(OPENJDK_TARGET_OS), macosx)
$(eval $(call FillCacheFind, \
$(SUPPORT_OUTPUTDIR)/modules_cmds $(SUPPORT_OUTPUTDIR)/modules_libs))
$(call FillFindCache, \
$(SUPPORT_OUTPUTDIR)/modules_cmds $(SUPPORT_OUTPUTDIR)/modules_libs)
FindDebuginfoFiles = \
$(if $(wildcard $1), $(call containing, .dSYM/, $(call CacheFind, $1)))
$(if $(wildcard $1), $(call containing, .dSYM/, $(call FindFiles, $1)))
endif
endif

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
# 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
@@ -52,13 +52,13 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
$(eval $(call SetupCopyFiles, COPY_JDK_IMAGE, \
SRC := $(JDK_IMAGE_DIR), \
DEST := $(JDK_MACOSX_CONTENTS_DIR)/Home, \
FILES := $(call CacheFind, $(JDK_IMAGE_DIR)), \
FILES := $(call FindFiles, $(JDK_IMAGE_DIR)), \
))
$(eval $(call SetupCopyFiles, COPY_JRE_IMAGE, \
SRC := $(JRE_IMAGE_DIR), \
DEST := $(JRE_MACOSX_CONTENTS_DIR)/Home, \
FILES := $(call CacheFind, $(JRE_IMAGE_DIR)), \
FILES := $(call FindFiles, $(JRE_IMAGE_DIR)), \
))
$(eval $(call SetupCopyFiles, COPY_LIBJLI_JDK, \

View File

@@ -80,7 +80,7 @@ ifneq ($(CREATING_BUILDJDK), true)
interim-cldrconverter:
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CopyInterimCLDRConverter.gmk)
interim-tzdb:
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CopyInterimTZDB.gmk)
@@ -140,7 +140,7 @@ ifneq ($(CREATING_BUILDJDK), true)
define DeclareModuleInfoRecipe
$1-gensrc-moduleinfo:
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) \
-f GensrcModuleInfo.gmk MODULE=$1)
-f gensrc/GensrcModuleInfo.gmk MODULE=$1)
$1-gensrc: $1-gensrc-moduleinfo
endef
@@ -266,6 +266,52 @@ hotspot-ide-project:
ALL_TARGETS += $(HOTSPOT_VARIANT_TARGETS) $(HOTSPOT_VARIANT_GENSRC_TARGETS) \
$(HOTSPOT_VARIANT_LIBS_TARGETS) hotspot-ide-project
################################################################################
# Generate libs and launcher targets for creating compile_commands.json fragments
define DeclareCompileCommandsRecipe
$1-compile-commands:
$$(call LogInfo, Generating compile_commands.json fragments for $1)
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Main.gmk $1-only \
GENERATE_COMPILE_COMMANDS_ONLY=true)
COMPILE_COMMANDS_TARGETS_$2 += $1-compile-commands
endef
$(foreach t, $(HOTSPOT_VARIANT_LIBS_TARGETS), \
$(eval $(call DeclareCompileCommandsRecipe,$t,HOTSPOT)) \
)
$(foreach t, $(LIBS_TARGETS) $(LAUNCHER_TARGETS), \
$(eval $(call DeclareCompileCommandsRecipe,$t,JDK)) \
)
compile-commands compile-commands-hotspot:
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileCommands.gmk)
ALL_TARGETS += $(COMPILE_COMMANDS_TARGETS_HOTSPOT) $(COMPILE_COMMANDS_TARGETS_JDK)
ALL_TARGETS += compile-commands compile-commands-hotspot
################################################################################
# VS Code projects
vscode-project:
+($(CD) $(TOPDIR)/make/vscode && $(MAKE) $(MAKE_ARGS) -f CreateVSCodeProject.gmk \
VSCODE_INDEXER=cpptools)
vscode-project-clangd:
+($(CD) $(TOPDIR)/make/vscode && $(MAKE) $(MAKE_ARGS) -f CreateVSCodeProject.gmk \
VSCODE_INDEXER=clangd)
vscode-project-rtags:
+($(CD) $(TOPDIR)/make/vscode && $(MAKE) $(MAKE_ARGS) -f CreateVSCodeProject.gmk \
VSCODE_INDEXER=rtags)
vscode-project-ccls:
+($(CD) $(TOPDIR)/make/vscode && $(MAKE) $(MAKE_ARGS) -f CreateVSCodeProject.gmk \
VSCODE_INDEXER=ccls)
ALL_TARGETS += vscode-project vscode-project-clangd vscode-project-rtags \
vscode-project-ccls
################################################################################
# Build demos targets
@@ -563,8 +609,12 @@ test-jdk-jtreg-native:
test-make:
($(CD) $(TOPDIR)/test/make && $(MAKE) $(MAKE_ARGS) -f TestMake.gmk $(TEST_TARGET))
test-compile-commands:
($(CD) $(TOPDIR)/test/make && $(MAKE) $(MAKE_ARGS) -f TestMake.gmk test-compile-commands)
ALL_TARGETS += test test-hotspot-jtreg test-hotspot-jtreg-native \
test-hotspot-internal test-hotspot-gtest test-jdk-jtreg-native test-make
test-hotspot-internal test-hotspot-gtest test-jdk-jtreg-native test-make \
test-compile-commands
################################################################################
# Bundles
@@ -636,7 +686,6 @@ else
# Declare dependencies between hotspot-<variant>* targets
$(foreach v, $(JVM_VARIANTS), \
$(eval hotspot-$v: hotspot-$v-gensrc hotspot-$v-libs) \
$(eval hotspot-$v-gensrc: java.base-copy) \
$(eval hotspot-$v-libs: hotspot-$v-gensrc java.base-copy) \
)
@@ -699,16 +748,17 @@ else
# copied and processed.
java.desktop-gensrc-src: java.base-gensrc java.base-copy
# The annotation processing for jdk.internal.vm.ci and jdk.internal.vm.compiler
# needs classes from the current JDK.
jdk.internal.vm.ci-gensrc-src: $(addsuffix -java, \
$(call FindTransitiveDepsForModule, jdk.internal.vm.ci))
# The annotation processing for jdk.internal.vm.compiler
# and jdk.internal.vm.compiler.management needs classes from the current JDK.
jdk.internal.vm.compiler-gensrc-src: $(addsuffix -java, \
$(call FindTransitiveDepsForModule, jdk.internal.vm.compiler))
jdk.internal.vm.compiler.management-gensrc-src: $(addsuffix -java, \
$(call FindTransitiveDepsForModule, jdk.internal.vm.compiler.management))
# For jdk.internal.vm.compiler, the gensrc step is generating a module-info.java.extra
# For these modules, the gensrc step is generating a module-info.java.extra
# file to be processed by the gensrc-moduleinfo target.
jdk.internal.vm.compiler-gensrc-moduleinfo: jdk.internal.vm.compiler-gensrc-src
jdk.internal.vm.compiler.management-gensrc-moduleinfo: jdk.internal.vm.compiler.management-gensrc-src
jdk.jdeps-gendata: java rmic
@@ -743,6 +793,25 @@ else
$(foreach m, $(ALL_MODULES), $(eval $m-jmod: $($(m)_JMOD_DEPS)))
$(foreach m, $(INTERIM_IMAGE_MODULES), $(eval $m-interim-jmod: $($(m)_JMOD_DEPS)))
# Setup the minimal set of generated native source dependencies for hotspot
$(foreach v, $(JVM_VARIANTS), \
$(eval hotspot-$v-libs-compile-commands: hotspot-$v-gensrc) \
$(foreach m, $(filter java.desktop jdk.hotspot.agent, $(GENSRC_MODULES)), \
$(eval hotspot-$v-libs-compile-commands: $m-gensrc)) \
)
# For the full JDK compile commands, create all possible generated sources
$(foreach m, $(GENSRC_MODULES), $(eval $m-libs-compile-commands: $m-gensrc))
$(foreach m, $(filter $(JAVA_MODULES), $(LIBS_MODULES)), $(eval $m-libs-compile-commands: $m-java))
compile-commands-hotspot: $(COMPILE_COMMANDS_TARGETS_HOTSPOT)
compile-commands: $(COMPILE_COMMANDS_TARGETS_HOTSPOT) $(COMPILE_COMMANDS_TARGETS_JDK)
vscode-project: compile-commands
vscode-project-clangd: compile-commands
vscode-project-rtags: compile-commands
vscode-project-ccls: compile-commands
# Jmods cannot be created until we have the jmod tool ready to run. During
# a normal build we run it from the exploded image, but when cross compiling
# it's run from the buildjdk, which is either created at build time or user
@@ -857,6 +926,8 @@ else
test-make: clean-test-make
test-compile-commands: compile-commands
build-test-lib: exploded-image-optimize
build-test-failure-handler: interim-langtools
@@ -910,6 +981,10 @@ JVM_TOOLS_TARGETS ?= buildtools-hotspot
buildtools: buildtools-langtools interim-langtools interim-rmic \
buildtools-jdk $(JVM_TOOLS_TARGETS)
# Declare dependencies from hotspot-<variant> targets
$(foreach v, $(JVM_VARIANTS), \
$(eval hotspot-$v: hotspot-$v-gensrc hotspot-$v-libs) \
)
hotspot: $(HOTSPOT_VARIANT_TARGETS)
# Create targets hotspot-libs and hotspot-gensrc.
@@ -1086,7 +1161,7 @@ CLEAN_MODULE_PHASE_TARGETS := $(addprefix clean-, $(foreach m, $(ALL_MODULES), \
# Remove everything, except the output from configure.
clean: $(CLEAN_DIR_TARGETS)
($(CD) $(OUTPUTDIR) && $(RM) -r build*.log*)
($(CD) $(OUTPUTDIR) && $(RM) -r build*.log* compile_commands.json)
$(ECHO) Cleaned all build artifacts.
clean-docs:

View File

@@ -100,5 +100,9 @@ $(eval $(call SetupCopyFiles, COPY_CONF, \
$(TARGETS)), \
))
all: $(TARGETS) $(COPY_LIBS_TO_BIN) $(COPY_LIBS_TO_LIB) \
$(COPY_INCLUDE) $(COPY_CMDS) $(COPY_CONF) $(LINK_LIBS_TO_LIB)
ifeq ($(GENERATE_COMPILE_COMMANDS_ONLY), true)
all: $(filter $(MAKESUPPORT_OUTPUTDIR)/compile-commands/%, $(TARGETS))
else
all: $(TARGETS) $(COPY_LIBS_TO_BIN) $(COPY_LIBS_TO_LIB) \
$(COPY_INCLUDE) $(COPY_CMDS) $(COPY_CONF) $(LINK_LIBS_TO_LIB)
endif

View File

@@ -83,7 +83,7 @@ endif
$(eval $(call ParseKeywordVariable, TEST_OPTS, \
SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR, \
STRING_KEYWORDS := VM_OPTIONS JAVA_OPTIONS, \
STRING_KEYWORDS := VM_OPTIONS JAVA_OPTIONS AOT_MODULES, \
))
# Helper function to propagate TEST_OPTS values.
@@ -141,8 +141,93 @@ ifneq ($(wildcard $(JTREG_FAILURE_HANDLER)), )
-timeoutHandlerTimeout:0
endif
GTEST_LAUNCHER_DIRS := $(patsubst %/gtestLauncher, %, $(wildcard $(TEST_IMAGE_DIR)/hotspot/gtest/*/gtestLauncher))
GTEST_VARIANTS := $(strip $(patsubst $(TEST_IMAGE_DIR)/hotspot/gtest/%, %, $(GTEST_LAUNCHER_DIRS)))
GTEST_LAUNCHER_DIRS := $(patsubst %/gtestLauncher, %, \
$(wildcard $(TEST_IMAGE_DIR)/hotspot/gtest/*/gtestLauncher))
GTEST_VARIANTS := $(strip $(patsubst $(TEST_IMAGE_DIR)/hotspot/gtest/%, %, \
$(GTEST_LAUNCHER_DIRS)))
################################################################################
# Optionally create AOT libraries for specified modules before running tests.
# Note, this could not be done during JDK build time.
################################################################################
# Note, this could not be done during JDK build time.
# Parameter 1 is the name of the rule.
#
# Remaining parameters are named arguments.
# MODULE The module to generate a library for
# BIN Output directory in which to put the library
# VM_OPTIONS List of JVM arguments to use when creating library
# OPTIONS_VAR Name of variable to put AOT java options in
# PREREQS_VAR Name of variable to put all AOT prerequisite rule targets in
# for test rules to depend on
#
SetupAotModule = $(NamedParamsMacroTemplate)
define SetupAotModuleBody
$1_AOT_LIB := $$($1_BIN)/$$(call SHARED_LIBRARY,$$($1_MODULE))
$1_AOT_CCLIST := $$(wildcard $$(TOPDIR)/test/hotspot/jtreg/compiler/aot/scripts/$$($1_MODULE)-list.txt)
# Create jaotc flags.
# VM flags which don't affect AOT code generation are filtered out:
# -Xcomp, -XX:+-TieredCompilation
$1_JAOTC_OPTS := \
-J-Xmx4g --info \
$$(addprefix -J, $$(filter-out -Xcomp %TieredCompilation, $$($1_VM_OPTIONS))) \
$$(addprefix --compile-commands$(SPACE), $$($1_AOT_CCLIST)) \
--linker-path $$(LD_JAOTC) \
#
ifneq ($$(filter -ea, $$($1_VM_OPTIONS)), )
$1_JAOTC_OPTS += --compile-with-assertions
endif
$$($1_AOT_LIB): $$(JDK_IMAGE_DIR)/release \
$$(call DependOnVariable, $1_JAOTC_OPTS) \
$$(call DependOnVariable, JDK_IMAGE_DIR)
$$(call LogWarn, Generating $$(patsubst $$(OUTPUTDIR)/%, %, $$@))
$$(call MakeTargetDir)
$$(call ExecuteWithLog, $$@, ( \
$$(FIXPATH) $$(JDK_IMAGE_DIR)/bin/jaotc \
$$($1_JAOTC_OPTS) --output $$@ --module $$($1_MODULE) \
))
$$(call ExecuteWithLog, $$@.check, ( \
$$(FIXPATH) $$(JDK_IMAGE_DIR)/bin/java \
$$($1_VM_OPTIONS) -XX:+UnlockDiagnosticVMOptions \
-XX:+PrintAOT -XX:+UseAOTStrictLoading \
-XX:AOTLibrary=$$@ -version \
> $$@.verify-aot \
))
$1_AOT_OPTIONS += -XX:AOTLibrary=$$($1_AOT_LIB)
$1_AOT_TARGETS += $$($1_AOT_LIB)
endef
# Parameter 1 is the name of the rule.
#
# Remaining parameters are named arguments.
# MODULES The modules to generate a library for
# VM_OPTIONS List of JVM arguments to use when creating libraries
#
# After calling this, the following variables are defined
# $1_AOT_OPTIONS List of all java options needed to use the AOT libraries
# $1_AOT_TARGETS List of all targets that the test rule will need to depend on
#
SetupAot = $(NamedParamsMacroTemplate)
define SetupAotBody
$$(info Running with AOTd libraries for $$($1_MODULES))
# Put aot libraries in a separate directory so they are not deleted between
# test runs and may be reused between make invocations.
$$(foreach m, $$($1_MODULES), \
$$(eval $$(call SetupAotModule, $1_$$m, \
MODULE := $$m, \
BIN := $$(TEST_SUPPORT_DIR)/aot/$1, \
VM_OPTIONS := $$($1_VM_OPTIONS), \
)) \
$$(eval $1_AOT_OPTIONS += $$($1_$$m_AOT_OPTIONS)) \
$$(eval $1_AOT_TARGETS += $$($1_$$m_AOT_TARGETS)) \
)
endef
################################################################################
# Setup global test running parameters
@@ -183,13 +268,17 @@ $(eval $(call SetTestOpt,JAVA_OPTIONS,JTREG))
$(eval $(call SetTestOpt,VM_OPTIONS,GTEST))
$(eval $(call SetTestOpt,JAVA_OPTIONS,GTEST))
$(eval $(call SetTestOpt,AOT_MODULES,JTREG))
$(eval $(call SetTestOpt,AOT_MODULES,GTEST))
$(eval $(call SetTestOpt,JOBS,JTREG))
$(eval $(call SetTestOpt,TIMEOUT_FACTOR,JTREG))
$(eval $(call ParseKeywordVariable, JTREG, \
SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR TEST_MODE ASSERT VERBOSE RETAIN MAX_MEM \
EXTRA_PROBLEM_LISTS KEYWORDS, \
STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS, \
SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR TEST_MODE ASSERT VERBOSE RETAIN \
MAX_MEM, \
STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS KEYWORDS \
EXTRA_PROBLEM_LISTS AOT_MODULES, \
))
ifneq ($(JTREG), )
@@ -199,7 +288,7 @@ endif
$(eval $(call ParseKeywordVariable, GTEST, \
SINGLE_KEYWORDS := REPEAT, \
STRING_KEYWORDS := OPTIONS VM_OPTIONS JAVA_OPTIONS, \
STRING_KEYWORDS := OPTIONS VM_OPTIONS JAVA_OPTIONS AOT_MODULES, \
))
ifneq ($(GTEST), )
@@ -337,7 +426,7 @@ endef
# Helper function to determine if a test specification is a special test
#
# It is a special test if it is "special:" followed by a test name.
# It is a special test if it is "special:" followed by a test name,
define ParseSpecialTestSelection
$(if $(filter special:%, $1), \
$1 \
@@ -428,20 +517,27 @@ define SetupRunGtestTestBody
$1_GTEST_REPEAT :=--gtest_repeat=$$(GTEST_REPEAT)
endif
run-test-$1: $(TEST_PREREQS)
ifneq ($$(GTEST_AOT_MODULES), )
$$(eval $$(call SetupAot, $1, \
MODULES := $$(GTEST_AOT_MODULES), \
VM_OPTIONS := $$(GTEST_VM_OPTIONS) $$(GTEST_JAVA_OPTIONS), \
))
endif
run-test-$1: $$($1_AOT_TARGETS)
$$(call LogWarn)
$$(call LogWarn, Running test '$$($1_TEST)')
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/gtest, \
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/gtest, ( \
$$(FIXPATH) $$(TEST_IMAGE_DIR)/hotspot/gtest/$$($1_VARIANT)/gtestLauncher \
-jdk $(JDK_IMAGE_DIR) $$($1_GTEST_FILTER) \
--gtest_output=xml:$$($1_TEST_RESULTS_DIR)/gtest.xml \
$$($1_GTEST_REPEAT) $$(GTEST_OPTIONS) $$(GTEST_VM_OPTIONS) \
$$($1_GTEST_JAVA_OPTIONS) \
$$(GTEST_JAVA_OPTIONS) $$($1_AOT_OPTIONS) \
> >($(TEE) $$($1_TEST_RESULTS_DIR)/gtest.txt) \
&& $$(ECHO) $$$$? > $$($1_EXITCODE) \
|| $$(ECHO) $$$$? > $$($1_EXITCODE) \
)
))
$1_RESULT_FILE := $$($1_TEST_RESULTS_DIR)/gtest.txt
@@ -609,7 +705,8 @@ define SetupRunJtregTestBody
$1_JTREG_BASIC_OPTIONS += -e:JIB_HOME=$$(JIB_HOME)
endif
$1_JTREG_BASIC_OPTIONS += -e:TEST_IMAGE_GRAAL_DIR=${TEST_IMAGE_DIR}/hotspot/jtreg/graal
$1_JTREG_BASIC_OPTIONS += -e:TEST_IMAGE_DIR=$(TEST_IMAGE_DIR)
$1_JTREG_BASIC_OPTIONS += -e:TEST_IMAGE_GRAAL_DIR=$(TEST_IMAGE_DIR)/hotspot/jtreg/graal
ifneq ($$(JTREG_FAILURE_HANDLER_OPTIONS), )
$1_JTREG_LAUNCHER_OPTIONS += -Djava.library.path="$(JTREG_FAILURE_HANDLER_DIR)"
@@ -626,14 +723,25 @@ define SetupRunJtregTestBody
endif
endif
ifneq ($$(JTREG_AOT_MODULES), )
$$(eval $$(call SetupAot, $1, \
MODULES := $$(JTREG_AOT_MODULES), \
VM_OPTIONS := $$(JTREG_VM_OPTIONS) $$(JTREG_JAVA_OPTIONS), \
))
endif
ifneq ($$($1_AOT_OPTIONS), )
$1_JTREG_BASIC_OPTIONS += -vmoptions:"$$($1_AOT_OPTIONS)"
endif
clean-workdir-$1:
$$(RM) -r $$($1_TEST_SUPPORT_DIR)
run-test-$1: clean-workdir-$1 $(TEST_PREREQS)
run-test-$1: clean-workdir-$1 $$($1_AOT_TARGETS)
$$(call LogWarn)
$$(call LogWarn, Running test '$$($1_TEST)')
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/jtreg, \
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/jtreg, ( \
$$(JAVA) $$($1_JTREG_LAUNCHER_OPTIONS) \
-Dprogram=jtreg -jar $$(JT_HOME)/lib/jtreg.jar \
$$($1_JTREG_BASIC_OPTIONS) \
@@ -646,7 +754,7 @@ define SetupRunJtregTestBody
$$($1_TEST_NAME) \
&& $$(ECHO) $$$$? > $$($1_EXITCODE) \
|| $$(ECHO) $$$$? > $$($1_EXITCODE) \
)
))
$1_RESULT_FILE := $$($1_TEST_RESULTS_DIR)/text/stats.txt
@@ -720,12 +828,12 @@ define SetupRunSpecialTestBody
$$(call LogWarn)
$$(call LogWarn, Running test '$$($1_TEST)')
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/test-execution, \
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/test-execution, ( \
$$($1_TEST_COMMAND_LINE) \
> >($(TEE) $$($1_TEST_RESULTS_DIR)/test-output.txt) \
&& $$(ECHO) $$$$? > $$($1_EXITCODE) \
|| $$(ECHO) $$$$? > $$($1_EXITCODE) \
)
))
$1_RESULT_FILE := $$($1_TEST_RESULTS_DIR)/gtest.txt

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2017, 2018, 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
@@ -95,12 +95,12 @@ endef
# $1: The output file name
# $2..$N: The lines to output to the file
define CreateNewSpec
$(if $(strip $(27)), \
$(if $(strip $(31)), \
$(error Internal makefile error: \
Too many arguments to macro, please update CreateNewSpec in RunTestsPrebuilt.gmk) \
) \
$(shell $(RM) $1) \
$(foreach i, $(call sequence, 2, 26), \
$(foreach i, $(call sequence, 2, 30), \
$(if $(strip $($i)), \
$(call AppendFile, $(strip $($i)), $1) \
) \
@@ -250,6 +250,30 @@ ifeq ($(MEMORY_SIZE), )
MEMORY_SIZE := 1024
endif
# Setup LD for AOT support
ifneq ($(DEVKIT_HOME), )
ifeq ($(OPENJDK_TARGET_OS), windows)
LD_JAOTC := $(DEVKIT_HOME)/VC/bin/x64/link.exe
LIBRARY_PREFIX :=
SHARED_LIBRARY_SUFFIX := .dll
else ifeq ($(OPENJDK_TARGET_OS), linux)
LD_JAOTC := $(DEVKIT_HOME)/bin/ld
LIBRARY_PREFIX := lib
SHARED_LIBRARY_SUFFIX := .so
else ifeq ($(OPENJDK_TARGET_OS), macosx)
LD_JAOTC := $(DEVKIT_HOME)/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
LIBRARY_PREFIX := lib
SHARED_LIBRARY_SUFFIX := .dylib
else ifeq ($(OPENJDK_TARGET_OS), solaris)
# Prefer system linker for AOT on Solaris.
LD_JAOTC := ld
LIBRARY_PREFIX := lib
SHARED_LIBRARY_SUFFIX := .so
endif
else
LD := ld
endif
################################################################################
# Generate the ephemeral spec file
################################################################################
@@ -286,6 +310,9 @@ $(call CreateNewSpec, $(NEW_SPEC), \
OPENJDK_TARGET_CPU_ENDIAN := $(OPENJDK_TARGET_CPU_ENDIAN), \
NUM_CORES := $(NUM_CORES), \
MEMORY_SIZE := $(MEMORY_SIZE), \
LD_JAOTC := $(LD_JAOTC), \
LIBRARY_PREFIX := $(LIBRARY_PREFIX), \
SHARED_LIBRARY_SUFFIX := $(SHARED_LIBRARY_SUFFIX), \
include $(TOPDIR)/make/RunTestsPrebuiltSpec.gmk, \
$(CUSTOM_NEW_SPEC_LINE), \
)

View File

@@ -186,3 +186,7 @@ endif
ifeq ($(OPENJDK_BUILD_OS), windows)
CYGPATH := cygpath
endif
################################################################################
# Simple macros from spec.gmk.in
SHARED_LIBRARY=$(LIBRARY_PREFIX)$1$(SHARED_LIBRARY_SUFFIX)

View File

@@ -37,10 +37,22 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
$(call install-file)
endif
prepare-test-image: $(FIXPATH_COPY)
BUILD_INFO_PROPERTIES := $(TEST_IMAGE_DIR)/build-info.properties
FIXPATH_ECHO := $(FIXPATH) $(call FixPath, $(ECHO))
$(BUILD_INFO_PROPERTIES):
$(call MakeTargetDir)
$(ECHO) "# Build info properties for JDK tests" > $@
$(FIXPATH_ECHO) "build.workspace.root=$(WORKSPACE_ROOT)" >> $@
$(FIXPATH_ECHO) "build.output.root=$(OUTPUTDIR)" >> $@
prepare-test-image: $(FIXPATH_COPY) $(BUILD_INFO_PROPERTIES)
$(call MakeDir, $(TEST_IMAGE_DIR))
$(ECHO) > $(TEST_IMAGE_DIR)/Readme.txt 'JDK test image'
################################################################################
all: prepare-test-image
.PHONY: default all prepare-test-image

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2017, 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
@@ -45,21 +45,13 @@ GLOBAL_SPECS_DEFAULT_CSS_FILE := $(TOPDIR)/make/data/docs-resources/resources/jd
DOCS_DIR := $(TOPDIR)/doc
$(eval $(call SetupProcessMarkdown, building, \
FILES := $(DOCS_DIR)/building.md, \
$(eval $(call SetupProcessMarkdown, md_docs, \
FILES := $(call FindFiles, $(DOCS_DIR), *.md), \
DEST := $(DOCS_DIR), \
CSS := $(GLOBAL_SPECS_DEFAULT_CSS_FILE), \
OPTIONS := --toc, \
))
TARGETS += $(building)
$(eval $(call SetupProcessMarkdown, testing, \
FILES := $(DOCS_DIR)/testing.md, \
DEST := $(DOCS_DIR), \
CSS := $(GLOBAL_SPECS_DEFAULT_CSS_FILE), \
OPTIONS := --toc, \
))
TARGETS += $(testing)
TARGETS += $(md_docs)
################################################################################

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2014, 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
@@ -87,6 +87,7 @@ ifeq ($(SRC_GENERATED), true)
EXCLUDE_FILES := $(SRC_ZIP_EXCLUDE_FILES), \
SUFFIXES := .java, \
ZIP := $(SUPPORT_OUTPUTDIR)/src.zip, \
FOLLOW_SYMLINKS := true, \
))
do-zip: $(BUILD_SRC_ZIP)

View File

@@ -641,6 +641,13 @@ AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
AC_MSG_RESULT([$TOPDIR])
AC_SUBST(TOPDIR)
if test "x$CUSTOM_ROOT" != x; then
WORKSPACE_ROOT="${CUSTOM_ROOT}"
else
WORKSPACE_ROOT="${TOPDIR}"
fi
AC_SUBST(WORKSPACE_ROOT)
# We can only call BASIC_FIXUP_PATH after BASIC_CHECK_PATHS_WINDOWS.
BASIC_FIXUP_PATH(CURDIR)
BASIC_FIXUP_PATH(TOPDIR)
@@ -867,11 +874,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
AC_MSG_RESULT([in build directory with custom name])
fi
if test "x$CUSTOM_ROOT" != x; then
OUTPUTDIR="${CUSTOM_ROOT}/build/${CONF_NAME}"
else
OUTPUTDIR="${TOPDIR}/build/${CONF_NAME}"
fi
OUTPUTDIR="${WORKSPACE_ROOT}/build/${CONF_NAME}"
$MKDIR -p "$OUTPUTDIR"
if test ! -d "$OUTPUTDIR"; then
AC_MSG_ERROR([Could not create build directory $OUTPUTDIR])

View File

@@ -75,6 +75,8 @@ JVM_LDFLAGS := @OPENJDK_BUILD_JVM_LDFLAGS@
JVM_ASFLAGS := @OPENJDK_BUILD_JVM_ASFLAGS@
JVM_LIBS := @OPENJDK_BUILD_JVM_LIBS@
FDLIBM_CFLAGS := @OPENJDK_BUILD_FDLIBM_CFLAGS@
# The compiler for the build platform is likely not warning compatible with the official
# compiler.
WARNINGS_AS_ERRORS := false

View File

@@ -1,5 +1,5 @@
SRC#
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
#
# 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
@@ -98,6 +98,9 @@ HOTSPOT_SETUP_JVM_VARIANTS
# With basic setup done, call the custom early hook.
CUSTOM_EARLY_HOOK
# This only needs debug level to be setup
JDKOPT_ALLOW_ABSOLUTE_PATHS_IN_OUTPUT
# Check if we have devkits, extra paths or sysroot set.
BASIC_SETUP_DEVKIT

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# 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
@@ -371,21 +371,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS],
FLAGS_CPU_LEGACY=$OPENJDK_BUILD_CPU_LEGACY
FLAGS_CPU_LEGACY_LIB=$OPENJDK_BUILD_CPU_LEGACY_LIB
FLAGS_SETUP_CFLAGS_CPU_DEP([BUILD], [OPENJDK_BUILD_])
COMPILER_FP_CONTRACT_OFF_FLAG="-ffp-contract=off"
# Check that the compiler supports -ffp-contract=off flag
# Set FDLIBM_CFLAGS to -ffp-contract=off if it does. Empty
# otherwise.
# These flags are required for GCC-based builds of
# fdlibm with optimization without losing precision.
# Notably, -ffp-contract=off needs to be added for GCC >= 4.6.
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${COMPILER_FP_CONTRACT_OFF_FLAG}],
IF_TRUE: [FDLIBM_CFLAGS=${COMPILER_FP_CONTRACT_OFF_FLAG}],
IF_FALSE: [FDLIBM_CFLAGS=""])
fi
AC_SUBST(FDLIBM_CFLAGS)
FLAGS_SETUP_CFLAGS_CPU_DEP([BUILD], [OPENJDK_BUILD_], [BUILD_])
# Tests are only ever compiled for TARGET
CFLAGS_TESTLIB="$CFLAGS_JDKLIB"
@@ -496,15 +482,14 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
if test "x$TOOLCHAIN_TYPE" = xgcc; then
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -fcheck-new -fstack-protector"
TOOLCHAIN_CFLAGS_JDK="-pipe -fstack-protector"
TOOLCHAIN_CFLAGS_JDK_CONLY="-fno-strict-aliasing" # technically NOT for CXX (but since this gives *worse* performance, use no-strict-aliasing everywhere!)
CXXSTD_CXXFLAG="-std=gnu++98"
FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$CXXSTD_CXXFLAG -Werror],
IF_FALSE: [CXXSTD_CXXFLAG=""])
TOOLCHAIN_CFLAGS_JDK_CXXONLY="$CXXSTD_CXXFLAG"
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM $CXXSTD_CXXFLAG"
ADLC_CXXFLAG="$CXXSTD_CXXFLAG"
# reduce lib size on s390x in link step, this needs also special compile flags
if test "x$OPENJDK_TARGET_CPU" = xs390x; then
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -ffunction-sections -fdata-sections"
TOOLCHAIN_CFLAGS_JDK="$TOOLCHAIN_CFLAGS_JDK -ffunction-sections -fdata-sections"
fi
# technically NOT for CXX (but since this gives *worse* performance, use
# no-strict-aliasing everywhere!)
TOOLCHAIN_CFLAGS_JDK_CONLY="-fno-strict-aliasing"
elif test "x$TOOLCHAIN_TYPE" = xclang; then
# Restrict the debug information created by Clang to avoid
@@ -595,6 +580,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
# Where does this really belong??
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
PICFLAG="-fPIC"
PIEFLAG="-fPIE"
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
PICFLAG="-KPIC"
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
@@ -646,15 +632,13 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
OS_CFLAGS_JVM="$OS_CFLAGS_JVM -DNEEDS_LIBRT"
fi
fi
# EXPORT
AC_SUBST(ADLC_CXXFLAG)
])
################################################################################
# $1 - Either BUILD or TARGET to pick the correct OS/CPU variables to check
# conditionals against.
# $2 - Optional prefix for each variable defined.
# $3 - Optional prefix for compiler variables (either BUILD_ or nothing).
AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
[
#### CPU DEFINES, these should (in theory) be independent on toolchain
@@ -748,6 +732,13 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
$1_CFLAGS_CPU_JDK="${$1_CFLAGS_CPU_JDK} -fno-omit-frame-pointer"
fi
$1_CXXSTD_CXXFLAG="-std=gnu++98"
FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${$1_CXXSTD_CXXFLAG} -Werror],
PREFIX: $3, IF_FALSE: [$1_CXXSTD_CXXFLAG=""])
$1_TOOLCHAIN_CFLAGS_JDK_CXXONLY="${$1_CXXSTD_CXXFLAG}"
$1_TOOLCHAIN_CFLAGS_JVM="${$1_TOOLCHAIN_CFLAGS_JVM} ${$1_CXXSTD_CXXFLAG}"
$2ADLC_CXXFLAG="${$1_CXXSTD_CXXFLAG}"
elif test "x$TOOLCHAIN_TYPE" = xclang; then
if test "x$FLAGS_OS" = xlinux; then
# ppc test not really needed for clang
@@ -784,20 +775,44 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
fi
if test "x$TOOLCHAIN_TYPE" = xgcc; then
TOOLCHAIN_CHECK_COMPILER_VERSION(VERSION: 6, PREFIX: $2, IF_AT_LEAST: FLAGS_SETUP_GCC6_COMPILER_FLAGS($1))
FLAGS_SETUP_GCC6_COMPILER_FLAGS($1, $3)
$1_TOOLCHAIN_CFLAGS="${$1_GCC6_CFLAGS}"
$1_WARNING_CFLAGS_JVM="-Wno-format-zero-length -Wtype-limits -Wuninitialized"
fi
# Prevent the __FILE__ macro from generating absolute paths into the built
# binaries. Depending on toolchain, different mitigations are possible.
# * GCC and Clang of new enough versions have -fmacro-prefix-map.
# * For most other toolchains, supplying all source files and -I flags as
# relative paths fixes the issue.
FILE_MACRO_CFLAGS=
if test "x$ALLOW_ABSOLUTE_PATHS_IN_OUTPUT" = "xfalse"; then
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
# Check if compiler supports -fmacro-prefix-map. If so, use that to make
# the __FILE__ macro resolve to paths relative to the workspace root.
workspace_root_trailing_slash="${WORKSPACE_ROOT%/}/"
FILE_MACRO_CFLAGS="-fmacro-prefix-map=${workspace_root_trailing_slash}="
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${FILE_MACRO_CFLAGS}],
PREFIX: $3,
IF_FALSE: [
FILE_MACRO_CFLAGS=
]
)
fi
fi
AC_SUBST(FILE_MACRO_CFLAGS)
# EXPORT to API
CFLAGS_JVM_COMMON="$ALWAYS_CFLAGS_JVM $ALWAYS_DEFINES_JVM $TOOLCHAIN_CFLAGS_JVM \
CFLAGS_JVM_COMMON="$ALWAYS_CFLAGS_JVM $ALWAYS_DEFINES_JVM \
$TOOLCHAIN_CFLAGS_JVM ${$1_TOOLCHAIN_CFLAGS_JVM} \
$OS_CFLAGS $OS_CFLAGS_JVM $CFLAGS_OS_DEF_JVM $DEBUG_CFLAGS_JVM \
$WARNING_CFLAGS $WARNING_CFLAGS_JVM $JVM_PICFLAG"
$WARNING_CFLAGS $WARNING_CFLAGS_JVM $JVM_PICFLAG $FILE_MACRO_CFLAGS"
CFLAGS_JDK_COMMON="$ALWAYS_CFLAGS_JDK $ALWAYS_DEFINES_JDK $TOOLCHAIN_CFLAGS_JDK \
$OS_CFLAGS $CFLAGS_OS_DEF_JDK $DEBUG_CFLAGS_JDK $DEBUG_OPTIONS_FLAGS_JDK \
$WARNING_CFLAGS $WARNING_CFLAGS_JDK $DEBUG_SYMBOLS_CFLAGS_JDK"
$WARNING_CFLAGS $WARNING_CFLAGS_JDK $DEBUG_SYMBOLS_CFLAGS_JDK \
$FILE_MACRO_CFLAGS"
# Use ${$2EXTRA_CFLAGS} to block EXTRA_CFLAGS to be added to build flags.
# (Currently we don't have any OPENJDK_BUILD_EXTRA_CFLAGS, but that might
@@ -805,7 +820,9 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
CFLAGS_JDK_COMMON_CONLY="$TOOLCHAIN_CFLAGS_JDK_CONLY \
$WARNING_CFLAGS_JDK_CONLY ${$2EXTRA_CFLAGS}"
CFLAGS_JDK_COMMON_CXXONLY="$ALWAYS_DEFINES_JDK_CXXONLY $TOOLCHAIN_CFLAGS_JDK_CXXONLY \
CFLAGS_JDK_COMMON_CXXONLY="$ALWAYS_DEFINES_JDK_CXXONLY \
$TOOLCHAIN_CFLAGS_JDK_CXXONLY \
${$1_TOOLCHAIN_CFLAGS_JDK_CXXONLY} \
$WARNING_CFLAGS_JDK_CXXONLY ${$2EXTRA_CXXFLAGS}"
$1_CFLAGS_JVM="${$1_DEFINES_CPU_JVM} ${$1_CFLAGS_CPU} ${$1_CFLAGS_CPU_JVM} ${$1_TOOLCHAIN_CFLAGS} ${$1_WARNING_CFLAGS_JVM}"
@@ -813,21 +830,40 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
$2JVM_CFLAGS="$CFLAGS_JVM_COMMON ${$1_CFLAGS_JVM} ${$2EXTRA_CXXFLAGS}"
$2CFLAGS_JDKEXE="$CFLAGS_JDK_COMMON $CFLAGS_JDK_COMMON_CONLY ${$1_CFLAGS_JDK}"
$2CXXFLAGS_JDKEXE="$CFLAGS_JDK_COMMON $CFLAGS_JDK_COMMON_CXXONLY ${$1_CFLAGS_JDK}"
$2CFLAGS_JDKLIB="${$2CFLAGS_JDKEXE} $JDK_PICFLAG ${$1_CFLAGS_CPU_JDK_LIBONLY}"
$2CXXFLAGS_JDKLIB="${$2CXXFLAGS_JDKEXE} $JDK_PICFLAG ${$1_CFLAGS_CPU_JDK_LIBONLY}"
$2CFLAGS_JDKEXE="$CFLAGS_JDK_COMMON $CFLAGS_JDK_COMMON_CONLY ${$1_CFLAGS_JDK} $PIEFLAG"
$2CXXFLAGS_JDKEXE="$CFLAGS_JDK_COMMON $CFLAGS_JDK_COMMON_CXXONLY ${$1_CFLAGS_JDK} $PIEFLAG"
$2CFLAGS_JDKLIB="$CFLAGS_JDK_COMMON $CFLAGS_JDK_COMMON_CONLY ${$1_CFLAGS_JDK} \
$JDK_PICFLAG ${$1_CFLAGS_CPU_JDK_LIBONLY}"
$2CXXFLAGS_JDKLIB="$CFLAGS_JDK_COMMON $CFLAGS_JDK_COMMON_CXXONLY ${$1_CFLAGS_JDK} \
$JDK_PICFLAG ${$1_CFLAGS_CPU_JDK_LIBONLY}"
AC_SUBST($2JVM_CFLAGS)
AC_SUBST($2CFLAGS_JDKLIB)
AC_SUBST($2CFLAGS_JDKEXE)
AC_SUBST($2CXXFLAGS_JDKLIB)
AC_SUBST($2CXXFLAGS_JDKEXE)
AC_SUBST($2ADLC_CXXFLAG)
COMPILER_FP_CONTRACT_OFF_FLAG="-ffp-contract=off"
# Check that the compiler supports -ffp-contract=off flag
# Set FDLIBM_CFLAGS to -ffp-contract=off if it does. Empty
# otherwise.
# These flags are required for GCC-based builds of
# fdlibm with optimization without losing precision.
# Notably, -ffp-contract=off needs to be added for GCC >= 4.6.
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${COMPILER_FP_CONTRACT_OFF_FLAG}],
PREFIX: $3,
IF_TRUE: [$2FDLIBM_CFLAGS=${COMPILER_FP_CONTRACT_OFF_FLAG}],
IF_FALSE: [$2FDLIBM_CFLAGS=""])
fi
AC_SUBST($2FDLIBM_CFLAGS)
])
# FLAGS_SETUP_GCC6_COMPILER_FLAGS([PREFIX])
# Arguments:
# $1 - Prefix for each variable defined.
# $2 - Prefix for compiler variables (either BUILD_ or nothing).
AC_DEFUN([FLAGS_SETUP_GCC6_COMPILER_FLAGS],
[
# These flags are required for GCC 6 builds as undefined behaviour in OpenJDK code
@@ -835,14 +871,11 @@ AC_DEFUN([FLAGS_SETUP_GCC6_COMPILER_FLAGS],
# Notably, value range propagation now assumes that the this pointer of C++
# member functions is non-null.
NO_DELETE_NULL_POINTER_CHECKS_CFLAG="-fno-delete-null-pointer-checks"
dnl Argument check is disabled until FLAGS_COMPILER_CHECK_ARGUMENTS handles cross-compilation
dnl FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_DELETE_NULL_POINTER_CHECKS_CFLAG -Werror],
dnl IF_FALSE: [NO_DELETE_NULL_POINTER_CHECKS_CFLAG=""])
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_DELETE_NULL_POINTER_CHECKS_CFLAG -Werror],
PREFIX: $2, IF_FALSE: [NO_DELETE_NULL_POINTER_CHECKS_CFLAG=""])
NO_LIFETIME_DSE_CFLAG="-fno-lifetime-dse"
dnl Argument check is disabled until FLAGS_COMPILER_CHECK_ARGUMENTS handles cross-compilation
dnl FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_LIFETIME_DSE_CFLAG -Werror],
dnl IF_FALSE: [NO_LIFETIME_DSE_CFLAG=""])
AC_MSG_NOTICE([GCC >= 6 detected; adding ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} and ${NO_LIFETIME_DSE_CFLAG}])
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_LIFETIME_DSE_CFLAG -Werror],
PREFIX: $2, IF_FALSE: [NO_LIFETIME_DSE_CFLAG=""])
$1_GCC6_CFLAGS="${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} ${NO_LIFETIME_DSE_CFLAG}"
])

View File

@@ -72,12 +72,14 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
fi
# Add -z defs, to forbid undefined symbols in object files.
BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,-z,defs"
# add relro (mark relocations read only) for all libs
BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,-z,defs -Wl,-z,relro"
# s390x : remove unused code+data in link step
if test "x$OPENJDK_TARGET_CPU" = xs390x; then
BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,--gc-sections -Wl,--print-gc-sections"
fi
BASIC_LDFLAGS_JVM_ONLY="-Wl,-z,noexecstack -Wl,-O1 -Wl,-z,relro"
BASIC_LDFLAGS_JDK_LIB_ONLY="-Wl,-z,noexecstack"
LIBJSIG_NOEXECSTACK_LDFLAGS="-Wl,-z,noexecstack"
BASIC_LDFLAGS_JVM_ONLY="-Wl,-O1"
elif test "x$TOOLCHAIN_TYPE" = xclang; then
BASIC_LDFLAGS_JVM_ONLY="-mno-omit-leaf-frame-pointer -mstack-alignment=16 \
@@ -103,6 +105,12 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
BASIC_LDFLAGS_JVM_ONLY="-opt:icf,8 -subsystem:windows"
fi
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
if test -n "$HAS_NOEXECSTACK"; then
BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,-z,noexecstack"
fi
fi
# Setup OS-dependent LDFLAGS
if test "x$TOOLCHAIN_TYPE" = xclang || test "x$TOOLCHAIN_TYPE" = xgcc; then
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
@@ -118,9 +126,6 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
if test "x$OPENJDK_TARGET_OS" = xlinux; then
if test x$DEBUG_LEVEL = xrelease; then
DEBUGLEVEL_LDFLAGS_JDK_ONLY="$DEBUGLEVEL_LDFLAGS_JDK_ONLY -Wl,-O1"
else
# mark relocations read only on (fast/slow) debug builds
DEBUGLEVEL_LDFLAGS_JDK_ONLY="-Wl,-z,relro"
fi
if test x$DEBUG_LEVEL = xslowdebug; then
# do relocations at load
@@ -140,6 +145,17 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
# Setup LDFLAGS for linking executables
if test "x$TOOLCHAIN_TYPE" = xgcc; then
EXECUTABLE_LDFLAGS="$EXECUTABLE_LDFLAGS -Wl,--allow-shlib-undefined"
# Enabling pie on 32 bit builds prevents the JVM from allocating a continuous
# java heap.
if test "x$OPENJDK_TARGET_CPU_BITS" != "x32"; then
EXECUTABLE_LDFLAGS="$EXECUTABLE_LDFLAGS -pie"
fi
fi
if test "x$ALLOW_ABSOLUTE_PATHS_IN_OUTPUT" = "xfalse"; then
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
BASIC_LDFLAGS="$BASIC_LDFLAGS -pdbaltpath:%_PDB%"
fi
fi
# Export some intermediate variables for compatibility

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