[pypy-commit] lang-smalltalk default: removed the argcount from ContextPartShadow>>short_str in favor of counting colons in method_str

lwassermann noreply at buildbot.pypy.org
Thu May 23 16:44:58 CEST 2013


Author: Lars Wassermann <lars.wassermann at gmail.com>
Branch: 
Changeset: r412:90b4534942c9
Date: 2013-05-23 16:43 +0200
http://bitbucket.org/pypy/lang-smalltalk/changeset/90b4534942c9/

Log:	removed the argcount from ContextPartShadow>>short_str in favor of
	counting colons in method_str

diff --git a/spyvm/interpreter.py b/spyvm/interpreter.py
--- a/spyvm/interpreter.py
+++ b/spyvm/interpreter.py
@@ -82,7 +82,7 @@
                 s_new_context.push(nlr.value)
             except ProcessSwitch, p:
                 if self.trace:
-                    print "====== Switch from: %s to: %s ======" % (s_new_context.short_str(0), p.s_new_context.short_str(0))
+                    print "====== Switch from: %s to: %s ======" % (s_new_context.short_str(), p.s_new_context.short_str())
                 s_new_context = p.s_new_context
 
     def c_loop(self, s_context, may_context_switch=True):
@@ -357,7 +357,7 @@
 
         # ######################################################################
         if interp.trace:
-            print interp.padding() + s_frame.short_str(argcount)
+            print interp.padding() + s_frame.short_str()
 
         return interp.stack_frame(s_frame)
 
@@ -380,7 +380,7 @@
 
         # ######################################################################
         if interp.trace:
-            print '%s%s missing: #%s' % (interp.padding('#'), s_frame.short_str(0), w_selector.as_string())
+            print '%s%s missing: #%s' % (interp.padding('#'), s_frame.short_str(), w_selector.as_string())
             if not objectmodel.we_are_translated():
                 import pdb; pdb.set_trace()
 
diff --git a/spyvm/shadow.py b/spyvm/shadow.py
--- a/spyvm/shadow.py
+++ b/spyvm/shadow.py
@@ -727,7 +727,7 @@
         if method:
             desc = self.method_str()
         else:
-            desc = self.short_str(0)
+            desc = self.short_str()
         return padding + ' ', '%s\n%s%s' % (ret_str, padding, desc)
 
 
@@ -830,7 +830,7 @@
     def is_closure_context(self):
         return True
 
-    def short_str(self, argcount):
+    def short_str(self):
         return 'BlockContext of %s (%s) [%d]' % (
             self.w_method().get_identifier_string(),
             self.w_receiver().as_repr_string(),
@@ -983,7 +983,9 @@
         retval += "\nStack   : " + str(self._temps_and_stack[:self._stack_ptr])
         return retval
 
-    def short_str(self, argcount):
+    def short_str(self):
+        method_str = self.method_str()
+        argcount = method_str.count(':')
         if argcount == 0:
             return '%s (rcvr: %s) [pc: %d]' % (
                 self.method_str(),


More information about the pypy-commit mailing list