Michal Wallace wrote:
def f(x):
if x:
return 1
else:
return 0
print f(1), f(0)
Nice coincidence. S. Togos' bug report too.
Anyway, its already fixed.
leo
Piers Cawley <[EMAIL PROTECTED]> wrote:
> Leopold Toetsch <[EMAIL PROTECTED]> writes:
>> As calling conventions clearly state, that the caller has to save
>> everything, its probably up to imcc/pcc.c to insert above
>> statements, if another sub gets called from a sub. I'll fix that in
>> a minute
On Sun, 10 Aug 2003, Leopold Toetsch wrote:
> Piers Cawley <[EMAIL PROTECTED]> wrote:
> > Leopold Toetsch <[EMAIL PROTECTED]> writes:
> >> As calling conventions clearly state, that the caller has to save
> >> everything, its probably up to imcc/pcc.c to insert above
> >> statements, if another su
Benjamin Goldberg <[EMAIL PROTECTED]> wrote:
> This is where .macro comes in handy :)
>.macro lexical(name_in_pad, register_name)
> local .register_name
> find_lex .register_name, .name_in_pad
>.endm
Macros are currently enabled for PASM mode only. But there is no special
rea
Michal Wallace <[EMAIL PROTECTED]> wrote:
> On Sun, 10 Aug 2003, Leopold Toetsch wrote:
>> Piers Cawley <[EMAIL PROTECTED]> wrote:
>> > If and only if that's not a tail call of course.
>>
>> Good point. But I can imagine, that's by far more simple to detect tail
>> calls at the AST level
> Well,
On Sat, 9 Aug 2003, Leopold Toetsch wrote:
> As calling conventions clearly state, that the caller has to save
> everything, its probably up to imcc/pcc.c to insert above statements, if
> another sub gets called from a sub. I'll fix that in a minute ;-)
I just synced up with cvs and now everyth
Piers Cawley <[EMAIL PROTECTED]> wrote:
> I'm not sure you can optimize it to a jump opcode when you're tail
> calling another function can you? You could be tailcalling into a
> closure so you'll need to use invoke to do the right thing with the
> lexical stack etc.
Argh, yes. What about:
If th
Michal Wallace wrote:
Gosh you're quick. Thanks!
Welcome
Want another one? :)
Always.
def g():
return 0
def f():
return g()
print f()
This prints:
'No more I register frames to pop!'
The return continuation P1 in f() isnt preserved.
# f from line 3
.p
On Sat, 9 Aug 2003, Benjamin Goldberg wrote:
> Michal Wallace wrote:
> [snip]
> > def f():
> > return g()
> [snip]
> > # f from line 3
> > .pcc_sub _sub1 non_prototyped
> > .local object res1# (visitReturn:528)
> > find_lex $P2, 'g' # (callingExpress
Hey all,
Sorry for the huge code listing here, but I don't
have a simpler case. This is what pirate outputs
when it compiles the following program:
def f(x):
if x:
return 1
else:
return 0
print f(1), f(0)
As far as I can tell,
Leopold Toetsch <[EMAIL PROTECTED]> writes:
> Piers Cawley <[EMAIL PROTECTED]> wrote:
>> Leopold Toetsch <[EMAIL PROTECTED]> writes:
>>> As calling conventions clearly state, that the caller has to save
>>> everything, its probably up to imcc/pcc.c to insert above
>>> statements, if another sub ge
On Sat, 9 Aug 2003, Leopold Toetsch wrote:
> Nice coincidence. S. Togos' bug report too.
> Anyway, its already fixed.
Gosh you're quick. Thanks!
Want another one? :)
def g():
return 0
def f():
return g()
print f()
This prints:
'No more I register frame
Michal Wallace wrote:
> Benjamin Goldberg wrote:
> > Michal Wallace wrote:
[snip]
> > Also... why is $P2 merely an imcc temporary, without a real name?
> > That is, why not do:
> >
> > .pcc_sub _sub1 non_prototyped
> > .local object sub1
> > find_lex sub1, 'g'
> > .pcc_begin non_protot
Michal Wallace wrote:
[snip]
> def f():
> return g()
[snip]
> # f from line 3
> .pcc_sub _sub1 non_prototyped
> .local object res1# (visitReturn:528)
> find_lex $P2, 'g' # (callingExpression:325)
> newsub $P3, .Continuation, ret0# (callingExpressi
Leopold Toetsch <[EMAIL PROTECTED]> writes:
> As calling conventions clearly state, that the caller has to save
> everything, its probably up to imcc/pcc.c to insert above
> statements, if another sub gets called from a sub. I'll fix that in
> a minute ;-)
If and only if that's not a tail call of
15 matches
Mail list logo