RE: question about branching/returning

2001-09-20 Thread Michael Maraist
On Thu, 20 Sep 2001, Brent Dax wrote: > Damien Neil: > # "RETURN(0);" (written exactly like that, no variation permitted) > # is a special case, and terminates the runops loop. The only op > # which uses this is "end", and it doesn't actually ever execute. > # Personally, I feel that this specia

Re: question about branching/returning

2001-09-20 Thread Dan Sugalski
At 10:22 PM 9/19/2001 -0700, Dave Storrs wrote: >I'm working on documenting the opcodes, and I want to make sure that I >understand the 'RETURN' code properly. I've poked around a little bit to >see if I coudl figure it out, but I don't want to divert too much. Would >someone please explain to m

Re: question about branching/returning

2001-09-20 Thread Gregor N. Purdy
Simon -- > But this still sucks: > > while (code >= code_start && code < (code_start + code_size) && code->i) { > DO_OP(code, temp, func, interpreter); > } > > Three tests and an addition each op. At the *very least*, we should store > code_end = code_start + code_size. And at b

Re: question about branching/returning

2001-09-20 Thread Damien Neil
On Wed, Sep 19, 2001 at 10:32:18PM -0700, Dave Storrs wrote: > Ok, that was pretty much what I thought. But then what is the 'end' > opcode for? It does a 'RETURN 0', which would increment the PC by 0 > opcodes...which either counts as an infinite loop or a no-op, and we've > already got a no-op

RE: question about branching/returning

2001-09-20 Thread Brent Dax
Damien Neil: # "RETURN(0);" (written exactly like that, no variation permitted) # is a special case, and terminates the runops loop. The only op # which uses this is "end", and it doesn't actually ever execute. # Personally, I feel that this special case should be removed. We should probably jus

Re: question about branching/returning

2001-09-20 Thread Damien Neil
On Wed, Sep 19, 2001 at 10:22:27PM -0700, Dave Storrs wrote: > I'm working on documenting the opcodes, and I want to make sure that I > understand the 'RETURN' code properly. I've poked around a little bit to > see if I coudl figure it out, but I don't want to divert too much. Would > someone pl

Re: question about branching/returning

2001-09-20 Thread Michael L Maraist
The internal do-op-loop runs until it sees a return value of zero from any op-codes. The RETURN statement within basic_opcodes.ops is really a keyword which gets parsed into an offset of the current PC counter based on the internally calculated size of the instruction (known at Configure time fro

RE: question about branching/returning

2001-09-19 Thread Gibbs Tanton - tgibbs
essage- From: Simon Cozens To: Dave Storrs Cc: 'The Perl 6 Internals list ' Sent: 9/20/2001 12:53 AM Subject: Re: question about branching/returning On Wed, Sep 19, 2001 at 10:47:44PM -0700, Dave Storrs wrote: > Well, I'm in the process of fiddling with this stuff anyway...what do y

Re: question about branching/returning

2001-09-19 Thread Simon Cozens
On Wed, Sep 19, 2001 at 10:47:44PM -0700, Dave Storrs wrote: > Well, I'm in the process of fiddling with this stuff anyway...what do you > want me to make it do? Oh, sorry, I see what happens. The last test (code->i) is what I would think of as *code: it tests whether we're sitting on an end op,

Re: question about branching/returning

2001-09-19 Thread Dave Storrs
Well, I'm in the process of fiddling with this stuff anyway...what do you want me to make it do? Dave On Thu, 20 Sep 2001, Simon Cozens wrote: > On Wed, Sep 19, 2001 at 10:32:18PM -0700, Dave Storrs wrote: > > Ok, that was pretty much what I thought. But then what is the 'end' > > opcode for?

Re: question about branching/returning

2001-09-19 Thread Simon Cozens
On Wed, Sep 19, 2001 at 10:32:18PM -0700, Dave Storrs wrote: > Ok, that was pretty much what I thought. But then what is the 'end' > opcode for? It does a 'RETURN 0', which would increment the PC by 0 > opcodes...which either counts as an infinite loop or a no-op, and we've > already got a no-op

RE: question about branching/returning

2001-09-19 Thread Gibbs Tanton - tgibbs
: Gibbs Tanton - tgibbs Cc: 'The Perl 6 Internals list ' Sent: 9/20/2001 12:32 AM Subject: RE: question about branching/returning Ok, that was pretty much what I thought. But then what is the 'end' opcode for? It does a 'RETURN 0', which would increment the PC by 0 op

RE: question about branching/returning

2001-09-19 Thread Dave Storrs
Ok, that was pretty much what I thought. But then what is the 'end' opcode for? It does a 'RETURN 0', which would increment the PC by 0 opcodes...which either counts as an infinite loop or a no-op, and we've already got a no-op op. Dave On Thu, 20 Sep 2001, Gibbs Tanton - tgibbs wrote: > RE

RE: question about branching/returning

2001-09-19 Thread Gibbs Tanton - tgibbs
list Sent: 9/20/2001 12:22 AM Subject: question about branching/returning I'm working on documenting the opcodes, and I want to make sure that I understand the 'RETURN' code properly. I've poked around a little bit to see if I coudl figure it out, but I don't want

question about branching/returning

2001-09-19 Thread Dave Storrs
I'm working on documenting the opcodes, and I want to make sure that I understand the 'RETURN' code properly. I've poked around a little bit to see if I coudl figure it out, but I don't want to divert too much. Would someone please explain to me what each of the following does? RETURN 4 RETURN