tclCompile.c File Reference

#include "tclInt.h"
#include "tclCompile.h"

Go to the source code of this file.

Functions

int TclSetByteCodeFromAny (Tcl_Interp *interp, Tcl_Obj *objPtr, CompileHookProc *hookProc, ClientData clientData)
void TclCleanupByteCode (register ByteCode *codePtr)
void TclInitCompileEnv (Tcl_Interp *interp, register CompileEnv *envPtr, const char *stringPtr, int numBytes, const CmdFrame *invoker, int word)
void TclFreeCompileEnv (register CompileEnv *envPtr)
int TclWordKnownAtCompileTime (Tcl_Token *tokenPtr, Tcl_Obj *valuePtr)
void TclCompileScript (Tcl_Interp *interp, const char *script, int numBytes, CompileEnv *envPtr)
void TclCompileTokens (Tcl_Interp *interp, Tcl_Token *tokenPtr, int count, CompileEnv *envPtr)
void TclCompileCmdWord (Tcl_Interp *interp, Tcl_Token *tokenPtr, int count, CompileEnv *envPtr)
void TclCompileExprWords (Tcl_Interp *interp, Tcl_Token *tokenPtr, int numWords, CompileEnv *envPtr)
int TclCompileNoOp (Tcl_Interp *interp, Tcl_Parse *parsePtr, Command *cmdPtr, CompileEnv *envPtr)
void TclInitByteCodeObj (Tcl_Obj *objPtr, register CompileEnv *envPtr)
int TclFindCompiledLocal (register const char *name, int nameBytes, int create, register Proc *procPtr)
void TclExpandCodeArray (void *envArgPtr)
int TclCreateExceptRange (ExceptionRangeType type, register CompileEnv *envPtr)
int TclCreateAuxData (ClientData clientData, AuxDataType *typePtr, register CompileEnv *envPtr)
void TclInitJumpFixupArray (register JumpFixupArray *fixupArrayPtr)
void TclExpandJumpFixupArray (register JumpFixupArray *fixupArrayPtr)
void TclFreeJumpFixupArray (register JumpFixupArray *fixupArrayPtr)
void TclEmitForwardJump (CompileEnv *envPtr, TclJumpType jumpType, JumpFixup *jumpFixupPtr)
int TclFixupForwardJump (CompileEnv *envPtr, JumpFixup *jumpFixupPtr, int jumpDist, int distThreshold)
void * TclGetInstructionTable (void)
void TclRegisterAuxDataType (AuxDataType *typePtr)
AuxDataTypeTclGetAuxDataType (char *typeName)
void TclInitAuxDataTypeTable (void)
void TclFinalizeAuxDataTypeTable (void)
Tcl_ObjTclDisassembleByteCodeObj (Tcl_Obj *objPtr)

Variables

InstructionDesc tclInstructionTable []
Tcl_ObjType tclByteCodeType


Function Documentation

void TclCompileCmdWord ( Tcl_Interp interp,
Tcl_Token tokenPtr,
int  count,
CompileEnv envPtr 
)

void TclCompileScript ( Tcl_Interp interp,
const char *  script,
int  numBytes,
CompileEnv envPtr 
)

Definition at line 1125 of file tclCompile.c.

