Date: Mon, 5 Jun 2023 20:35:04 +0800
Subject: Optimizing ObjectInputStream by FreqInlineSize

---
 hotspot/src/share/vm/opto/bytecodeInfo.cpp         |  2 +-
 .../share/classes/java/io/ObjectInputStream.java   |  2 +-
 .../share/classes/java/io/ObjectOutputStream.java  |  2 +-
 4 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/hotspot/src/share/vm/opto/bytecodeInfo.cpp b/hotspot/src/share/vm/opto/bytecodeInfo.cpp
index 4fa8e12f1..f9191ec06 100644
--- a/hotspot/src/share/vm/opto/bytecodeInfo.cpp
+++ b/hotspot/src/share/vm/opto/bytecodeInfo.cpp
@@ -171,7 +171,7 @@ bool InlineTree::should_inline(ciMethod* callee_method, ciMethod* caller_method,
       is_unboxing_method(callee_method, C) ||
       is_init_with_ea(callee_method, caller_method, C)) {
 
-    max_inline_size = C->freq_inline_size();
+    max_inline_size = (int)FreqInlineSize;
     if (size <= max_inline_size && TraceFrequencyInlining) {
       CompileTask::print_inline_indent(inline_level());
       tty->print_cr("Inlined frequent method (freq=%d count=%d):", freq, call_site_count);
diff --git a/jdk/src/share/classes/java/io/ObjectInputStream.java b/jdk/src/share/classes/java/io/ObjectInputStream.java
index 85e3958b4..6a7280eab 100644
--- a/jdk/src/share/classes/java/io/ObjectInputStream.java
+++ b/jdk/src/share/classes/java/io/ObjectInputStream.java
@@ -387,7 +387,7 @@ public class ObjectInputStream
     /**
      * value of "useFastSerializer" property
      */
-    private static final boolean defaultFastSerializer = UNSAFE.getUseFastSerializer();
+    private final boolean defaultFastSerializer = UNSAFE.getUseFastSerializer();
 
     /**
      *  true or false for open FastSerilizer
diff --git a/jdk/src/share/classes/java/io/ObjectOutputStream.java b/jdk/src/share/classes/java/io/ObjectOutputStream.java
index 23c1fff59..328f47589 100644
--- a/jdk/src/share/classes/java/io/ObjectOutputStream.java
+++ b/jdk/src/share/classes/java/io/ObjectOutputStream.java
@@ -240,7 +240,7 @@ public class ObjectOutputStream
      * Value of "UseFastSerializer" property. The fastSerializer is turned
      * on when it is true.
      */
-    private static final boolean useFastSerializer = UNSAFE.getUseFastSerializer();
+    private final boolean useFastSerializer = UNSAFE.getUseFastSerializer();
 
     /**
      * value of  "printFastSerializer" property,
-- 
2.22.0

