[pypy-svn] r46694 - pypy/dist/pypy/translator/jvm

antocuni at codespeak.net antocuni at codespeak.net
Mon Sep 17 15:32:28 CEST 2007


Author: antocuni
Date: Mon Sep 17 15:32:22 2007
New Revision: 46694

Modified:
   pypy/dist/pypy/translator/jvm/generator.py
   pypy/dist/pypy/translator/jvm/genjvm.py
Log:
enable stack_optimizations for jvm; to do this, we must compare
Variables by name and not by identity.



Modified: pypy/dist/pypy/translator/jvm/generator.py
==============================================================================
--- pypy/dist/pypy/translator/jvm/generator.py	(original)
+++ pypy/dist/pypy/translator/jvm/generator.py	Mon Sep 17 15:32:22 2007
@@ -515,14 +515,14 @@
         idx = self.next_offset
         self.next_offset += jtype.descriptor.type_width()
         if jvar:
-            assert jvar not in self.local_vars # never been added before
-            self.local_vars[jvar] = idx
+            assert jvar.name not in self.local_vars # never been added before
+            self.local_vars[jvar.name] = idx
         self.function_arguments.append((jtype, idx))
         return idx
     def var_offset(self, jvar, jtype):
         """ Returns offset for variable 'jvar', of java type 'jtype' """
-        if jvar in self.local_vars:
-            return self.local_vars[jvar]
+        if jvar.name in self.local_vars:
+            return self.local_vars[jvar.name]
         return self.add_var(jvar, jtype)
 
 
@@ -1370,7 +1370,7 @@
             return str(arg)
         strargs = [jasmin_syntax(arg) for arg in args]
         instr_text = '%s %s' % (jvmstr, " ".join(strargs))
-        self.curclass.out('    .line %d\n' % self.curfunc.instr_counter)
+        #self.curclass.out('    .line %d\n' % self.curfunc.instr_counter)
         self.curclass.out('    %-60s\n' % (instr_text,))
         self.curfunc.instr_counter+=1
 

Modified: pypy/dist/pypy/translator/jvm/genjvm.py
==============================================================================
--- pypy/dist/pypy/translator/jvm/genjvm.py	(original)
+++ pypy/dist/pypy/translator/jvm/genjvm.py	Mon Sep 17 15:32:22 2007
@@ -267,9 +267,6 @@
     def append_prebuilt_nodes(self):
         create_interlink_node(self.db)
 
-    def stack_optimization(self):
-        pass # TODO: enable stack_optimization
-
     def generate_source(self):
         """ Creates the sources, and returns a JvmGeneratedSource object
         for manipulating them """



More information about the Pypy-commit mailing list