[pypy-svn] r53379 - in pypy/branch/less-meta-instances/pypy: annotation translator/cli

antocuni at codespeak.net antocuni at codespeak.net
Sat Apr 5 11:31:33 CEST 2008


Author: antocuni
Date: Sat Apr  5 11:31:31 2008
New Revision: 53379

Modified:
   pypy/branch/less-meta-instances/pypy/annotation/model.py
   pypy/branch/less-meta-instances/pypy/translator/cli/function.py
   pypy/branch/less-meta-instances/pypy/translator/cli/opcodes.py
Log:
fix gencli



Modified: pypy/branch/less-meta-instances/pypy/annotation/model.py
==============================================================================
--- pypy/branch/less-meta-instances/pypy/annotation/model.py	(original)
+++ pypy/branch/less-meta-instances/pypy/annotation/model.py	Sat Apr  5 11:31:31 2008
@@ -591,6 +591,8 @@
         return s_val.ootype
     if isinstance(s_val, SomeOOStaticMeth):
         return s_val.method
+    if isinstance(s_val, SomeOOClass):
+        return ootype.Class
     if isinstance(s_val, SomeInteriorPtr):
         p = s_val.ll_ptrtype
         if 0 in p.offsets:

Modified: pypy/branch/less-meta-instances/pypy/translator/cli/function.py
==============================================================================
--- pypy/branch/less-meta-instances/pypy/translator/cli/function.py	(original)
+++ pypy/branch/less-meta-instances/pypy/translator/cli/function.py	Sat Apr  5 11:31:31 2008
@@ -39,7 +39,7 @@
 
     def record_ll_meta_exc(self, ll_meta_exc):
         # record the type only if it doesn't belong to a native_class
-        ll_exc = ll_meta_exc._inst.class_._INSTANCE
+        ll_exc = ll_meta_exc._INSTANCE
         NATIVE_INSTANCE = ll_exc._hints.get('NATIVE_INSTANCE', None)
         if NATIVE_INSTANCE is None:
             OOFunction.record_ll_meta_exc(self, ll_meta_exc)
@@ -107,7 +107,7 @@
 
     def begin_catch(self, llexitcase):
         ll_meta_exc = llexitcase
-        ll_exc = ll_meta_exc._inst.class_._INSTANCE
+        ll_exc = ll_meta_exc._INSTANCE
         cts_exc = self.cts.lltype_to_cts(ll_exc)
         self.ilasm.begin_catch(cts_exc.classname())
 
@@ -129,10 +129,10 @@
         else:
             # the exception value is on the stack, store it in the proper place
             if isinstance(link.last_exception, flowmodel.Variable):
-                self.ilasm.opcode('dup')
+                #self.ilasm.opcode('dup')
                 self.store(link.last_exc_value)
-                self.ilasm.get_field(('class Object_meta', 'Object', 'meta'))
-                self.store(link.last_exception)
+                #self.ilasm.get_field(('class Object_meta', 'Object', 'meta'))
+                #self.store(link.last_exception)
             else:
                 self.store(link.last_exc_value)
             self._setup_link(link)

Modified: pypy/branch/less-meta-instances/pypy/translator/cli/opcodes.py
==============================================================================
--- pypy/branch/less-meta-instances/pypy/translator/cli/opcodes.py	(original)
+++ pypy/branch/less-meta-instances/pypy/translator/cli/opcodes.py	Sat Apr  5 11:31:31 2008
@@ -49,6 +49,7 @@
     'cli_fieldinfo_for_const':  [FieldInfoForConst],
     'oois':                     'ceq',
     'oononnull':                [PushAllArgs, 'ldnull', 'ceq']+Not,
+    'classof':                  [PushAllArgs, 'callvirt instance [mscorlib]System.Type object::GetType()'],
     'instanceof':               [CastTo, 'ldnull', 'cgt.un'],
     'subclassof':               [PushAllArgs, 'call bool [pypylib]pypy.runtime.Utils::SubclassOf(class [mscorlib]System.Type, class[mscorlib]System.Type)'],
     'ooidentityhash':           [PushAllArgs, 'callvirt instance int32 object::GetHashCode()'],



More information about the Pypy-commit mailing list