[armedbear-cvs] r12082 - trunk/abcl/src/org/armedbear/lisp

Erik Huelsmann ehuelsmann at common-lisp.net
Sat Aug 1 07:58:23 UTC 2009


Author: ehuelsmann
Date: Sat Aug  1 03:58:15 2009
New Revision: 12082

Log:
Hot spot counting for the profiler.

Modified:
   trunk/abcl/src/org/armedbear/lisp/LispThread.java
   trunk/abcl/src/org/armedbear/lisp/Profiler.java

Modified: trunk/abcl/src/org/armedbear/lisp/LispThread.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/LispThread.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/LispThread.java	Sat Aug  1 03:58:15 2009
@@ -834,6 +834,18 @@
     public void incrementCallCounts() throws ConditionThrowable
     {
         StackFrame s = stack;
+
+        for (int i = 0; i < 8; i++) {
+            if (s == null)
+                break;
+            LispObject operator = s.operator;
+            if (operator != null) {
+                operator.incrementHotCount();
+                operator.incrementCallCount();
+            }
+            s = s.next;
+        }
+
         while (s != null) {
             LispObject operator = s.operator;
             if (operator != null)

Modified: trunk/abcl/src/org/armedbear/lisp/Profiler.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Profiler.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Profiler.java	Sat Aug  1 03:58:15 2009
@@ -68,12 +68,14 @@
                         LispObject object = symbol.getSymbolFunction();
                         if (object != null) {
                             object.setCallCount(0);
+                            object.setHotCount(0);
                             if (object instanceof StandardGenericFunction) {
                                 LispObject methods =
                                     PACKAGE_MOP.intern("GENERIC-FUNCTION-METHODS").execute(object);
                                 while (methods != NIL) {
                                     StandardMethod method = (StandardMethod) methods.car();
                                     method.getFunction().setCallCount(0);
+                                    method.getFunction().setHotCount(0);
                                     methods = methods.cdr();
                                 }
                             }




More information about the armedbear-cvs mailing list