You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: jsrc/cl.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ static DF1(jtscfn){F12IP;
23
23
// AM(self) is the block for u
24
24
staticDF1(jtlev1){F12IP;
25
25
ARGCHK1(w); // self is never 0
26
-
if(levelle(jt,w,FAV(self)->localuse.lslevels[2])){Az, fs=(A)AM(self); RZ(z=CALL1(FAV(fs)->valencefns[0],w,fs)); if(FAV(self)->id!=CSCAPCO)RETF(z); Rscfn(z,self);} else{STACKCHKOFLRevery(w,self);} // since this recurs, check stack scaf if abandoned inplaceable, could have a version of every that replaces boxes in place
26
+
if(levelle(jt,w,FAV(self)->localuse.lslevels[2])){Az, fs=(A)AM(self); RZ(z=CALL1(FAV(fs)->valencefns[0],w,fs)); if(FAV(self)->id!=CSCAPCO)RETF(z); Rscfn(z,self);} else{STACKCHKOFLRevery(w,self);} // since this recurs, check stack
27
27
}
28
28
29
29
// Like monad, but AT(self) is left trigger level, AC(self) is the right trigger level
jt->tstackcurr=(A*)jt->tstackcurr[0]; // back up to the previous block
1149
1149
}
1150
1150
1151
-
// measureI tpopscaf[10]; // # tpops requested
1152
1151
// pop stack, ending when we have freed the entry with tnextpushp==old. tnextpushp is left pointing to an empty slot
1153
1152
// If the block has recursive usecount, decrement usecount in children if we free it
1154
-
// stats I totalpops=0, nonnullpops=0, frees=0;
1155
1153
voidjttpop(Jjt,A*old,A*pushp){A*endingtpushp;
1156
1154
// pushp points to an empty cell. old points to the last cell to be freed. decrement pushp to point to the cell to free (or to the chain). decr old to match
1157
1155
// if jttg failed to allocate a new block, we will have left pushp pointing to the cell after the last valid cell. This may be in unmapped memory, but
1158
1156
// that's OK, because we start by decrementing it to point to the last valid push
1159
1157
// errors that could not be eformatted at once might do tpop on the way out. We ignore these if there is a pmstack.
// If count goes to 0: if the usercount is marked recursive, do the recursive fa(), otherwise just free using mf(). If virtual, the backer must be recursive, so fa() it
1185
1180
// Otherwise just decrement the count
1186
1181
if(c<=1||ACDECRNOPERM(np)<=1){ // avoid RFO if count is 1
1187
-
// stats ++frees;
1188
1182
// The block is going to be destroyed. See if there are further ramifications
1189
1183
if(!(flg&AFVIRTUAL)){fanapop(np,flg);} // do the recursive POP only if RECURSIBLE block; then free np
1190
1184
else{Ab=ABACK(np); fanano0(b); mf(np);} // if virtual block going away, reduce usecount in backer, ignore the flagged recursiveness just free the virt block
@@ -1409,7 +1403,6 @@ A zfillind(A w, I m){
1409
1403
}
1410
1404
Rw;
1411
1405
}
1412
-
// stats I statsnga=0, statsngashape=0;
1413
1406
// like jtga, but don't copy shape. Never called for SPARSE type
1414
1407
// We pack rank+type into one reg to save registers (it also helps the LIMIT test). With this, the compiler should be able to save/restore
1415
1408
// only 2 regs (ranktype and bytes) but the prodigal compiler saves 3. We accept this to be able to save AK AR AT here, so that the caller doesn't have to preserve them over the call.
pri=4+((0x5affcbf476ffffffLL>>(pri<<2))&0xf); // 4 is II, lower than the lowest routine# we can call for here
1831
1831
VA2selva2=vainfo->p2[pri]; // routine/flags for the top-priority arg
1832
-
Icvtflgs=(apri>wpri?VCOPYA:0)+(apri<wpri?VCOPYW:0); // set the flag to cause conversion of low-pri arg to the upper. This handles ALL mixed-mode conversions scaf would be nice to avoid conversion of left arg of o.
1832
+
Icvtflgs=(apri>wpri?VCOPYA:0)+(apri<wpri?VCOPYW:0); // set the flag to cause conversion of low-pri arg to the upper. This handles ALL mixed-mode conversions
1833
1833
cvtflgs=selva2.cv&(VBB|VII|VDD|VZZ)?0:cvtflgs; // If the routine already forces a conversion, don't override. Most DD, SP, QP specify no conversion, but +. or bitwise require bool or integer
if(((MAX(acr,wcr)-3)&-AN(a)&-AN(w)&((acr+wcr-3)|((p^q)-1)))<0){ // r<=2, neither arg empty, (sum of ranks<3 (if max rank <= 2 and sum of ranks >2, neither can possibly be an atom) OR items (which are lists) have same length)
296
296
// joining atoms, rows, row/atom, or table/row with same lengths, or table/atom; possibly with frame. In any case no fill is possible, but scalar replication might be
297
-
// scaf this could be generalized to any time ranks differ by at most 1 and the items agree or one is atomic
297
+
// this could be generalized to any time (ranks differ by at most 1 and the items agree) or (one is atomic); no fill needed then. But it complicates the computation too much, because p/q need to become pairs, and registers are dear. The high-rank case is rare.
298
298
Iawcrflg=4*acr+wcr; // incredible register pressure. Combine af/wf, and shift in flags as we calculate them
299
299
Icc2a=__atomic_load_n(&AS(a)[ar-2],__ATOMIC_RELAXED); p=awcrflg&0b1100?p:1; cc2a=awcrflg&0b1000?cc2a:1; ma=cc2a*p; ma=awcrflg==0b0010?q:ma; // cc2a is # 2-cells of a; ma is #atoms in a cell of a EXCEPT when joining atom a to table w: then length of row of w; i. e. #atoms to fill from an item of a
300
300
Icc2w=__atomic_load_n(&AS(w)[wr-2],__ATOMIC_RELAXED); q=awcrflg&0b0011?q:1; cc2w=awcrflg&0b0010?cc2w:1; cc2a+=cc2w; mw=cc2w*q; mw=awcrflg==0b1000?p:mw; // sim for w; cc2a is combined length of axis -2 f can increment only once
0 commit comments