better inlining split
This commit is contained in:
parent
8c22564b41
commit
671efcc948
27
src/ffi.c
27
src/ffi.c
@ -855,7 +855,7 @@ static B readStruct(BQNFFIType* t, u8* ptr) {
|
|||||||
return HARR_FV(r);
|
return HARR_FV(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
static B readSimple(u8 resCType, u8* ptr) {
|
static NOINLINE B readSimple(u8 resCType, u8* ptr) {
|
||||||
switch(resCType) { default: UD; // thrM("FFI: Unimplemented type");
|
switch(resCType) { default: UD; // thrM("FFI: Unimplemented type");
|
||||||
case sty_void:return m_c32(0);
|
case sty_void:return m_c32(0);
|
||||||
case sty_a: return getB(*(BQNV*)ptr);
|
case sty_a: return getB(*(BQNV*)ptr);
|
||||||
@ -884,23 +884,22 @@ static B readRe(BQNFFIType* t, u8* src) {
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
static B readAny(B o, u8* ptr) { // doesn't consume
|
static NOINLINE B readComplex(B o, u8* ptr) { // doesn't consume
|
||||||
if (isC32(o)) {
|
BQNFFIType* t = c(BQNFFIType, o);
|
||||||
return readSimple(styG(o), ptr);
|
if (t->ty == cty_repr) { // cty_repr, scalar:x
|
||||||
} else {
|
return readRe(t, ptr);
|
||||||
BQNFFIType* t = c(BQNFFIType, o);
|
} else if (t->ty==cty_struct || t->ty==cty_starr) { // {...}, [n]...
|
||||||
if (t->ty == cty_repr) { // cty_repr, scalar:x
|
return readStruct(t, ptr);
|
||||||
return readRe(t, ptr);
|
} else if (t->ty==cty_ptr) { // *...
|
||||||
} else if (t->ty==cty_struct || t->ty==cty_starr) { // {...}, [n]...
|
return m_ptrobj_s(*(void**)ptr, inc(t->a[0].o));
|
||||||
return readStruct(c(BQNFFIType, o), ptr);
|
|
||||||
} else if (t->ty==cty_ptr) { // *...
|
|
||||||
return m_ptrobj_s(*(void**)ptr, inc(t->a[0].o));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
thrM("FFI: Unimplemented in-memory type for reading");
|
thrM("FFI: Unimplemented in-memory type for reading");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static B readAny(B o, u8* ptr) { // doesn't consume
|
||||||
|
return isC32(o)? readSimple(styG(o), ptr) : readComplex(o, ptr);
|
||||||
|
}
|
||||||
|
|
||||||
B readUpdatedObj(BQNFFIEnt ent, bool anyMut, B** objs) {
|
B readUpdatedObj(BQNFFIEnt ent, bool anyMut, B** objs) {
|
||||||
if (isC32(ent.o)) return m_f64(0); // scalar
|
if (isC32(ent.o)) return m_f64(0); // scalar
|
||||||
BQNFFIType* t = c(BQNFFIType, ent.o);
|
BQNFFIType* t = c(BQNFFIType, ent.o);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user