src/java.base/share/classes/java/lang/invoke/LambdaForm.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
jdk Cdiff src/java.base/share/classes/java/lang/invoke/LambdaForm.java
src/java.base/share/classes/java/lang/invoke/LambdaForm.java
Print this page
rev 10755 : 8059877: GWT branch frequencies pollution due to LF sharing
Reviewed-by: ?
*** 117,126 ****
--- 117,127 ----
* @author John Rose, JSR 292 EG
*/
class LambdaForm {
final int arity;
final int result;
+ final boolean forceInline;
@Stable final Name[] names;
final String debugName;
MemberName vmentry; // low-level behavior, or null if not yet prepared
private boolean isCompiled;
*** 241,273 ****
}
}
LambdaForm(String debugName,
int arity, Name[] names, int result) {
assert(namesOK(arity, names));
this.arity = arity;
this.result = fixResult(result, names);
this.names = names.clone();
this.debugName = fixDebugName(debugName);
int maxOutArity = normalize();
if (maxOutArity > MethodType.MAX_MH_INVOKER_ARITY) {
// Cannot use LF interpreter on very high arity expressions.
assert(maxOutArity <= MethodType.MAX_JVM_ARITY);
compileToBytecode();
}
}
-
LambdaForm(String debugName,
int arity, Name[] names) {
! this(debugName,
! arity, names, LAST_RESULT);
}
-
LambdaForm(String debugName,
Name[] formals, Name[] temps, Name result) {
this(debugName,
! formals.length, buildNames(formals, temps, result), LAST_RESULT);
}
private static Name[] buildNames(Name[] formals, Name[] temps, Name result) {
int arity = formals.length;
int length = arity + temps.length + (result == null ? 0 : 1);
--- 242,285 ----
}
}
LambdaForm(String debugName,
int arity, Name[] names, int result) {
+ this(debugName, arity, names, result, true);
+ }
+ LambdaForm(String debugName,
+ int arity, Name[] names, int result, boolean forceInline) {
assert(namesOK(arity, names));
this.arity = arity;
this.result = fixResult(result, names);
this.names = names.clone();
this.debugName = fixDebugName(debugName);
+ this.forceInline = forceInline;
int maxOutArity = normalize();
if (maxOutArity > MethodType.MAX_MH_INVOKER_ARITY) {
// Cannot use LF interpreter on very high arity expressions.
assert(maxOutArity <= MethodType.MAX_JVM_ARITY);
compileToBytecode();
}
}
LambdaForm(String debugName,
int arity, Name[] names) {
! this(debugName, arity, names, LAST_RESULT, true);
! }
! LambdaForm(String debugName,
! int arity, Name[] names, boolean forceInline) {
! this(debugName, arity, names, LAST_RESULT, forceInline);
}
LambdaForm(String debugName,
Name[] formals, Name[] temps, Name result) {
this(debugName,
! formals.length, buildNames(formals, temps, result), LAST_RESULT, true);
! }
! LambdaForm(String debugName,
! Name[] formals, Name[] temps, Name result, boolean forceInline) {
! this(debugName,
! formals.length, buildNames(formals, temps, result), LAST_RESULT, forceInline);
}
private static Name[] buildNames(Name[] formals, Name[] temps, Name result) {
int arity = formals.length;
int length = arity + temps.length + (result == null ? 0 : 1);
*** 277,294 ****
--- 289,311 ----
names[length - 1] = result;
return names;
}
private LambdaForm(String sig) {
+ this(sig, true);
+ }
+
+ private LambdaForm(String sig, boolean forceInline) {
// Make a blank lambda form, which returns a constant zero or null.
// It is used as a template for managing the invocation of similar forms that are non-empty.
// Called only from getPreparedForm.
assert(isValidSignature(sig));
this.arity = signatureArity(sig);
this.result = (signatureReturn(sig) == V_TYPE ? -1 : arity);
this.names = buildEmptyNames(arity, sig);
this.debugName = "LF.zero";
+ this.forceInline = forceInline;
assert(nameRefsAreLegal());
assert(isEmpty());
assert(sig.equals(basicTypeSignature())) : sig + " != " + basicTypeSignature();
}
src/java.base/share/classes/java/lang/invoke/LambdaForm.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File