[CVS ci] event-handling-4

2003-12-15 Thread Leopold Toetsch
I've committed a first attempt towards event handling. Caused by the absence of further design docs it might be not a scheme, that will finally be run, but I hope that at least parts are useful. Its a bit tested w. dynoplibs/alarm.pasm $ parrot dynoplibs/alarm.pasm 0 1 alarm Please s. doc

Re: [perl #23039] [PATCH] event handling-2

2003-09-20 Thread Nicholas Clark
On Fri, Jul 18, 2003 at 05:06:09PM +, Leopold Toetsch wrote: > # New Ticket Created by Leopold Toetsch > # Please include the string: [perl #23039] > # in the subject line of all future correspondence about this issue. > # http://rt.perl.org/rt2/Ticket/Display.html?id=23039 > RT says that

Re: Event handling (was Re: [CVS ci] exceptions-6: signals, catch a SIGFPE (generic platform)

2003-09-13 Thread Leopold Toetsch
ot committed, lacking some kind of confirmation. WRT your question: scheduling an event puts the event handler opcode in place. If there are no events in the quueue, there are no event check opcodes executed that could slow down the operation. When there are multiple events to handle, it doesn

Re: Event handling (was Re: [CVS ci] exceptions-6: signals, catch a SIGFPE (generic platform)

2003-09-12 Thread Mark A. Biggar
Nicholas Clark wrote: On Thu, Jul 17, 2003 at 08:40:44PM -0400, Benjamin Goldberg wrote: Actually, I'm thinking of something like the following... suppose the original code is like: label_foo: loop body branch_address: branch label_foo Add in the following: e_handler_foo: .local Perl

Re: Event handling (was Re: [CVS ci] exceptions-6: signals, catch a SIGFPE (generic platform)

2003-09-12 Thread Nicholas Clark
On Thu, Jul 17, 2003 at 08:40:44PM -0400, Benjamin Goldberg wrote: > Actually, I'm thinking of something like the following... suppose the > original code is like: > >label_foo: >loop body >branch_address: >branch label_foo > > Add in the following: > >e_handler_foo: >.l

Re: [perl #23039] [PATCH] event handling-2

2003-08-01 Thread Leopold Toetsch
Benjamin Goldberg <[EMAIL PROTECTED]> wrote: > Leopold Toetsch wrote: >> OK here it is. >> Again the description for the record: >> >> 1) Initialization: >> - normal core: build op_func_table with all opcode #4 [1] >> - CG core: build ops_addr[] filled with this opcode >> - prederef cor

Re: [perl #23039] [PATCH] event handling-2

2003-08-01 Thread Benjamin Goldberg
Leopold Toetsch wrote: > OK here it is. > Again the description for the record: > > 1) Initialization: > - normal core: build op_func_table with all opcode #4 [1] > - CG core: build ops_addr[] filled with this opcode > - prederef cores: build a list of (backward) branch instructions >

Re: [perl #23039] [PATCH] event handling-2

2003-07-31 Thread Leopold Toetsch
Leopold Toetsch <[EMAIL PROTECTED]> wrote: [ event checking without runloop penalty ] > 3) So when the next instruction (normal, CG core) or the branch > instruction (prederefed cores) gets executed, first the op_func_table > or the patched instructions are restored and then the event han

Re: [perl #23039] [PATCH] event handling-2

2003-07-19 Thread Leopold Toetsch
Here is a small patch on top of #23039 - fix memory corruption for very small programs - fix misplaced #endif leo --- interpreter.c Fri Jul 18 17:53:13 2003 +++ /opt/src/parrot-leo/interpreter.c Sat Jul 19 11:07:48 2003 @@ -202,13 +202,16 @@ void **temp = (void **)Parrot_memalign_i

[perl #23039] [PATCH] event handling-2

2003-07-18 Thread via RT
x27;t have any runtime penalty for an extra check if events are due. [1] This opcode (check_event__) calls the actual event handling code and returns the same address, i.e. doesn't advance the PC. [2] We could do the same here, but this needs cache sync for ARM and PPC, which may or ma

Re: Event handling (was Re: [CVS ci] exceptions-6: signals, catch a SIGFPE (generic platform)

2003-07-18 Thread Leopold Toetsch
ime penalty for an extra check if events are due. [1] This opcode (check_event__) calls the actual event handling code and returns the same address, i.e. doesn't advance the PC. [2] We could do the same here, but this needs cache sync for ARM and PPC, which may or may not be allowed in

Re: Event handling (was Re: [CVS ci] exceptions-6: signals, catch a SIGFPE (generic platform)

2003-07-17 Thread Benjamin Goldberg
Sean O'Rourke wrote: > > On Thu, 17 Jul 2003, Leopold Toetsch wrote: > > PC = ((op_func_t*) (*PC)) (PC, INTERP); // prederef functions > > > > To be able to switch function tables, this then should become: > > > > PC = ((op_func_t*) (func_table + *PC)) (PC, INTERP); > > > > Thus prederefernc

Re: Event handling

2003-07-17 Thread Jerome Vouillon
On Thu, Jul 17, 2003 at 09:52:35PM +0200, Leopold Toetsch wrote: > Remaining is: > 1) save & fill the byte_code with event handler ops. > 2) use address relative to op_func_table > 3) Or the "official" way: do regular checks. > I estimate 2) to be best for prederefed code. I'm not sure about this.

Re: Event handling (was Re: [CVS ci] exceptions-6: signals, catch a SIGFPE (generic platform)

2003-07-17 Thread Leopold Toetsch
Sean O'Rourke wrote: On Thu, 17 Jul 2003, Leopold Toetsch wrote: Replacing the next instruction with a branch to the signal handler (like adding a breakpoint) out of the question? I don't know, how to get the address of the next instruction i.e. the "PC" above. Thinking more of this: There is no

Re: Event handling (was Re: [CVS ci] exceptions-6: signals, catch a SIGFPE (generic platform)

2003-07-17 Thread Sean O'Rourke
On Thu, 17 Jul 2003, Leopold Toetsch wrote: > > Replacing the next instruction with a branch to the signal handler > > (like adding a breakpoint) out of the question? > > I don't know, how to get the address of the next instruction i.e. the > "PC" above. Going this way would either mean: > - fill t

Re: Event handling (was Re: [CVS ci] exceptions-6: signals, catch a SIGFPE (generic platform)

2003-07-17 Thread Leopold Toetsch
Sean O'Rourke wrote: To be able to switch function tables, this then should become: PC = ((op_func_t*) (func_table + *PC)) (PC, INTERP); Or is there a better way to do it? Replacing the next instruction with a branch to the signal handler (like adding a breakpoint) out of the question? I don

Re: Event handling (was Re: [CVS ci] exceptions-6: signals, catch a SIGFPE (generic platform)

2003-07-17 Thread Sean O'Rourke
On Thu, 17 Jul 2003, Leopold Toetsch wrote: > PC = ((op_func_t*) (*PC)) (PC, INTERP); // prederef functions > > To be able to switch function tables, this then should become: > > PC = ((op_func_t*) (func_table + *PC)) (PC, INTERP); > > Thus predereferncing the function pointer would place an of

Re: Event handling (was Re: [CVS ci] exceptions-6: signals, catch a SIGFPE (generic platform)

2003-07-17 Thread Leopold Toetsch
Leopold Toetsch <[EMAIL PROTECTED]> wrote: > ... Switching the whole op_func_table() or > ops_addr[] (for CG cores) is simpler, If have it running now for the slow and the computed goto core. The signal handler (interrupt code) switches the op_func_table (ops_addr) and returns. Then the next execu

Re: Event handling

2003-07-15 Thread Leopold Toetsch
Jason Gloudon <[EMAIL PROTECTED]> wrote: > On Tue, Jul 15, 2003 at 10:15:57AM +0200, Leopold Toetsch wrote: > How is the described scheme supposed to work with JIT generated code ? JIT code would be intersparsed with (JITted) CHECK_EVENTS() opcodes. They would get emitted e.g. at backward branche

Re: Event handling (was Re: [CVS ci] exceptions-6: signals, catch a SIGFPE (generic platform)

2003-07-15 Thread Jason Gloudon
On Tue, Jul 15, 2003 at 10:15:57AM +0200, Leopold Toetsch wrote: How is the described scheme supposed to work with JIT generated code ? -- Jason

[CVS ci] event handling-1: some opcodes

2003-07-15 Thread Leopold Toetsch
The plan is to follow Gregors idea to swap op_func_table/op_addr array, if events got enqueued. The internal check_events__ will get filled into a second op_func_table which will then take over. There are still some questions: - How does the actual event structure look like? - Is this a QUEUE_EN

Re: Event handling (was Re: [CVS ci] exceptions-6: signals, catch a SIGFPE (generic platform)

2003-07-15 Thread Leopold Toetsch
Gregor N. Purdy <[EMAIL PROTECTED]> wrote: > #define DO_OP(PC,INTERP) \ > (PC = ((INTERP->op_func_table)[*PC])(PC,INTERP)) > The easiest way to intercept this flow with minimal cost is to > have the mechanism that wants to take over replace the interpreter's > op_func_table with a block of po

Re: Event handling (was Re: [CVS ci] exceptions-6: signals, catch a SIGFPE (generic platform)

2003-07-13 Thread Leopold Toetsch
Gregor N. Purdy <[EMAIL PROTECTED]> wrote: > Benjamin -- > #define DO_OP(PC,INTERP) \ > (PC = ((INTERP->op_func_table)[*PC])(PC,INTERP)) > The easiest way to intercept this flow with minimal cost is to > have the mechanism that wants to take over replace the interpreter's > op_func_table with

Re: Event handling (was Re: [CVS ci] exceptions-6: signals, catch a SIGFPE (generic platform)

2003-07-11 Thread Gregor N. Purdy
Benjamin -- The trick is to find the cheapest possible way to get conditional processing to occur if and only if there are events in the event queue. I'll only be considering the fast core here for simplicity. But, if you look at include/parrot/interp_guts.h, the only thing of interest there is t

Event handling (was Re: [CVS ci] exceptions-6: signals, catch a SIGFPE (generic platform)

2003-07-11 Thread Benjamin Goldberg
Leopold Toetsch wrote: [snip] > - When will we check, it there are events in the event queue? If we check too often (between each two ops), it will slow things down. If we don't check often enough, the code might manage to avoid checking for events entirely. I would suggest that every flow contr