Exemple #1
0
 def settopvalue(self, w_object, index_from_top=0):
     index_from_top = hint(index_from_top, promote=True)
     index = self.valuestackdepth + ~index_from_top
     self.assert_stack_index(index)
     assert index >= 0
     self.locals_cells_stack_w[index] = ll_assert_not_none(w_object)
Exemple #2
0
 def peekvalue(self, index_from_top=0):
     # NOTE: top of the stack is peekvalue(0).
     # Contrast this with CPython where it's PEEK(-1).
     return ll_assert_not_none(self.peekvalue_maybe_none(index_from_top))
Exemple #3
0
 def pushvalue(self, w_object):
     depth = self.valuestackdepth
     self.locals_cells_stack_w[depth] = ll_assert_not_none(w_object)
     self.valuestackdepth = depth + 1
Exemple #4
0
 def popvalue(self):
     return ll_assert_not_none(self.popvalue_maybe_none())
Exemple #5
0
 def f(i):
     a1 = g(i)
     a = A()
     a.x = i
     ll_assert_not_none(a1)
     return a.x