RFR(S): 8148752: Compiled StringBuilder code throws StringIndexOutOfBoundsException
christian.thalinger at oracle.com
Tue Feb 9 21:57:41 UTC 2016
Ouch. Gotta hate long/double-slots. Thanks for fixing my bug.
> On Feb 9, 2016, at 2:01 AM, Tobias Hartmann <tobias.hartmann at oracle.com> wrote:
> please review the following patch.
> GraphBuilder::try_method_handle_inline() handles long and double arguments incorrectly when casting them to their actual type. Long/double arguments occupy two slots (see Parse::do_get_xxx() -> push_pair()). Currently, these two slots are treated as two individual arguments, causing incorrect casting of arguments.
> In this case, an Object argument is casted to String and therefore being used as a String (although it's actually of type 'ResolvedJavaMethod'). We later fail by throwing exceptions in compiled code. For a detailed evaluation see my comments in the bug .
> We should handle this like C1 does in GraphBuilder::try_method_handle_inline().
>  https://bugs.openjdk.java.net/browse/JDK-8148752?focusedCommentId=13896557&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13896557
More information about the hotspot-compiler-dev