RVM
  1. RVM
  2. RVM-397

Use Inline.When pragma to replace hard-coded arraycopy hack

    Details

    • Type: Improvement Improvement
    • Status: Open Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 1000
    • Component/s: Compiler: Optimizing
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Inlining the outerlevels of arraycopy when more precise type information than java.lang.Object is known for the array arguments is fairly performance critical as it eliminates the long cascade of instanceof tests.

      Currently this is hacked directly into the inliner. The better way to express this is with an Inline.When pragma that says to inline exactly when we have better type information at compile time (thus putting the condition on the source method where it is easier to maintain instead of buried in the opt compiler).

        Issue Links

          Activity

          Hide
          Ian Rogers added a comment -

          I agree, what would the annotation look like? The hack is that we inline if the first argument to arraycopy is anything other than a java.lang.Object, so would the pragma look like:
          @Inline(When.FirstArgumentIsTypeOtherThanObject)
          It's trivial to code this once we have a nice style for the "when".

          Show
          Ian Rogers added a comment - I agree, what would the annotation look like? The hack is that we inline if the first argument to arraycopy is anything other than a java.lang.Object, so would the pragma look like: @Inline(When.FirstArgumentIsTypeOtherThanObject) It's trivial to code this once we have a nice style for the "when".

            People

            • Assignee:
              Unassigned
              Reporter:
              David Grove
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: