diff --git a/gc.c b/gc.c index 0c9c1608..26e4b252 100644 --- a/gc.c +++ b/gc.c @@ -77,14 +77,7 @@ gc_copy (SCM old) ///((internal)) { NVECTOR (new) = g_free; for (int i=0; iaccu size)))))))) ;; c+p expr->arg - ;; g_cells[0] - ((array-ref (p-expr (fixed ,index)) (p-expr (ident ,array))) - (let* ((index (cstring->number index)) + ;; g_cells[] + ((array-ref ,index (p-expr (ident ,array))) + (let* ((info ((expr->accu info) index)) (type (ident->type info array)) (size (type->size info type))) (clone info #:text - (append text - ((ident->base info) array) - (list (lambda (f g ta t d) - (append - (i386:value->accu (* size index)) - (case size - ((1) (i386:byte-base-mem->accu)) - ((4) (i386:base-mem->accu)) - (else (i386:accu+base)))))))))) - - ;; c+p expr->arg - ;; g_cells[i] - ((array-ref (p-expr (ident ,index)) (p-expr (ident ,array))) - (let* ((type (ident->type info array)) - (size (type->size info type))) - (clone info #:text (append text - ((ident->base info) index) - (list (lambda (f g ta t d) - (append - (i386:base->accu) - (if (< size 4) '() - (append - (i386:accu+accu) - (if (= size 12) (i386:accu+base) '()) - (i386:accu-shl 2)))))) - ((ident->base info) array) - (list (lambda (f g ta t d) - (case size - ((1) (i386:byte-base-mem->accu)) - ((4) (i386:base-mem->accu)) - (else (i386:accu+base))))))))) + (append (.text info) + ;; immediate: (i386:value->accu (* size index)) + ;; * size cells: * length * 4 = * 12 + (list (lambda (f g ta t d) + (append + (i386:accu->base) + (if (eq? size 1) '() + (append + (if (> size 4) (i386:accu+accu) '()) + (if (> size 8) (i386:accu+base) '()) + (i386:accu-shl 2)))))) + ((ident->base info) array) + (list (lambda (f g ta t d) + (append + (case size + ((1) (i386:byte-base-mem->accu)) + ((4) (i386:base-mem->accu)) + (else (i386:accu+base)))))))))) ;; f.field ((d-sel (ident ,field) (p-expr (ident ,array))) diff --git a/scaffold/t.c b/scaffold/t.c index 1d470844..522ba7ca 100644 --- a/scaffold/t.c +++ b/scaffold/t.c @@ -294,7 +294,7 @@ struct_test () TYPE (1) = 1; CAR (1) = 2; CDR (1) = 3; - g_cells[0] = g_cells[1]; + g_cells[0] = g_cells[0+1]; if (TYPE (0) != 1) return 1; if (CAR (0) != 2) return 2; if (CDR (0) != 3) return 3; diff --git a/vector.c b/vector.c index 26acf804..1b5db523 100644 --- a/vector.c +++ b/vector.c @@ -87,12 +87,7 @@ list_to_vector (SCM x) SCM p = VECTOR (v); while (x != cell_nil) { -#if __GNUC__ g_cells[p++] = g_cells[vector_entry (car (x))]; -#else - SCM b = vector_entry (car (x)); - g_cells[p++] = g_cells[b]; -#endif x = cdr (x); } return v;