[pypy-svn] r27381 - in pypy/dist/pypy/rpython: lltypesystem ootypesystem

pedronis at codespeak.net pedronis at codespeak.net
Thu May 18 04:04:33 CEST 2006


Author: pedronis
Date: Thu May 18 04:04:29 2006
New Revision: 27381

Modified:
   pypy/dist/pypy/rpython/lltypesystem/exceptiondata.py
   pypy/dist/pypy/rpython/ootypesystem/exceptiondata.py
Log:
streamline: use annotate_helper_fn helper


Modified: pypy/dist/pypy/rpython/lltypesystem/exceptiondata.py
==============================================================================
--- pypy/dist/pypy/rpython/lltypesystem/exceptiondata.py	(original)
+++ pypy/dist/pypy/rpython/lltypesystem/exceptiondata.py	Thu May 18 04:04:29 2006
@@ -1,6 +1,5 @@
 from pypy.annotation import model as annmodel
 from pypy.rpython.lltypesystem import rclass
-from pypy.rpython.annlowlevel import annotate_lowlevel_helper
 from pypy.rpython.lltypesystem.lltype import \
      Array, malloc, Ptr, PyObject, pyobjectptr, \
      FuncType, functionptr, Signed
@@ -21,26 +20,23 @@
     def make_exception_matcher(self, rtyper):
         # ll_exception_matcher(real_exception_vtable, match_exception_vtable)
         s_typeptr = annmodel.SomePtr(self.lltype_of_exception_type)
-        helper_graph = annotate_lowlevel_helper(
-            rtyper.annotator, rclass.ll_issubclass, [s_typeptr, s_typeptr])
-        return rtyper.getcallable(helper_graph)
+        helper_fn = rtyper.annotate_helper_fn(rclass.ll_issubclass, [s_typeptr, s_typeptr])
+        return helper_fn
 
 
     def make_raise_OSError(self, rtyper):
         # ll_raise_OSError(errno)
         def ll_raise_OSError(errno):
             raise OSError(errno, None)
-        helper_graph = annotate_lowlevel_helper(
-            rtyper.annotator, ll_raise_OSError, [annmodel.SomeInteger()])
-        return rtyper.getcallable(helper_graph)
+        helper_fn = rtyper.annotate_helper_fn(ll_raise_OSError, [annmodel.SomeInteger()])
+        return helper_fn
 
 
     def make_type_of_exc_inst(self, rtyper):
         # ll_type_of_exc_inst(exception_instance) -> exception_vtable
         s_excinst = annmodel.SomePtr(self.lltype_of_exception_value)
-        helper_graph = annotate_lowlevel_helper(
-            rtyper.annotator, rclass.ll_type, [s_excinst])
-        return rtyper.getcallable(helper_graph)
+        helper_fn = rtyper.annotate_helper_fn(rclass.ll_type, [s_excinst])
+        return helper_fn
 
 
     def make_pyexcclass2exc(self, rtyper):
@@ -118,6 +114,5 @@
             return default_excinst
 
         s_pyobj = annmodel.SomePtr(Ptr(PyObject))
-        helper_graph = annotate_lowlevel_helper(
-            rtyper.annotator, ll_pyexcclass2exc, [s_pyobj])
-        return rtyper.getcallable(helper_graph)
+        helper_fn = rtyper.annotate_helper_fn(ll_pyexcclass2exc, [s_pyobj])
+        return helper_fn

Modified: pypy/dist/pypy/rpython/ootypesystem/exceptiondata.py
==============================================================================
--- pypy/dist/pypy/rpython/ootypesystem/exceptiondata.py	(original)
+++ pypy/dist/pypy/rpython/ootypesystem/exceptiondata.py	Thu May 18 04:04:29 2006
@@ -1,7 +1,6 @@
 from pypy.rpython.exceptiondata import AbstractExceptionData
 from pypy.rpython.ootypesystem import rclass
 from pypy.rpython.ootypesystem import ootype
-from pypy.rpython.annlowlevel import annotate_lowlevel_helper
 from pypy.annotation import model as annmodel
 from pypy.annotation.classdef import FORCE_ATTRIBUTES_INTO_CLASSES
 
@@ -28,16 +27,14 @@
     def make_exception_matcher(self, rtyper):
         # ll_exception_matcher(real_exception_meta, match_exception_meta)
         s_classtype = annmodel.SomeOOInstance(self.lltype_of_exception_type)
-        helper_graph = annotate_lowlevel_helper(
-            rtyper.annotator, rclass.ll_issubclass, [s_classtype, s_classtype])
-        return rtyper.getcallable(helper_graph)
-
+        helper_fn = rtyper.annotate_helper_fn(rclass.ll_issubclass, [s_classtype, s_classtype])
+        return helper_fn
+    
     def make_type_of_exc_inst(self, rtyper):
         # ll_type_of_exc_inst(exception_instance) -> exception_vtable
         s_excinst = annmodel.SomeOOInstance(self.lltype_of_exception_value)
-        helper_graph = annotate_lowlevel_helper(
-            rtyper.annotator, rclass.ll_inst_type, [s_excinst])
-        return rtyper.getcallable(helper_graph)
+        helper_fn = rtyper.annotate_helper_fn(rclass.ll_inst_type, [s_excinst])
+        return helper_fn
 
     def make_pyexcclass2exc(self, rtyper):
         # ll_pyexcclass2exc(python_exception_class) -> exception_instance



More information about the Pypy-commit mailing list