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

rschlatte at common-lisp.net rschlatte at common-lisp.net
Sat Oct 20 10:39:04 UTC 2012


Author: rschlatte
Date: Sat Oct 20 03:39:03 2012
New Revision: 14207

Log:
Call method-function instead of directly accessing a slot.

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

Modified: trunk/abcl/src/org/armedbear/lisp/Profiler.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Profiler.java	Sat Oct 20 02:44:54 2012	(r14206)
+++ trunk/abcl/src/org/armedbear/lisp/Profiler.java	Sat Oct 20 03:39:03 2012	(r14207)
@@ -76,17 +76,14 @@
                                 methods =
                                     Symbol.GENERIC_FUNCTION_METHODS.execute(object);
                             }
-                            // TODO: extract methods from non-standard
-                            // generic functions here once they are
-                            // implemented
                             while (methods != null && methods != NIL) {
-                                LispObject maybeMethod = methods.car();
-                                if (maybeMethod instanceof StandardObject) {
-                                    StandardObject method = (StandardObject) maybeMethod;
-                                    LispObject function = method.getInstanceSlotValue(Symbol._FUNCTION);
-                                    function.setCallCount(0);
-                                    function.setHotCount(0);
-                                    methods = methods.cdr();
+                                LispObject method = methods.car();
+                                LispObject function =
+                                  Symbol.METHOD_FUNCTION.execute(method);
+                                if (function != NIL) {
+                                  function.setCallCount(0);
+                                  function.setHotCount(0);
+                                  methods = methods.cdr();
                                 }
                             }
                         }

Modified: trunk/abcl/src/org/armedbear/lisp/Symbol.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Symbol.java	Sat Oct 20 02:44:54 2012	(r14206)
+++ trunk/abcl/src/org/armedbear/lisp/Symbol.java	Sat Oct 20 03:39:03 2012	(r14207)
@@ -2986,6 +2986,8 @@
     PACKAGE_MOP.addExternalSymbol("GENERIC-FUNCTION-METHODS");
   public static final Symbol METAOBJECT =
     PACKAGE_MOP.addExternalSymbol("METAOBJECT");
+  public static final Symbol METHOD_FUNCTION =
+    PACKAGE_MOP.addExternalSymbol("METHOD-FUNCTION");
   public static final Symbol SPECIALIZER =
     PACKAGE_MOP.addExternalSymbol("SPECIALIZER");
   public static final Symbol STANDARD_ACCESSOR_METHOD =




More information about the armedbear-cvs mailing list