[pypy-commit] pypy new-jit-log: forgot to set get_location to pypy's main jitdriver
plan_rich
pypy.commits at gmail.com
Tue Apr 19 03:57:14 EDT 2016
Author: Richard Plangger <planrichi at gmail.com>
Branch: new-jit-log
Changeset: r83760:eff88c49b7e9
Date: 2016-04-18 20:31 +0200
http://bitbucket.org/pypy/pypy/changeset/eff88c49b7e9/
Log: forgot to set get_location to pypy's main jitdriver
diff --git a/pypy/module/pypyjit/interp_jit.py b/pypy/module/pypyjit/interp_jit.py
--- a/pypy/module/pypyjit/interp_jit.py
+++ b/pypy/module/pypyjit/interp_jit.py
@@ -43,13 +43,18 @@
def get_location(next_instr, is_being_profiled, bytecode):
from pypy.tool.stdlib_opcode import opcode_method_names
- name = opcode_method_names[ord(bytecode.co_code[next_instr])]
+ opname = opcode_method_names[ord(bytecode.co_code[next_instr])]
+ if not opname:
+ opname = ""
+ name = bytecode.co_name
+ if not name:
+ name = ""
# we can probably do better at co_firstlineno?
return (bytecode.co_filename,
bytecode.co_firstlineno,
- bytecode.co_name,
- next_instr,
- name)
+ name,
+ intmask(next_instr),
+ opname)
def should_unroll_one_iteration(next_instr, is_being_profiled, bytecode):
return (bytecode.co_flags & CO_GENERATOR) != 0
@@ -60,6 +65,7 @@
virtualizables = ['frame']
pypyjitdriver = PyPyJitDriver(get_printable_location = get_printable_location,
+ get_location = get_location,
get_unique_id = get_unique_id,
should_unroll_one_iteration =
should_unroll_one_iteration,
diff --git a/rpython/jit/metainterp/warmstate.py b/rpython/jit/metainterp/warmstate.py
--- a/rpython/jit/metainterp/warmstate.py
+++ b/rpython/jit/metainterp/warmstate.py
@@ -681,9 +681,9 @@
# get_location new API
get_location_ptr = self.jitdriver_sd._get_location_ptr
if get_location_ptr is None:
- missing = '(%s: no get_location)' % drivername
+ missing_get_loc = '(%s: no get_location)' % drivername
def get_location(greenkey):
- return (missing, 0, '', 0, '')
+ return (missing_get_loc, 0, '', 0, '')
else:
unwrap_greenkey = self.make_unwrap_greenkey()
def get_location(greenkey):
diff --git a/rpython/rlib/jit.py b/rpython/rlib/jit.py
--- a/rpython/rlib/jit.py
+++ b/rpython/rlib/jit.py
@@ -899,6 +899,7 @@
driver = self.instance.im_self
h = self.annotate_hook
h(driver.get_printable_location, driver.greens, **kwds_s)
+ h(driver.get_location, driver.greens, **kwds_s)
def annotate_hook(self, func, variables, args_s=[], **kwds_s):
if func is None:
More information about the pypy-commit
mailing list