References CompileEnv::atCmdStart, ckfree, CMD_HAS_EXEC_TRACES, CompileEnv::cmdMapPtr, Proc::cmdPtr, CompileEnv::codeNext, CompileEnv::codeStart, Tcl_Parse::commandSize, Tcl_Parse::commandStart, Command::compileProc, CompileEnv::currStackDepth, DONT_COMPILE_CMDS_INLINE, CompileEnv::extCmdMapPtr, Interp::flags, Command::flags, INST_EXPAND_START, INST_EXPAND_STKTOP, INST_INVOKE_EXPANDED, INST_INVOKE_STK1, INST_INVOKE_STK4, INST_POP, INST_START_CMD, iPtr, ECL::line, CompileEnv::line, CompileEnv::literalArrayPtr, ExtCmdLoc::loc, JumpList::next, Command::nsPtr, ExtCmdLoc::nuloc, CmdLocation::numCodeBytes, CompileEnv::numCommands, Tcl_Token::numComponents, CompileEnv::numSrcBytes, Tcl_Parse::numWords, LiteralEntry::objPtr, CompileEnv::procPtr, CompileEnv::source, Tcl_DStringAppend(), Tcl_DStringFree(), Tcl_DStringInit(), Tcl_DStringSetLength(), Tcl_DStringValue, Tcl_FindCommand(), Tcl_FreeParse(), Tcl_LogCommandInfo(), Tcl_NewObj(), TCL_OK, Tcl_ParseCommand(), Tcl_ResetResult(), TCL_TOKEN_EXPAND_WORD, TCL_TOKEN_SIMPLE_WORD, TclAddLiteralObj(), TclAdjustStackDepth, TclAdvanceLines(), TclCompileSyntaxError(), TclCompileTokens(), TclEmitInstInt1, TclEmitInstInt4, TclEmitInt4, TclEmitOpcode, TclEmitPush, TclGetUInt4AtPtr, TclHideLiteral(), TclMin, TclPrintSource(), TclRegisterNewLiteral, TclRegisterNewNSLiteral, TclSetCmdNameObj(), TclStackAlloc(), TclStackFree(), TclStoreInt4AtPtr, Tcl_Parse::term, Tcl_Parse::tokenPtr, and Tcl_Token::type.

Referenced by TclCompileCmdWord(), TclCompileTokens(), and TclSetByteCodeFromAny().

int TclCreateAuxData ( ClientData  clientData,
AuxDataType typePtr,
register CompileEnv envPtr 
)

Definition at line 2509 of file tclCompile.c.

References ckalloc, ckrealloc, AuxData::clientData, and AuxData::type.

Referenced by TclCompileDictUpdateCmd(), and TclCompileForeachCmd().

void TclExpandCodeArray ( void *  envArgPtr  ) 

void TclExpandJumpFixupArray ( register JumpFixupArray fixupArrayPtr  ) 

Definition at line 2606 of file tclCompile.c.

References ckalloc, and ckrealloc.

void TclFinalizeAuxDataTypeTable ( void   ) 

Definition at line 3017 of file tclCompile.c.

References Tcl_DeleteHashTable(), Tcl_MutexLock, and Tcl_MutexUnlock.

Referenced by TclFinalizeExecution().

void TclFreeCompileEnv ( register CompileEnv envPtr  ) 

Definition at line 1001 of file tclCompile.c.

References ckfree.

Referenced by Tcl_ExprObj().

void TclFreeJumpFixupArray ( register JumpFixupArray fixupArrayPtr  ) 

Definition at line 2654 of file tclCompile.c.

References ckfree.

AuxDataType* TclGetAuxDataType ( char *  typeName  ) 

void* TclGetInstructionTable ( void   ) 

Definition at line 2864 of file tclCompile.c.

References tclInstructionTable.

void TclInitAuxDataTypeTable ( void   ) 

void TclInitJumpFixupArray ( register JumpFixupArray fixupArrayPtr  ) 

Definition at line 2574 of file tclCompile.c.

References JUMPFIXUP_INIT_ENTRIES.


Variable Documentation

Initial value:

 {
    "bytecode",                 
    FreeByteCodeInternalRep,    
    DupByteCodeInternalRep,     
    NULL,                       
    SetByteCodeFromAny          
}

Definition at line 441 of file tclCompile.c.

Referenced by Tcl_DisassembleObjCmd(), Tcl_ExprObj(), TclCompEvalObj(), TclInitByteCodeObj(), TclInitCompiledLocals(), and TclInitObjSubsystem().

Definition at line 55 of file tclCompile.c.

Referenced by TclGetInstructionTable().



Generated on Wed Mar 12 12:18:28 2008 by  doxygen 1.5.1