Java Code Examples for jdk.nashorn.internal.lookup.MethodHandleFactory#addDebugPrintout()
The following examples show how to use
jdk.nashorn.internal.lookup.MethodHandleFactory#addDebugPrintout() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GlobalConstants.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
private MethodHandle constantGetter(final Object c) { final MethodHandle mh = staticConstantGetter(c); if (log.isEnabled()) { return MethodHandleFactory.addDebugPrintout(log, Level.FINEST, mh, "getting as constant"); } return mh; }
Example 2
Source File: GlobalConstants.java From hottub with GNU General Public License v2.0 | 5 votes |
private MethodHandle constantGetter(final Object c) { final MethodHandle mh = staticConstantGetter(c); if (log.isEnabled()) { return MethodHandleFactory.addDebugPrintout(log, Level.FINEST, mh, "getting as constant"); } return mh; }
Example 3
Source File: GlobalConstants.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
private MethodHandle constantGetter(final Object c) { final MethodHandle mh = staticConstantGetter(c); if (log.isEnabled()) { return MethodHandleFactory.addDebugPrintout(log, Level.FINEST, mh, "getting as constant"); } return mh; }
Example 4
Source File: GlobalConstants.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private MethodHandle constantGetter(final Object c) { final MethodHandle mh = staticConstantGetter(c); if (log.isEnabled()) { return MethodHandleFactory.addDebugPrintout(log, Level.FINEST, mh, "getting as constant"); } return mh; }
Example 5
Source File: GlobalConstants.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
private MethodHandle constantGetter(final Object c) { final MethodHandle mh = staticConstantGetter(c); if (log.isEnabled()) { return MethodHandleFactory.addDebugPrintout(log, Level.FINEST, mh, "getting as constant"); } return mh; }
Example 6
Source File: GlobalConstants.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
private MethodHandle constantGetter(final Object c) { final MethodHandle mh = staticConstantGetter(c); if (log.isEnabled()) { return MethodHandleFactory.addDebugPrintout(log, Level.FINEST, mh, "getting as constant"); } return mh; }
Example 7
Source File: GlobalConstants.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
/** * Try to turn a getter into a MethodHandle.constant, if possible * * @param find property lookup * @param receiver receiver * @param desc callsite descriptor * * @return resulting getter, or null if failed to create constant */ GuardedInvocation findGetMethod(final FindProperty find, final ScriptObject receiver, final CallSiteDescriptor desc) { // Only use constant getter for fast scope access, because the receiver may change between invocations // for slow-scope and non-scope callsites. // Also return null for user accessor properties as they may have side effects. if (invalidatedForever.get() || !NashornCallSiteDescriptor.isFastScope(desc) || (GLOBAL_ONLY && !find.getOwner().isGlobal()) || find.getProperty() instanceof UserAccessorProperty) { return null; } final boolean isOptimistic = NashornCallSiteDescriptor.isOptimistic(desc); final int programPoint = isOptimistic ? getProgramPoint(desc) : INVALID_PROGRAM_POINT; final Class<?> retType = desc.getMethodType().returnType(); final String name = desc.getNameToken(CallSiteDescriptor.NAME_OPERAND); synchronized (this) { final Access acc = getOrCreateSwitchPoint(name); log.fine("Starting to look up object value " + name); final Object c = find.getObjectValue(); if (log.isEnabled()) { log.fine("Trying to link constant GETTER " + acc + " value = " + c); } if (acc.hasBeenInvalidated() || acc.guardFailed() || invalidatedForever.get()) { if (log.isEnabled()) { log.info("*** GET: Giving up on " + quote(name) + " - retry count has exceeded " + DynamicLinker.getLinkedCallSiteLocation()); } return null; } final MethodHandle cmh = constantGetter(c); MethodHandle mh; MethodHandle guard; if (isOptimistic) { if (JSType.getAccessorTypeIndex(cmh.type().returnType()) <= JSType.getAccessorTypeIndex(retType)) { //widen return type - this is pessimistic, so it will always work mh = MH.asType(cmh, cmh.type().changeReturnType(retType)); } else { //immediately invalidate - we asked for a too wide constant as a narrower one mh = MH.dropArguments(MH.insertArguments(JSType.THROW_UNWARRANTED.methodHandle(), 0, c, programPoint), 0, Object.class); } } else { //pessimistic return type filter mh = Lookup.filterReturnType(cmh, retType); } if (find.getOwner().isGlobal()) { guard = null; } else { guard = MH.insertArguments(RECEIVER_GUARD, 0, acc, receiver); } if (log.isEnabled()) { log.info("Linked getter " + quote(name) + " as MethodHandle.constant() -> " + c + " " + acc.getSwitchPoint()); mh = MethodHandleFactory.addDebugPrintout(log, Level.FINE, mh, "get const " + acc); } return new GuardedInvocation(mh, guard, acc.getSwitchPoint(), null); } }
Example 8
Source File: GlobalConstants.java From jdk8u_nashorn with GNU General Public License v2.0 | 4 votes |
/** * Try to turn a getter into a MethodHandle.constant, if possible * * @param find property lookup * @param receiver receiver * @param desc callsite descriptor * * @return resulting getter, or null if failed to create constant */ GuardedInvocation findGetMethod(final FindProperty find, final ScriptObject receiver, final CallSiteDescriptor desc) { // Only use constant getter for fast scope access, because the receiver may change between invocations // for slow-scope and non-scope callsites. // Also return null for user accessor properties as they may have side effects. if (invalidatedForever.get() || !NashornCallSiteDescriptor.isFastScope(desc) || (GLOBAL_ONLY && !find.getOwner().isGlobal()) || find.getProperty() instanceof UserAccessorProperty) { return null; } final boolean isOptimistic = NashornCallSiteDescriptor.isOptimistic(desc); final int programPoint = isOptimistic ? getProgramPoint(desc) : INVALID_PROGRAM_POINT; final Class<?> retType = desc.getMethodType().returnType(); final String name = desc.getNameToken(CallSiteDescriptor.NAME_OPERAND); synchronized (this) { final Access acc = getOrCreateSwitchPoint(name); log.fine("Starting to look up object value " + name); final Object c = find.getObjectValue(); if (log.isEnabled()) { log.fine("Trying to link constant GETTER " + acc + " value = " + c); } if (acc.hasBeenInvalidated() || acc.guardFailed() || invalidatedForever.get()) { if (log.isEnabled()) { log.info("*** GET: Giving up on " + quote(name) + " - retry count has exceeded " + DynamicLinker.getLinkedCallSiteLocation()); } return null; } final MethodHandle cmh = constantGetter(c); MethodHandle mh; MethodHandle guard; if (isOptimistic) { if (JSType.getAccessorTypeIndex(cmh.type().returnType()) <= JSType.getAccessorTypeIndex(retType)) { //widen return type - this is pessimistic, so it will always work mh = MH.asType(cmh, cmh.type().changeReturnType(retType)); } else { //immediately invalidate - we asked for a too wide constant as a narrower one mh = MH.dropArguments(MH.insertArguments(JSType.THROW_UNWARRANTED.methodHandle(), 0, c, programPoint), 0, Object.class); } } else { //pessimistic return type filter mh = Lookup.filterReturnType(cmh, retType); } if (find.getOwner().isGlobal()) { guard = null; } else { guard = MH.insertArguments(RECEIVER_GUARD, 0, acc, receiver); } if (log.isEnabled()) { log.info("Linked getter " + quote(name) + " as MethodHandle.constant() -> " + c + " " + acc.getSwitchPoint()); mh = MethodHandleFactory.addDebugPrintout(log, Level.FINE, mh, "get const " + acc); } return new GuardedInvocation(mh, guard, acc.getSwitchPoint(), null); } }
Example 9
Source File: GlobalConstants.java From hottub with GNU General Public License v2.0 | 4 votes |
/** * Try to turn a getter into a MethodHandle.constant, if possible * * @param find property lookup * @param receiver receiver * @param desc callsite descriptor * * @return resulting getter, or null if failed to create constant */ GuardedInvocation findGetMethod(final FindProperty find, final ScriptObject receiver, final CallSiteDescriptor desc) { // Only use constant getter for fast scope access, because the receiver may change between invocations // for slow-scope and non-scope callsites. // Also return null for user accessor properties as they may have side effects. if (invalidatedForever.get() || !NashornCallSiteDescriptor.isFastScope(desc) || (GLOBAL_ONLY && !find.getOwner().isGlobal()) || find.getProperty() instanceof UserAccessorProperty) { return null; } final boolean isOptimistic = NashornCallSiteDescriptor.isOptimistic(desc); final int programPoint = isOptimistic ? getProgramPoint(desc) : INVALID_PROGRAM_POINT; final Class<?> retType = desc.getMethodType().returnType(); final String name = desc.getNameToken(CallSiteDescriptor.NAME_OPERAND); synchronized (this) { final Access acc = getOrCreateSwitchPoint(name); log.fine("Starting to look up object value " + name); final Object c = find.getObjectValue(); if (log.isEnabled()) { log.fine("Trying to link constant GETTER " + acc + " value = " + c); } if (acc.hasBeenInvalidated() || acc.guardFailed() || invalidatedForever.get()) { if (log.isEnabled()) { log.info("*** GET: Giving up on " + quote(name) + " - retry count has exceeded " + DynamicLinker.getLinkedCallSiteLocation()); } return null; } final MethodHandle cmh = constantGetter(c); MethodHandle mh; MethodHandle guard; if (isOptimistic) { if (JSType.getAccessorTypeIndex(cmh.type().returnType()) <= JSType.getAccessorTypeIndex(retType)) { //widen return type - this is pessimistic, so it will always work mh = MH.asType(cmh, cmh.type().changeReturnType(retType)); } else { //immediately invalidate - we asked for a too wide constant as a narrower one mh = MH.dropArguments(MH.insertArguments(JSType.THROW_UNWARRANTED.methodHandle(), 0, c, programPoint), 0, Object.class); } } else { //pessimistic return type filter mh = Lookup.filterReturnType(cmh, retType); } if (find.getOwner().isGlobal()) { guard = null; } else { guard = MH.insertArguments(RECEIVER_GUARD, 0, acc, receiver); } if (log.isEnabled()) { log.info("Linked getter " + quote(name) + " as MethodHandle.constant() -> " + c + " " + acc.getSwitchPoint()); mh = MethodHandleFactory.addDebugPrintout(log, Level.FINE, mh, "get const " + acc); } return new GuardedInvocation(mh, guard, acc.getSwitchPoint(), null); } }
Example 10
Source File: GlobalConstants.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
/** * Try to turn a getter into a MethodHandle.constant, if possible * * @param find property lookup * @param receiver receiver * @param desc callsite descriptor * * @return resulting getter, or null if failed to create constant */ GuardedInvocation findGetMethod(final FindProperty find, final ScriptObject receiver, final CallSiteDescriptor desc) { // Only use constant getter for fast scope access, because the receiver may change between invocations // for slow-scope and non-scope callsites. // Also return null for user accessor properties as they may have side effects. if (invalidatedForever.get() || !NashornCallSiteDescriptor.isFastScope(desc) || (GLOBAL_ONLY && !find.getOwner().isGlobal()) || find.getProperty() instanceof UserAccessorProperty) { return null; } final boolean isOptimistic = NashornCallSiteDescriptor.isOptimistic(desc); final int programPoint = isOptimistic ? getProgramPoint(desc) : INVALID_PROGRAM_POINT; final Class<?> retType = desc.getMethodType().returnType(); final String name = NashornCallSiteDescriptor.getOperand(desc); synchronized (this) { final Access acc = getOrCreateSwitchPoint(name); log.fine("Starting to look up object value " + name); final Object c = find.getObjectValue(); if (log.isEnabled()) { log.fine("Trying to link constant GETTER " + acc + " value = " + c); } if (acc.hasBeenInvalidated() || acc.guardFailed() || invalidatedForever.get()) { if (log.isEnabled()) { log.info("*** GET: Giving up on " + quote(name) + " - retry count has exceeded " + DynamicLinker.getLinkedCallSiteLocation()); } return null; } final MethodHandle cmh = constantGetter(c); MethodHandle mh; MethodHandle guard; if (isOptimistic) { if (JSType.getAccessorTypeIndex(cmh.type().returnType()) <= JSType.getAccessorTypeIndex(retType)) { //widen return type - this is pessimistic, so it will always work mh = MH.asType(cmh, cmh.type().changeReturnType(retType)); } else { //immediately invalidate - we asked for a too wide constant as a narrower one mh = MH.dropArguments(MH.insertArguments(JSType.THROW_UNWARRANTED.methodHandle(), 0, c, programPoint), 0, Object.class); } } else { //pessimistic return type filter mh = Lookup.filterReturnType(cmh, retType); } if (find.getOwner().isGlobal()) { guard = null; } else { guard = MH.insertArguments(RECEIVER_GUARD, 0, acc, receiver); } if (log.isEnabled()) { log.info("Linked getter " + quote(name) + " as MethodHandle.constant() -> " + c + " " + acc.getSwitchPoint()); mh = MethodHandleFactory.addDebugPrintout(log, Level.FINE, mh, "get const " + acc); } return new GuardedInvocation(mh, guard, acc.getSwitchPoint(), null); } }
Example 11
Source File: GlobalConstants.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
/** * Try to turn a getter into a MethodHandle.constant, if possible * * @param find property lookup * @param receiver receiver * @param desc callsite descriptor * * @return resulting getter, or null if failed to create constant */ GuardedInvocation findGetMethod(final FindProperty find, final ScriptObject receiver, final CallSiteDescriptor desc) { // Only use constant getter for fast scope access, because the receiver may change between invocations // for slow-scope and non-scope callsites. // Also return null for user accessor properties as they may have side effects. if (invalidatedForever.get() || !NashornCallSiteDescriptor.isFastScope(desc) || (GLOBAL_ONLY && !find.getOwner().isGlobal()) || find.getProperty() instanceof UserAccessorProperty) { return null; } final boolean isOptimistic = NashornCallSiteDescriptor.isOptimistic(desc); final int programPoint = isOptimistic ? getProgramPoint(desc) : INVALID_PROGRAM_POINT; final Class<?> retType = desc.getMethodType().returnType(); final String name = desc.getNameToken(CallSiteDescriptor.NAME_OPERAND); synchronized (this) { final Access acc = getOrCreateSwitchPoint(name); log.fine("Starting to look up object value " + name); final Object c = find.getObjectValue(); if (log.isEnabled()) { log.fine("Trying to link constant GETTER " + acc + " value = " + c); } if (acc.hasBeenInvalidated() || acc.guardFailed() || invalidatedForever.get()) { if (log.isEnabled()) { log.info("*** GET: Giving up on " + quote(name) + " - retry count has exceeded " + DynamicLinker.getLinkedCallSiteLocation()); } return null; } final MethodHandle cmh = constantGetter(c); MethodHandle mh; MethodHandle guard; if (isOptimistic) { if (JSType.getAccessorTypeIndex(cmh.type().returnType()) <= JSType.getAccessorTypeIndex(retType)) { //widen return type - this is pessimistic, so it will always work mh = MH.asType(cmh, cmh.type().changeReturnType(retType)); } else { //immediately invalidate - we asked for a too wide constant as a narrower one mh = MH.dropArguments(MH.insertArguments(JSType.THROW_UNWARRANTED.methodHandle(), 0, c, programPoint), 0, Object.class); } } else { //pessimistic return type filter mh = Lookup.filterReturnType(cmh, retType); } if (find.getOwner().isGlobal()) { guard = null; } else { guard = MH.insertArguments(RECEIVER_GUARD, 0, acc, receiver); } if (log.isEnabled()) { log.info("Linked getter " + quote(name) + " as MethodHandle.constant() -> " + c + " " + acc.getSwitchPoint()); mh = MethodHandleFactory.addDebugPrintout(log, Level.FINE, mh, "get const " + acc); } return new GuardedInvocation(mh, guard, acc.getSwitchPoint(), null); } }
Example 12
Source File: GlobalConstants.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
/** * Try to turn a getter into a MethodHandle.constant, if possible * * @param find property lookup * @param receiver receiver * @param desc callsite descriptor * * @return resulting getter, or null if failed to create constant */ GuardedInvocation findGetMethod(final FindProperty find, final ScriptObject receiver, final CallSiteDescriptor desc) { // Only use constant getter for fast scope access, because the receiver may change between invocations // for slow-scope and non-scope callsites. // Also return null for user accessor properties as they may have side effects. if (invalidatedForever.get() || !NashornCallSiteDescriptor.isFastScope(desc) || (GLOBAL_ONLY && !find.getOwner().isGlobal()) || find.getProperty() instanceof UserAccessorProperty) { return null; } final boolean isOptimistic = NashornCallSiteDescriptor.isOptimistic(desc); final int programPoint = isOptimistic ? getProgramPoint(desc) : INVALID_PROGRAM_POINT; final Class<?> retType = desc.getMethodType().returnType(); final String name = desc.getNameToken(CallSiteDescriptor.NAME_OPERAND); synchronized (this) { final Access acc = getOrCreateSwitchPoint(name); log.fine("Starting to look up object value " + name); final Object c = find.getObjectValue(); if (log.isEnabled()) { log.fine("Trying to link constant GETTER " + acc + " value = " + c); } if (acc.hasBeenInvalidated() || acc.guardFailed() || invalidatedForever.get()) { if (log.isEnabled()) { log.info("*** GET: Giving up on " + quote(name) + " - retry count has exceeded " + DynamicLinker.getLinkedCallSiteLocation()); } return null; } final MethodHandle cmh = constantGetter(c); MethodHandle mh; MethodHandle guard; if (isOptimistic) { if (JSType.getAccessorTypeIndex(cmh.type().returnType()) <= JSType.getAccessorTypeIndex(retType)) { //widen return type - this is pessimistic, so it will always work mh = MH.asType(cmh, cmh.type().changeReturnType(retType)); } else { //immediately invalidate - we asked for a too wide constant as a narrower one mh = MH.dropArguments(MH.insertArguments(JSType.THROW_UNWARRANTED.methodHandle(), 0, c, programPoint), 0, Object.class); } } else { //pessimistic return type filter mh = Lookup.filterReturnType(cmh, retType); } if (find.getOwner().isGlobal()) { guard = null; } else { guard = MH.insertArguments(RECEIVER_GUARD, 0, acc, receiver); } if (log.isEnabled()) { log.info("Linked getter " + quote(name) + " as MethodHandle.constant() -> " + c + " " + acc.getSwitchPoint()); mh = MethodHandleFactory.addDebugPrintout(log, Level.FINE, mh, "get const " + acc); } return new GuardedInvocation(mh, guard, acc.getSwitchPoint(), null); } }
Example 13
Source File: GlobalConstants.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
/** * Try to turn a getter into a MethodHandle.constant, if possible * * @param find property lookup * @param receiver receiver * @param desc callsite descriptor * * @return resulting getter, or null if failed to create constant */ GuardedInvocation findGetMethod(final FindProperty find, final ScriptObject receiver, final CallSiteDescriptor desc) { // Only use constant getter for fast scope access, because the receiver may change between invocations // for slow-scope and non-scope callsites. // Also return null for user accessor properties as they may have side effects. if (invalidatedForever.get() || !NashornCallSiteDescriptor.isFastScope(desc) || (GLOBAL_ONLY && !find.getOwner().isGlobal()) || find.getProperty() instanceof UserAccessorProperty) { return null; } final boolean isOptimistic = NashornCallSiteDescriptor.isOptimistic(desc); final int programPoint = isOptimistic ? getProgramPoint(desc) : INVALID_PROGRAM_POINT; final Class<?> retType = desc.getMethodType().returnType(); final String name = desc.getNameToken(CallSiteDescriptor.NAME_OPERAND); synchronized (this) { final Access acc = getOrCreateSwitchPoint(name); log.fine("Starting to look up object value " + name); final Object c = find.getObjectValue(); if (log.isEnabled()) { log.fine("Trying to link constant GETTER " + acc + " value = " + c); } if (acc.hasBeenInvalidated() || acc.guardFailed() || invalidatedForever.get()) { if (log.isEnabled()) { log.info("*** GET: Giving up on " + quote(name) + " - retry count has exceeded " + DynamicLinker.getLinkedCallSiteLocation()); } return null; } final MethodHandle cmh = constantGetter(c); MethodHandle mh; MethodHandle guard; if (isOptimistic) { if (JSType.getAccessorTypeIndex(cmh.type().returnType()) <= JSType.getAccessorTypeIndex(retType)) { //widen return type - this is pessimistic, so it will always work mh = MH.asType(cmh, cmh.type().changeReturnType(retType)); } else { //immediately invalidate - we asked for a too wide constant as a narrower one mh = MH.dropArguments(MH.insertArguments(JSType.THROW_UNWARRANTED.methodHandle(), 0, c, programPoint), 0, Object.class); } } else { //pessimistic return type filter mh = Lookup.filterReturnType(cmh, retType); } if (find.getOwner().isGlobal()) { guard = null; } else { guard = MH.insertArguments(RECEIVER_GUARD, 0, acc, receiver); } if (log.isEnabled()) { log.info("Linked getter " + quote(name) + " as MethodHandle.constant() -> " + c + " " + acc.getSwitchPoint()); mh = MethodHandleFactory.addDebugPrintout(log, Level.FINE, mh, "get const " + acc); } return new GuardedInvocation(mh, guard, acc.getSwitchPoint(), null); } }
Example 14
Source File: Context.java From openjdk-jdk8u with GNU General Public License v2.0 | 3 votes |
/** * Given a Loggable class, weave debug info info a method handle for that logger. * * @param clazz loggable * @param level log level * @param mh method handle * @param paramStart first parameter to print * @param printReturnValue should we print the return value? * @param text debug printout to add * * @return instrumented method handle, or null if logger not enabled */ public MethodHandle addLoggingToHandle(final Class<? extends Loggable> clazz, final Level level, final MethodHandle mh, final int paramStart, final boolean printReturnValue, final Supplier<String> text) { final DebugLogger log = getLogger(clazz); if (log.isEnabled()) { return MethodHandleFactory.addDebugPrintout(log, level, mh, paramStart, printReturnValue, text.get()); } return mh; }
Example 15
Source File: Context.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 3 votes |
/** * Given a Loggable class, weave debug info info a method handle for that logger. * * @param clazz loggable * @param level log level * @param mh method handle * @param paramStart first parameter to print * @param printReturnValue should we print the return value? * @param text debug printout to add * * @return instrumented method handle, or null if logger not enabled */ public MethodHandle addLoggingToHandle(final Class<? extends Loggable> clazz, final Level level, final MethodHandle mh, final int paramStart, final boolean printReturnValue, final Supplier<String> text) { final DebugLogger log = getLogger(clazz); if (log.isEnabled()) { return MethodHandleFactory.addDebugPrintout(log, level, mh, paramStart, printReturnValue, text.get()); } return mh; }
Example 16
Source File: Context.java From jdk8u60 with GNU General Public License v2.0 | 3 votes |
/** * Given a Loggable class, weave debug info info a method handle for that logger. * * @param clazz loggable * @param level log level * @param mh method handle * @param paramStart first parameter to print * @param printReturnValue should we print the return vaulue? * @param text debug printout to add * * @return instrumented method handle, or null if logger not enabled */ public MethodHandle addLoggingToHandle(final Class<? extends Loggable> clazz, final Level level, final MethodHandle mh, final int paramStart, final boolean printReturnValue, final Supplier<String> text) { final DebugLogger log = getLogger(clazz); if (log.isEnabled()) { return MethodHandleFactory.addDebugPrintout(log, level, mh, paramStart, printReturnValue, text.get()); } return mh; }
Example 17
Source File: Context.java From openjdk-jdk9 with GNU General Public License v2.0 | 3 votes |
/** * Given a Loggable class, weave debug info info a method handle for that logger. * * @param clazz loggable * @param level log level * @param mh method handle * @param paramStart first parameter to print * @param printReturnValue should we print the return value? * @param text debug printout to add * * @return instrumented method handle, or null if logger not enabled */ public MethodHandle addLoggingToHandle(final Class<? extends Loggable> clazz, final Level level, final MethodHandle mh, final int paramStart, final boolean printReturnValue, final Supplier<String> text) { final DebugLogger log = getLogger(clazz); if (log.isEnabled()) { return MethodHandleFactory.addDebugPrintout(log, level, mh, paramStart, printReturnValue, text.get()); } return mh; }
Example 18
Source File: Context.java From TencentKona-8 with GNU General Public License v2.0 | 3 votes |
/** * Given a Loggable class, weave debug info info a method handle for that logger. * * @param clazz loggable * @param level log level * @param mh method handle * @param paramStart first parameter to print * @param printReturnValue should we print the return value? * @param text debug printout to add * * @return instrumented method handle, or null if logger not enabled */ public MethodHandle addLoggingToHandle(final Class<? extends Loggable> clazz, final Level level, final MethodHandle mh, final int paramStart, final boolean printReturnValue, final Supplier<String> text) { final DebugLogger log = getLogger(clazz); if (log.isEnabled()) { return MethodHandleFactory.addDebugPrintout(log, level, mh, paramStart, printReturnValue, text.get()); } return mh; }
Example 19
Source File: Context.java From hottub with GNU General Public License v2.0 | 3 votes |
/** * Given a Loggable class, weave debug info info a method handle for that logger. * * @param clazz loggable * @param level log level * @param mh method handle * @param paramStart first parameter to print * @param printReturnValue should we print the return value? * @param text debug printout to add * * @return instrumented method handle, or null if logger not enabled */ public MethodHandle addLoggingToHandle(final Class<? extends Loggable> clazz, final Level level, final MethodHandle mh, final int paramStart, final boolean printReturnValue, final Supplier<String> text) { final DebugLogger log = getLogger(clazz); if (log.isEnabled()) { return MethodHandleFactory.addDebugPrintout(log, level, mh, paramStart, printReturnValue, text.get()); } return mh; }
Example 20
Source File: Context.java From jdk8u_nashorn with GNU General Public License v2.0 | 3 votes |
/** * Given a Loggable class, weave debug info info a method handle for that logger. * * @param clazz loggable * @param level log level * @param mh method handle * @param paramStart first parameter to print * @param printReturnValue should we print the return value? * @param text debug printout to add * * @return instrumented method handle, or null if logger not enabled */ public MethodHandle addLoggingToHandle(final Class<? extends Loggable> clazz, final Level level, final MethodHandle mh, final int paramStart, final boolean printReturnValue, final Supplier<String> text) { final DebugLogger log = getLogger(clazz); if (log.isEnabled()) { return MethodHandleFactory.addDebugPrintout(log, level, mh, paramStart, printReturnValue, text.get()); } return mh; }