--- old/src/java.base/share/classes/java/lang/invoke/LambdaForm.java 2015-01-16 19:37:29.000000000 +0300 +++ new/src/java.base/share/classes/java/lang/invoke/LambdaForm.java 2015-01-16 19:37:29.000000000 +0300 @@ -120,6 +120,7 @@ final int arity; final int result; final boolean forceInline; + final boolean isGWT; @Stable final Name[] names; final String debugName; MemberName vmentry; // low-level behavior, or null if not yet prepared @@ -244,16 +245,17 @@ LambdaForm(String debugName, int arity, Name[] names, int result) { - this(debugName, arity, names, result, true); + this(debugName, arity, names, result, /*forceInline=*/true, /*isGWT=*/false); } LambdaForm(String debugName, - int arity, Name[] names, int result, boolean forceInline) { + int arity, Name[] names, int result, boolean forceInline, boolean isGWT) { assert(namesOK(arity, names)); this.arity = arity; this.result = fixResult(result, names); this.names = names.clone(); this.debugName = fixDebugName(debugName); this.forceInline = forceInline; + this.isGWT = isGWT; int maxOutArity = normalize(); if (maxOutArity > MethodType.MAX_MH_INVOKER_ARITY) { // Cannot use LF interpreter on very high arity expressions. @@ -263,21 +265,25 @@ } LambdaForm(String debugName, int arity, Name[] names) { - this(debugName, arity, names, LAST_RESULT, true); + this(debugName, arity, names, LAST_RESULT, /*forceInline=*/true, /*isGWT=*/false); } LambdaForm(String debugName, - int arity, Name[] names, boolean forceInline) { - this(debugName, arity, names, LAST_RESULT, forceInline); + int arity, Name[] names, boolean forceInline, boolean isGWT) { + this(debugName, arity, names, LAST_RESULT, forceInline, isGWT); } LambdaForm(String debugName, Name[] formals, Name[] temps, Name result) { this(debugName, - formals.length, buildNames(formals, temps, result), LAST_RESULT, true); + formals.length, buildNames(formals, temps, result), LAST_RESULT, /*forceInline=*/true, /*isGWT=*/false); } LambdaForm(String debugName, Name[] formals, Name[] temps, Name result, boolean forceInline) { this(debugName, - formals.length, buildNames(formals, temps, result), LAST_RESULT, forceInline); + formals.length, buildNames(formals, temps, result), LAST_RESULT, forceInline, /*isGWT=*/false); + } + + static LambdaForm makeGuardWithTestForm(int paramCount, Name[] names) { + return new LambdaForm("guard", paramCount, names, /*forceInline=*/true, /*isGWT=*/true); } private static Name[] buildNames(Name[] formals, Name[] temps, Name result) { @@ -291,10 +297,6 @@ } 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. @@ -303,7 +305,8 @@ this.result = (signatureReturn(sig) == V_TYPE ? -1 : arity); this.names = buildEmptyNames(arity, sig); this.debugName = "LF.zero"; - this.forceInline = forceInline; + this.forceInline = true; + this.isGWT = false; assert(nameRefsAreLegal()); assert(isEmpty()); assert(sig.equals(basicTypeSignature())) : sig + " != " + basicTypeSignature(); @@ -1795,6 +1798,15 @@ @interface Hidden { } + /** + * Internal marker which signals JIT that gathered profile is useless. + */ + /*non-public*/ + @Target(ElementType.METHOD) + @Retention(RetentionPolicy.RUNTIME) + @interface IgnoreProfile { + } + private static final HashMap DEBUG_NAME_COUNTERS; static { if (debugEnabled())