Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8147076

LinkerCallSite.ARGLIMIT is used incorrectly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 10
    • None
    • core-libs
    • None
    • b26
    • generic
    • generic

      We use LinkerCallSite.ARGLIMIT (and its copy, ScriptFunctionData.MAX_ARITY) incorrectly. Namely, parameter lists of methods in Java are not limited to 255 parameters. Rather, they are limited to 255 words, where long and double parameters contribute 2 words. So whenever we test against the ARGLIMIT, we need to count double parameters as 2. This can get tricky as in some cases we might even need to test earlier than we created the type specializations.

      For this reason, maybe we should be conservative and lower the value to 127. With 127, we'll use non-vararg invocation for at most 126 arguments. Even if they're all doubles, that'd mean 252 words + 2 for initial (callee, this). 127 would also allow us to keep using simple parameter length comparison instead of scanning parameter lists for doubles to count them twice.

      For reference, see http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.3.3

            sdama Srinivas Dama (Inactive)
            attila Attila Szegedi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: