summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c419
1 files changed, 215 insertions, 204 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index c94e570..ccbd953 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -192,7 +192,7 @@ VarHashCreateVar(
/* Verify the stack depth, only when no expansion is in progress */
#ifdef TCL_COMPILE_DEBUG
-#define CHECK_STACK() \
+#define CHECK_STACK() \
do { \
ValidatePcAndStackTop(codePtr, pc, CURR_DEPTH, \
/*checkStack*/ !(starting || auxObjList)); \
@@ -202,53 +202,53 @@ VarHashCreateVar(
#define CHECK_STACK()
#endif
-#define NEXT_INST_F(pcAdjustment, nCleanup, resultHandling) \
- do { \
- TCL_CT_ASSERT((nCleanup >= 0) && (nCleanup <= 2)); \
- CHECK_STACK(); \
- if (nCleanup == 0) { \
- if (resultHandling != 0) { \
- if ((resultHandling) > 0) { \
- PUSH_OBJECT(objResultPtr); \
- } else { \
- *(++tosPtr) = objResultPtr; \
- } \
- } \
- pc += (pcAdjustment); \
- goto cleanup0; \
- } else if (resultHandling != 0) { \
- if ((resultHandling) > 0) { \
- Tcl_IncrRefCount(objResultPtr); \
- } \
- pc += (pcAdjustment); \
- switch (nCleanup) { \
- case 1: goto cleanup1_pushObjResultPtr; \
- case 2: goto cleanup2_pushObjResultPtr; \
- case 0: break; \
- } \
- } else { \
- pc += (pcAdjustment); \
- switch (nCleanup) { \
- case 1: goto cleanup1; \
- case 2: goto cleanup2; \
- case 0: break; \
- } \
- } \
+#define NEXT_INST_F(pcAdjustment, nCleanup, resultHandling) \
+ do { \
+ TCL_CT_ASSERT((nCleanup >= 0) && (nCleanup <= 2)); \
+ CHECK_STACK(); \
+ if (nCleanup == 0) { \
+ if (resultHandling != 0) { \
+ if ((resultHandling) > 0) { \
+ PUSH_OBJECT(objResultPtr); \
+ } else { \
+ *(++tosPtr) = objResultPtr; \
+ } \
+ } \
+ pc += (pcAdjustment); \
+ goto cleanup0; \
+ } else if (resultHandling != 0) { \
+ if ((resultHandling) > 0) { \
+ Tcl_IncrRefCount(objResultPtr); \
+ } \
+ pc += (pcAdjustment); \
+ switch (nCleanup) { \
+ case 1: goto cleanup1_pushObjResultPtr; \
+ case 2: goto cleanup2_pushObjResultPtr; \
+ case 0: break; \
+ } \
+ } else { \
+ pc += (pcAdjustment); \
+ switch (nCleanup) { \
+ case 1: goto cleanup1; \
+ case 2: goto cleanup2; \
+ case 0: break; \
+ } \
+ } \
} while (0)
-#define NEXT_INST_V(pcAdjustment, nCleanup, resultHandling) \
- CHECK_STACK(); \
- do { \
- pc += (pcAdjustment); \
- cleanup = (nCleanup); \
- if (resultHandling) { \
- if ((resultHandling) > 0) { \
- Tcl_IncrRefCount(objResultPtr); \
- } \
- goto cleanupV_pushObjResultPtr; \
- } else { \
- goto cleanupV; \
- } \
+#define NEXT_INST_V(pcAdjustment, nCleanup, resultHandling) \
+ CHECK_STACK(); \
+ do { \
+ pc += (pcAdjustment); \
+ cleanup = (nCleanup); \
+ if (resultHandling) { \
+ if ((resultHandling) > 0) { \
+ Tcl_IncrRefCount(objResultPtr); \
+ } \
+ goto cleanupV_pushObjResultPtr; \
+ } else { \
+ goto cleanupV; \
+ } \
} while (0)
#ifndef TCL_COMPILE_DEBUG
@@ -258,16 +258,16 @@ VarHashCreateVar(
switch (*pc) { \
case INST_JUMP_FALSE1: \
NEXT_INST_F(((condition)? 2 : TclGetInt1AtPtr(pc+1)), (cleanup), 0); \
- break; \
+ break; \
case INST_JUMP_TRUE1: \
NEXT_INST_F(((condition)? TclGetInt1AtPtr(pc+1) : 2), (cleanup), 0); \
- break; \
+ break; \
case INST_JUMP_FALSE4: \
NEXT_INST_F(((condition)? 5 : TclGetInt4AtPtr(pc+1)), (cleanup), 0); \
- break; \
+ break; \
case INST_JUMP_TRUE4: \
NEXT_INST_F(((condition)? TclGetInt4AtPtr(pc+1) : 5), (cleanup), 0); \
- break; \
+ break; \
default: \
if ((condition) < 0) { \
TclNewIntObj(objResultPtr, -1); \
@@ -275,7 +275,7 @@ VarHashCreateVar(
objResultPtr = TCONST((condition) > 0); \
} \
NEXT_INST_F(0, (cleanup), 1); \
- break; \
+ break; \
} \
} while (0)
#define JUMP_PEEPHOLE_V(condition, pcAdjustment, cleanup) \
@@ -284,16 +284,16 @@ VarHashCreateVar(
switch (*pc) { \
case INST_JUMP_FALSE1: \
NEXT_INST_V(((condition)? 2 : TclGetInt1AtPtr(pc+1)), (cleanup), 0); \
- break; \
+ break; \
case INST_JUMP_TRUE1: \
NEXT_INST_V(((condition)? TclGetInt1AtPtr(pc+1) : 2), (cleanup), 0); \
- break; \
+ break; \
case INST_JUMP_FALSE4: \
NEXT_INST_V(((condition)? 5 : TclGetInt4AtPtr(pc+1)), (cleanup), 0); \
- break; \
+ break; \
case INST_JUMP_TRUE4: \
NEXT_INST_V(((condition)? TclGetInt4AtPtr(pc+1) : 5), (cleanup), 0); \
- break; \
+ break; \
default: \
if ((condition) < 0) { \
TclNewIntObj(objResultPtr, -1); \
@@ -301,7 +301,7 @@ VarHashCreateVar(
objResultPtr = TCONST((condition) > 0); \
} \
NEXT_INST_V(0, (cleanup), 1); \
- break; \
+ break; \
} \
} while (0)
#else /* TCL_COMPILE_DEBUG */
@@ -377,13 +377,14 @@ VarHashCreateVar(
#ifdef TCL_COMPILE_DEBUG
# define TRACE(a) \
- while (traceInstructions) { \
- fprintf(stdout, "%2" TCL_SIZE_MODIFIER "d: %2" TCL_T_MODIFIER "d (%" TCL_T_MODIFIER "d) %s ", iPtr->numLevels, \
- CURR_DEPTH, \
- (pc - codePtr->codeStart), \
- GetOpcodeName(pc)); \
- printf a; \
- break; \
+ while (traceInstructions) { \
+ fprintf(stdout, "%2" TCL_SIZE_MODIFIER "d: %2" TCL_T_MODIFIER \
+ "d (%" TCL_T_MODIFIER "d) %s ", iPtr->numLevels, \
+ CURR_DEPTH, \
+ (pc - codePtr->codeStart), \
+ GetOpcodeName(pc)); \
+ printf a; \
+ break; \
}
# define TRACE_APPEND(a) \
while (traceInstructions) { \
@@ -393,15 +394,16 @@ VarHashCreateVar(
# define TRACE_ERROR(interp) \
TRACE_APPEND(("ERROR: %.30s\n", O2S(Tcl_GetObjResult(interp))));
# define TRACE_WITH_OBJ(a, objPtr) \
- while (traceInstructions) { \
- fprintf(stdout, "%2" TCL_SIZE_MODIFIER "d: %2" TCL_T_MODIFIER "d (%" TCL_T_MODIFIER "d) %s ", iPtr->numLevels, \
- CURR_DEPTH, \
- (pc - codePtr->codeStart), \
- GetOpcodeName(pc)); \
- printf a; \
- TclPrintObject(stdout, objPtr, 30); \
- fprintf(stdout, "\n"); \
- break; \
+ while (traceInstructions) { \
+ fprintf(stdout, "%2" TCL_SIZE_MODIFIER "d: %2" TCL_T_MODIFIER \
+ "d (%" TCL_T_MODIFIER "d) %s ", iPtr->numLevels, \
+ CURR_DEPTH, \
+ (pc - codePtr->codeStart), \
+ GetOpcodeName(pc)); \
+ printf a; \
+ TclPrintObject(stdout, objPtr, 30); \
+ fprintf(stdout, "\n"); \
+ break; \
}
# define O2S(objPtr) \
(objPtr ? TclGetString(objPtr) : "")
@@ -475,7 +477,8 @@ VarHashCreateVar(
* usage in [incr]: do the first summand and the sum have != signs?
*/
-#define Overflowing(a,b,sum) ((((a)^(sum)) < 0) && (((a)^(b)) >= 0))
+#define Overflowing(a,b,sum) \
+ ((((a)^(sum)) < 0) && (((a)^(b)) >= 0))
/*
* Macro for checking whether the type is NaN, used when we're thinking about
@@ -1406,8 +1409,7 @@ CompileExprObj(
Interp *iPtr = (Interp *) interp;
CompileEnv compEnv; /* Compilation environment structure allocated
* in frame. */
- ByteCode *codePtr = NULL;
- /* Tcl Internal type of bytecode. Initialized
+ ByteCode *codePtr = NULL; /* Tcl Internal type of bytecode. Initialized
* to avoid compiler warning. */
/*
@@ -1562,7 +1564,7 @@ TclCompileObj(
int word)
{
Interp *iPtr = (Interp *) interp;
- ByteCode *codePtr; /* Tcl Internal type of bytecode. */
+ ByteCode *codePtr; /* Tcl Internal type of bytecode. */
Namespace *namespacePtr = iPtr->varFramePtr->nsPtr;
/*
@@ -2026,8 +2028,8 @@ TEBCresume(
Tcl_Obj **tosPtr; /* Cached pointer to top of evaluation
* stack. */
const unsigned char *pc = (const unsigned char *)data[1];
- /* The current program counter. */
- unsigned char inst; /* The currently running instruction */
+ /* The current program counter. */
+ unsigned char inst; /* The currently running instruction */
/*
* Transfer variables - needed only between opcodes, but not while
@@ -2036,7 +2038,7 @@ TEBCresume(
int cleanup = PTR2INT(data[2]);
Tcl_Obj *objResultPtr;
- int checkInterp = 0; /* Indicates when a check of interp readyness
+ int checkInterp = 0; /* Indicates when a check of interp readyness
* is necessary. Set by CACHE_STACK_INFO() */
/*
@@ -2090,7 +2092,7 @@ TEBCresume(
goto cleanup0;
} else {
- /* resume from invocation */
+ /* resume from invocation */
CACHE_STACK_INFO();
NRE_ASSERT(iPtr->cmdFramePtr == bcFramePtr);
@@ -2580,14 +2582,15 @@ TEBCresume(
case INST_REVERSE: {
Tcl_Obj **a, **b;
- opnd = TclGetUInt4AtPtr(pc+1);
- a = tosPtr-(opnd-1);
+ opnd = TclGetUInt4AtPtr(pc + 1);
+ a = tosPtr - (opnd - 1);
b = tosPtr;
- while (a<b) {
+ while (a < b) {
tmpPtr = *a;
*a = *b;
*b = tmpPtr;
- a++; b--;
+ a++;
+ b--;
}
TRACE(("%u => OK\n", opnd));
NEXT_INST_F(5, 0, 0);
@@ -2618,7 +2621,7 @@ TEBCresume(
*/
opnd = TclGetUInt4AtPtr(pc+1);
- objResultPtr = Tcl_ConcatObj(opnd, &OBJ_AT_DEPTH(opnd-1));
+ objResultPtr = Tcl_ConcatObj(opnd, &OBJ_AT_DEPTH(opnd - 1));
TRACE_WITH_OBJ(("%u => ", opnd), objResultPtr);
NEXT_INST_V(5, opnd, 1);
break;
@@ -3181,7 +3184,7 @@ TEBCresume(
O2S(part1Ptr), O2S(part2Ptr), O2S(valuePtr)));
}
#endif
- varPtr = TclObjLookupVarEx(interp, objPtr,part2Ptr, TCL_LEAVE_ERR_MSG,
+ varPtr = TclObjLookupVarEx(interp, objPtr, part2Ptr, TCL_LEAVE_ERR_MSG,
"set", /*createPart1*/ 1, /*createPart2*/ 1, &arrayPtr);
if (!varPtr) {
TRACE_ERROR(interp);
@@ -3772,7 +3775,7 @@ TEBCresume(
if (varPtr) {
if (ReadTraced(varPtr) || (arrayPtr && ReadTraced(arrayPtr))) {
DECACHE_STACK_INFO();
- TclObjCallVarTraces(iPtr, arrayPtr, varPtr, part1Ptr,part2Ptr,
+ TclObjCallVarTraces(iPtr, arrayPtr, varPtr, part1Ptr, part2Ptr,
TCL_TRACE_READS, 0, -1);
CACHE_STACK_INFO();
}
@@ -4696,7 +4699,7 @@ TEBCresume(
}
/*
- * End of TclOO support instructions.
+ * End of TclOO support instructions.
* -----------------------------------------------------------------
* Start of INST_LIST and related instructions.
*/
@@ -4733,7 +4736,7 @@ TEBCresume(
TRACE(("\"%.30s\" \"%.30s\" => ", O2S(valuePtr), O2S(value2Ptr)));
/* special case for AbstractList */
- if (TclObjTypeHasProc(valuePtr,indexProc)) {
+ if (TclObjTypeHasProc(valuePtr, indexProc)) {
DECACHE_STACK_INFO();
length = TclObjTypeLength(valuePtr);
if (TclGetIntForIndexM(interp, value2Ptr, length-1, &index)!=TCL_OK) {
@@ -4824,7 +4827,7 @@ TEBCresume(
*/
/* special case for AbstractList */
- if (TclObjTypeHasProc(valuePtr,indexProc)) {
+ if (TclObjTypeHasProc(valuePtr, indexProc)) {
length = TclObjTypeLength(valuePtr);
/* Decode end-offset index values. */
@@ -4923,11 +4926,11 @@ TEBCresume(
DECACHE_STACK_INFO();
if (TclObjTypeHasProc(valuePtr, setElementProc)) {
objResultPtr = TclObjTypeSetElement(interp,
- valuePtr, numIndices,
- &OBJ_AT_DEPTH(numIndices), OBJ_AT_TOS);
+ valuePtr, numIndices,
+ &OBJ_AT_DEPTH(numIndices), OBJ_AT_TOS);
} else {
objResultPtr = TclLsetFlat(interp, valuePtr, numIndices,
- &OBJ_AT_DEPTH(numIndices), OBJ_AT_TOS);
+ &OBJ_AT_DEPTH(numIndices), OBJ_AT_TOS);
}
if (!objResultPtr) {
CACHE_STACK_INFO();
@@ -5073,60 +5076,60 @@ TEBCresume(
value2Ptr = OBJ_AT_TOS;
valuePtr = OBJ_UNDER_TOS;
- s1 = TclGetStringFromObj(valuePtr, &s1len);
- TRACE(("\"%.30s\" \"%.30s\" => ", O2S(valuePtr), O2S(value2Ptr)));
-
- if (TclObjTypeHasProc(value2Ptr,inOperProc) != NULL) {
- int status = TclObjTypeInOperator(interp, valuePtr, value2Ptr, &match);
- if (status != TCL_OK) {
- TRACE_ERROR(interp);
- goto gotError;
- }
- } else {
-
- if (TclListObjLength(interp, value2Ptr, &length) != TCL_OK) {
- TRACE_ERROR(interp);
- goto gotError;
- }
- match = 0;
- if (length > 0) {
- Tcl_Size i = 0;
- Tcl_Obj *o;
- int isAbstractList = TclObjTypeHasProc(value2Ptr,indexProc) != NULL;
-
- /*
- * An empty list doesn't match anything.
- */
-
- do {
- if (isAbstractList) {
- DECACHE_STACK_INFO();
- if (TclObjTypeIndex(interp, value2Ptr, i, &o) != TCL_OK) {
- CACHE_STACK_INFO();
- TRACE_ERROR(interp);
- goto gotError;
- }
- CACHE_STACK_INFO();
- } else {
- Tcl_ListObjIndex(NULL, value2Ptr, i, &o);
- }
- if (o != NULL) {
- s2 = TclGetStringFromObj(o, &s2len);
- } else {
- s2 = "";
- s2len = 0;
- }
- if (s1len == s2len) {
- match = (memcmp(s1, s2, s1len) == 0);
- }
-
- /* Could be an ephemeral abstract obj */
- Tcl_BounceRefCount(o);
-
- i++;
- } while (i < length && match == 0);
- }
- }
+ s1 = TclGetStringFromObj(valuePtr, &s1len);
+ TRACE(("\"%.30s\" \"%.30s\" => ", O2S(valuePtr), O2S(value2Ptr)));
+
+ if (TclObjTypeHasProc(value2Ptr, inOperProc) != NULL) {
+ int status = TclObjTypeInOperator(interp, valuePtr, value2Ptr, &match);
+ if (status != TCL_OK) {
+ TRACE_ERROR(interp);
+ goto gotError;
+ }
+ } else {
+
+ if (TclListObjLength(interp, value2Ptr, &length) != TCL_OK) {
+ TRACE_ERROR(interp);
+ goto gotError;
+ }
+ match = 0;
+ if (length > 0) {
+ Tcl_Size i = 0;
+ Tcl_Obj *o;
+ int isAbstractList = TclObjTypeHasProc(value2Ptr, indexProc) != NULL;
+
+ /*
+ * An empty list doesn't match anything.
+ */
+
+ do {
+ if (isAbstractList) {
+ DECACHE_STACK_INFO();
+ if (TclObjTypeIndex(interp, value2Ptr, i, &o) != TCL_OK) {
+ CACHE_STACK_INFO();
+ TRACE_ERROR(interp);
+ goto gotError;
+ }
+ CACHE_STACK_INFO();
+ } else {
+ Tcl_ListObjIndex(NULL, value2Ptr, i, &o);
+ }
+ if (o != NULL) {
+ s2 = TclGetStringFromObj(o, &s2len);
+ } else {
+ s2 = "";
+ s2len = 0;
+ }
+ if (s1len == s2len) {
+ match = (memcmp(s1, s2, s1len) == 0);
+ }
+
+ /* Could be an ephemeral abstract obj */
+ Tcl_BounceRefCount(o);
+
+ i++;
+ } while (i < length && match == 0);
+ }
+ }
if (*pc == INST_LIST_NOT_IN) {
match = !match;
@@ -5165,8 +5168,7 @@ TEBCresume(
NEXT_INST_F(1, 1, 0);
}
- case INST_LREPLACE4:
- {
+ case INST_LREPLACE4: {
size_t numToDelete, numNewElems;
int end_indicator;
int haveSecondIndex, flags;
@@ -5562,7 +5564,7 @@ TEBCresume(
if ((*ustring1 == *ustring2) &&
/* Fix bug [69218ab7b]: restrict max compare length. */
((end - ustring1) >= length2) && (length2 == 1 ||
- memcmp(ustring1, ustring2,
+ memcmp(ustring1, ustring2,
sizeof(Tcl_UniChar) * length2) == 0)) {
if (p != ustring1) {
Tcl_AppendUnicodeToObj(objResultPtr, p, ustring1-p);
@@ -7381,7 +7383,7 @@ TEBCresume(
goto gotError;
}
DECACHE_STACK_INFO();
- result = TclDictWithFinish(interp, varPtr,arrayPtr,varNamePtr,NULL,-1,
+ result = TclDictWithFinish(interp, varPtr, arrayPtr, varNamePtr, NULL, -1,
objc, objv, keysPtr);
CACHE_STACK_INFO();
TclDecrRefCount(keysPtr);
@@ -7424,38 +7426,36 @@ TEBCresume(
* -----------------------------------------------------------------
*/
- case INST_CLOCK_READ:
- { /* Read the wall clock */
- Tcl_WideInt wval;
- Tcl_Time now;
- switch (TclGetUInt1AtPtr(pc+1)) {
- case 0: /* clicks */
+ case INST_CLOCK_READ: { /* Read the wall clock */
+ Tcl_WideInt wval;
+ Tcl_Time now;
+ switch (TclGetUInt1AtPtr(pc+1)) {
+ case 0: /* clicks */
#ifdef TCL_WIDE_CLICKS
- wval = TclpGetWideClicks();
+ wval = TclpGetWideClicks();
#else
- wval = (Tcl_WideInt)TclpGetClicks();
+ wval = (Tcl_WideInt)TclpGetClicks();
#endif
- break;
- case 1: /* microseconds */
- Tcl_GetTime(&now);
- wval = (Tcl_WideInt)now.sec * 1000000 + now.usec;
- break;
- case 2: /* milliseconds */
- Tcl_GetTime(&now);
- wval = (Tcl_WideInt)now.sec * 1000 + now.usec / 1000;
- break;
- case 3: /* seconds */
- Tcl_GetTime(&now);
- wval = (Tcl_WideInt)now.sec;
- break;
- default:
- Tcl_Panic("clockRead instruction with unknown clock#");
- }
- TclNewIntObj(objResultPtr, wval);
- TRACE_WITH_OBJ(("=> "), objResultPtr);
- NEXT_INST_F(2, 0, 1);
+ break;
+ case 1: /* microseconds */
+ Tcl_GetTime(&now);
+ wval = (Tcl_WideInt)now.sec * 1000000 + now.usec;
+ break;
+ case 2: /* milliseconds */
+ Tcl_GetTime(&now);
+ wval = (Tcl_WideInt)now.sec * 1000 + now.usec / 1000;
+ break;
+ case 3: /* seconds */
+ Tcl_GetTime(&now);
+ wval = (Tcl_WideInt)now.sec;
+ break;
+ default:
+ Tcl_Panic("clockRead instruction with unknown clock#");
}
- break;
+ TclNewIntObj(objResultPtr, wval);
+ TRACE_WITH_OBJ(("=> "), objResultPtr);
+ NEXT_INST_F(2, 0, 1);
+ }
default:
Tcl_Panic("TclNRExecuteByteCode: unrecognized opCode %u", *pc);
@@ -8654,17 +8654,17 @@ ExecuteExtendedBinaryMathOp(
Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
err = mp_init(&bigResult);
if (err == MP_OKAY) {
- switch (opcode) {
- case INST_ADD:
+ switch (opcode) {
+ case INST_ADD:
err = mp_add(&big1, &big2, &bigResult);
break;
- case INST_SUB:
+ case INST_SUB:
err = mp_sub(&big1, &big2, &bigResult);
break;
- case INST_MULT:
+ case INST_MULT:
err = mp_mul(&big1, &big2, &bigResult);
break;
- case INST_DIV:
+ case INST_DIV:
if (mp_iszero(&big2)) {
mp_clear(&big1);
mp_clear(&big2);
@@ -8958,19 +8958,26 @@ TclCompareTwoNumbers(
static void
PrintByteCodeInfo(
- ByteCode *codePtr) /* The bytecode whose summary is printed to
+ ByteCode *codePtr) /* The bytecode whose summary is printed to
* stdout. */
{
Proc *procPtr = codePtr->procPtr;
Interp *iPtr = (Interp *) *codePtr->interpHandle;
- fprintf(stdout, "\nExecuting ByteCode 0x%p, refCt %" TCL_Z_MODIFIER "u, epoch %" TCL_Z_MODIFIER "u, interp 0x%p (epoch %" TCL_Z_MODIFIER "u)\n",
+ fprintf(stdout,
+ "\nExecuting ByteCode 0x%p, refCt %" TCL_Z_MODIFIER
+ "u, epoch %" TCL_Z_MODIFIER "u, interp 0x%p (epoch %"
+ TCL_Z_MODIFIER "u)\n",
codePtr, codePtr->refCount, codePtr->compileEpoch, iPtr,
iPtr->compileEpoch);
fprintf(stdout, " Source: ");
TclPrintSource(stdout, codePtr->source, 60);
- fprintf(stdout, "\n Cmds %" TCL_Z_MODIFIER "u, src %" TCL_Z_MODIFIER "u, inst %" TCL_Z_MODIFIER "u, litObjs %" TCL_Z_MODIFIER "u, aux %" TCL_Z_MODIFIER "u, stkDepth %" TCL_Z_MODIFIER "u, code/src %.2f\n",
+ fprintf(stdout,
+ "\n Cmds %" TCL_Z_MODIFIER "u, src %" TCL_Z_MODIFIER
+ "u, inst %" TCL_Z_MODIFIER "u, litObjs %" TCL_Z_MODIFIER
+ "u, aux %" TCL_Z_MODIFIER "u, stkDepth %" TCL_Z_MODIFIER
+ "u, code/src %.2f\n",
codePtr->numCommands, codePtr->numSrcBytes,
codePtr->numCodeBytes, codePtr->numLitObjects,
codePtr->numAuxDataItems, codePtr->maxStackDepth,
@@ -8981,8 +8988,11 @@ PrintByteCodeInfo(
0.0);
#ifdef TCL_COMPILE_STATS
- fprintf(stdout, " Code %" TCL_Z_MODIFIER "u = header %" TCL_Z_MODIFIER "u+inst %" TCL_Z_MODIFIER
- "u+litObj %" TCL_Z_MODIFIER "u+exc %" TCL_Z_MODIFIER "u+aux %" TCL_Z_MODIFIER "u+cmdMap %" TCL_Z_MODIFIER "u\n",
+ fprintf(stdout,
+ " Code %" TCL_Z_MODIFIER "u = header %" TCL_Z_MODIFIER
+ "u+inst %" TCL_Z_MODIFIER "u+litObj %" TCL_Z_MODIFIER
+ "u+exc %" TCL_Z_MODIFIER "u+aux %" TCL_Z_MODIFIER
+ "u+cmdMap %" TCL_Z_MODIFIER "u\n",
codePtr->structureSize,
offsetof(ByteCode, localCachePtr),
codePtr->numCodeBytes,
@@ -8993,7 +9003,8 @@ PrintByteCodeInfo(
#endif /* TCL_COMPILE_STATS */
if (procPtr != NULL) {
fprintf(stdout,
- " Proc 0x%p, refCt %" TCL_Z_MODIFIER "u, args %" TCL_Z_MODIFIER "u, compiled locals %" TCL_Z_MODIFIER "u\n",
+ " Proc 0x%p, refCt %" TCL_Z_MODIFIER "u, args %"
+ TCL_Z_MODIFIER "u, compiled locals %" TCL_Z_MODIFIER "u\n",
procPtr, procPtr->refCount, procPtr->numArgs,
procPtr->numCompiledLocals);
}
@@ -9022,7 +9033,7 @@ PrintByteCodeInfo(
#ifdef TCL_COMPILE_DEBUG
static void
ValidatePcAndStackTop(
- ByteCode *codePtr, /* The bytecode whose summary is printed to
+ ByteCode *codePtr, /* The bytecode whose summary is printed to
* stdout. */
const unsigned char *pc, /* Points to first byte of a bytecode
* instruction. The program counter. */
@@ -9062,7 +9073,7 @@ ValidatePcAndStackTop(
TclNewLiteralStringObj(message, "\n executing ");
Tcl_IncrRefCount(message);
Tcl_AppendLimitedToObj(message, cmd, numChars, 100, NULL);
- fprintf(stderr,"%s\n", TclGetString(message));
+ fprintf(stderr, "%s\n", TclGetString(message));
Tcl_DecrRefCount(message);
} else {
fprintf(stderr, "\n");
@@ -9094,7 +9105,7 @@ static void
IllegalExprOperandType(
Tcl_Interp *interp, /* Interpreter to which error information
* pertains. */
- const unsigned char *pc, /* Points to the instruction being executed
+ const unsigned char *pc, /* Points to the instruction being executed
* when the illegal type was found. */
Tcl_Obj *opndPtr) /* Points to the operand holding the value
* with the illegal type. */
@@ -9158,21 +9169,21 @@ TclGetSourceFromFrame(
Tcl_Obj *const objv[])
{
if (cfPtr == NULL) {
- return Tcl_NewListObj(objc, objv);
+ return Tcl_NewListObj(objc, objv);
}
if (cfPtr->cmdObj == NULL) {
- if (cfPtr->cmd == NULL) {
+ if (cfPtr->cmd == NULL) {
ByteCode *codePtr = (ByteCode *) cfPtr->data.tebc.codePtr;
- cfPtr->cmd = GetSrcInfoForPc((unsigned char *)
+ cfPtr->cmd = GetSrcInfoForPc((unsigned char *)
cfPtr->data.tebc.pc, codePtr, &cfPtr->len, NULL, NULL);
- }
+ }
if (cfPtr->cmd) {
cfPtr->cmdObj = Tcl_NewStringObj(cfPtr->cmd, cfPtr->len);
} else {
cfPtr->cmdObj = Tcl_NewListObj(objc, objv);
}
- Tcl_IncrRefCount(cfPtr->cmdObj);
+ Tcl_IncrRefCount(cfPtr->cmdObj);
}
return cfPtr->cmdObj;
}
@@ -9544,7 +9555,7 @@ TclExprFloatError(
int
TclLog2(
- int value) /* The integer for which to compute the log
+ int value) /* The integer for which to compute the log
* base 2. */
{
int n = value;
@@ -9813,23 +9824,23 @@ EvalStatsCmd(
currentHeaderBytes / numCurrentByteCodes);
Tcl_AppendPrintfToObj(objPtr, "Instructions %12.6g %8.1f%% %8.1f\n",
statsPtr->currentInstBytes,
- Percent(statsPtr->currentInstBytes,statsPtr->currentByteCodeBytes),
+ Percent(statsPtr->currentInstBytes, statsPtr->currentByteCodeBytes),
statsPtr->currentInstBytes / numCurrentByteCodes);
Tcl_AppendPrintfToObj(objPtr, "Literal ptr array %12.6g %8.1f%% %8.1f\n",
statsPtr->currentLitBytes,
- Percent(statsPtr->currentLitBytes,statsPtr->currentByteCodeBytes),
+ Percent(statsPtr->currentLitBytes, statsPtr->currentByteCodeBytes),
statsPtr->currentLitBytes / numCurrentByteCodes);
Tcl_AppendPrintfToObj(objPtr, "Exception table %12.6g %8.1f%% %8.1f\n",
statsPtr->currentExceptBytes,
- Percent(statsPtr->currentExceptBytes,statsPtr->currentByteCodeBytes),
+ Percent(statsPtr->currentExceptBytes, statsPtr->currentByteCodeBytes),
statsPtr->currentExceptBytes / numCurrentByteCodes);
Tcl_AppendPrintfToObj(objPtr, "Auxiliary data %12.6g %8.1f%% %8.1f\n",
statsPtr->currentAuxBytes,
- Percent(statsPtr->currentAuxBytes,statsPtr->currentByteCodeBytes),
+ Percent(statsPtr->currentAuxBytes, statsPtr->currentByteCodeBytes),
statsPtr->currentAuxBytes / numCurrentByteCodes);
Tcl_AppendPrintfToObj(objPtr, "Command map %12.6g %8.1f%% %8.1f\n",
statsPtr->currentCmdMapBytes,
- Percent(statsPtr->currentCmdMapBytes,statsPtr->currentByteCodeBytes),
+ Percent(statsPtr->currentCmdMapBytes, statsPtr->currentByteCodeBytes),
statsPtr->currentCmdMapBytes / numCurrentByteCodes);
/*