diff --git a/racket/src/cs/rumble/control.ss b/racket/src/cs/rumble/control.ss index e83fbd10fd..5badbd9c80 100644 --- a/racket/src/cs/rumble/control.ss +++ b/racket/src/cs/rumble/control.ss @@ -1245,7 +1245,7 @@ (make-continuation-mark-set (prune-mark-chain-suffix tag - (get-current-mark-chain #f #f mc)) + (get-current-mark-chain '() #f mc)) (get-metacontinuation-traces mc)))] [(full-continuation? k) (make-continuation-mark-set diff --git a/racket/src/cs/rumble/memory.ss b/racket/src/cs/rumble/memory.ss index 8469f4d3f6..24149c4837 100644 --- a/racket/src/cs/rumble/memory.ss +++ b/racket/src/cs/rumble/memory.ss @@ -177,19 +177,20 @@ (enable-object-backreferences #f) (chez:fprintf (current-error-port) "Begin Dump\n") (chez:fprintf (current-error-port) "Current memory use: ~a\n" (bytes-allocated)) - (chez:fprintf (current-error-port) "Begin RacketCS\n") - (for-each (lambda (e) - (chez:fprintf (current-error-port) - (layout-line (chez:format "~a" (car e)) - ((get-count #f) e) ((get-bytes #f) e) - ((get-count #t) e) ((get-bytes #t) e)))) - (list-sort (lambda (a b) (< ((get-bytes #f) a) ((get-bytes #f) b))) counts)) - (chez:fprintf (current-error-port) (layout-line "total" - (apply + (map (get-count #f) counts)) - (apply + (map (get-bytes #f) counts)) - (apply + (map (get-count #t) counts)) - (apply + (map (get-bytes #t) counts)))) - (chez:fprintf (current-error-port) "End RacketCS\n") + (unless (#%memq 'only args) + (chez:fprintf (current-error-port) "Begin RacketCS\n") + (for-each (lambda (e) + (chez:fprintf (current-error-port) + (layout-line (chez:format "~a" (car e)) + ((get-count #f) e) ((get-bytes #f) e) + ((get-count #t) e) ((get-bytes #t) e)))) + (list-sort (lambda (a b) (< ((get-bytes #f) a) ((get-bytes #f) b))) counts)) + (chez:fprintf (current-error-port) (layout-line "total" + (apply + (map (get-count #f) counts)) + (apply + (map (get-bytes #f) counts)) + (apply + (map (get-count #t) counts)) + (apply + (map (get-bytes #t) counts)))) + (chez:fprintf (current-error-port) "End RacketCS\n")) (when backtrace-predicate (when (and use-prev? (not prev-stats-objects)) (set! prev-stats-objects (make-weak-eq-hashtable))) @@ -248,11 +249,17 @@ (lambda (o) (and (#%$record? o) (eq? (record-type-name (#%$record-type-descriptor o)) struct-name))))] + [(weak-box? (car args)) + (let ([v (weak-box-value (car args))]) + (lambda (o) (eq? o v)))] [(eq? 'code (car args)) #%$code?] [(eq? 'ephemeron (car args)) ephemeron-pair?] [(symbol? (car args)) + #f + ;; This is disaterously slow, so don't try it: + #; (let ([type (car args)]) (lambda (o) (eq? ((inspect/object o) 'type) type)))] diff --git a/racket/src/io/print/main.rkt b/racket/src/io/print/main.rkt index 55187208bd..ea520dd311 100644 --- a/racket/src/io/print/main.rkt +++ b/racket/src/io/print/main.rkt @@ -273,6 +273,8 @@ (print-named "struct-type" v mode o max-length)] [(struct-type-property? v) (print-named "struct-type-property" v mode o max-length)] + [(thread? v) + (print-named "thread" v mode o max-length)] [(eof-object? v) (write-string/max "#" o max-length)] [(core-input-port? v) diff --git a/racket/src/thread/sync.rkt b/racket/src/thread/sync.rkt index f6fa79ee95..e6e9d8aa10 100644 --- a/racket/src/thread/sync.rkt +++ b/racket/src/thread/sync.rkt @@ -170,6 +170,8 @@ (case-lambda [(evt) (cond + [(evt-impersonator? evt) + (do-sync 'sync #f (list evt))] [(semaphore? evt) (semaphore-wait evt) evt] @@ -187,6 +189,8 @@ (case-lambda [(timeout evt) (cond + [(evt-impersonator? evt) + (do-sync 'sync/timeout timeout (list evt))] [(and (semaphore? evt) (eqv? timeout 0)) (if (semaphore-try-wait? evt) diff --git a/racket/src/thread/thread.rkt b/racket/src/thread/thread.rkt index 52ef943650..7e16d734ac 100644 --- a/racket/src/thread/thread.rkt +++ b/racket/src/thread/thread.rkt @@ -122,7 +122,8 @@ #:suspend! (lambda (t i-cb r-cb) (thread-deschedule! t #f i-cb r-cb)) #:resume! (lambda (t v) (thread-reschedule! t) v)) #:property prop:evt (lambda (t) (wrap-evt (get-thread-dead-evt t) - (lambda (v) t)))) + (lambda (v) t))) + #:property prop:object-name (struct-field-index name)) (define root-thread #f) @@ -148,7 +149,7 @@ (define t (thread 'none ; node prev 'none ; node next - (gensym) + (object-name proc) e p #f ; sleeping