Author: Hakan Ardo <ha...@debian.org> Branch: Changeset: r54796:8cb0aa4c2211 Date: 2012-04-28 22:54 +0200 http://bitbucket.org/pypy/pypy/changeset/8cb0aa4c2211/
Log: Some more explanations of InvalidLoop diff --git a/pypy/jit/metainterp/optimizeopt/unroll.py b/pypy/jit/metainterp/optimizeopt/unroll.py --- a/pypy/jit/metainterp/optimizeopt/unroll.py +++ b/pypy/jit/metainterp/optimizeopt/unroll.py @@ -315,7 +315,10 @@ try: jumpargs = virtual_state.make_inputargs(values, self.optimizer) except BadVirtualState: - raise InvalidLoop + raise InvalidLoop('The state of the optimizer at the end of ' + + 'peeled loop is inconsistent with the ' + + 'VirtualState at the begining of the peeled ' + + 'loop') jumpop.initarglist(jumpargs) # Inline the short preamble at the end of the loop @@ -325,7 +328,11 @@ for i in range(len(short_inputargs)): if short_inputargs[i] in args: if args[short_inputargs[i]] != jmp_to_short_args[i]: - raise InvalidLoop + raise InvalidLoop('The short preamble wants the ' + + 'same box passed to multiple of its ' + + 'inputargs, but the jump at the ' + + 'end of this bridge does not do that.') + args[short_inputargs[i]] = jmp_to_short_args[i] self.short_inliner = Inliner(short_inputargs, jmp_to_short_args) for op in self.short[1:]: diff --git a/pypy/jit/metainterp/optimizeopt/virtualstate.py b/pypy/jit/metainterp/optimizeopt/virtualstate.py --- a/pypy/jit/metainterp/optimizeopt/virtualstate.py +++ b/pypy/jit/metainterp/optimizeopt/virtualstate.py @@ -27,11 +27,15 @@ if self.generalization_of(other, renum, {}): return if renum[self.position] != other.position: - raise InvalidLoop + raise InvalidLoop('The numbering of the virtual states does not ' + + 'match. This means that two virtual fields ' + + 'have been set to the same Box in one of the ' + + 'virtual states but not in the other.') self._generate_guards(other, box, cpu, extra_guards) def _generate_guards(self, other, box, cpu, extra_guards): - raise InvalidLoop + raise InvalidLoop('Generating guards for making the VirtualStates ' + + 'at hand match have not been implemented') def enum_forced_boxes(self, boxes, value, optimizer): raise NotImplementedError @@ -346,10 +350,12 @@ def _generate_guards(self, other, box, cpu, extra_guards): if not isinstance(other, NotVirtualStateInfo): - raise InvalidLoop + raise InvalidLoop('The VirtualStates does not match as a ' + + 'virtual appears where a pointer is needed ' + + 'and it is too late to force it.') if self.lenbound or other.lenbound: - raise InvalidLoop + raise InvalidLoop('The array length bounds does not match.') if self.level == LEVEL_KNOWNCLASS and \ box.nonnull() and \ @@ -400,7 +406,8 @@ return # Remaining cases are probably not interesting - raise InvalidLoop + raise InvalidLoop('Generating guards for making the VirtualStates ' + + 'at hand match have not been implemented') if self.level == LEVEL_CONSTANT: import pdb; pdb.set_trace() raise NotImplementedError _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit