Skip to content

Commit e131cd0

Browse files
committed
removing the index field from types
1 parent 8410c66 commit e131cd0

File tree

3 files changed

+5
-20
lines changed

3 files changed

+5
-20
lines changed

src/backend-c/generate-c.rkt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
(: emit-var-declarations (-> (Listof Uid) Void))
164164
(define (emit-var-declarations d*)
165165
(display "\n//These are the variable declarations\n")
166-
(display "\ntable types_ht;\nint64_t types_unique_index_counter;\n")
166+
(display "\ntable types_ht;\n")
167167
(display "\ncast_queue* mref_cast_q;\ncast_queue* mvect_cast_q;\n")
168168
(display cast-profiler/external-c-decl*)
169169
(display-seq (map uid->string d*) "" (string-append IMDT-C-TYPE " ") "" ";\n" ""))
@@ -179,8 +179,7 @@
179179
(: initialize-types-table (-> Void))
180180
(define (initialize-types-table)
181181
(printf "types_ht = alloc_hash_table(~a, ~a);\n"
182-
(init-types-hash-table-slots) (types-hash-table-load-factor))
183-
(display "types_unique_index_counter = 0;"))
182+
(init-types-hash-table-slots) (types-hash-table-load-factor)))
184183

185184
(: initialize-suspended-cast-queues (-> Void))
186185
(define (initialize-suspended-cast-queues)
@@ -650,10 +649,6 @@
650649
(display ",")
651650
(emit-value hcode)
652651
(display ")")]
653-
[('Types-gen-index! (list))
654-
(display "types_unique_index_counter++")]
655-
[('get-types-hashcons-index (list))
656-
(display "types_unique_index_counter")]
657652
[('mref-cast-queue-enqueue (list addr ty))
658653
(display "cast_queue_enqueue(mref_cast_q,")
659654
(emit-value addr)

src/backend-c/runtime/runtime.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include "suspended_cast.h"
2323

2424
extern table types_ht;
25-
extern int64_t types_unique_index_counter;
2625
extern cast_queue* mref_cast_q;
2726
extern cast_queue* mvect_cast_q;
2827

src/casts/constants-and-codes.rkt

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@
4444
(TYPE-FLOAT-RT-VALUE #b100111)
4545
(TYPE-CHAR-RT-VALUE #b101111)
4646
(TYPE-MAX-ATOMIC-RT-VALUE #b111111)
47-
(TYPE-HASHCONS-INDEX-INDEX 0)
48-
(TYPE-HASHCONS-HASHCODE-INDEX 1)
47+
(TYPE-HASHCONS-HASHCODE-INDEX 0)
4948

5049
(HC-PRJ-TAG-MASK #b10)
5150
(HC-INJ-TAG-MASK #b01)
@@ -229,8 +228,6 @@
229228
(format-id stx "~a-~a?" namespace-string name-string))
230229
(define/with-syntax namespace-mask-def
231230
(format-id stx "~a-TAG-MASK" namespace-string-caps))
232-
(define/with-syntax index-def
233-
(format-id stx "~a-INDEX-INDEX" qualified-upcase-name))
234231
(define/with-syntax hash-def
235232
(format-id stx "~a-HASH-INDEX" qualified-upcase-name))
236233
(define/with-syntax tag-def (format-id stx "~a-TAG" qualified-upcase-name))
@@ -259,8 +256,7 @@
259256
[else
260257
#`(sr-alloc
261258
#,name-string tag-def
262-
`(("index" . ,(Quote 0))
263-
("hashcode" . ,(Quote 0))
259+
`(("hashcode" . ,(Quote 0))
264260
(field* . ,alloc-val*) ...))]))))
265261
(define/with-syntax equal-arg (generate-temporary))
266262
(define (gen-func-access*)
@@ -309,8 +305,7 @@
309305
#`(begin
310306
(define-constants
311307
(tag-def tag)
312-
(index-def 0)
313-
(hash-def 1)
308+
(hash-def 0)
314309
(sindex/offset-def* sindex/offset-val*) ...)
315310
func-alloc
316311
(define (func-huh-name equal-arg)
@@ -401,11 +396,7 @@
401396
;; one for the index in the hashconsing table and one for the
402397
;; hashcode.
403398
(when$ (op$ = ty hty)
404-
(assign$ index (op$ get-types-hashcons-index))
405-
(assign$ _unused (op$ Types-gen-index!))
406399
(assign$ tag (sr-get-tag ty TYPE-TAG-MASK))
407-
(sr-tagged-array-set!
408-
hty tag TYPE-HASHCONS-INDEX-INDEX index)
409400
(sr-tagged-array-set!
410401
hty tag TYPE-HASHCONS-HASHCODE-INDEX hcode))
411402
hty)])))

0 commit comments

Comments
 (0)