diff --git a/doc/benchmark_results2.org b/doc/benchmark_results2.org index ff30368..0f26778 100644 --- a/doc/benchmark_results2.org +++ b/doc/benchmark_results2.org @@ -18,14 +18,14 @@ | triangl | .8 | 1.184 | -48. | *WIN* | | x | | destruc | 1.08 | 1.28 | -18.518519 | *WIN* | | x | | gcbench | .59 | .556 | 5.7627119 | | letrec define opt | | -| puzzle | 1.7 | 1.55 | 8.8235294 | | loop opt | x | +| puzzle | 1.32 | 1.55 | -13.970588 | *WIN* | loop opt | x | | paraffins | 3.24 | 4.270 | -31.790123 | *WIN* | | x | | maze | .437 | .845 | -93.363844 | *WIN* | | x | | mazefun | 1.79 | 1.731 | 3.2960894 | | | x | | lattice | 2.7 | 2.7 | 0. | *WIN* | closure sinking, sccp | x | | browse | .92 | .987 | -7.2826087 | *WIN* | | | -| graphs | 1.9 | 1.3 | 31.578947 | | LOOP, closure analysis , closure sinking | nested | -| conform | 1.97 | 1.422 | 27.817259 | | | | +| graphs | 1.75 | 1.3 | 26.966292 | | LOOP, closure analysis , closure sinking | nested | +| conform | 1.89 | 1.422 | 24.761905 | | | | | sboyer | .87 | .731 | 15.977011 | | ?? typecheck | | | nboyer | 1.42 | 1.483 | -4.4366197 | *WIN* | ?? | | | array1 | 2.0 | 4.5 | -125. | *WIN* | | x | @@ -42,6 +42,6 @@ | compiler | 2.19 | 2.004 | 8.4931507 | | loop catching | | | matrix | 1.2 | .899 | 25.083333 | | loop catching?? opt_loop | | | dynamic | 1.88 | 1.447 | 23.031915 | | read | | -| TOTAL | 73.074 | 76.9779 | -5.3423926 | *WIN* | | | +| TOTAL | 72.534 | 76.9779 | -6.1266441 | *WIN* | | | |-----------+--------+---------+-------------+-------+-------------------------------------------------+------------| #+TBLFM: $4=($2-$3) * 100.0 /$2::$5='(if (not (= $2 0)) (if (>= $3 $2) '*WIN* "") "BAD");N::@>$2=vsum(@2..@-1)::@>$3=vsum(@2..@-1) diff --git a/docs/index.html b/docs/index.html index ac5a601..f38ad0b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -158,9 +158,9 @@

Benchmarks

arrayLabel = ['Chez', 'Loko', 'Gambit', 'Hawk']; makechart('destruc', [1.2800000000002, 1.1779999732971191, 1.529525, 1.08]); //makechart('pnpoly', [3.2399999999997817, 3.7260000705718994, 2.29479, 6.8]); - makechart('conform', [1.3599999999996726, 1.2949999570846558, 2.161752, 1.96]); + makechart('conform', [1.3599999999996726, 1.2949999570846558, 2.161752, 1.89]); //makechart('fibfp', [2.199999999999818, 2.046999931335449, 0.89905, 3.784]); - makechart('puzzle', [1.6299999999996544, 1.5299999713897705, 2.193014, 1.68]); + makechart('puzzle', [1.6299999999996544, 1.5299999713897705, 2.193014, 1.32]); //makechart('fft', [0.0, 0.9300000071525574, 0.869155, 2.21]); makechart('dynamic', [1.3899999999998727, 2.3949999809265137, 3.172476, 1.88]); //makechart('ctak', [0.41000000000030923, 16.945999145507812, 1.854662, 3.29]); @@ -208,7 +208,7 @@

Benchmarks

makechart('diviter', [0.9800000000000182, 1.1749999523162842, 1.108788, 1.00]); makechart('equal', [0.3900000000003274, 1.5759999752044678, 0.234992, 0.2]); makechart('divrec', [1.6200000000, 1.9700000286102295, 1.559836, 1.59]); - makechart('graphs', [1.3099999999999454, 1.7000000476837158, 5.411687, 1.89]); + makechart('graphs', [1.3099999999999454, 1.7000000476837158, 5.411687, 1.75]); makechart('mperm', [6.8400000000001455, 4.39300012588501, 4.34869, 5.05]); makechart('mazefun', [1.5799999999999272, 1.6059999465942383, 2.093023, 1.76]); makechart('array1', [4.5900000000001455, 1.4989999532699585, 2.981551, 2.00]); diff --git a/lib/bc.scm b/lib/bc.scm index fe26ee9..95b2978 100644 --- a/lib/bc.scm +++ b/lib/bc.scm @@ -703,7 +703,6 @@ (write-u64 (string-length c) p) (for-each (lambda (c) (write-u8 (char->integer c) p)) (string->list c))) ((vector? c) - (write-u64 ptr-tag p) (write-u64 vector-tag p) (write-u64 (vector-length c) p) (do ((i 0 (+ i 1))) diff --git a/lib/bootstrap.scm b/lib/bootstrap.scm index ec3dc77..9616a49 100644 --- a/lib/bootstrap.scm +++ b/lib/bootstrap.scm @@ -24,7 +24,7 @@ (define (pair? x) ($guard x 3)) (define (procedure? x) ($guard x 5)) (define (symbol? x) ($guard x 6)) -(define (vector? x) ($guard x #x11)) +(define (vector? x) ($guard x 7)) (define (string? x) ($guard x 9)) (define (port? x) ($guard x #x19)) (define complex? number?) diff --git a/lib/memory_layout.scm b/lib/memory_layout.scm index 1191aab..0b8cb2c 100644 --- a/lib/memory_layout.scm +++ b/lib/memory_layout.scm @@ -11,12 +11,11 @@ (define literal-tag #b100) (define closure-tag #b101) (define symbol-tag #b110) -(define forward-tag #b111) +(define vector-tag #b111) ;; ptr-tagged objects ;; Bottom bits must be '001' ;; First 8 bytes are always the tag. (define string-tag #b001001) -(define vector-tag #b010001) (define port-tag #b011001) (define box-tag #b100001) (define cont-tag #b101001) diff --git a/src/asm_x64.c b/src/asm_x64.c index cb3b61e..e4eac06 100644 --- a/src/asm_x64.c +++ b/src/asm_x64.c @@ -690,6 +690,13 @@ static void emit_init_funcs() { void emit_vref(uint8_t reg, uint8_t opcode, trace_s* trace, ir_ins* op, int *slot, uint32_t *next_spill) { // TODO: fuse. + uint8_t type; + if (ir_is_const(op->op1)) { + type = get_object_ir_type(trace->consts[op->op1 - IR_CONST_BIAS]); + } else { + type = trace->ops[op->op1].type; + } + type &= TAG_MASK; maybe_assign_register(op->op1, trace, slot, next_spill); maybe_assign_register(op->op2, trace, slot, next_spill); assert(reg != REG_NONE); @@ -699,14 +706,14 @@ void emit_vref(uint8_t reg, uint8_t opcode, trace_s* trace, ir_ins* op, int *slo // TODO could be a special reloc type and one mov. auto c2 = trace->consts[op->op2 - IR_CONST_BIAS]; - emit_mem_reg(opcode, 16 - PTR_TAG + c2, R15, reg); + emit_mem_reg(opcode, 16 - type + c2, R15, reg); auto c1 = trace->consts[op->op1 - IR_CONST_BIAS]; auto re = (reloc){emit_offset(), c1, RELOC_ABS}; arrput(trace->relocs, re); emit_mov64(R15, c1); } else { - emit_mem_reg_sib(opcode, 16 - PTR_TAG, 0, trace->ops[op->op2].reg, + emit_mem_reg_sib(opcode, 16 - type, 0, trace->ops[op->op2].reg, R15, reg); auto c1 = trace->consts[op->op1 - IR_CONST_BIAS]; @@ -718,10 +725,10 @@ void emit_vref(uint8_t reg, uint8_t opcode, trace_s* trace, ir_ins* op, int *slo if (ir_is_const(op->op2)) { // Must be fixnum auto c = trace->consts[op->op2 - IR_CONST_BIAS]; - emit_mem_reg(opcode, 16 - PTR_TAG + c, trace->ops[op->op1].reg, + emit_mem_reg(opcode, 16 - type + c, trace->ops[op->op1].reg, reg); } else { - emit_mem_reg_sib(opcode, 16 - PTR_TAG, 0, trace->ops[op->op2].reg, + emit_mem_reg_sib(opcode, 16 - type, 0, trace->ops[op->op2].reg, trace->ops[op->op1].reg, reg); } } @@ -1036,15 +1043,16 @@ void asm_jit(trace_s *trace, snap_s *side_exit, trace_s *parent) { break; } case IR_ABC: { + auto type = op->type & TAG_MASK; maybe_assign_register(op->op1, trace, slot, &next_spill); maybe_assign_register(op->op2, trace, slot, &next_spill); emit_jcc32(JL, snap_labels[cur_snap]); emit_arith_op(OP_ARITH_CMP, OP_CMP, R15, op->op2, trace, slot); if (!ir_is_const(op->op1)) { - emit_mem_reg(OP_MOV_MR, 8 - PTR_TAG, trace->ops[op->op1].reg, R15); + emit_mem_reg(OP_MOV_MR, 8 - type, trace->ops[op->op1].reg, R15); } else { vector_s *v = - (vector_s *)(trace->consts[op->op1 - IR_CONST_BIAS] - PTR_TAG); + (vector_s *)(trace->consts[op->op1 - IR_CONST_BIAS] - type); emit_mov64(R15, v->len); } break; diff --git a/src/gc.c b/src/gc.c index 25a4aec..39d0f18 100644 --- a/src/gc.c +++ b/src/gc.c @@ -131,6 +131,7 @@ static void put_gc_block(gc_block *mem) { bool is_ptr_type(long obj) { auto type = obj & TAG_MASK; if (type == PTR_TAG || type == FLONUM_TAG || type == CONS_TAG || + type == VECTOR_TAG || type == CLOSURE_TAG || type == SYMBOL_TAG) { return true; } @@ -674,6 +675,7 @@ static void scan_log_buf(void (*add_increment)(long *)) { auto v = *field; auto type = v & TAG_MASK; if (type == PTR_TAG || type == FLONUM_TAG || type == CONS_TAG || + type == VECTOR_TAG || type == CLOSURE_TAG || type == SYMBOL_TAG) { // printf("Add log increments: %p\n", *field); add_increment(field); @@ -681,6 +683,7 @@ static void scan_log_buf(void (*add_increment)(long *)) { v = cur.addr; type = v & TAG_MASK; if (type == PTR_TAG || type == FLONUM_TAG || type == CONS_TAG || + type == VECTOR_TAG || type == CLOSURE_TAG || type == SYMBOL_TAG) { // printf("Add log decrements: %p\n", v); arrput(cur_decrements, v); diff --git a/src/readbc.c b/src/readbc.c index d4d1002..3cb62d8 100644 --- a/src/readbc.c +++ b/src/readbc.c @@ -121,33 +121,33 @@ long read_const(FILE *fptr) { } str->str[len] = '\0'; val = (long)str | PTR_TAG; - } else if (ptrtype == VECTOR_TAG) { - long len; - if (fread(&len, 1, 8, fptr) != 8) { - goto error; - } - - long *vals = malloc(sizeof(long) * len); - assert(vals); - for (long i = 0; i < len; i++) { - vals[i] = read_const(fptr); - GC_push_root(&vals[i]); - } - - auto v = (vector_s *)GC_malloc(16 + len * sizeof(long)); - v->type = ptrtype; - v->len = len << 3; - v->rc = 0; - for (long i = len - 1; i >= 0; i--) { - v->v[i] = vals[i]; - GC_pop_root(&vals[i]); - } - free(vals); - val = (long)v | PTR_TAG; } else { printf("Unknown boxed type:%lx\\n", ptrtype); exit(-1); } + } else if (type == VECTOR_TAG) { + long len; + if (fread(&len, 1, 8, fptr) != 8) { + goto error; + } + + long *vals = malloc(sizeof(long) * len); + assert(vals); + for (long i = 0; i < len; i++) { + vals[i] = read_const(fptr); + GC_push_root(&vals[i]); + } + + auto v = (vector_s *)GC_malloc(16 + len * sizeof(long)); + v->type = VECTOR_TAG; + v->len = len << 3; + v->rc = 0; + for (long i = len - 1; i >= 0; i--) { + v->v[i] = vals[i]; + GC_pop_root(&vals[i]); + } + free(vals); + val = (long)v | VECTOR_TAG; } else if (type == CLOSURE_TAG) { long bcfunc_num; if (fread(&bcfunc_num, 1, 8, fptr) != 8) { diff --git a/src/record.c b/src/record.c index d177ea4..2cf9d7c 100644 --- a/src/record.c +++ b/src/record.c @@ -1332,8 +1332,8 @@ int record_instr(unsigned int *pc, long *frame, long argcnt) { auto idx = record_stack_load(INS_B(i), frame); auto obj = record_stack_load(INS_C(i), frame); - push_ir(trace, IR_GCLOG, vec, IR_NONE, VECTOR_TAG); - push_ir(trace, IR_ABC, vec, idx, IR_INS_TYPE_GUARD); + push_ir(trace, IR_GCLOG, vec, IR_NONE, UNDEFINED_TAG); + push_ir(trace, IR_ABC, vec, idx, IR_INS_TYPE_GUARD | VECTOR_TAG); auto vref = push_ir(trace, IR_VREF, vec, idx, 0); push_ir(trace, IR_STORE, vref, obj, 0); @@ -1347,11 +1347,11 @@ int record_instr(unsigned int *pc, long *frame, long argcnt) { auto vec = record_stack_load(INS_B(i), frame); auto idx = record_stack_load(INS_C(i), frame); - push_ir(trace, IR_ABC, vec, idx, IR_INS_TYPE_GUARD); + push_ir(trace, IR_ABC, vec, idx, IR_INS_TYPE_GUARD | VECTOR_TAG); auto vref = push_ir(trace, IR_VREF, vec, idx, 0); uint64_t pos = frame[INS_C(i)] >> 3; - vector_s *vec_d = (vector_s *)(frame[INS_B(i)] - PTR_TAG); + vector_s *vec_d = (vector_s *)(frame[INS_B(i)] - VECTOR_TAG); uint8_t type = get_object_ir_type(vec_d->v[pos]); regs[INS_A(i)] = push_ir(trace, IR_LOAD, vref, 0, IR_INS_TYPE_GUARD | type); stack_top = INS_A(i) + 1; @@ -1362,7 +1362,7 @@ int record_instr(unsigned int *pc, long *frame, long argcnt) { auto str = record_stack_load(INS_B(i), frame); auto idx = record_stack_load(INS_C(i), frame); - push_ir(trace, IR_ABC, str, idx, IR_INS_TYPE_GUARD); + push_ir(trace, IR_ABC, str, idx, IR_INS_TYPE_GUARD | STRING_TAG); regs[INS_A(i)] = push_ir(trace, IR_STRLD, str, idx, CHAR_TAG); stack_top = INS_A(i) + 1; @@ -1373,7 +1373,7 @@ int record_instr(unsigned int *pc, long *frame, long argcnt) { auto idx = record_stack_load(INS_B(i), frame); auto val = record_stack_load(INS_C(i), frame); - push_ir(trace, IR_ABC, str, idx, IR_INS_TYPE_GUARD); + push_ir(trace, IR_ABC, str, idx, IR_INS_TYPE_GUARD | STRING_TAG); auto ref = push_ir(trace, IR_STRREF, str, idx, 0); push_ir(trace, IR_STRST, ref, val, 0); stack_top = INS_A(i) + 1; @@ -1507,9 +1507,9 @@ int record_instr(unsigned int *pc, long *frame, long argcnt) { auto alloc_sz_aligned = push_ir(trace, IR_MUL, alloc_sz, knum | IR_CONST_BIAS, FIXNUM_TAG); // TODO snaps?? - auto cell = push_ir(trace, IR_ALLOC, alloc_sz_aligned, PTR_TAG, VECTOR_TAG); + auto cell = push_ir(trace, IR_ALLOC, alloc_sz_aligned, VECTOR_TAG, VECTOR_TAG); - auto ref = push_ir(trace, IR_REF, cell, 8 - PTR_TAG, UNDEFINED_TAG); + auto ref = push_ir(trace, IR_REF, cell, 8 - VECTOR_TAG, UNDEFINED_TAG); push_ir(trace, IR_STORE, ref, sz, UNDEFINED_TAG); regs[INS_A(i)] = cell; @@ -1540,14 +1540,14 @@ int record_instr(unsigned int *pc, long *frame, long argcnt) { auto knum = arrlen(trace->consts); arrput(trace->consts, (sizeof(vector_s) + 8 * len) << 3); auto cell = - push_ir(trace, IR_ALLOC, knum | IR_CONST_BIAS, PTR_TAG, VECTOR_TAG); + push_ir(trace, IR_ALLOC, knum | IR_CONST_BIAS, VECTOR_TAG, VECTOR_TAG); regs[reg] = cell; - auto ref = push_ir(trace, IR_REF, cell, 8 - PTR_TAG, UNDEFINED_TAG); + auto ref = push_ir(trace, IR_REF, cell, 8 - VECTOR_TAG, UNDEFINED_TAG); knum = arrlen(trace->consts); arrput(trace->consts, (long)(len << 3)); push_ir(trace, IR_STORE, ref, knum | IR_CONST_BIAS, UNDEFINED_TAG); for (uint32_t cnt = 0; cnt < len; cnt++) { - ref = push_ir(trace, IR_REF, cell, 16 + cnt * 8 - PTR_TAG, UNDEFINED_TAG); + ref = push_ir(trace, IR_REF, cell, 16 + cnt * 8 - VECTOR_TAG, UNDEFINED_TAG); push_ir(trace, IR_STORE, ref, loaded[cnt], UNDEFINED_TAG); } stack_top = INS_A(i) + 1; @@ -1830,14 +1830,20 @@ int record_instr(unsigned int *pc, long *frame, long argcnt) { stack_top = INS_A(i) + 1; break; } - case STRING_LENGTH: - case VECTOR_LENGTH: { + case STRING_LENGTH: { auto vec = record_stack_load(INS_B(i), frame); auto ref = push_ir(trace, IR_REF, vec, 8 - PTR_TAG, UNDEFINED_TAG); regs[INS_A(i)] = push_ir(trace, IR_LOAD, ref, 0, FIXNUM_TAG); stack_top = INS_A(i) + 1; break; } + case VECTOR_LENGTH: { + auto vec = record_stack_load(INS_B(i), frame); + auto ref = push_ir(trace, IR_REF, vec, 8 - VECTOR_TAG, UNDEFINED_TAG); + regs[INS_A(i)] = push_ir(trace, IR_LOAD, ref, 0, FIXNUM_TAG); + stack_top = INS_A(i) + 1; + break; + } case CLOSURE_GET: { auto clo = record_stack_load(INS_B(i), frame); auto ref = push_ir(trace, IR_REF, clo, diff --git a/src/trace_dump.c b/src/trace_dump.c index 2de203a..5ade0c7 100644 --- a/src/trace_dump.c +++ b/src/trace_dump.c @@ -37,15 +37,15 @@ void print_const_or_val(int i, trace_s *ctrace) { printf("eof"); } else if ((c & IMMEDIATE_MASK) == NIL_TAG) { printf("nil"); + } else if (type == VECTOR_TAG) { + printf("vector"); } else if (type == SYMBOL_TAG) { string_s *sym_name = (string_s *)(((symbol *)(c - SYMBOL_TAG))->name - PTR_TAG); printf("\e[1;35m%s\e[m", sym_name->str); } else if (type == PTR_TAG) { auto type2 = ((long *)(c - PTR_TAG))[0] & 0xff; - if (type2 == VECTOR_TAG) { - printf("vector"); - } else if (type2 == STRING_TAG) { + if (type2 == STRING_TAG) { printf("str"); } else if (type2 == PORT_TAG) { printf("port"); diff --git a/src/types.c b/src/types.c index 3c79e42..e11903a 100644 --- a/src/types.c +++ b/src/types.c @@ -60,25 +60,6 @@ static ep_result equalp_interleave(uf *ht, bool fast, long a, long b, long k) { if (ta != tb) { return (ep_result){false, k}; } - if (ta == VECTOR_TAG) { - vector_s *va = (vector_s *)(a - PTR_TAG); - vector_s *vb = (vector_s *)(b - PTR_TAG); - if (va->len != vb->len) { - return (ep_result){false, k}; - } - if (!fast && unionfind(ht, a, b)) { - return (ep_result){true, 0}; - } - // Decrement K once for the vector, but return same K value - uint64_t lim = va->len >> 3; - for (uint64_t i = 0; i < lim; i++) { - auto res = ep(ht, fast, va->v[i], vb->v[i], k - 1); - if (true != res.v) { - return res; - } - } - return (ep_result){true, k}; - } if (ta == STRING_TAG) { string_s *sa = (string_s *)(a - PTR_TAG); string_s *sb = (string_s *)(b - PTR_TAG); @@ -91,6 +72,27 @@ static ep_result equalp_interleave(uf *ht, bool fast, long a, long b, long k) { return (ep_result){false, k}; } } + if ((a&TAG_MASK) == VECTOR_TAG) { + if ((b&TAG_MASK) == VECTOR_TAG) { + vector_s *va = (vector_s *)(a - VECTOR_TAG); + vector_s *vb = (vector_s *)(b - VECTOR_TAG); + if (va->len != vb->len) { + return (ep_result){false, k}; + } + if (!fast && unionfind(ht, a, b)) { + return (ep_result){true, 0}; + } + // Decrement K once for the vector, but return same K value + uint64_t lim = va->len >> 3; + for (uint64_t i = 0; i < lim; i++) { + auto res = ep(ht, fast, va->v[i], vb->v[i], k - 1); + if (true != res.v) { + return res; + } + } + return (ep_result){true, k}; + } + } // eqp? if ((a & TAG_MASK) == FLONUM_TAG) { if ((b & TAG_MASK) != FLONUM_TAG) { @@ -154,21 +156,23 @@ void print_obj(long obj, FILE *file) { fputs(str->str, file); } else if (ptrtype == PORT_TAG) { fputs("#", file); - } else if (ptrtype == VECTOR_TAG) { - auto v = (vector_s *)(obj - PTR_TAG); - fputs("#(", file); - for (long i = 0; i < (v->len >> 3); i++) { - if (i != 0) { - fputc(' ', file); - } - print_obj(v->v[i], file); - } - fputc(')', file); } else { fprintf(file, "PTR:%lx", ptrtype); } break; } + case VECTOR_TAG: { + auto v = (vector_s *)(obj - VECTOR_TAG); + fputs("#(", file); + for (long i = 0; i < (v->len >> 3); i++) { + if (i != 0) { + fputc(' ', file); + } + print_obj(v->v[i], file); + } + fputc(')', file); + break; + } case FLONUM_TAG: { auto f = (flonum_s *)(obj - FLONUM_TAG); char buffer[40]; diff --git a/src/types.h b/src/types.h index b0ddb76..9e21851 100644 --- a/src/types.h +++ b/src/types.h @@ -18,6 +18,7 @@ #define LITERAL_TAG 0x4 #define CLOSURE_TAG 0x5 #define SYMBOL_TAG 0x6 +#define VECTOR_TAG 0x7 #define TAG_MASK 0x7 @@ -25,7 +26,6 @@ // Bottom three bits are '001' so it is also recognized as a PTR using the same // tag. #define STRING_TAG 0x9 -#define VECTOR_TAG 0x11 #define PORT_TAG 0x19 #define BOX_TAG 0x21 #define CONT_TAG 0x29 diff --git a/src/vm.c b/src/vm.c index 01ee5dc..a160a3d 100644 --- a/src/vm.c +++ b/src/vm.c @@ -766,7 +766,7 @@ LIBRARY_FUNC_B(VECTOR) for (int i = 0; i < rb; i++) { closure->v[i] = frame[ra + i]; } - frame[ra] = (long)closure | PTR_TAG; + frame[ra] = (long)closure | VECTOR_TAG; END_LIBRARY_FUNC LIBRARY_FUNC_B(CLOSURE) @@ -1087,7 +1087,7 @@ LIBRARY_FUNC_BC_NAME(MAKE-VECTOR, MAKE_VECTOR) vec->v[i] = fc; } - frame[ra] = (long)vec | PTR_TAG; + frame[ra] = (long)vec | VECTOR_TAG; END_LIBRARY_FUNC void vm_make_string(long str, long ch) { @@ -1126,7 +1126,8 @@ END_LIBRARY_FUNC LIBRARY_FUNC_BC_LOAD_NAME(VECTOR-REF, VECTOR_REF) TYPECHECK_FIXNUM(fc); - LOAD_TYPE_WITH_CHECK(vec, vector_s, fb, VECTOR_TAG); + TYPECHECK_TAG(fb, VECTOR_TAG); + auto vec = (vector_s*)(fb - VECTOR_TAG); long pos = fc >> 3; if ((long)(vec->len >> 3) - pos < 0) { MUSTTAIL return FAIL_SLOWPATH(ARGS); @@ -1145,7 +1146,8 @@ LIBRARY_FUNC_BC_LOAD_NAME(STRING-REF, STRING_REF) END_LIBRARY_FUNC LIBRARY_FUNC_B_LOAD_NAME(VECTOR-LENGTH, VECTOR_LENGTH) - LOAD_TYPE_WITH_CHECK(vec, vector_s, fb, VECTOR_TAG); + TYPECHECK_TAG(fb, VECTOR_TAG); + auto vec = (vector_s*)(fb - VECTOR_TAG); frame[ra] = (long)(vec->len); END_LIBRARY_FUNC @@ -1157,7 +1159,8 @@ END_LIBRARY_FUNC LIBRARY_FUNC_BC_LOAD_NAME(VECTOR-SET!, VECTOR_SET) auto fa = frame[ra]; TYPECHECK_FIXNUM(fb); - LOAD_TYPE_WITH_CHECK(vec, vector_s, fa, VECTOR_TAG); + TYPECHECK_TAG(fa, VECTOR_TAG); + auto vec = (vector_s*)(fa - VECTOR_TAG); long pos = fb >> 3; if ((long)(vec->len >> 3) - pos <= 0) { MUSTTAIL return FAIL_SLOWPATH(ARGS);