summaryrefslogtreecommitdiffstats
path: root/generic/tclCompCmdsSZ.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2014-01-09 10:49:04 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2014-01-09 10:49:04 (GMT)
commitacf1cebeab93607fc83206e77534b5fada8726ef (patch)
tree856bea5b60422e27886e3076665070d4ef4294bc /generic/tclCompCmdsSZ.c
parent7e69e5c6b95b8116b04521b813321502ac377c72 (diff)
downloadtcl-acf1cebeab93607fc83206e77534b5fada8726ef.zip
tcl-acf1cebeab93607fc83206e77534b5fada8726ef.tar.gz
tcl-acf1cebeab93607fc83206e77534b5fada8726ef.tar.bz2
use compact form
Diffstat (limited to 'generic/tclCompCmdsSZ.c')
-rw-r--r--generic/tclCompCmdsSZ.c51
1 files changed, 25 insertions, 26 deletions
diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c
index 06cca50..345dd9f 100644
--- a/generic/tclCompCmdsSZ.c
+++ b/generic/tclCompCmdsSZ.c
@@ -451,8 +451,7 @@ TclCompileStringIsCmd(
STR_IS_TRUE, STR_IS_UPPER, STR_IS_WIDE, STR_IS_WORD,
STR_IS_XDIGIT
};
- JumpFixup jumpFixup;
- int t, range, allowEmpty = 0;
+ int t, range, allowEmpty = 0, end;
Tcl_Obj *isClass;
if (parsePtr->numWords < 3 || parsePtr->numWords > 6) {
@@ -538,7 +537,7 @@ TclCompileStringIsCmd(
*/
range = TclCreateExceptRange(CATCH_EXCEPTION_RANGE, envPtr);
- TclEmitInstInt4( INST_BEGIN_CATCH4, range, envPtr);
+ OP4( BEGIN_CATCH4, range);
ExceptionRangeStarts(envPtr, range);
/*
@@ -554,28 +553,28 @@ TclCompileStringIsCmd(
* this is true for).
*/
- TclEmitOpcode( INST_DUP, envPtr);
- TclEmitOpcode( INST_DUP, envPtr);
- TclEmitOpcode( INST_NEQ, envPtr);
- TclEmitInstInt1( INST_JUMP_TRUE1, 5, envPtr);
+ OP( DUP);
+ OP( DUP);
+ OP( NEQ);
+ OP1( JUMP_TRUE1, 5);
/*
* Type check for all other double values.
*/
- TclEmitOpcode( INST_DUP, envPtr);
- TclEmitOpcode( INST_UMINUS, envPtr);
- TclEmitOpcode( INST_POP, envPtr);
+ OP( DUP);
+ OP( UMINUS);
+ OP( POP);
break;
case STR_IS_ENTIER:
- TclEmitOpcode( INST_DUP, envPtr);
- TclEmitOpcode( INST_BITNOT, envPtr);
- TclEmitOpcode( INST_POP, envPtr);
+ OP( DUP);
+ OP( BITNOT);
+ OP( POP);
break;
case STR_IS_LIST:
- TclEmitOpcode( INST_DUP, envPtr);
- TclEmitOpcode( INST_LIST_LENGTH, envPtr);
- TclEmitOpcode( INST_POP, envPtr);
+ OP( DUP);
+ OP( LIST_LENGTH);
+ OP( POP);
break;
}
@@ -587,20 +586,20 @@ TclCompileStringIsCmd(
*/
ExceptionRangeEnds(envPtr, range);
- TclEmitOpcode( INST_END_CATCH, envPtr);
- TclEmitOpcode( INST_POP, envPtr);
- PushLiteral(envPtr, "1", 1);
- TclEmitForwardJump(envPtr, TCL_UNCONDITIONAL_JUMP, &jumpFixup);
+ OP( END_CATCH);
+ OP( POP);
+ PUSH( "1");
+ JUMP1( JUMP, end);
ExceptionRangeTarget(envPtr, range, catchOffset);
- TclEmitOpcode( INST_END_CATCH, envPtr);
+ OP( END_CATCH);
if (allowEmpty) {
- PushLiteral(envPtr, "", 0);
- TclEmitOpcode( INST_STR_EQ, envPtr);
+ PUSH( "");
+ OP( STR_EQ);
} else {
- TclEmitOpcode( INST_POP, envPtr);
- PushLiteral(envPtr, "0", 1);
+ OP( POP);
+ PUSH( "0");
}
- TclFixupForwardJumpToHere(envPtr, &jumpFixup, 127);
+ FIXJUMP1( end);
return TCL_OK;
}