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

LinkerCallSite.ARGLIMIT is used incorrectly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b26
    • CPU:
      generic
    • OS:
      generic

      Description

      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

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: