diff options
Diffstat (limited to 'src/lj_crecord.c')
-rw-r--r-- | src/lj_crecord.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/lj_crecord.c b/src/lj_crecord.c index d46a239c..18e1ee13 100644 --- a/src/lj_crecord.c +++ b/src/lj_crecord.c | |||
@@ -50,8 +50,8 @@ static GCcdata *argv2cdata(jit_State *J, TRef tr, cTValue *o) | |||
50 | lj_trace_err(J, LJ_TRERR_BADTYPE); | 50 | lj_trace_err(J, LJ_TRERR_BADTYPE); |
51 | cd = cdataV(o); | 51 | cd = cdataV(o); |
52 | /* Specialize to the CTypeID. */ | 52 | /* Specialize to the CTypeID. */ |
53 | trtypeid = emitir(IRT(IR_FLOAD, IRT_U16), tr, IRFL_CDATA_TYPEID); | 53 | trtypeid = emitir(IRT(IR_FLOAD, IRT_U16), tr, IRFL_CDATA_CTYPEID); |
54 | emitir(IRTG(IR_EQ, IRT_INT), trtypeid, lj_ir_kint(J, (int32_t)cd->typeid)); | 54 | emitir(IRTG(IR_EQ, IRT_INT), trtypeid, lj_ir_kint(J, (int32_t)cd->ctypeid)); |
55 | return cd; | 55 | return cd; |
56 | } | 56 | } |
57 | 57 | ||
@@ -59,7 +59,7 @@ static GCcdata *argv2cdata(jit_State *J, TRef tr, cTValue *o) | |||
59 | static CTypeID crec_constructor(jit_State *J, GCcdata *cd, TRef tr) | 59 | static CTypeID crec_constructor(jit_State *J, GCcdata *cd, TRef tr) |
60 | { | 60 | { |
61 | CTypeID id; | 61 | CTypeID id; |
62 | lua_assert(tref_iscdata(tr) && cd->typeid == CTID_CTYPEID); | 62 | lua_assert(tref_iscdata(tr) && cd->ctypeid == CTID_CTYPEID); |
63 | id = *(CTypeID *)cdataptr(cd); | 63 | id = *(CTypeID *)cdataptr(cd); |
64 | tr = emitir(IRT(IR_ADD, IRT_PTR), tr, lj_ir_kintp(J, sizeof(GCcdata))); | 64 | tr = emitir(IRT(IR_ADD, IRT_PTR), tr, lj_ir_kintp(J, sizeof(GCcdata))); |
65 | tr = emitir(IRT(IR_XLOAD, IRT_INT), tr, 0); | 65 | tr = emitir(IRT(IR_XLOAD, IRT_INT), tr, 0); |
@@ -87,8 +87,8 @@ static CTypeID argv2ctype(jit_State *J, TRef tr, cTValue *o) | |||
87 | return cp.val.id; | 87 | return cp.val.id; |
88 | } else { | 88 | } else { |
89 | GCcdata *cd = argv2cdata(J, tr, o); | 89 | GCcdata *cd = argv2cdata(J, tr, o); |
90 | return cd->typeid == CTID_CTYPEID ? crec_constructor(J, cd, tr) : | 90 | return cd->ctypeid == CTID_CTYPEID ? crec_constructor(J, cd, tr) : |
91 | cd->typeid; | 91 | cd->ctypeid; |
92 | } | 92 | } |
93 | } | 93 | } |
94 | 94 | ||
@@ -415,7 +415,7 @@ static TRef crec_ct_tv(jit_State *J, CType *d, TRef dp, TRef sp, cTValue *sval) | |||
415 | } | 415 | } |
416 | } else { /* NYI: tref_istab(sp), tref_islightud(sp). */ | 416 | } else { /* NYI: tref_istab(sp), tref_islightud(sp). */ |
417 | IRType t; | 417 | IRType t; |
418 | sid = argv2cdata(J, sp, sval)->typeid; | 418 | sid = argv2cdata(J, sp, sval)->ctypeid; |
419 | s = ctype_raw(cts, sid); | 419 | s = ctype_raw(cts, sid); |
420 | svisnz = cdataptr(cdataV(sval)); | 420 | svisnz = cdataptr(cdataV(sval)); |
421 | if (ctype_isenum(s->info)) s = ctype_child(cts, s); | 421 | if (ctype_isenum(s->info)) s = ctype_child(cts, s); |
@@ -514,7 +514,7 @@ void LJ_FASTCALL recff_cdata_index(jit_State *J, RecordFFData *rd) | |||
514 | ptrdiff_t ofs = sizeof(GCcdata); | 514 | ptrdiff_t ofs = sizeof(GCcdata); |
515 | GCcdata *cd = argv2cdata(J, ptr, &rd->argv[0]); | 515 | GCcdata *cd = argv2cdata(J, ptr, &rd->argv[0]); |
516 | CTState *cts = ctype_ctsG(J2G(J)); | 516 | CTState *cts = ctype_ctsG(J2G(J)); |
517 | CType *ct = ctype_raw(cts, cd->typeid); | 517 | CType *ct = ctype_raw(cts, cd->ctypeid); |
518 | CTypeID sid = 0; | 518 | CTypeID sid = 0; |
519 | 519 | ||
520 | /* Resolve pointer or reference for cdata object. */ | 520 | /* Resolve pointer or reference for cdata object. */ |
@@ -553,7 +553,7 @@ again: | |||
553 | } | 553 | } |
554 | } else if (tref_iscdata(idx)) { | 554 | } else if (tref_iscdata(idx)) { |
555 | GCcdata *cdk = cdataV(&rd->argv[1]); | 555 | GCcdata *cdk = cdataV(&rd->argv[1]); |
556 | CType *ctk = ctype_raw(cts, cdk->typeid); | 556 | CType *ctk = ctype_raw(cts, cdk->ctypeid); |
557 | IRType t; | 557 | IRType t; |
558 | if (ctype_isenum(ctk->info)) ctk = ctype_child(cts, ctk); | 558 | if (ctype_isenum(ctk->info)) ctk = ctype_child(cts, ctk); |
559 | if (ctype_ispointer(ct->info) && | 559 | if (ctype_ispointer(ct->info) && |
@@ -577,7 +577,7 @@ again: | |||
577 | } | 577 | } |
578 | } else if (tref_isstr(idx)) { | 578 | } else if (tref_isstr(idx)) { |
579 | GCstr *name = strV(&rd->argv[1]); | 579 | GCstr *name = strV(&rd->argv[1]); |
580 | if (cd->typeid == CTID_CTYPEID) | 580 | if (cd->ctypeid == CTID_CTYPEID) |
581 | ct = ctype_raw(cts, crec_constructor(J, cd, ptr)); | 581 | ct = ctype_raw(cts, crec_constructor(J, cd, ptr)); |
582 | if (ctype_isstruct(ct->info)) { | 582 | if (ctype_isstruct(ct->info)) { |
583 | CTSize fofs; | 583 | CTSize fofs; |
@@ -879,7 +879,7 @@ static void crec_snap_caller(jit_State *J) | |||
879 | static int crec_call(jit_State *J, RecordFFData *rd, GCcdata *cd) | 879 | static int crec_call(jit_State *J, RecordFFData *rd, GCcdata *cd) |
880 | { | 880 | { |
881 | CTState *cts = ctype_ctsG(J2G(J)); | 881 | CTState *cts = ctype_ctsG(J2G(J)); |
882 | CType *ct = ctype_raw(cts, cd->typeid); | 882 | CType *ct = ctype_raw(cts, cd->ctypeid); |
883 | IRType tp = IRT_PTR; | 883 | IRType tp = IRT_PTR; |
884 | if (ctype_isptr(ct->info)) { | 884 | if (ctype_isptr(ct->info)) { |
885 | tp = (LJ_64 && ct->size == 8) ? IRT_P64 : IRT_P32; | 885 | tp = (LJ_64 && ct->size == 8) ? IRT_P64 : IRT_P32; |
@@ -946,7 +946,7 @@ void LJ_FASTCALL recff_cdata_call(jit_State *J, RecordFFData *rd) | |||
946 | { | 946 | { |
947 | CTState *cts = ctype_ctsG(J2G(J)); | 947 | CTState *cts = ctype_ctsG(J2G(J)); |
948 | GCcdata *cd = argv2cdata(J, J->base[0], &rd->argv[0]); | 948 | GCcdata *cd = argv2cdata(J, J->base[0], &rd->argv[0]); |
949 | CTypeID id = cd->typeid; | 949 | CTypeID id = cd->ctypeid; |
950 | CType *ct; | 950 | CType *ct; |
951 | cTValue *tv; | 951 | cTValue *tv; |
952 | MMS mm = MM_call; | 952 | MMS mm = MM_call; |
@@ -1084,10 +1084,10 @@ static void crec_arith_meta(jit_State *J, CTState *cts, RecordFFData *rd) | |||
1084 | cTValue *tv = NULL; | 1084 | cTValue *tv = NULL; |
1085 | if (J->base[0]) { | 1085 | if (J->base[0]) { |
1086 | if (tviscdata(&rd->argv[0])) | 1086 | if (tviscdata(&rd->argv[0])) |
1087 | tv = lj_ctype_meta(cts, argv2cdata(J, J->base[0], &rd->argv[0])->typeid, | 1087 | tv = lj_ctype_meta(cts, argv2cdata(J, J->base[0], &rd->argv[0])->ctypeid, |
1088 | (MMS)rd->data); | 1088 | (MMS)rd->data); |
1089 | if (!tv && J->base[1] && tviscdata(&rd->argv[1])) | 1089 | if (!tv && J->base[1] && tviscdata(&rd->argv[1])) |
1090 | tv = lj_ctype_meta(cts, argv2cdata(J, J->base[1], &rd->argv[1])->typeid, | 1090 | tv = lj_ctype_meta(cts, argv2cdata(J, J->base[1], &rd->argv[1])->ctypeid, |
1091 | (MMS)rd->data); | 1091 | (MMS)rd->data); |
1092 | } | 1092 | } |
1093 | if (tv) { | 1093 | if (tv) { |
@@ -1115,7 +1115,7 @@ void LJ_FASTCALL recff_cdata_arith(jit_State *J, RecordFFData *rd) | |||
1115 | if (!tr) { | 1115 | if (!tr) { |
1116 | goto trymeta; | 1116 | goto trymeta; |
1117 | } else if (tref_iscdata(tr)) { | 1117 | } else if (tref_iscdata(tr)) { |
1118 | CTypeID id = argv2cdata(J, tr, &rd->argv[i])->typeid; | 1118 | CTypeID id = argv2cdata(J, tr, &rd->argv[i])->ctypeid; |
1119 | ct = ctype_raw(cts, id); | 1119 | ct = ctype_raw(cts, id); |
1120 | if (ctype_isptr(ct->info)) { /* Resolve pointer or reference. */ | 1120 | if (ctype_isptr(ct->info)) { /* Resolve pointer or reference. */ |
1121 | IRType t = (LJ_64 && ct->size == 8) ? IRT_P64 : IRT_P32; | 1121 | IRType t = (LJ_64 && ct->size == 8) ? IRT_P64 : IRT_P32; |
@@ -1323,7 +1323,7 @@ void LJ_FASTCALL recff_ffi_abi(jit_State *J, RecordFFData *rd) | |||
1323 | void LJ_FASTCALL lj_crecord_tonumber(jit_State *J, RecordFFData *rd) | 1323 | void LJ_FASTCALL lj_crecord_tonumber(jit_State *J, RecordFFData *rd) |
1324 | { | 1324 | { |
1325 | CTState *cts = ctype_ctsG(J2G(J)); | 1325 | CTState *cts = ctype_ctsG(J2G(J)); |
1326 | CType *d, *ct = lj_ctype_rawref(cts, cdataV(&rd->argv[0])->typeid); | 1326 | CType *d, *ct = lj_ctype_rawref(cts, cdataV(&rd->argv[0])->ctypeid); |
1327 | if (ctype_isenum(ct->info)) ct = ctype_child(cts, ct); | 1327 | if (ctype_isenum(ct->info)) ct = ctype_child(cts, ct); |
1328 | if (ctype_isnum(ct->info) || ctype_iscomplex(ct->info)) { | 1328 | if (ctype_isnum(ct->info) || ctype_iscomplex(ct->info)) { |
1329 | if (ctype_isinteger_or_bool(ct->info) && ct->size <= 4 && | 1329 | if (ctype_isinteger_or_bool(ct->info) && ct->size <= 4 && |