Commits

Lars Wassermann committed 0a1371c

fixed a typo with _attr_ -> _attrs_ and subsequent annotator errors

  • Participants
  • Parent commits 011594b

Comments (0)

Files changed (5)

File spyvm/error.py

 	pass
 
 class Exit(Exception):
+    _attrs_ = ["msg"]
     def __init__(self, msg):
         self.msg = msg
 

File spyvm/interpreter.py

         return symbol * (self.max_stack_depth - self.remaining_stack_depth)
 
 class ReturnFromTopLevel(Exception):
+    _attrs_ = ["object"]
     def __init__(self, object):
         self.object = object
 
 class StackOverflow(Exception):
+    _attrs_ = ["s_context"]
     def __init__(self, s_top_context):
         self.s_context = s_top_context
 
 class Return(Exception):
+    _attrs_ = ["value", "s_target_context"]
     def __init__(self, object, s_context):
         self.value = object
         self.s_target_context = s_context
 
 class ProcessSwitch(Exception):
+    _attrs_ = ["s_new_context"]
     def __init__(self, s_context):
         self.s_new_context = s_context
 

File spyvm/interpreter_proxy.py

         def wrapped(*c_arguments):
             assert len_unwrap_spec == len(c_arguments)
             args = ()
-            if IProxy.interp.trace_proxy:
+            if IProxy.trace_proxy:
                 print 'Called InterpreterProxy >> %s' % func.func_name,
+            assert IProxy.s_frame is not None and IProxy.space is not None and IProxy.interp is not None
             try:
                 for i, spec in unrolling_unwrap_spec:
                     c_arg = c_arguments[i]
                     else:
                         args += (c_arg, )
                 result = func(*args)
-                if IProxy.interp.trace_proxy:
+                if IProxy.trace_proxy:
                     print '\t-> %s' % result
                 if result_type is oop:
                     assert isinstance(result, model.W_Object)
     def __init__(self):
         self.vm_proxy = lltype.nullptr(VMPtr.TO)
         self.vm_initialized = False
+        self.space = None
         self._next_oop = 0
         self.oop_map = {}
         self.object_map = {}
         self.argcount = 0
         self.s_method = None
         self.fail_reason = 0
+        self.trace_proxy = False
 
     def call(self, signature, interp, s_frame, argcount, s_method):
         self.initialize_from_call(signature, interp, s_frame, argcount, s_method)
         self.argcount = argcount
         self.s_method = s_method
         self.space = interp.space
+        self.trace_proxy = interp.trace_proxy
         # ensure that space.w_nil gets the first possible oop
         self.object_to_oop(self.space.w_nil)
 

File spyvm/model.py

     """
 
     _immutable_fields_ = ["_shadow?"]
+    _attrs_ = ["bytes", "_likely_methodname", "header", "argsize", "primitive", 
+                "literals", "tempsize", "literalsize", "islarge", "_shadow"]
 ### Extension from Squeak 3.9 doc, which we do not implement:
 ###        trailer (variable)
 ###    The trailer has two variant formats.  In the first variant, the last

File spyvm/shadow.py

     """A shadow is an optional extra bit of information that
     can be attached at run-time to any Smalltalk object.
     """
-    _attr_ = ['_w_self']
+    _attrs_ = ['_w_self', 'space']
 
     def __init__(self, space, w_self):
         self.space = space
 
 class AbstractCachingShadow(AbstractShadow):
     _immutable_fields_ = ['version?']
-    _attr_ = []
+    _attrs_ = ['version']
 
     def __init__(self, space, w_self):
         AbstractShadow.__init__(self, space, w_self)
     (i.e. used as the class of another Smalltalk object).
     """
 
-    _attr_ = ["name", "_instance_size", "instance_varsized", "instance_kind",
+    _attrs_ = ["name", "_instance_size", "instance_varsized", "instance_kind",
                 "_s_methoddict", "_s_superclass", "subclass_s"]
 
     def __init__(self, space, w_self):
 class MethodDictionaryShadow(AbstractShadow):
 
     _immutable_fields_ = ['invalid?', 's_class']
-    _attr_ = ['methoddict']
+    _attrs_ = ['methoddict', 'invalid', 's_class']
 
     def __init__(self, space, w_self):
         self.invalid = True
 
 
 class AbstractRedirectingShadow(AbstractShadow):
-    _attr_ = ['_w_self_size']
+    _attrs_ = ['_w_self_size']
 
     def __init__(self, space, w_self):
         AbstractShadow.__init__(self, space, w_self)
 class ContextPartShadow(AbstractRedirectingShadow):
 
     __metaclass__ = extendabletype
-    _attr_ = ['_s_sender', '_pc', '_temps_and_stack',
+    _attrs_ = ['_s_sender', '_pc', '_temps_and_stack',
             '_stack_ptr', 'instances_w']
 
     _virtualizable2_ = [
 
 
 class BlockContextShadow(ContextPartShadow):
-    _attr_ = ['_w_home', '_initialip', '_eargc']
+    _attrs_ = ['_w_home', '_initialip', '_eargc']
 
     @staticmethod
     def make_context(space, w_home, s_sender, argcnt, initialip):
         )
 
 class MethodContextShadow(ContextPartShadow):
-    _attr_ = ['w_closure_or_nil', '_w_receiver', '_w_method']
+    _attrs_ = ['w_closure_or_nil', '_w_receiver', '_w_method']
 
     def __init__(self, space, w_self):
         self.w_closure_or_nil = space.w_nil
         return '%s%s' % (block, self.w_method().get_identifier_string())
 
 class CompiledMethodShadow(object):
-    _attr_ = ["_w_self", "bytecode",
-              "literals[*]", "bytecodeoffset",
-              "literalsize", "tempsize", "primitive",
+    _attrs_ = ["_w_self", "bytecode",
+              "literals", "bytecodeoffset",
+              "literalsize", "_tempsize", "_primitive",
               "argsize", "islarge",
-              "w_compiledin"]
+              "w_compiledin", "version"]
     _immutable_fields_ = ["version?", "_w_self"]
 
     def __init__(self, w_compiledmethod):
         w_compiledmethod = self._w_self
         self.version = Version()
         self.bytecode = "".join(w_compiledmethod.bytes)
-        self.literals = w_compiledmethod.literals
         self.bytecodeoffset = w_compiledmethod.bytecodeoffset()
         self.literalsize = w_compiledmethod.getliteralsize()
         self._tempsize = w_compiledmethod.gettempsize()
         self._primitive = w_compiledmethod.primitive
         self.argsize = w_compiledmethod.argsize
         self.islarge = w_compiledmethod.islarge
+        self.literals = w_compiledmethod.literals
 
         self.w_compiledin = None
         if self.literals:
 
 
 class ObserveeShadow(AbstractShadow):
-    _attr_ = ['dependent']
+    _attrs_ = ['dependent']
     def __init__(self, space, w_self):
         AbstractShadow.__init__(self, space, w_self)
         self.dependent = None