|
1 | 1 | ;;; 7.ss
|
2 | 2 | ;;; Copyright 1984-2017 Cisco Systems, Inc.
|
3 |
| -;;; |
| 3 | +;;; |
4 | 4 | ;;; Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | ;;; you may not use this file except in compliance with the License.
|
6 | 6 | ;;; You may obtain a copy of the License at
|
7 |
| -;;; |
| 7 | +;;; |
8 | 8 | ;;; http://www.apache.org/licenses/LICENSE-2.0
|
9 |
| -;;; |
| 9 | +;;; |
10 | 10 | ;;; Unless required by applicable law or agreed to in writing, software
|
11 | 11 | ;;; distributed under the License is distributed on an "AS IS" BASIS,
|
12 | 12 | ;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
466 | 466 | (define-record-type (sstats make-sstats sstats?)
|
467 | 467 | (nongenerative #{sstats pfwch3jd8ts96giujpitoverj-0})
|
468 | 468 | (sealed #t)
|
469 |
| - (fields |
| 469 | + (fields |
470 | 470 | (mutable cpu sstats-cpu set-sstats-cpu!)
|
471 | 471 | (mutable real sstats-real set-sstats-real!)
|
472 | 472 | (mutable bytes sstats-bytes set-sstats-bytes!)
|
|
479 | 479 | (lambda (cpu real bytes gc-count gc-cpu gc-real gc-bytes)
|
480 | 480 | (new cpu real bytes gc-count gc-cpu gc-real gc-bytes))))))
|
481 | 481 | (define exact-integer? (lambda (x) (and (integer? x) (exact? x))))
|
482 |
| - (set-who! make-sstats |
| 482 | + (set-who! make-sstats |
483 | 483 | (lambda (cpu real bytes gc-count gc-cpu gc-real gc-bytes)
|
484 | 484 | (define verify-time
|
485 | 485 | (lambda (name x)
|
|
616 | 616 | (unless (and (real? v) (not (negative? v)))
|
617 | 617 | ($oops 'collect-maximum-generation-threshold-factor "~s is not a nonnegative real" v))
|
618 | 618 | v)))
|
619 |
| - |
| 619 | + |
620 | 620 | (define $reset-protect
|
621 | 621 | (lambda (body out)
|
622 |
| - ((call/cc |
623 |
| - (lambda (k) |
624 |
| - (parameterize ([reset-handler |
| 622 | + (call/cc |
| 623 | + (lambda (k) |
| 624 | + (parameterize ([reset-handler |
625 | 625 | (lambda ()
|
626 |
| - (k (lambda () |
627 |
| - (out) |
628 |
| - ((reset-handler)))))]) |
629 |
| - (with-exception-handler |
630 |
| - (lambda (c) |
631 |
| - ; would prefer not to burn bridges even for serious condition |
632 |
| - ; if the exception is continuable, but we have no way to know |
633 |
| - ; short of grubbing through the continuation |
634 |
| - (if (serious-condition? c) |
635 |
| - (k (lambda () (out) (raise c))) |
636 |
| - (raise-continuable c))) |
637 |
| - (lambda () |
638 |
| - (call-with-values body |
639 |
| - (case-lambda |
640 |
| - [(v) (lambda () v)] |
641 |
| - [v* (lambda () (apply values v*))])))))))))) |
| 626 | + (call-in-continuation k |
| 627 | + (lambda () |
| 628 | + (out) |
| 629 | + ((reset-handler)))))]) |
| 630 | + (with-exception-handler |
| 631 | + (lambda (c) |
| 632 | + ; would prefer not to burn bridges even for serious condition |
| 633 | + ; if the exception is continuable, but we have no way to know |
| 634 | + ; short of grubbing through the continuation |
| 635 | + (if (serious-condition? c) |
| 636 | + (call-in-continuation k (lambda () (out) (raise c))) |
| 637 | + (raise-continuable c))) |
| 638 | + body)))))) |
642 | 639 |
|
643 | 640 | (define exit-handler)
|
644 | 641 | (define reset-handler)
|
|
890 | 887 | (docollect
|
891 | 888 | (lambda (gct prev-allocated-after-max)
|
892 | 889 | (let ([max-gen? (fx= g (collect-maximum-generation))])
|
893 |
| - (values |
| 890 | + (values |
894 | 891 | ; make gc-trip to look like we've just collected generation g
|
895 | 892 | ; w/o also having collected generation g+1
|
896 | 893 | (if max-gen?
|
|
1288 | 1285 | (condition-wait $collect-cond $tc-mutex)
|
1289 | 1286 | (f)]))))
|
1290 | 1287 | (critical-section
|
1291 |
| - (dynamic-wind |
| 1288 | + (dynamic-wind |
1292 | 1289 | once
|
1293 | 1290 | (collect-request-handler)
|
1294 | 1291 | (lambda () (set! $collect-request-pending #f))))))))
|
|
1467 | 1464 | (define-record-type pass-stats
|
1468 | 1465 | (nongenerative)
|
1469 | 1466 | (sealed #t)
|
1470 |
| - (fields |
| 1467 | + (fields |
1471 | 1468 | (mutable calls)
|
1472 | 1469 | (mutable cpu)
|
1473 | 1470 | (mutable gc-cpu)
|
|
1489 | 1486 | (set! stats-ht (make-eq-hashtable))))
|
1490 | 1487 |
|
1491 | 1488 | (set! $enable-pass-timing (make-parameter #f))
|
1492 |
| - |
| 1489 | + |
1493 | 1490 | (set-who! $pass-time
|
1494 | 1491 | (lambda (name thunk)
|
1495 | 1492 | (unless (symbol? name) ($oops who "~s is not a symbol" name))
|
|
1539 | 1536 | (define (build-result namev psv)
|
1540 | 1537 | (vector->list
|
1541 | 1538 | (vector-map
|
1542 |
| - (lambda (name ps) |
1543 |
| - (list name |
| 1539 | + (lambda (name ps) |
| 1540 | + (list name |
1544 | 1541 | (pass-stats-calls ps)
|
1545 | 1542 | (pass-stats-cpu ps)
|
1546 | 1543 | (pass-stats-gc-cpu ps)
|
|
0 commit comments