Commits

Maciej Fijalkowski committed 68f68a7

disallow , in debug_merge_point args, kill special casing in oparser.

  • Participants
  • Parent commits 73d001b

Comments (0)

Files changed (5)

pypy/jit/metainterp/logger.py

         if op.getopnum() == rop.DEBUG_MERGE_POINT:
             jd_sd = self.metainterp_sd.jitdrivers_sd[op.getarg(0).getint()]
             s = jd_sd.warmstate.get_location_str(op.getarglist()[2:])
+            s = s.replace(',', '.') # we use comma for argument splitting
             return "debug_merge_point(%d, '%s')" % (op.getarg(1).getint(), s)
         if ops_offset is None:
             offset = -1

pypy/jit/tool/oparser.py

         args = []
         descr = None
         if argspec.strip():
-            if opname == 'debug_merge_point':
-                allargs = argspec.split(',', 1)
-            else:
-                allargs = [arg for arg in argspec.split(",")
-                           if arg != '']
+            allargs = [arg for arg in argspec.split(",")
+                       if arg != '']
 
             poss_descr = allargs[-1].strip()
             if poss_descr.startswith('descr='):

pypy/jit/tool/test/test_oparser.py

         []
         debug_merge_point(0, "info")
         debug_merge_point(0, 'info')
-        debug_merge_point(1, '<some ('other,')> info')
+        debug_merge_point(1, '<some ('other.')> info')
         debug_merge_point(0, '(stuff) #1')
         '''
         loop = self.parse(x)
         assert loop.operations[0].getarg(1)._get_str() == 'info'
         assert loop.operations[1].getarg(1)._get_str() == 'info'
-        assert loop.operations[2].getarg(1)._get_str() == "<some ('other,')> info"
+        assert loop.operations[2].getarg(1)._get_str() == "<some ('other.')> info"
         assert loop.operations[3].getarg(1)._get_str() == "(stuff) #1"
 
 

pypy/module/pypyjit/interp_jit.py

     return (bytecode.co_flags & CO_GENERATOR) != 0
 
 
+def wrap_oplist(space, logger, operations):
+    list_w = []
+    for op in operations:
+        xxx
+
 class PyPyJitDriver(JitDriver):
     reds = ['frame', 'ec']
     greens = ['next_instr', 'is_being_profiled', 'pycode']
             return
         if space.is_true(cache.w_compile_hook):
             logops = logger._make_log_operations()
-            list_w = [space.wrap(logops.repr_of_resop(op))
-                      for op in operations]
+            list_w = wrap_oplist(space, logger, operations)
             pycode = cast_base_ptr_to_instance(PyCode, ll_pycode)
             cache.in_recursion = True
             try:
             return
         if space.is_true(cache.w_compile_hook):
             logops = logger._make_log_operations()
-            list_w = [space.wrap(logops.repr_of_resop(op))
-                      for op in operations]
+            list_w = wrap_oplist(space, logger, operations)
             cache.in_recursion = True
             try:
                 space.call_function(cache.w_compile_hook,

pypy/module/pypyjit/test/test_jit_hook.py

 from pypy.jit.metainterp.typesystem import llhelper
 
 class MockSD(object):
-    class cpu:
+    class cpu(object):
         ts = llhelper
 
 class AppTestJitHook(object):
         oplist = parse("""
         [i1, i2]
         i3 = int_add(i1, i2)
+        debug_merge_point(0, 0, 0, 0, ConstPtr(ptr0))
         guard_true(i3) []
-        """).operations
+        """, namespace={'ptr0': 3}).operations
 
         def interp_on_compile():
             pypyjitdriver.on_compile(logger, LoopToken(), oplist, 'loop',