-1

Running a JVM with -XX:PrintCompilation, these two lines in the output caught my attention:

252219 6548       3       java.lang.Character::toUpperCase (6 bytes)
252220 6549       3       java.lang.Character::toUpperCase (9 bytes)

Why does that happen?

Michael
  • 41,989
  • 11
  • 82
  • 128
Alex R
  • 11,364
  • 15
  • 100
  • 180
  • As-is, the question lacks details. For one there are two `toUpperCase` methods (one [without parameters](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html#toUpperCase()) and one [with a parameter](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html#toUpperCase(java.util.Locale))). For another, it can well be that the JIT compiler (re-)compiles a method if it deems it necessary. – Turing85 Dec 01 '22 at 00:10
  • @Turing85 I think you answered it (there are two methods!) – Alex R Dec 01 '22 at 00:11
  • @Michael your explanation relating to OSR is verifiably incorrect. OSR compilations are marked by a percent (%) sign. – Alex R Dec 01 '22 at 00:12
  • You don't need to add those edits... – Michael Dec 01 '22 at 00:14

1 Answers1

0

From @Turing85's comment:

there are two toUpperCase methods (one without parameters and one with a parameter)

Alex R
  • 11,364
  • 15
  • 100
  • 180