Skip to content

Commit 35fdc1b

Browse files
committed
Cleanup & minor improvements
1 parent 1a14492 commit 35fdc1b

File tree

5 files changed

+466
-376
lines changed

5 files changed

+466
-376
lines changed

src/deemon/method-hints/method-hints.dee

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2212,9 +2212,13 @@ function printNativeOperatorExportedApi() {
22122212
if (!mustMapFunptr)
22132213
fastForwardImpls = ();
22142214
print(f" \{");
2215-
print(f" DeeNO_{opName}_t {opVarName};");
2216-
print(f" if unlikely("),;
2215+
print(f" __register DeeNO_{opName}_t {opVarName};");
22172216
local tpSelfExpr = usedOperator.tpSelfExpr;
2217+
if (tpSelfExpr.startswith("Dee_TYPE(") && tpSelfExpr.endswith(")")) {
2218+
print(f" __register DeeTypeObject *tp_self = {tpSelfExpr};");
2219+
tpSelfExpr = "tp_self";
2220+
}
2221+
print(f" if unlikely("),;
22182222
if (usedOperator.name.table !is none)
22192223
print(f"!{tpSelfExpr}->{usedOperator.name.table} || "),;
22202224
print(f"({opVarName} = {tpSelfExpr}->{usedOperator.name.locExpr}) == NULL)"),;

src/deemon/objects/object.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3148,15 +3148,6 @@ INTDEF NONNULL((1, 2)) void DCALL class_visit(DeeTypeObject *__restrict self, dv
31483148
INTDEF NONNULL((1)) void DCALL class_clear(DeeTypeObject *__restrict self);
31493149
INTDEF NONNULL((1)) void DCALL class_pclear(DeeTypeObject *__restrict self, unsigned int gc_priority);
31503150

3151-
INTDEF WUNUSED NONNULL((1)) DeeTypeObject *DCALL /* from "../runtime/operator.c" */
3152-
DeeType_GetOpClassOrigin(DeeTypeObject *__restrict self, uint16_t oi_class);
3153-
#define DeeType_GetMathOrigin(self) DeeType_GetOpClassOrigin(self, offsetof(DeeTypeObject, tp_math))
3154-
#define DeeType_GetCmpOrigin(self) DeeType_GetOpClassOrigin(self, offsetof(DeeTypeObject, tp_cmp))
3155-
#define DeeType_GetSeqOrigin(self) DeeType_GetOpClassOrigin(self, offsetof(DeeTypeObject, tp_seq))
3156-
#define DeeType_GetWithOrigin(self) DeeType_GetOpClassOrigin(self, offsetof(DeeTypeObject, tp_with))
3157-
#define DeeType_GetBufferOrigin(self) DeeType_GetOpClassOrigin(self, offsetof(DeeTypeObject, tp_buffer))
3158-
3159-
31603151
PRIVATE NONNULL((1)) void DCALL
31613152
type_fini(DeeTypeObject *__restrict self) {
31623153
/* Clear weak references and check for revival. */

0 commit comments

Comments
 (0)