<div dir="ltr">Glad to help! Paging for David and Thomas again, who'll probably be able to help you more than I can<div><br></div><div>best regards,</div><div>Julian</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 3, 2024 at 3:54 PM zhengxianwei <<a href="mailto:baikaishiuc@gmail.com">baikaishiuc@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><span style="color:rgb(13,13,13);font-family:Söhne,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif,"Helvetica Neue",Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:16px">I carefully analyzed it and found that what you said is actually correct.</span><div><span style="color:rgb(13,13,13);font-family:Söhne,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif,"Helvetica Neue",Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:16px"><br></span></div><div><span style="color:rgb(13,13,13);font-family:Söhne,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif,"Helvetica Neue",Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:16px">I didn't understand it correctly initially. </span></div><div><span style="color:rgb(13,13,13);font-family:Söhne,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif,"Helvetica Neue",Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:16px"><br></span></div><div><span style="color:rgb(13,13,13);font-family:Söhne,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif,"Helvetica Neue",Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:16px">Thanks again for your explanation</span><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 3, 2024 at 11:03 AM Julian Waters <<a href="mailto:tanksherman27@gmail.com" target="_blank">tanksherman27@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Xian Wei,<div><br></div><div>No, you are right! The code in templateTable_x86.cpp that you linked to in your post is not part of the Just in Time Compilers, it is part of the x86 Interpreter! The Java HotSpot VM actually has 2 different Interpreters, the primary Interpreter is written in large chunks of assembly specific to each platform, which is then processed by the HotSpot macro assemblers. The bytecodeInterpreter.cpp file you linked to is part of the second and less often used Interpreter, which is why modifying the bytecodeInterpreter.cpp instanceof implementation did nothing in your case (The Interpreter used actually depends on the platform, and the secondary Interpreter is not used on ARM or x86). The details on the macro assemblers unfortunately elude me since I am not a HotSpot expert (Although I hope to be one day), but to understand how instanceof works on x86 and ARM, you need to understand both x86 and ARM assembly. The Interpreter's instanceof opcode is implemented on x86 in <a href="https://github.com/openjdk/jdk/blob/6bef0474c8b8773d0d20c0f25c36a2ce9cdbd7e8/src/hotspot/cpu/x86/templateTable_x86.cpp#L4243" target="_blank">https://github.com/openjdk/jdk/blob/6bef0474c8b8773d0d20c0f25c36a2ce9cdbd7e8/src/hotspot/cpu/x86/templateTable_x86.cpp#L4243</a> and on ARM, it is implemented in <a href="https://github.com/openjdk/jdk/blob/6bef0474c8b8773d0d20c0f25c36a2ce9cdbd7e8/src/hotspot/cpu/arm/templateTable_arm.cpp#L4182" target="_blank">https://github.com/openjdk/jdk/blob/6bef0474c8b8773d0d20c0f25c36a2ce9cdbd7e8/src/hotspot/cpu/arm/templateTable_arm.cpp#L4182</a></div><div><br></div><div>Happy to help!</div><div><br></div><div>best regards,</div><div>Julian</div></div>
</blockquote></div>
</blockquote></div>