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) |
AuxDataType * | TclGetAuxDataType (char *typeName) |
void | TclInitAuxDataTypeTable (void) |
void | TclFinalizeAuxDataTypeTable (void) |
Tcl_Obj * | TclDisassembleByteCodeObj (Tcl_Obj *objPtr) |
Variables |
InstructionDesc | tclInstructionTable [] |
Tcl_ObjType | tclByteCodeType |
Function Documentation
void TclCleanupByteCode |
( |
register ByteCode * |
codePtr |
) |
|
Definition at line 687 of file tclCompile.c.
References AuxData::clientData, AuxDataType::freeProc, iPtr, Tcl_Time::sec, TCL_BYTECODE_PRECOMPILED, Tcl_DecrRefCount, Tcl_GetTime(), TclReleaseLiteral(), AuxData::type, and Tcl_Time::usec.
Referenced by Tcl_ExprObj(), TclCompEvalObj(), and TclObjInterpProcCore().
Definition at line 1808 of file tclCompile.c.
References INST_CONCAT1, INST_EXPR_STK, Tcl_Token::numComponents, TCL_TOKEN_SIMPLE_WORD, TclCompileExpr(), TclCompileTokens(), TclEmitInstInt1, TclEmitOpcode, TclEmitPush, TclRegisterNewLiteral, and Tcl_Token::type.
Referenced by TclCompileExprCmd(), TclCompileForCmd(), and TclCompileWhileCmd().
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().
Definition at line 1561 of file tclCompile.c.
References CompileEnv::codeNext, INST_LOAD_SCALAR1, INST_LOAD_SCALAR4, INST_LOAD_SCALAR_STK, Tcl_Token::numComponents, CompileEnv::procPtr, Tcl_Token::size, Tcl_Token::start, Tcl_DStringAppend(), Tcl_DStringFree(), Tcl_DStringInit(), Tcl_DStringLength, Tcl_DStringValue, TCL_TOKEN_BS, TCL_TOKEN_COMMAND, TCL_TOKEN_TEXT, TCL_TOKEN_VARIABLE, TCL_UTF_MAX, Tcl_UtfBackslash(), TclCompileScript(), TclEmitInstInt1, TclEmitInstInt4, TclEmitOpcode, TclEmitPush, TclFindCompiledLocal(), TclRegisterNewLiteral, and Tcl_Token::type.
Referenced by TclCompileCmdWord(), TclCompileExprWords(), TclCompileNoOp(), and TclCompileScript().
Definition at line 3363 of file tclCompile.c.
References CATCH_EXCEPTION_RANGE, ByteCode::codeStart, ByteCode::compileEpoch, Interp::compileEpoch, ByteCode::exceptArrayPtr, Proc::firstLocalPtr, CompiledLocal::flags, Tcl_Obj::internalRep, ByteCode::interpHandle, iPtr, LOOP_EXCEPTION_RANGE, ByteCode::maxExceptDepth, ByteCode::maxStackDepth, Proc::numArgs, ByteCode::numAuxDataItems, ByteCode::numCmdLocBytes, ByteCode::numCodeBytes, ByteCode::numCommands, Proc::numCompiledLocals, ByteCode::numExceptRanges, ByteCode::numLitObjects, ByteCode::numSrcBytes, Tcl_Obj::otherValuePtr, ByteCode::procPtr, ByteCode::refCount, Proc::refCount, ByteCode::source, ByteCode::structureSize, Tcl_AppendPrintfToObj(), Tcl_AppendToObj(), Tcl_Panic(), TclIsVarTemporary, TclMin, TclNewObj, VAR_ARGUMENT, VAR_ARRAY, VAR_LINK, VAR_RESOLVED, and VAR_TEMPORARY.
Referenced by Tcl_DisassembleObjCmd().
Definition at line 2687 of file tclCompile.c.
References JumpFixup::cmdIndex, CompileEnv::codeNext, JumpFixup::codeOffset, CompileEnv::codeStart, CompileEnv::exceptArrayNext, JumpFixup::exceptIndex, INST_JUMP1, INST_JUMP_FALSE1, INST_JUMP_TRUE1, JumpFixup::jumpType, CompileEnv::numCommands, TCL_TRUE_JUMP, TCL_UNCONDITIONAL_JUMP, and TclEmitInstInt1.
Referenced by TclCompileCatchCmd(), TclCompileDictUpdateCmd(), TclCompileForCmd(), TclCompileForeachCmd(), and TclCompileWhileCmd().
void TclExpandCodeArray |
( |
void * |
envArgPtr |
) |
|
void TclExpandJumpFixupArray |
( |
register JumpFixupArray * |
fixupArrayPtr |
) |
|
void TclFinalizeAuxDataTypeTable |
( |
void |
|
) |
|
int TclFindCompiledLocal |
( |
register const char * |
name, |
|
|
int |
nameBytes, |
|
|
int |
create, |
|
|
register Proc * |
procPtr | |
|
) |
| | |
Definition at line 2093 of file tclCompile.c.
References ckalloc, CompiledLocal::defValuePtr, CompiledLocal::flags, CompiledLocal::frameIndex, localName, CompiledLocal::name, CompiledLocal::nameLength, CompiledLocal::nextPtr, CompiledLocal::resolveInfo, TclIsVarTemporary, and VAR_TEMPORARY.
Referenced by TclCompileCatchCmd(), TclCompileDictAppendCmd(), TclCompileDictForCmd(), TclCompileDictIncrCmd(), TclCompileDictLappendCmd(), TclCompileDictSetCmd(), TclCompileDictUpdateCmd(), TclCompileForeachCmd(), and TclCompileTokens().
int TclFixupForwardJump |
( |
CompileEnv * |
envPtr, |
|
|
JumpFixup * |
jumpFixupPtr, |
|
|
int |
jumpDist, |
|
|
int |
distThreshold | |
|
) |
| | |
Definition at line 2749 of file tclCompile.c.
References CATCH_EXCEPTION_RANGE, JumpFixup::cmdIndex, CompileEnv::cmdMapPtr, CompileEnv::codeEnd, CompileEnv::codeNext, JumpFixup::codeOffset, CompileEnv::codeStart, CompileEnv::exceptArrayNext, CompileEnv::exceptArrayPtr, JumpFixup::exceptIndex, INST_JUMP1, INST_JUMP4, INST_JUMP_FALSE1, INST_JUMP_FALSE4, INST_JUMP_TRUE1, INST_JUMP_TRUE4, JumpFixup::jumpType, LOOP_EXCEPTION_RANGE, CompileEnv::numCommands, Tcl_Panic(), TCL_TRUE_JUMP, TCL_UNCONDITIONAL_JUMP, TclExpandCodeArray(), TclUpdateInstInt1AtPc, and TclUpdateInstInt4AtPc.
Referenced by TclCompileForCmd(), and TclCompileWhileCmd().
void TclFreeCompileEnv |
( |
register CompileEnv * |
envPtr |
) |
|
void TclFreeJumpFixupArray |
( |
register JumpFixupArray * |
fixupArrayPtr |
) |
|
void* TclGetInstructionTable |
( |
void |
|
) |
|
void TclInitAuxDataTypeTable |
( |
void |
|
) |
|
Definition at line 1928 of file tclCompile.c.
References ByteCode::auxDataArrayPtr, ckalloc, ByteCode::codeStart, Namespace::compiledVarResProc, Interp::compileEpoch, ByteCode::compileEpoch, ByteCode::exceptArrayPtr, ByteCode::flags, Interp::handle, Tcl_Obj::internalRep, ByteCode::interpHandle, iPtr, Interp::lineBCPtr, ByteCode::maxExceptDepth, ByteCode::maxStackDepth, ByteCode::nsEpoch, ByteCode::nsPtr, ByteCode::numAuxDataItems, ByteCode::numCmdLocBytes, ByteCode::numCodeBytes, ByteCode::numCommands, ByteCode::numExceptRanges, ByteCode::numLitObjects, ByteCode::numSrcBytes, ByteCode::objArrayPtr, Tcl_Obj::otherValuePtr, ByteCode::procPtr, ByteCode::refCount, Namespace::resolverEpoch, Interp::resolverPtr, ByteCode::source, ByteCode::structureSize, TCL_ALIGN, TCL_BYTECODE_RESOLVE_VARS, Tcl_CreateHashEntry, Tcl_GetTime(), Tcl_Panic(), Tcl_SetHashValue, tclByteCodeType, TclFreeIntRep, TclHandlePreserve(), and Tcl_Obj::typePtr.
Referenced by Tcl_ExprObj(), and TclSetByteCodeFromAny().
void TclInitCompileEnv |
( |
Tcl_Interp * |
interp, |
|
|
register CompileEnv * |
envPtr, |
|
|
const char * |
stringPtr, |
|
|
int |
numBytes, |
|
|
const CmdFrame * |
invoker, |
|
|
int |
word | |
|
) |
| | |
Definition at line 848 of file tclCompile.c.
References ckalloc, Interp::compiledProcPtr, COMPILEENV_INIT_AUX_DATA_SIZE, COMPILEENV_INIT_CMD_MAP_SIZE, COMPILEENV_INIT_CODE_BYTES, COMPILEENV_INIT_EXCEPT_RANGES, COMPILEENV_INIT_NUM_OBJECTS, CmdFrame::data, CmdFrame::eval, iPtr, CmdFrame::line, CmdFrame::nline, Tcl_IncrRefCount, TCL_LOCATION_BC, TCL_LOCATION_PROC, TCL_LOCATION_SOURCE, TclGetSrcInfoForPc(), TclInitLiteralTable(), TclStackAlloc(), TclStackFree(), and CmdFrame::type.
Referenced by Tcl_ExprObj(), and TclSetByteCodeFromAny().
void TclInitJumpFixupArray |
( |
register JumpFixupArray * |
fixupArrayPtr |
) |
|
Definition at line 475 of file tclCompile.c.
References CompileEnv::auxDataArrayNext, CompileEnv::auxDataArrayPtr, AuxData::clientData, AuxDataType::freeProc, INST_DONE, Interp::invokeCmdFramePtr, Interp::invokeWord, iPtr, CompileEnv::literalArrayNext, CompileEnv::literalArrayPtr, LiteralEntry::objPtr, TCL_LINK_INT, Tcl_LinkVar(), TCL_OK, Tcl_Panic(), TclCompileScript(), TclEmitOpcode, TclGetStringFromObj, TclInitByteCodeObj(), TclInitCompileEnv(), TclReleaseLiteral(), and AuxData::type.
Referenced by Tcl_DisassembleObjCmd().
Definition at line 1052 of file tclCompile.c.
References Tcl_Token::numComponents, Tcl_Token::size, Tcl_Token::start, Tcl_AppendObjToObj(), Tcl_AppendToObj(), Tcl_DecrRefCount, Tcl_IncrRefCount, Tcl_NewObj(), TCL_TOKEN_BS, TCL_TOKEN_SIMPLE_WORD, TCL_TOKEN_TEXT, TCL_TOKEN_WORD, TCL_UTF_MAX, Tcl_UtfBackslash(), and Tcl_Token::type.
Referenced by TclCompileReturnCmd(), TclCompileUpvarCmd(), and TclEvalEx().
Variable Documentation
Generated on Wed Mar 12 12:18:28 2008 by
1.5.1
|