Cells as stob (from S48 0.57).
This commit is contained in:
		
							parent
							
								
									6f083d7205
								
							
						
					
					
						commit
						06b68b7c5e
					
				|  | @ -223,20 +223,6 @@ | ||||||
|             (apply define-data-struct-primitives stuff)) |             (apply define-data-struct-primitives stuff)) | ||||||
|           stob-data) |           stob-data) | ||||||
| 
 | 
 | ||||||
| ; For flat environments |  | ||||||
| 
 |  | ||||||
| (let ((:value (sexp->type ':value #t)) |  | ||||||
|       (:vector (sexp->type ':vector #t))) |  | ||||||
|   (define-simple-primitive 'make-cell |  | ||||||
|     (proc (:value) :vector) |  | ||||||
|     (instruction (enum op make-stored-object) 1 (enum stob vector))) |  | ||||||
|   (define-simple-primitive 'cell-ref |  | ||||||
|     (proc (:vector) :value) |  | ||||||
|     (instruction (enum op stored-object-ref) (enum stob vector) 0)) |  | ||||||
|   (define-simple-primitive 'cell-set! |  | ||||||
|     (proc (:vector :value) unspecific-type) |  | ||||||
|     (instruction (enum op stored-object-set!) (enum stob vector) 0))) |  | ||||||
| 
 |  | ||||||
| ; Define primitives for vector-like stored objects. | ; Define primitives for vector-like stored objects. | ||||||
| 
 | 
 | ||||||
| (define (define-vector-primitives name element-type make length ref set!) | (define (define-vector-primitives name element-type make length ref set!) | ||||||
|  |  | ||||||
|  | @ -112,6 +112,12 @@ | ||||||
| 	  ((bitwise-and bitwise-ior bitwise-xor) | 	  ((bitwise-and bitwise-ior bitwise-xor) | ||||||
| 	   (proc (&rest :exact-integer) :exact-integer)))) | 	   (proc (&rest :exact-integer) :exact-integer)))) | ||||||
| 
 | 
 | ||||||
|  | (define-interface cells-interface | ||||||
|  |   (export cell? | ||||||
|  | 	  make-cell | ||||||
|  | 	  cell-ref | ||||||
|  | 	  cell-set!)) | ||||||
|  | 
 | ||||||
| (define-interface locations-interface | (define-interface locations-interface | ||||||
|   (export location? |   (export location? | ||||||
| 	  location-defined? | 	  location-defined? | ||||||
|  |  | ||||||
|  | @ -18,6 +18,7 @@ | ||||||
| 		    (vm-exposure vm-exposure-interface) | 		    (vm-exposure vm-exposure-interface) | ||||||
| 		    (ascii ascii-interface) | 		    (ascii ascii-interface) | ||||||
| 		    (locations locations-interface) | 		    (locations locations-interface) | ||||||
|  | 		    (cells cells-interface) | ||||||
| 		    (low-channels low-channels-interface) | 		    (low-channels low-channels-interface) | ||||||
| 		    (ports ports-interface) | 		    (ports ports-interface) | ||||||
| 		    (shared-bindings shared-bindings-interface) | 		    (shared-bindings shared-bindings-interface) | ||||||
|  |  | ||||||
|  | @ -234,6 +234,7 @@ | ||||||
|   (export ((ascii |   (export ((ascii | ||||||
| 	    bitwise | 	    bitwise | ||||||
| 	    byte-vectors | 	    byte-vectors | ||||||
|  | 	    cells | ||||||
| 	    code-vectors | 	    code-vectors | ||||||
| 	    features | 	    features | ||||||
| 	    ;; records  - lose | 	    ;; records  - lose | ||||||
|  |  | ||||||
|  | @ -398,6 +398,7 @@ | ||||||
|    vector |    vector | ||||||
|    closure |    closure | ||||||
|    location |    location | ||||||
|  |    cell | ||||||
|    channel |    channel | ||||||
|    port |    port | ||||||
|    ratnum |    ratnum | ||||||
|  | @ -432,6 +433,8 @@ | ||||||
|     (location location? make-location |     (location location? make-location | ||||||
|       (location-id set-location-id!) |       (location-id set-location-id!) | ||||||
|       (contents set-contents!)) |       (contents set-contents!)) | ||||||
|  |     (cell cell? make-cell | ||||||
|  |       (cell-ref cell-set!)) | ||||||
|     (closure closure? make-closure |     (closure closure? make-closure | ||||||
|       (closure-template) (closure-env)) |       (closure-template) (closure-env)) | ||||||
|     (weak-pointer weak-pointer? make-weak-pointer |     (weak-pointer weak-pointer? make-weak-pointer | ||||||
|  |  | ||||||
|  | @ -248,6 +248,7 @@ | ||||||
| 	  vm-symbol-next vm-set-symbol-next! | 	  vm-symbol-next vm-set-symbol-next! | ||||||
| 	  closure? closure-size make-closure closure-template closure-env | 	  closure? closure-size make-closure closure-template closure-env | ||||||
| 	  location? location-size make-location contents set-contents! location-id | 	  location? location-size make-location contents set-contents! location-id | ||||||
|  |   	  cell? cell-size make-cell cell-ref cell-set! | ||||||
| 	  weak-pointer? weak-pointer-size make-weak-pointer weak-pointer-ref | 	  weak-pointer? weak-pointer-size make-weak-pointer weak-pointer-ref | ||||||
| 
 | 
 | ||||||
| 	  shared-binding? shared-binding-size make-shared-binding | 	  shared-binding? shared-binding-size make-shared-binding | ||||||
|  |  | ||||||
|  | @ -22,6 +22,7 @@ | ||||||
|   (symbol-next set-symbol-next!))       		; hidden from RTS |   (symbol-next set-symbol-next!))       		; hidden from RTS | ||||||
| (define-shared-primitive-data-type closure #f #t) | (define-shared-primitive-data-type closure #f #t) | ||||||
| (define-shared-primitive-data-type location) | (define-shared-primitive-data-type location) | ||||||
|  | (define-shared-primitive-data-type cell) | ||||||
| (define-shared-primitive-data-type weak-pointer) | (define-shared-primitive-data-type weak-pointer) | ||||||
| (define-shared-primitive-data-type shared-binding #f #f | (define-shared-primitive-data-type shared-binding #f #f | ||||||
|   #f |   #f | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 mainzelm
						mainzelm