Annotation of OpenXM/src/k097/debug/return.k, Revision 1.1
1.1 ! maekawa 1:
! 2:
! 3: /* return --> goto で処理がどの程度遅い原因かを調べる. return.k
! 4: 1997, 5/31
! 5: */
! 6:
! 7: Println(" Type in Foo1(number) for regular return or Foo2(number) without regular return.");
! 8:
! 9: def Foo1(n) {
! 10: local i;
! 11: sm1(" set_timer ");
! 12: PSfor (i=0; i<n; i++) {
! 13: foo1a();
! 14: }
! 15: sm1(" set_timer ");
! 16: }
! 17: def foo1a() {
! 18: local x;
! 19: return(10);
! 20: x = 1; x = 1; x = 1; x = 1; x = 1; x = 1; x = 1; x = 1;
! 21: x = 1; x = 1; x = 1; x = 1; x = 1; x = 1; x = 1; x = 1;
! 22: x = 1; x = 1; x = 1; x = 1; x = 1; x = 1; x = 1; x = 1;
! 23: x = 1; x = 1; x = 1; x = 1; x = 1; x = 1; x = 1; x = 1;
! 24: x = 1; x = 1; x = 1; x = 1; x = 1; x = 1; x = 1; x = 1;
! 25: x = 1; x = 1; x = 1; x = 1; x = 1; x = 1; x = 1; x = 1;
! 26: }
! 27:
! 28: def Foo2(n) {
! 29: local i;
! 30: sm1(" set_timer ");
! 31: PSfor (i=0; i<n; i++) {
! 32: foo2a();
! 33: }
! 34: sm1(" set_timer ");
! 35: }
! 36: def foo2a() {
! 37: local x;
! 38: if (true) {
! 39: x = 10;
! 40: } else {
! 41: x = 1; x = 1; x = 1; x = 1; x = 1; x = 1; x = 1; x = 1;
! 42: x = 1; x = 1; x = 1; x = 1; x = 1; x = 1; x = 1; x = 1;
! 43: x = 1; x = 1; x = 1; x = 1; x = 1; x = 1; x = 1; x = 1;
! 44: x = 1; x = 1; x = 1; x = 1; x = 1; x = 1; x = 1; x = 1;
! 45: x = 1; x = 1; x = 1; x = 1; x = 1; x = 1; x = 1; x = 1;
! 46: x = 1; x = 1; x = 1; x = 1; x = 1; x = 1; x = 1; x = 1;
! 47: }
! 48: return(10);
! 49: }
! 50:
! 51:
! 52:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>