< prev index next >
src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeDebug.java
Print this page
*** 34,44 ****
import jdk.nashorn.internal.objects.annotations.Function;
import jdk.nashorn.internal.objects.annotations.ScriptClass;
import jdk.nashorn.internal.objects.annotations.Where;
import jdk.nashorn.internal.runtime.Context;
import jdk.nashorn.internal.runtime.JSType;
! import jdk.nashorn.internal.runtime.PropertyListeners;
import jdk.nashorn.internal.runtime.PropertyMap;
import jdk.nashorn.internal.runtime.Scope;
import jdk.nashorn.internal.runtime.ScriptFunction;
import jdk.nashorn.internal.runtime.ScriptObject;
import jdk.nashorn.internal.runtime.ScriptRuntime;
--- 34,44 ----
import jdk.nashorn.internal.objects.annotations.Function;
import jdk.nashorn.internal.objects.annotations.ScriptClass;
import jdk.nashorn.internal.objects.annotations.Where;
import jdk.nashorn.internal.runtime.Context;
import jdk.nashorn.internal.runtime.JSType;
! import jdk.nashorn.internal.runtime.PropertySwitchPoints;
import jdk.nashorn.internal.runtime.PropertyMap;
import jdk.nashorn.internal.runtime.Scope;
import jdk.nashorn.internal.runtime.ScriptFunction;
import jdk.nashorn.internal.runtime.ScriptObject;
import jdk.nashorn.internal.runtime.ScriptRuntime;
*** 242,252 ****
* @param obj script object whose listener count is returned
* @return listener count
*/
@Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
public static int getListenerCount(final Object self, final Object obj) {
! return (obj instanceof ScriptObject) ? PropertyListeners.getListenerCount((ScriptObject) obj) : 0;
}
/**
* Dump all Nashorn debug mode counters. Calling this may be better if
* you want to print all counters. This way you can avoid too many callsites
--- 242,252 ----
* @param obj script object whose listener count is returned
* @return listener count
*/
@Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
public static int getListenerCount(final Object self, final Object obj) {
! return (obj instanceof ScriptObject) ? PropertySwitchPoints.getSwitchPointCount((ScriptObject) obj) : 0;
}
/**
* Dump all Nashorn debug mode counters. Calling this may be better if
* you want to print all counters. This way you can avoid too many callsites
*** 258,269 ****
public static Object dumpCounters(final Object self) {
final PrintWriter out = Context.getCurrentErr();
out.println("ScriptObject count " + ScriptObject.getCount());
out.println("Scope count " + Scope.getScopeCount());
! out.println("ScriptObject listeners added " + PropertyListeners.getListenersAdded());
! out.println("ScriptObject listeners removed " + PropertyListeners.getListenersRemoved());
out.println("ScriptFunction constructor calls " + ScriptFunction.getConstructorCount());
out.println("ScriptFunction invokes " + ScriptFunction.getInvokes());
out.println("ScriptFunction allocations " + ScriptFunction.getAllocations());
out.println("PropertyMap count " + PropertyMap.getCount());
out.println("PropertyMap cloned " + PropertyMap.getClonedCount());
--- 258,269 ----
public static Object dumpCounters(final Object self) {
final PrintWriter out = Context.getCurrentErr();
out.println("ScriptObject count " + ScriptObject.getCount());
out.println("Scope count " + Scope.getScopeCount());
! out.println("Property SwitchPoints added " + PropertySwitchPoints.getSwitchPointsAdded());
! out.println("Property SwitchPoints invalidated " + PropertySwitchPoints.getSwitchPointsInvalidated());
out.println("ScriptFunction constructor calls " + ScriptFunction.getConstructorCount());
out.println("ScriptFunction invokes " + ScriptFunction.getInvokes());
out.println("ScriptFunction allocations " + ScriptFunction.getAllocations());
out.println("PropertyMap count " + PropertyMap.getCount());
out.println("PropertyMap cloned " + PropertyMap.getClonedCount());
< prev index next >