本文整理汇总了Python中frame.Frame.push_boxed_int方法的典型用法代码示例。如果您正苦于以下问题:Python Frame.push_boxed_int方法的具体用法?Python Frame.push_boxed_int怎么用?Python Frame.push_boxed_int使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类frame.Frame
的用法示例。
在下文中一共展示了Frame.push_boxed_int方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from frame import Frame [as 别名]
# 或者: from frame.Frame import push_boxed_int [as 别名]
#.........这里部分代码省略.........
obj = self.frame.peek(-3)
key = self.frame.peek(-2)
value = self.frame.peek(-1)
self.call(add_property, obj, key, value)
self.frame.pop()
self.frame.pop()
# the object pointers stays on the stack
def op_function(self, node):
assert 0
def op_this(self, nodes):
@function(c_int)
def this():
return self.ctx.this.raw
self.call(this)
reg = self.frame.alloc_reg()
self.assembler.mov(reg, eax)
self.frame.push('unknown', reg)
def op_unary_minus(self, node):
self.compile_node(node[0])
lhs = self.frame.peek(-1)
if lhs.is_constant():
self.frame.pop()
value = self.rt.sub(boxed_integer(0), lhs.to_boxed_int())
self.push_boxed_int(value)
elif lhs.is_int():
reg = lhs.to_reg()
self.frame.pop()
self.frame.take_reg(reg)
self.assembler.neg(reg)
self.frame.push('int', reg)
else:
@function(c_int, BoxedInt)
def unary_minus(lhs):
return self.rt.sub(boxed_integer(0), lhs).value
self.call(unary_minus, lhs)
result = self.frame.alloc_reg()
self.assembler.mov(result, eax)
self.frame.pop()
self.frame.push('unknown', result)
def op_unary_plus(self, node):
self.compile_node(node[0])
lhs = self.frame.peek(-1)
if lhs.is_int() or lhs.is_double():
return # nothing to do
if lhs.is_constant():
self.frame.pop()
value = self.rt.toNumber(lhs.to_boxed_int())
self.frame.push_boxed_int(value)
else: