Author: Carl Friedrich Bolz <[email protected]>
Branch: spaceops-are-variables
Changeset: r74248:da1ff18593fd
Date: 2014-10-26 14:09 +0100
http://bitbucket.org/pypy/pypy/changeset/da1ff18593fd/
Log: more fixes in the rtyper
diff --git a/rpython/memory/gctransform/transform.py
b/rpython/memory/gctransform/transform.py
--- a/rpython/memory/gctransform/transform.py
+++ b/rpython/memory/gctransform/transform.py
@@ -41,7 +41,7 @@
def dispatch(self):
gct = self.gctransformer
opname = self.spaceop.opname
- v_result = self.spaceop.result
+ v_result = self.spaceop
meth = getattr(gct, 'gct_' + opname, gct.default)
meth(self)
@@ -69,7 +69,7 @@
return resultvar
def cast_result(self, var):
- v_result = self.spaceop.result
+ v_result = self.spaceop
resulttype = v_result.concretetype
curtype = var.concretetype
if curtype == resulttype:
@@ -77,6 +77,7 @@
else:
v_new = gen_cast(self.llops, resulttype, var)
assert v_new != var
+ xxx
self.llops[-1].result = v_result
# ________________________________________________________________
@@ -475,7 +476,7 @@
ll_stack_malloc_fixedsize, [lltype.Signed], llmemory.Address)
def gct_malloc(self, hop, add_flags=None):
- TYPE = hop.spaceop.result.concretetype.TO
+ TYPE = hop.spaceop.concretetype.TO
assert not TYPE._is_varsize()
flags = hop.spaceop.args[1].value
flavor = flags['flavor']
@@ -521,7 +522,7 @@
def varsize_malloc_helper(self, hop, flags, meth, extraargs):
def intconst(c): return rmodel.inputconst(lltype.Signed, c)
op = hop.spaceop
- TYPE = op.result.concretetype.TO
+ TYPE = op.concretetype.TO
assert TYPE._is_varsize()
if isinstance(TYPE, lltype.Struct):
ARRAY = TYPE._flds[TYPE._arrayfld]
diff --git a/rpython/rtyper/normalizecalls.py b/rpython/rtyper/normalizecalls.py
--- a/rpython/rtyper/normalizecalls.py
+++ b/rpython/rtyper/normalizecalls.py
@@ -282,13 +282,13 @@
#
if hasattr(classdef, 'my_instantiate_graph'):
return
- v = Variable()
block = Block([])
- block.operations.append(SpaceOperation('instantiate1', [], v))
+ op = SpaceOperation('instantiate1', [])
+ block.operations.append(op)
name = valid_identifier('instantiate_' + classdef.name)
graph = FunctionGraph(name, block)
- block.closeblock(Link([v], graph.returnblock))
- annotator.setbinding(v, annmodel.SomeInstance(classdef))
+ block.closeblock(Link([op], graph.returnblock))
+ annotator.setbinding(op, annmodel.SomeInstance(classdef))
annotator.annotated[block] = graph
# force the result to be converted to a generic OBJECTPTR
generalizedresult = annmodel.SomeInstance(classdef=None)
diff --git a/rpython/rtyper/rcontrollerentry.py
b/rpython/rtyper/rcontrollerentry.py
--- a/rpython/rtyper/rcontrollerentry.py
+++ b/rpython/rtyper/rcontrollerentry.py
@@ -73,6 +73,5 @@
hop2.s_result, hop2.r_result = s_new, r_new
hop2.v_s_insertfirstarg(c_meth, s_meth)
spaceop = op.simple_call(*hop2.args_v)
- spaceop.result = hop2.spaceop.result
hop2.spaceop = spaceop
return hop2.dispatch()
diff --git a/rpython/rtyper/test/test_llinterp.py
b/rpython/rtyper/test/test_llinterp.py
--- a/rpython/rtyper/test/test_llinterp.py
+++ b/rpython/rtyper/test/test_llinterp.py
@@ -344,7 +344,7 @@
g = FunctionGraph("is_one", block)
op1 = op.eq(v_i, Constant(1))
block.operations.append(op1)
- block.exitswitch = op1.result
+ block.exitswitch = op1
tlink = Link([Constant(1)], g.returnblock, True)
flink = Link([Constant(0)], g.returnblock, False)
links = [tlink, flink]
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit