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

[lworld] Unnecessary buffering because trivial accessor methods are not C2 compiled

    XMLWordPrintable

    Details

      Description

      Attached src.zip contains some benchmarks for return of value type.
      Here are results:
      Benchmark Mode Cnt Score Error Units
      Ret4.bench_invokeArgInt avgt 5 4.439 ± 0.037 ns/op
      Ret4.bench_invokeArgVal_loc0 avgt 5 4.725 ± 0.106 ns/op
      Ret4.bench_invokeArgVal_loc1 avgt 5 4.729 ± 0.093 ns/op
      Ret4.bench_invokeArgVal_loc2 avgt 5 4.704 ± 0.056 ns/op
      Ret4.bench_invokeIF avgt 5 7.349 ± 0.360 ns/op
      Ret4.bench_invokeNew avgt 5 4.185 ± 0.083 ns/op
      Ret4.bench_invokeSF avgt 5 4.453 ± 0.041 ns/op

      Benchmarks cover different behavior:
      invokeNew() - return new Value(<const>);
      invokeSF() - return <static field>
      invokeIF() - return <instance field>
      invokeArgInt(int) - return new Value(<arg>);
      invokeArgVal(VInteger v) - return <arg>;

      All benchmarks behave the same except "invokeIF".
      Code generated for "invokeIF" does unnecessary value buffering:

      Ret4.bench_invokeArgInt:·gc.alloc.rate.norm avgt 5 ≈ 10⁻⁶ B/op
      Ret4.bench_invokeArgVal_loc0:·gc.alloc.rate.norm avgt 5 ≈ 10⁻⁶ B/op
      Ret4.bench_invokeArgVal_loc1:·gc.alloc.rate.norm avgt 5 ≈ 10⁻⁶ B/op
      Ret4.bench_invokeArgVal_loc2:·gc.alloc.rate.norm avgt 5 ≈ 10⁻⁶ B/op
      Ret4.bench_invokeIF:·gc.alloc.rate.norm avgt 5 16.001 ± 0.001 B/op
      Ret4.bench_invokeNew:·gc.alloc.rate.norm avgt 5 ≈ 10⁻⁶ B/op
      Ret4.bench_invokeSF:·gc.alloc.rate.norm avgt 5 ≈ 10⁻⁶ B/op

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              thartmann Tobias Hartmann
              Reporter:
              skuksenko Sergey Kuksenko
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: