Re: [perl #31026] Fix generation of src/nci.c to be more efficient

2004-08-14 Thread Leopold Toetsch
Chromatic <[EMAIL PROTECTED]> wrote: > Oh yeah, the goal of this exercise was to cache the hash, Thanks, applied. > It still complains about passing constant C-strings to > hash_put() fixed. leo

Re: [perl #31026] Fix generation of src/nci.c to be more efficient

2004-08-13 Thread chromatic
Oh yeah, the goal of this exercise was to cache the hash, not build it every time. Here's a version which does that and passes the tests with GC_DEBUG. It still complains about passing constant C-strings to hash_put(), but that's a different story. -- c Index: include/parrot/interpreter.h

Re: [perl #31026] Fix generation of src/nci.c to be more efficient

2004-08-13 Thread chromatic
On Fri, 2004-08-13 at 11:58, Leopold Toetsch wrote: > When that's fixed (or hash's memory is malloced) then the keys have to > be declared with CONST_STRING() or - as these are C strings in the first > place, you create a custom hash with C-string keys. See the API in > hash.c:new_hash_x() or j

Re: [perl #31026] Fix generation of src/nci.c to be more efficient

2004-08-13 Thread Leopold Toetsch
chromatic wrote: On Fri, 2004-08-13 at 09:23, Dan Sugalski wrote: This hash should either be allocated from constant PMCs that don't get GC'd, or put in the root set, then. Just to be specific then, the steps would be: - allocate a new PMC - mark it as constant (PMC_constant_FLAG) That would

Re: [perl #31026] Fix generation of src/nci.c to be more efficient

2004-08-13 Thread chromatic
On Fri, 2004-08-13 at 09:23, Dan Sugalski wrote: > This hash should either be allocated from constant PMCs that don't > get GC'd, or put in the root set, then. Just to be specific then, the steps would be: - allocate a new PMC - mark it as constant (PMC_constant_FLAG) or call th

Re: [perl #31026] Fix generation of src/nci.c to be more efficient

2004-08-13 Thread Dan Sugalski
At 5:16 PM +0100 8/10/04, Nicholas Clark wrote: On Mon, Aug 09, 2004 at 03:11:53PM -0400, Dan Sugalski wrote: At 11:57 AM -0700 8/9/04, chromatic wrote: >Is there a particular hash lookup style you have in mind? If there's >something similar in the code already, I can copy, paste, and modify t

Re: [perl #31026] Fix generation of src/nci.c to be more efficient

2004-08-13 Thread Dan Sugalski
At 1:11 PM +0200 8/13/04, Leopold Toetsch wrote: chromatic wrote: No, not a lot of examples. Here's a patch that's somewhat naive but passes all tests on my machine (Linux PPC). I'm a bit concerned about the initialization code, especially the static hash, but it's more important to have code avai

Re: [perl #31026] Fix generation of src/nci.c to be more efficient

2004-08-13 Thread Leopold Toetsch
chromatic wrote: No, not a lot of examples. Here's a patch that's somewhat naive but passes all tests on my machine (Linux PPC). I'm a bit concerned about the initialization code, especially the static hash, but it's more important to have code available for review than improvement than to wait un

Re: [perl #31026] Fix generation of src/nci.c to be more efficient

2004-08-12 Thread chromatic
On Mon, 2004-08-09 at 12:11, Dan Sugalski wrote: > You could look at what we do for class registration -- that code > might be similar. I don't think we've got too much at the C level > that messes around with parrot hashes yet, though. No, not a lot of examples. Here's a patch that's somewhat

Re: [perl #31026] Fix generation of src/nci.c to be more efficient

2004-08-12 Thread chromatic
On Tue, 2004-08-10 at 09:16, Nicholas Clark wrote: > Does the structure change at runtime? (ie can one register new dynamically > loaded NCI helper code?) If I understand what Dan wants, no. Unless the platform has a JIT that can generate stubs for all valid NCI signatures, it has to fall back t

Re: [perl #31026] Fix generation of src/nci.c to be more efficient

2004-08-10 Thread Nicholas Clark
On Mon, Aug 09, 2004 at 03:11:53PM -0400, Dan Sugalski wrote: > At 11:57 AM -0700 8/9/04, chromatic wrote: > >Is there a particular hash lookup style you have in mind? If there's > >something similar in the code already, I can copy, paste, and modify the > >generator trivially. > > You could loo

Re: [perl #31026] Fix generation of src/nci.c to be more efficient

2004-08-09 Thread Dan Sugalski
At 11:57 AM -0700 8/9/04, chromatic wrote: On Mon, 2004-08-09 at 11:36, Dan Sugalski wrote: Right now the master function in nci.c that figures out if we have a thunking function for a given function signature does a linear search looking for a match. This is pretty nasty and gets slower the mor

Re: [perl #31026] Fix generation of src/nci.c to be more efficient

2004-08-09 Thread chromatic
On Mon, 2004-08-09 at 11:36, Dan Sugalski wrote: > Right now the master function in nci.c that figures out if we have a > thunking function for a given function signature does a linear search > looking for a match. This is pretty nasty and gets slower the more > functions are in the search list

[perl #31026] Fix generation of src/nci.c to be more efficient

2004-08-09 Thread via RT
# New Ticket Created by Dan Sugalski # Please include the string: [perl #31026] # in the subject line of all future correspondence about this issue. # http://rt.perl.org:80/rt3/Ticket/Display.html?id=31026 > Right now the master function in nci.c that figures out if we have a thunking functi