Tcl Source Code

View Ticket
Login
Ticket UUID: 519535
Title: Call C-functions from bytecodes (rough)
Type: Patch Version: None
Submitter: msofer Created on: 2002-02-18 20:40:18
Subsystem: 47. Bytecode Compiler Assigned To: msofer
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2004-03-27 03:48:45
Resolution: Out of Date Closed By: msofer
    Closed on: 2004-03-26 20:48:45
Description:
*** EXPERIMENTAL PATCH ***

This patch explores the possibility of calling
C-functions from the bytecode; see the README. What it
does is:

   * Incorporation of new functions with signature
      Tcl_Obj * TclCoreFun (Tcl_Interp *interp, int
objc, 
           Tcl_Obj *CONST objv[], int argc, ClientData
*argv);

     These will implement the core functionality of
Tcl; the standard
     calls act as front ends for them.

     The usage is to allow receiving pointers to C
structures that are
     determined at proc-compile time - for example, to
variables.

   * Modification of the main variable access functions
in tclVar.c to
     follow this structure. Factoring out TclLookupVar.

   * Definition of new instructions to
       - lookup variable pointers given their index
(locals) or name
       - push non-Tcl_Obj items on the Tcl stack
       - call a TclCoreFun

   * test trial: [gets] is compiled using these
interfaces, with a 20% 
     speed gain in the benchmarks:

     000 VERSIONS:                           patched   
HEAD
     001 READ 595K, gets                      136482 
175674
     006 READ 3050b, gets                       
742     953
     011 READ bin 595K, gets                  145248 
183942
     016 READ bin 3050b, gets                    803   
1007
User Comments: msofer added on 2004-03-27 03:48:45:
Logged In: YES 
user_id=148712

Where did I put the patch? Only readme attached ...

This thing is outdated anyway; the speedup is obtained in
current HEAD using the special varNameType Tcl_Obj.

msofer added on 2002-02-19 03:41:53:

File Added - 18068: README

Attachments: