[pypy-svn] r28476 - pypy/dist/pypy/translator/cli

antocuni at codespeak.net antocuni at codespeak.net
Wed Jun 7 19:25:06 CEST 2006


Author: antocuni
Date: Wed Jun  7 19:25:06 2006
New Revision: 28476

Modified:
   pypy/dist/pypy/translator/cli/metavm.py
   pypy/dist/pypy/translator/cli/opcodes.py
Log:
bugfix related to class field with Void type.



Modified: pypy/dist/pypy/translator/cli/metavm.py
==============================================================================
--- pypy/dist/pypy/translator/cli/metavm.py	(original)
+++ pypy/dist/pypy/translator/cli/metavm.py	Wed Jun  7 19:25:06 2006
@@ -49,6 +49,16 @@
         generator.load(this)
         generator.get_field(this.concretetype, field.value)
 
+class _SetField(MicroInstruction):
+    def render(self, generator, op):
+        this, field, value = op.args
+        if value.concretetype is ootype.Void:
+            return
+        generator.load(this)
+        generator.load(value)
+        generator.set_field(this.concretetype, field.value)
+
+
 class _CastTo(MicroInstruction):
     def render(self, generator, op):
         generator.load(op.args[0])
@@ -59,4 +69,5 @@
 IndirectCall = _IndirectCall()
 RuntimeNew = _RuntimeNew()
 GetField = _GetField()
+SetField = _SetField()
 CastTo = _CastTo()

Modified: pypy/dist/pypy/translator/cli/opcodes.py
==============================================================================
--- pypy/dist/pypy/translator/cli/opcodes.py	(original)
+++ pypy/dist/pypy/translator/cli/opcodes.py	Wed Jun  7 19:25:06 2006
@@ -1,6 +1,7 @@
-from pypy.translator.cli.metavm import  Call, CallMethod, RuntimeNew, IndirectCall, GetField, CastTo
+from pypy.translator.cli.metavm import  Call, CallMethod, RuntimeNew, \
+     IndirectCall, GetField, SetField, CastTo
 from pypy.translator.oosupport.metavm import PushArg, PushAllArgs, StoreResult, InstructionList,\
-    SetField, New
+    New
 
 # some useful instruction patterns
 Not = ['ldc.i4.0', 'ceq']



More information about the Pypy-commit mailing list