develooper Front page | perl.perl6.internals | Postings from December 2001

Re: Just-in-Time Predereferencing Patch

Thread Previous | Thread Next
From:
Simon Cozens
Date:
December 11, 2001 07:48
Subject:
Re: Just-in-Time Predereferencing Patch
Message ID:
20011211154955.GA1676@netthink.co.uk
On Tue, Dec 11, 2001 at 10:09:07AM -0500, Gregor N. Purdy wrote:
> -        runops_generic(core, interpreter, pc);
> +        if ((interpreter->flags & PARROT_PREDEREF_FLAG) != 0) {
> +          size_t offset = pc - (opcode_t *)interpreter->code->byte_code;
> +
> +          if (!interpreter->prederef_code) {
> +            interpreter->prederef_code = (void **)calloc(interpreter->code->byte_code_size, sizeof(void *));
> +          }
> +
> +          runops_prederef(interpreter, pc, interpreter->prederef_code + offset);
> +        }
> +        else {
> +          runops_generic(core, interpreter, pc);
> +        }
> +    }
> +
> +    if (interpreter->prederef_code) {
> +      free(interpreter->prederef_code);
> +      interpreter->prederef_code = NULL;
>  

I haven't tried this, so feel free to shoot me down, but is your 22%
speed-up based on an unpatched Parrot, or a patched Parrot without the
-P flag? I'm trying to work out whether or not this patch actually slows
down the general case, which wouldn't be pleasant.

-- 
Timesharing just doesn't work. -K. Thompson, 1982.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About