Author: Maciej Fijalkowski <[email protected]>
Branch: jit-threshold-hooks
Changeset: r66323:96f84f4695e0
Date: 2013-08-26 17:36 +0100
http://bitbucket.org/pypy/pypy/changeset/96f84f4695e0/
Log: small fix to allocate new cell
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
@@ -8,7 +8,7 @@
from rpython.rlib.rarithmetic import r_uint, intmask
from rpython.rlib.jit import JitDriver, hint, we_are_jitted, dont_look_inside,\
BaseJitCell
-from rpython.rlib import jit
+from rpython.rlib import jit, jit_hooks
from rpython.rlib.jit import current_trace_length, unroll_parameters
import pypy.interpreter.pyopcode # for side-effects
from pypy.interpreter.error import OperationError, operationerrfmt
@@ -176,5 +176,8 @@
at value given.
"""
ref = w_code.jit_cells[pos << 1]
+ if not ref:
+ ref = jit_hooks.new_jitcell()
+ w_code.jit_cells[pos << 1] = ref
jitcell = cast_base_ptr_to_instance(BaseJitCell, ref)
jitcell.counter = value
diff --git a/rpython/rlib/jit_hooks.py b/rpython/rlib/jit_hooks.py
--- a/rpython/rlib/jit_hooks.py
+++ b/rpython/rlib/jit_hooks.py
@@ -135,6 +135,12 @@
from rpython.jit.metainterp.history import Const
return isinstance(_cast_to_box(llbox), Const)
+@register_helper(annmodel.SomePtr(llmemory.GCREF))
+def new_jitcell():
+ from rpython.jit.metainterp.warmstate import JitCell
+
+ return _cast_to_gcref(JitCell)
+
# ------------------------- stats interface ---------------------------
@register_helper(annmodel.SomeBool())
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit