Tcl Source Code

Check-in [6e3a672696]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:remove unnecessary messing around INST_CONTINUE and INST_BREAK: local continue/break are already converted to jumps, so that these are either caught or returned - in either case, the stacks are cleaned up properly by TEBC itself.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6e3a67269680df7bdd904e3816e1b06e3965fe3d
User & Date: mig 2013-12-22 14:11:46
Context
2013-12-27
20:22
merge to pre-conflict check-in: 378998b647 user: dgp tags: dgp-refactor
2013-12-23
11:28
Added new tools for managing and verifying the stack depth during compilation. Used it in some spots... check-in: c91b235146 user: mig tags: trunk
2013-12-22
14:19
merge trunk check-in: 1b948d66b1 user: mig tags: mig-optimize
14:11
remove unnecessary messing around INST_CONTINUE and INST_BREAK: local continue/break are already con... check-in: 6e3a672696 user: mig tags: trunk
13:03
remove duplicate statement in previous commit check-in: ce6b692ea9 user: mig tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclCompCmds.c.

485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502

503
504
505
506
507
508
509
    if (rangePtr && rangePtr->type == LOOP_EXCEPTION_RANGE) {
	/*
	 * Found the target! No need for a nasty INST_BREAK here.
	 */

	TclCleanupStackForBreakContinue(envPtr, auxPtr);
	TclAddLoopBreakFixup(envPtr, auxPtr);
	TclAdjustStackDepth(1, envPtr);
    } else {
	/*
	 * Emit a real break.
	 */

	PushStringLiteral(envPtr, "");
	TclEmitOpcode(INST_DUP, envPtr);
	TclEmitInstInt4(INST_RETURN_IMM, TCL_BREAK, envPtr);
	TclEmitInt4(0, envPtr);
    }


    return TCL_OK;
}

/*
 *----------------------------------------------------------------------
 *







<





<
|
<
<

>







485
486
487
488
489
490
491

492
493
494
495
496

497


498
499
500
501
502
503
504
505
506
    if (rangePtr && rangePtr->type == LOOP_EXCEPTION_RANGE) {
	/*
	 * Found the target! No need for a nasty INST_BREAK here.
	 */

	TclCleanupStackForBreakContinue(envPtr, auxPtr);
	TclAddLoopBreakFixup(envPtr, auxPtr);

    } else {
	/*
	 * Emit a real break.
	 */


	TclEmitOpcode(INST_BREAK, envPtr);


    }
    TclAdjustStackDepth(1, envPtr);

    return TCL_OK;
}

/*
 *----------------------------------------------------------------------
 *
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748

749
750
751
752
753
754
755
    if (rangePtr && rangePtr->type == LOOP_EXCEPTION_RANGE) {
	/*
	 * Found the target! No need for a nasty INST_CONTINUE here.
	 */

	TclCleanupStackForBreakContinue(envPtr, auxPtr);
	TclAddLoopContinueFixup(envPtr, auxPtr);
	TclAdjustStackDepth(1, envPtr);
    } else {
	/*
	 * Emit a real continue.
	 */

	PushStringLiteral(envPtr, "");
	TclEmitOpcode(INST_DUP, envPtr);
	TclEmitInstInt4(INST_RETURN_IMM, TCL_CONTINUE, envPtr);
	TclEmitInt4(0, envPtr);
    }


    return TCL_OK;
}

/*
 *----------------------------------------------------------------------
 *







<





<
|
<
<

>







728
729
730
731
732
733
734

735
736
737
738
739

740


741
742
743
744
745
746
747
748
749
    if (rangePtr && rangePtr->type == LOOP_EXCEPTION_RANGE) {
	/*
	 * Found the target! No need for a nasty INST_CONTINUE here.
	 */

	TclCleanupStackForBreakContinue(envPtr, auxPtr);
	TclAddLoopContinueFixup(envPtr, auxPtr);

    } else {
	/*
	 * Emit a real continue.
	 */


	TclEmitOpcode(INST_CONTINUE, envPtr);


    }
    TclAdjustStackDepth(1, envPtr);

    return TCL_OK;
}

/*
 *----------------------------------------------------------------------
 *