RFR(S) 8236236 Eliminate CDS md region and consolidate c++ vtable patching code

Calvin Cheung calvin.cheung at oracle.com
Thu Jan 2 16:55:42 UTC 2020


Hi Ioi,

The code changes look good. I saw the following tests still have 
references to the MD region.

appcds/SharedArchiveConsistency.java and 
appcds/dynamicArchive/ArchiveConsistency.java

Suggested change:

bash-4.2$ hg diff 
test/hotspot/jtreg/runtime/cds/appcds/SharedArchiveConsistency.javadiff 
--git 
a/test/hotspot/jtreg/runtime/cds/appcds/SharedArchiveConsistency.java 
b/test/hotspot/jtreg/runtime/cds/appcds/SharedArchiveConsistency.java
--- a/test/hotspot/jtreg/runtime/cds/appcds/SharedArchiveConsistency.java
+++ b/test/hotspot/jtreg/runtime/cds/appcds/SharedArchiveConsistency.java
@@ -74,7 +74,7 @@
          "mc",          // MiscCode
          "rw",          // ReadWrite
          "ro",          // ReadOnly
-        "md",          // MiscData
+        "bm",          // relocation bitmaps
          "first_closed_archive",
          "last_closed_archive",
          "first_open_archive",
bash-4.2$
bash-4.2$ hg diff 
test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/ArchiveConsistency.java
diff --git 
a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/ArchiveConsistency.java 
b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/ArchiveConsistency.java
--- 
a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/ArchiveConsistency.java
+++ 
b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/ArchiveConsistency.java
@@ -49,7 +49,7 @@
  public class ArchiveConsistency extends DynamicArchiveTestBase {
      public static WhiteBox wb;
      public static int int_size;        // size of int
-    public static String[] shared_region_name = {"MiscCode", 
"ReadWrite", "ReadOnly", "MiscData"};
+    public static String[] shared_region_name = {"MiscCode", 
"ReadWrite", "ReadOnly", "BitMap"};
      public static int num_regions = shared_region_name.length;

      public static void main(String[] args) throws Exception {

thanks,

Calvin

On 12/19/19 3:51 PM, Ioi Lam wrote:
> https://bugs.openjdk.java.net/browse/JDK-8236236
> http://cr.openjdk.java.net/~iklam/jdk15/8236236_remove_cds_md_section.v01/ 
>
>
> This is the first step of:
>
> JDK-8234693 - Consolidate CDS static and dynamic archive dumping code
>
> My plan is to first make the two archives structurally alike, and then
> merge the code that generates them.
>
> ---
>
> Currently the static archive has 4 regions, in the order of MC,RW,RO,MD,
> but the dynamic archive has 3 regions, in the order of RW,RO,MC
>
> The difference in the number and ordering causes special handling 
> code, e.g.,
>
> http://hg.openjdk.java.net/jdk/jdk/file/f33197adda9a/src/hotspot/share/memory/metaspaceShared.cpp#l2303 
>
>
> The MD region is used only for the cloned CPP vtables. It's safe to
> move these into the MC region.
>
> Also, for c++ vtable patching:
>
>   static  archive uses MetaspaceShared::patch_cpp_vtable_pointers()
>   dynamic archive uses 
> MetaspaceShared::fix_cpp_vtable_for_dynamic_archive().
>
> We should consolidate the code to just use the latter.
>
> Thanks
> - Ioi


More information about the hotspot-runtime-dev mailing list