Armin Rigo avatar Armin Rigo committed ad49676

Random changes, mostly documentation fixes

Comments (0)

Files changed (3)

pypy/jit/backend/llsupport/jitframe.py

 
 _LONGLONGARRAY = lltype.GcArray(lltype.SignedLongLong)
 
-JITFRAME = lltype.GcStruct('JITFRAME',
-               ('jf_descr', llmemory.GCREF),
-               ('jf_excvalue', llmemory.GCREF),
-               ('jf_nongcvalues', lltype.Ptr(_LONGLONGARRAY)),
-               ('jf_gcvalues', lltype.Array(llmemory.GCREF)))
+JITFRAME = lltype.GcStruct(
+    'JITFRAME',
+
+    # Once the execute_token() returns, the field 'jf_descr' stores the
+    # descr of the last executed operation (either a GUARD, or FINISH).
+    ('jf_descr', llmemory.GCREF),
+
+    # For the front-end: a GCREF for the savedata
+    ('jf_savedata', llmemory.GCREF),
+
+    # XXX
+    ('jf_nongcvalues', lltype.Ptr(_LONGLONGARRAY)),
+    ('jf_gcvalues', lltype.Array(llmemory.GCREF)))
 JITFRAMEPTR = lltype.Ptr(JITFRAME)

pypy/jit/backend/model.py

 from pypy.rlib.debug import debug_start, debug_print, debug_stop
 from pypy.rlib.rarithmetic import intmask
 from pypy.jit.metainterp import history
-from pypy.jit.codewriter.longlong import longlong2floatstorage
 from pypy.rpython.lltypesystem import lltype
 
 
     def get_latest_descr(self, jitframe):
         """Return the descr of the last operation executed by the
         jitframe."""
-        return jitframe.jf_descr
+        raise NotImplementedError
 
     def get_latest_value_int(self, jitframe, index):
-        """Returns the value for the index'th argument to the
-        last executed operation (from 'fail_args' if it was a guard,
-        or from 'args' if it was a FINISH).  Returns an int."""
-        return intmask(jitframe.jf_nongcvalues[index])
+        """Returns the value for the index'th 'fail_args' of the
+        last executed operation.  Returns an int."""
+        raise NotImplementedError
 
     def get_latest_value_float(self, jitframe, index):
-        """Returns the value for the index'th argument to the
-        last executed operation (from 'fail_args' if it was a guard,
-        or from 'args' if it was a FINISH).  Returns a FLOATSTORAGE."""
-        return longlong2floatstorage(jitframe.jf_nongcvalues[index])
+        """Returns the value for the index'th 'fail_args' of the
+        last executed operation.  Returns a FLOATSTORAGE."""
+        raise NotImplementedError
 
     def get_latest_value_ref(self, jitframe, index):
-        """Returns the value for the index'th argument to the
-        last executed operation (from 'fail_args' if it was a guard,
-        or from 'args' if it was a FINISH).  Returns a GCREF."""
-        return jitframe.jf_gcvalues[index]
+        """Returns the value for the index'th 'fail_args' of the
+        last executed operation.  Returns a GCREF."""
+        raise NotImplementedError
 
     def get_latest_value_count(self, jitframe):
         """Return how many values are ready to be returned by
-        get_latest_value_xxx().  Only after a guard failure; not
-        necessarily correct after a FINISH."""
-        return len(jitframe.jf_gcvalues)
+        get_latest_value_xxx()."""
+        raise NotImplementedError
 
     def get_finish_value_int(self, jitframe):
         """Return the result passed to FINISH, which was an int."""
-        return jitframe.jf_finish_int
+        raise NotImplementedError
 
     def get_finish_value_float(self, jitframe):
         """Return the result passed to FINISH, which was a FLOATSTORAGE."""
-        return jitframe.jf_finish_float
+        raise NotImplementedError
 
     def get_finish_value_ref(self, jitframe):
         """Return and clear the result passed to FINISH, which was a GCREF.
         Also used when it exits due to a failure of a GUARD_EXCEPTION or
         GUARD_NO_EXCEPTION, to return the exception."""
-        xxxx
-        return jitframe.jf_finish_ref
+        raise NotImplementedError
 
     def get_savedata_ref(self, jitframe):
         """Return and clear the last value stored by the frontend with
         set_savedata_ref."""
-        xxxx
+        raise NotImplementedError
 
     def set_savedata_ref(self, jitframe, value):
         """Store on the jitframe a random GCREF value that will be returned
         by the following call to get_savedata_ref()."""
-        xxxx
+        raise NotImplementedError
 
     def redirect_call_assembler(self, oldlooptoken, newlooptoken):
         """Redirect oldlooptoken to newlooptoken.  More precisely, it is

pypy/jit/backend/x86/arch.py

 #        +--------------------+    <== aligned to 16 bytes
 
 if WORD == 4:
+    # enough for calls with up to 7 arguments, or 7 scratch stores
     SCRATCH_SIZE = 7     # total size: 32 bytes
 else:
+    # enough for calls with up to 6+3 arguments, or 3 scratch stores
     SCRATCH_SIZE = 3     # total size: 32 bytes
 
 # All the rest of the data is in a GC-managed variable-size "frame".
 # This frame object's address is always stored in the register EBP/RBP.
-# A frame is a jit.backend.llsupport.llmodel.FRAME = GcArray(Signed).
+# A frame is a jit.backend.llsupport.jitframe.JITFRAME.
 # The following locations are indices in this array.
 
 # The frame's fixed size gives the standard fixed part at the
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.