[pypy-commit] lang-smalltalk default: (cfbolz): added the correct hints to the preliminary type-hinting

lwassermann noreply at buildbot.pypy.org
Tue Apr 16 14:10:37 CEST 2013


Author: Lars Wassermann <lars.wassermann at gmail.com>
Branch: 
Changeset: r279:6b77a8d99cdd
Date: 2013-04-12 19:03 +0200
http://bitbucket.org/pypy/lang-smalltalk/changeset/6b77a8d99cdd/

Log:	(cfbolz): added the correct hints to the preliminary type-hinting

diff --git a/spyvm/fieldtypes.py b/spyvm/fieldtypes.py
--- a/spyvm/fieldtypes.py
+++ b/spyvm/fieldtypes.py
@@ -31,7 +31,7 @@
         w_obj._vars[n0] = w_val
 
 class FieldTypes(VarSizedFieldTypes):
-    _immutable_fields_ = ['types']
+    _immutable_fields_ = ['types[*]']
     _attrs_ = ['types', 'parent', 'siblings', 'diff']
     _settled_ = True
 
@@ -63,7 +63,7 @@
             w_object.fieldtypes = self.sibling(n0, changed_type)
         w_object._vars[n0] = w_value
 
-
+    @jit.elidable
     def sibling(self, n0, changed_type):
         assert self.types[n0] is not changed_type
         change = (n0, changed_type)
@@ -108,6 +108,7 @@
 
 
     @staticmethod
+    @jit.elidable
     def of_length(n):
         if n not in maps:
             maps[n] = FieldTypes([obj] * n)


More information about the pypy-commit mailing list