RFR(L): 8143211: provide bytecode intrinsics for loop and try/finally executors

Paul Sandoz paul.sandoz at oracle.com
Wed Jun 22 10:29:37 UTC 2016


> On 16 Jun 2016, at 15:17, Michael Haupt <michael.haupt at oracle.com> wrote:
> 
> Dear all,
> 
> please review this change.
> RFE: https://bugs.openjdk.java.net/browse/JDK-8143211
> Webrev: http://cr.openjdk.java.net/~mhaupt/8143211/webrev.00/
> 

InvokerBytecodeGenerator
—

I agree with Vladimir on the loop state held by InvokerBytecodeGenerator.


 758                     i = i+2; // Jump to the end of GWC idiom
 759                     continue;
 760                 case TRY_FINALLY:
 761                     assert isTryFinally(i);
 762                     onStack = emitTryFinally(i);
 763                     i += 2; // jump to the end of the TF idiom


Might as wall fix up #759 to be consistent.


MethodHandleImpl
—

1762         LambdaForm form = makeLoopForm(type.basicType(),
1763                 init.stream().map(h -> h.type().returnType()).
1764                         map(BasicType::basicTypeChar).
1765                         reduce("", (s, c) -> s + c, (s, t) -> s + t));

map to string and use the joining collector?

  map(rt -> String.valueOf(BasicType.basicTypeChar(rt)).
  collect(Collectors.joining());


Paul.



> The change puts the tryFinally and loop method handle combinator implementations, which were introduced as part of the JEP 274 effort, on a LambdaForm basis, which executes in bytecode generating (default) and LambdaForm interpretation (-Djava.lang.invoke.MethodHandle.COMPILE_THRESHOLD=-1) modes. It also changes the output formatting of LambdaForms, introducing a (hopefully) more readable format.
> 
> Thanks,
> 
> Michael
> 
> --
> 
> <http://www.oracle.com/>
> Dr. Michael Haupt | Principal Member of Technical Staff
> Phone: +49 331 200 7277 | Fax: +49 331 200 7561
> Oracle Java Platform Group | LangTools Team | Nashorn
> Oracle Deutschland B.V. & Co. KG | Schiffbauergasse 14 | 14467 Potsdam, Germany
> 
> ORACLE Deutschland B.V. & Co. KG | Hauptverwaltung: Riesstraße 25, D-80992 München
> Registergericht: Amtsgericht München, HRA 95603
> 
> Komplementärin: ORACLE Deutschland Verwaltung B.V. | Hertogswetering 163/167, 3543 AS Utrecht, Niederlande
> Handelsregister der Handelskammer Midden-Nederland, Nr. 30143697
> Geschäftsführer: Alexander van der Ven, Jan Schultheiss, Val Maher
> <http://www.oracle.com/commitment>	Oracle is committed to developing practices and products that help protect the environment
> 



More information about the core-libs-dev mailing list