[pypy-commit] pypy default: Yet more markup
alex_gaynor
noreply at buildbot.pypy.org
Sat Oct 26 20:08:35 CEST 2013
Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch:
Changeset: r67636:96bed2d09b62
Date: 2013-10-26 11:07 -0700
http://bitbucket.org/pypy/pypy/changeset/96bed2d09b62/
Log: Yet more markup
diff --git a/pypy/doc/jit/virtualizable.rst b/pypy/doc/jit/virtualizable.rst
--- a/pypy/doc/jit/virtualizable.rst
+++ b/pypy/doc/jit/virtualizable.rst
@@ -25,13 +25,19 @@
forcing them. This is very useful for frames. Declaring an object to be
virtualizable works like this:
+.. code-block:: python
+
class Frame(object):
_virtualizable_ = ['locals[*]', 'stackdepth']
-And we use them in ``JitDriver`` like this::
+
+And we use them in ``JitDriver`` like this:
+
+.. code-block:: python
jitdriver = JitDriver(greens=[], reds=['frame'], virtualizables=['frame'])
+
This declaration means that ``stackdepth`` is a virtualizable **field**, while
``locals`` is a virtualizable **array** (a list stored on a virtualizable).
There are various rules about using virtualizables, especially using
@@ -44,9 +50,11 @@
constant or changing rarely within the context of the user's code.
* If you initialize a new virtualizable in the JIT, it has to be done like this
- (for example if we're in ``Frame.__init__``)::
+ (for example if we're in ``Frame.__init__``):
- self = hint(self, access_directly=True, fresh_virtualizable=True)
+ .. code-block:: python
+
+ self = hint(self, access_directly=True, fresh_virtualizable=True)
that way you can populate the fields directly.
More information about the pypy-commit
mailing list