src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File jdk Sdiff src/java.base/share/classes/java/lang/invoke

src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java

Print this page
rev 11254 : 8063137: Never-taken branches should be pruned when GWT LambdaForms are shared
Reviewed-by: ?
rev 11255 : [mq]: gwt.profile.1
rev 11256 : [mq]: gwt.profile.2
rev 11257 : [mq]: gwt.profile.3


 618 
 619     /**
 620      * Generate an invoker method for the passed {@link LambdaForm}.
 621      */
 622     private byte[] generateCustomizedCodeBytes() {
 623         classFilePrologue();
 624 
 625         // Suppress this method in backtraces displayed to the user.
 626         mv.visitAnnotation("Ljava/lang/invoke/LambdaForm$Hidden;", true);
 627 
 628         // Mark this method as a compiled LambdaForm
 629         mv.visitAnnotation("Ljava/lang/invoke/LambdaForm$Compiled;", true);
 630 
 631         if (lambdaForm.forceInline) {
 632             // Force inlining of this invoker method.
 633             mv.visitAnnotation("Ljava/lang/invoke/ForceInline;", true);
 634         } else {
 635             mv.visitAnnotation("Ljava/lang/invoke/DontInline;", true);
 636         }
 637 
 638 
 639         // iterate over the form's names, generating bytecode instructions for each
 640         // start iterating at the first name following the arguments
 641         Name onStack = null;
 642         for (int i = lambdaForm.arity; i < lambdaForm.names.length; i++) {
 643             Name name = lambdaForm.names[i];
 644 
 645             emitStoreResult(onStack);
 646             onStack = name;  // unless otherwise modified below
 647             MethodHandleImpl.Intrinsic intr = name.function.intrinsicName();
 648             switch (intr) {
 649                 case SELECT_ALTERNATIVE:
 650                     assert isSelectAlternative(i);
 651                     onStack = emitSelectAlternative(name, lambdaForm.names[i+1]);
 652                     i++;  // skip MH.invokeBasic of the selectAlternative result
 653                     continue;
 654                 case GUARD_WITH_CATCH:
 655                     assert isGuardWithCatch(i);
 656                     onStack = emitGuardWithCatch(i);
 657                     i = i+2; // Jump to the end of GWC idiom
 658                     continue;




 618 
 619     /**
 620      * Generate an invoker method for the passed {@link LambdaForm}.
 621      */
 622     private byte[] generateCustomizedCodeBytes() {
 623         classFilePrologue();
 624 
 625         // Suppress this method in backtraces displayed to the user.
 626         mv.visitAnnotation("Ljava/lang/invoke/LambdaForm$Hidden;", true);
 627 
 628         // Mark this method as a compiled LambdaForm
 629         mv.visitAnnotation("Ljava/lang/invoke/LambdaForm$Compiled;", true);
 630 
 631         if (lambdaForm.forceInline) {
 632             // Force inlining of this invoker method.
 633             mv.visitAnnotation("Ljava/lang/invoke/ForceInline;", true);
 634         } else {
 635             mv.visitAnnotation("Ljava/lang/invoke/DontInline;", true);
 636         }
 637 

 638         // iterate over the form's names, generating bytecode instructions for each
 639         // start iterating at the first name following the arguments
 640         Name onStack = null;
 641         for (int i = lambdaForm.arity; i < lambdaForm.names.length; i++) {
 642             Name name = lambdaForm.names[i];
 643 
 644             emitStoreResult(onStack);
 645             onStack = name;  // unless otherwise modified below
 646             MethodHandleImpl.Intrinsic intr = name.function.intrinsicName();
 647             switch (intr) {
 648                 case SELECT_ALTERNATIVE:
 649                     assert isSelectAlternative(i);
 650                     onStack = emitSelectAlternative(name, lambdaForm.names[i+1]);
 651                     i++;  // skip MH.invokeBasic of the selectAlternative result
 652                     continue;
 653                 case GUARD_WITH_CATCH:
 654                     assert isGuardWithCatch(i);
 655                     onStack = emitGuardWithCatch(i);
 656                     i = i+2; // Jump to the end of GWC idiom
 657                     continue;


src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File