Author: Alex Gaynor <[email protected]>
Branch:
Changeset: r59460:da703a547305
Date: 2012-12-16 03:37 -0800
http://bitbucket.org/pypy/pypy/changeset/da703a547305/
Log: fix a mis-indented block
diff --git a/pypy/translator/backendopt/malloc.py
b/pypy/translator/backendopt/malloc.py
--- a/pypy/translator/backendopt/malloc.py
+++ b/pypy/translator/backendopt/malloc.py
@@ -1,5 +1,4 @@
-from pypy.objspace.flow.model import Variable, Constant, Block, Link
-from pypy.objspace.flow.model import SpaceOperation
+from pypy.objspace.flow.model import Variable, Constant, SpaceOperation
from pypy.tool.algo.unionfind import UnionFind
from pypy.rpython.lltypesystem import lltype
from pypy.rpython.ootypesystem import ootype
@@ -7,6 +6,7 @@
from pypy.translator.backendopt import removenoops
from pypy.translator.backendopt.support import log
+
class LifeTime:
def __init__(self, (block, var)):
@@ -165,24 +165,24 @@
set_use_point(node, node.exitswitch, "exitswitch", node)
for node in graph.iterlinks():
- if isinstance(node.last_exception, Variable):
- set_creation_point(node.prevblock, node.last_exception,
- "last_exception")
- if isinstance(node.last_exc_value, Variable):
- set_creation_point(node.prevblock, node.last_exc_value,
- "last_exc_value")
- d = {}
- for i, arg in enumerate(node.args):
- union(node.prevblock, arg,
- node.target, node.target.inputargs[i])
- if isinstance(arg, Variable):
- if arg in d:
- # same variable present several times in link.args
- # consider it as a 'use' of the variable, which
- # will disable malloc optimization (aliasing
problems)
- set_use_point(node.prevblock, arg, "dup", node, i)
- else:
- d[arg] = True
+ if isinstance(node.last_exception, Variable):
+ set_creation_point(node.prevblock, node.last_exception,
+ "last_exception")
+ if isinstance(node.last_exc_value, Variable):
+ set_creation_point(node.prevblock, node.last_exc_value,
+ "last_exc_value")
+ d = {}
+ for i, arg in enumerate(node.args):
+ union(node.prevblock, arg,
+ node.target, node.target.inputargs[i])
+ if isinstance(arg, Variable):
+ if arg in d:
+ # same variable present several times in link.args
+ # consider it as a 'use' of the variable, which
+ # will disable malloc optimization (aliasing problems)
+ set_use_point(node.prevblock, arg, "dup", node, i)
+ else:
+ d[arg] = True
return lifetimes.infos()
@@ -407,13 +407,12 @@
isinstance(S._flds[S._names[0]], lltype.Struct) and
S._flds[S._names[0]]._hints.get('union'))
-
def RTTI_dtor(self, STRUCT):
try:
destr_ptr =
lltype.getRuntimeTypeInfo(STRUCT)._obj.destructor_funcptr
if destr_ptr:
return True
- except (ValueError, AttributeError), e:
+ except (ValueError, AttributeError):
pass
return False
@@ -535,7 +534,7 @@
newop = SpaceOperation('same_as', [c], op.result)
self.newops.append(newop)
else:
- raise AssertionError, op.opname
+ raise AssertionError(op.opname)
class OOTypeMallocRemover(BaseMallocRemover):
@@ -614,7 +613,7 @@
newop = SpaceOperation('same_as', [c], op.result)
self.newops.append(newop)
else:
- raise AssertionError, op.opname
+ raise AssertionError(op.opname)
def remove_simple_mallocs(graph, type_system='lltypesystem', verbose=True):
@@ -639,5 +638,3 @@
tot += count
log.malloc("removed %d simple mallocs in total" % tot)
return tot
-
-
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit