summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2015-06-30 08:10:15 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2015-06-30 08:10:15 (GMT)
commit68de044c4e43f457cf298983fc8dc0936aed9923 (patch)
treee963a357aeb17226cede5a09a53f75b86b353eab /generic/tclExecute.c
parentcdbe969ea378527a9002c3a5ab21465c7a79fc4b (diff)
downloadtcl-68de044c4e43f457cf298983fc8dc0936aed9923.zip
tcl-68de044c4e43f457cf298983fc8dc0936aed9923.tar.gz
tcl-68de044c4e43f457cf298983fc8dc0936aed9923.tar.bz2
Use twoPtrValue in stead of ptrAndLongRep for implementation of some internal Obj types. On most platforms this doesn't make a difference,
as (void *) and (long) generially have the same size. The only exception where it makes a difference is win64, as we can now store 64 bits in this field in stead of only 32 bits, exactly what the processor is optimized for.
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 4a6c009..5b053a6 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -198,14 +198,14 @@ typedef struct TEBCdata {
if (auxObjList) { \
objPtr->length += auxObjList->length; \
} \
- objPtr->internalRep.ptrAndLongRep.ptr = auxObjList; \
+ objPtr->internalRep.twoPtrValue.ptr1 = auxObjList; \
auxObjList = objPtr; \
} while (0)
#define POP_TAUX_OBJ() \
do { \
tmpPtr = auxObjList; \
- auxObjList = tmpPtr->internalRep.ptrAndLongRep.ptr; \
+ auxObjList = tmpPtr->internalRep.twoPtrValue.ptr1; \
Tcl_DecrRefCount(tmpPtr); \
} while (0)
@@ -1649,8 +1649,7 @@ FreeExprCodeInternalRep(
ByteCode *codePtr = objPtr->internalRep.twoPtrValue.ptr1;
objPtr->typePtr = NULL;
- codePtr->refCount--;
- if (codePtr->refCount <= 0) {
+ if (codePtr->refCount-- < 2) {
TclCleanupByteCode(codePtr);
}
}
@@ -2858,7 +2857,7 @@ TEBCresume(
*/
TclNewObj(objPtr);
- objPtr->internalRep.ptrAndLongRep.value = CURR_DEPTH;
+ objPtr->internalRep.twoPtrValue.ptr2 = INT2PTR(CURR_DEPTH);
objPtr->length = 0;
PUSH_TAUX_OBJ(objPtr);
TRACE(("=> mark depth as %d\n", (int) CURR_DEPTH));
@@ -2872,7 +2871,7 @@ TEBCresume(
*/
CLANG_ASSERT(auxObjList);
- objc = CURR_DEPTH - auxObjList->internalRep.ptrAndLongRep.value;
+ objc = CURR_DEPTH - PTR2INT(auxObjList->internalRep.twoPtrValue.ptr2);
POP_TAUX_OBJ();
#ifdef TCL_COMPILE_DEBUG
/* Ugly abuse! */
@@ -2973,7 +2972,7 @@ TEBCresume(
case INST_INVOKE_EXPANDED:
CLANG_ASSERT(auxObjList);
- objc = CURR_DEPTH - auxObjList->internalRep.ptrAndLongRep.value;
+ objc = CURR_DEPTH - PTR2INT(auxObjList->internalRep.twoPtrValue.ptr2);
POP_TAUX_OBJ();
if (objc) {
pcAdjustment = 1;
@@ -8066,7 +8065,7 @@ TEBCresume(
while (auxObjList) {
if ((catchTop != initCatchTop)
&& (*catchTop > (ptrdiff_t)
- auxObjList->internalRep.ptrAndLongRep.value)) {
+ auxObjList->internalRep.twoPtrValue.ptr2)) {
break;
}
POP_TAUX_OBJ();