1.1 --- a/rsvp.py Sat Feb 26 01:12:25 2011 +0100
1.2 +++ b/rsvp.py Sun Feb 27 02:45:38 2011 +0100
1.3 @@ -158,7 +158,15 @@
1.4 def dump(self):
1.5 print "PC", self.pc, "->", self.load(self.pc)
1.6 print "PC stack", self.pc_stack
1.7 - print "Frame stack", self.frame_stack
1.8 + print "Frame stack:"
1.9 + if self.local_sp_stack:
1.10 + start = self.local_sp_stack[0]
1.11 + for end in self.local_sp_stack[1:]:
1.12 + print " %2d" % start, self.frame_stack[start:end]
1.13 + start = end
1.14 + else:
1.15 + print " %2d" % start, self.frame_stack[start:]
1.16 + print
1.17 print "Local stack pointers", self.local_sp_stack
1.18 print "Invocation stack pointers", self.invocation_sp_stack
1.19 print "Handler stack", self.handler_stack
1.20 @@ -206,12 +214,8 @@
1.21
1.22 def up(self):
1.23 retaddr = self.pc_stack[-1]
1.24 - new_breakpoint = retaddr not in self.breakpoints
1.25 - if new_breakpoint:
1.26 - self.set_break(retaddr)
1.27 + self.set_break(retaddr)
1.28 self.run()
1.29 - if new_breakpoint:
1.30 - self.breakpoints.remove(retaddr)
1.31
1.32 # Internal operations.
1.33
1.34 @@ -469,7 +473,7 @@
1.35 size = self.operand
1.36 value = self.value
1.37 # NOTE: Referencing the instance template.
1.38 - addr = self._MakeObject(size, value.ref - 2)
1.39 + addr = self._MakeObject(size, value.ref - Library.instance_template_size)
1.40 # Introduce object as context for the new object.
1.41 self.value = DataValue(addr, addr)
1.42
1.43 @@ -752,7 +756,7 @@
1.44
1.45 def RaiseException(self):
1.46 # NOTE: Adding the program counter as the first attribute after __class__.
1.47 - self.save(self.exception + 2, self.pc)
1.48 + self.save(self.exception + Library.instance_data_offset, self.pc)
1.49 # Jumping to the current handler.
1.50 if self.abort_upon_exception:
1.51 raise Exception
1.52 @@ -843,9 +847,6 @@
1.53 addr = self.new(size)
1.54 # Save the header, overriding the size.
1.55 self.save(addr, data.with_size(size))
1.56 - # Copy the __class__ attribute.
1.57 - cls_attr = self.load(ref + 1)
1.58 - self.save(addr + 1, cls_attr)
1.59 return addr
1.60
1.61 def _MakeFragment(self, occupied, size):