diff --git a/include/config.h.in b/include/config.h.in index 66f7783096..e8063e87ea 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -10,4 +10,7 @@ #mesondefine U3_OS_ENDIAN_little #mesondefine U3_OS_ENDIAN_big +#mesondefine U3_MEMORY_DEBUG +#mesondefine U3_CPU_DEBUG + #endif /*CONFIG_H*/ diff --git a/include/noun/allocate.h b/include/noun/allocate.h index 075b12d2fe..23fd558917 100644 --- a/include/noun/allocate.h +++ b/include/noun/allocate.h @@ -2,12 +2,6 @@ ** ** This file is in the public domain. */ - /** Options. - **/ - /* U3_MEMORY_DEBUG: add debugging information to heap. Breaks image. - */ -# undef U3_MEMORY_DEBUG - /** Constants. **/ /* u3a_bits: number of bits in word-addressed pointer. 29 == 2GB. @@ -128,10 +122,17 @@ } all; struct { // jet dashboard - u3p(u3h_root) har_p; // warm state - u3_noun das; // cold state + u3p(u3h_root) hot_p; // hot state (home road only) + u3p(u3h_root) war_p; // warm state + u3p(u3h_root) cod_p; // cold state + u3p(u3h_root) han_p; // hank cache + u3p(u3h_root) bas_p; // battery hashes } jed; + struct { // bytecode state + u3p(u3h_root) har_p; // formula->post of bytecode + } byc; + struct { // namespace u3_noun gul; // (list $+(* (unit (unit)))) now } ski; diff --git a/include/noun/hashtable.h b/include/noun/hashtable.h index 93c34f4871..127514afd3 100644 --- a/include/noun/hashtable.h +++ b/include/noun/hashtable.h @@ -141,7 +141,15 @@ c3_w u3h_mark(u3p(u3h_root) har_p); - /* u3h_walk(): traverse hashtable with key, value fn; RETAINS. + /* u3h_walk_with(): traverse hashtable with key, value fn and data + * argument; RETAINS. + */ + void + u3h_walk_with(u3p(u3h_root) har_p, + void (*fun_f)(u3_noun, void*), + void* wit); + + /* u3h_walk(): u3h_walk_with, but with no data argument */ void u3h_walk(u3p(u3h_root) har_p, void (*fun_f)(u3_noun)); diff --git a/include/noun/jets.h b/include/noun/jets.h index 321eb26f5f..16c318c29e 100644 --- a/include/noun/jets.h +++ b/include/noun/jets.h @@ -5,23 +5,32 @@ /** Noun semantics. **/ #if 0 - ++ bane ,@tas :: battery name - ++ bash ,@uvH :: label hash - ++ bosh ,@uvH :: battery hash - ++ batt ,* :: battery - ++ calf :: - $: jax=,@ud :: hot core index - hap=(map ,@ud ,@ud) :: axis/hot arm index - lab=path :: label as path - jit=* :: arbitrary data - == :: - ++ calx (trel calf (pair bash cope) club) :: cached by battery - ++ clog (pair cope (map batt club)) :: label record - ++ club (pair corp (map term nock)) :: battery pattern - ++ cope (trel bane axis (each bash noun)) :: core pattern - ++ core ,* - ++ corp (each core batt) :: parent or static - ++ dash (map bash clog) :: jet system ++= location $: pattern=(each static dynamic) + name=term + hooks=(map term axis) + == ++= static (each payload=* parent=location) ++= dynamic [where=axis parent=location] +:: ++= registry [roots=(map * location) parents=(list parent)] ++= parent (pair axis (map location location)) +:: ++= activation $: hot-index=@ud + drivers=(map axis @ud) + label=path + jit=* :: FIXME: should probably be (map battery *) + :: since there can be multiple batteries per location + == ++= hot-info $: reg=registry + hot-index=@ud + drivers=(map axis @ud) + label=path + == ++= bash @ :: battery hash (sha-256 based) +:: ++= hot (map bash hot-info) ++= cold (map battery=^ (pair bash registry)) ++= warm (map location activation) #endif /** Data structures. @@ -41,26 +50,77 @@ struct _u3j_core* cop_u; // containing core } u3j_harm; + /* u3j_hood: hook description. + */ + typedef struct _u3j_hood { + c3_c* nam_c; // hook name + c3_l axe_l; // hook axis (XX: direct) + c3_o kic_o; // hook is kick (vs. fragment) + c3_l sax_l; // hook subject axis (XX: direct) + } u3j_hood; + /* u3j_core: driver definition. */ typedef struct _u3j_core { c3_c* cos_c; // control string + c3_l axe_l; // axis to parent struct _u3j_harm* arm_u; // blank-terminated static list struct _u3j_core* dev_u; // blank-terminated static list + c3_c** bas_u; // blank-terminated static list + struct _u3j_hood* huc_u; // blank-terminated static list struct _u3j_core* par_u; // dynamic parent pointer - c3_l axe_l; // axis to parent c3_l jax_l; // index in global dashboard } u3j_core; /* u3e_dash, u3_Dash, u3D: jet dashboard singleton */ typedef struct _u3e_dash { - u3j_core* dev_u; // null-terminated static list - c3_l len_l; // dynamic array length - c3_l all_l; // allocated length - u3j_core* ray_u; // dynamic array by axis + u3j_core* dev_u; // null-terminated static list + c3_l len_l; // dynamic array length + c3_l all_l; // allocated length + u3j_core* ray_u; // dynamic array by axis } u3j_dash; + /* u3j_fist: a single step in a fine check. + */ + typedef struct { + u3_noun bat; // battery + u3_noun pax; // parent axis + } u3j_fist; + + /* u3j_fink: (fine check) enough data to verify a located core. + */ + typedef struct { + c3_w len_w; // number of fists + u3_noun sat; // static noun at end of check + u3j_fist fis_u[0]; // fists + } u3j_fink; + + /* u3j_rite: site of a %fast, used to skip re-mining. + */ + typedef struct { + c3_o own_o; // rite owns fink? + u3_weak clu; // cached product of clue formula + u3p(u3j_fink) fin_p; // fine check + } u3j_rite; + + /* u3j_site: site of a kick (nock 9), used to cache call target. + */ + struct _u3n_prog; + typedef struct { + u3p(struct _u3n_prog) pog_p; // program for formula + u3_noun axe; // axis + u3_weak bat; // battery (for verification) + u3_weak bas; // hash of battery (for hot find) + u3_weak loc; // location (for reaming) + c3_o jet_o; // have jet driver? + c3_o fon_o; // site owns fink? + u3_weak lab; // label (for tracing) + u3j_core* cop_u; // jet core + u3j_harm* ham_u; // jet arm + u3p(u3j_fink) fin_p; // fine check + } u3j_site; + /** Globals. **/ /* u3_Dash: jet dashboard. @@ -73,20 +133,29 @@ /* u3j_boot(): initialize jet system. */ void - u3j_boot(void); + u3j_boot(c3_o nuu_o); /* u3j_clear(): clear jet table to re-register. */ void u3j_clear(void); + /* u3j_cook(): + ** + ** Execute hook from core, call site cached by arbitrary c string + */ + u3_noun + u3j_cook(const c3_c* key_c, + u3_noun cor, + const c3_c* tam_c); + /* u3j_hook(): ** ** Execute hook from core. */ u3_noun u3j_hook(u3_noun cor, - const c3_c* tam_c); + const c3_c* tam_c); /* u3j_soft(): ** @@ -94,12 +163,7 @@ */ u3_noun u3j_soft(u3_noun cor, - const c3_c* tam_c); - - /* u3j_find(): in warm state, return u3_none or calx. RETAINS. - */ - u3_weak - u3j_find(u3_noun bat); + const c3_c* tam_c); /* u3j_kick(): try to kick by jet. If no kick, produce u3_none. ** @@ -114,7 +178,7 @@ u3_noun u3j_kink(u3_noun cor, u3_noun axe); - + /* u3j_mine(): register core for jets. */ void @@ -129,4 +193,76 @@ /* u3j_reap(): promote jet state. RETAINS. */ void - u3j_reap(u3_noun das, u3p(u3h_root) har_p); + u3j_reap(u3p(u3h_root) cod_p, u3p(u3h_root) war_p, u3p(u3h_root) han_p, u3p(u3h_root) bas_p); + + /* u3j_rite_mine(): mine cor with clu, using u3j_rite for caching + */ + void + u3j_rite_mine(u3j_rite* rit_u, u3_noun clu, u3_noun cor); + + /* u3j_rite_copy(): copy rite references from src_u to dst_u, + ** losing old references if los_o is yes + */ + void + u3j_rite_copy(u3j_rite* dst_u, u3j_rite* src_u, c3_o los_o); + + /* u3j_site_copy(): copy site references from src_u to dst_u, + ** losing old references if los_o is yes + */ + void + u3j_site_copy(u3j_site* dst_u, u3j_site* src_u, c3_o los_o); + + /* u3j_site_ream(): refresh u3j_site after restoring from checkpoint + */ + void + u3j_site_ream(u3j_site* sit_u); + + /* u3j_site_kick(): kick a core with a u3j_site cache. + */ + u3_weak + u3j_site_kick(u3_noun cor, u3j_site* sit_u); + + /* u3j_gate_prep(): prepare a locally cached gate to call repeatedly. + */ + void + u3j_gate_prep(u3j_site* sit_u, u3_noun cor); + + /* u3j_gate_slam(): slam a site prepared by u3j_gate_find() with sample. + */ + u3_noun + u3j_gate_slam(u3j_site* sit_u, u3_noun sam); + + /* u3j_gate_lose(): clean up site prepared by u3j_gate_find(). + */ + void + u3j_gate_lose(u3j_site* sit_u); + + /* u3j_rite_mark(): mark u3j_rite for gc. + */ + c3_w + u3j_rite_mark(u3j_rite* rit_u); + + /* u3j_rite_lose(): lose references of u3j_rite (but do not free). + */ + void + u3j_rite_lose(u3j_rite* rit_u); + + /* u3j_site_lose(): lose references of u3j_site (but do not free). + */ + void + u3j_site_lose(u3j_site* sit_u); + + /* u3j_site_mark(): mark u3j_site for gc. + */ + c3_w + u3j_site_mark(u3j_site* sit_u); + + /* u3j_mark(): mark jet state for gc. + */ + c3_w + u3j_mark(void); + + /* u3j_free(): free jet state. + */ + void + u3j_free(void); diff --git a/include/noun/nock.h b/include/noun/nock.h index 2234778d96..ff376a875a 100644 --- a/include/noun/nock.h +++ b/include/noun/nock.h @@ -2,6 +2,43 @@ ** ** This file is in the public domain. */ + /** Data structures. + *** + **/ + + /* u3n_memo: %memo hint space + */ + typedef struct { + c3_l sip_l; + u3_noun key; + } u3n_memo; + + /* u3n_prog: program compiled from nock + */ + typedef struct _u3n_prog { + struct { + c3_o own_o; // program owns ops_y? + c3_w len_w; // length of bytecode (bytes) + c3_y* ops_y; // actual array of bytes + } byc_u; // bytecode + struct { + c3_w len_w; // number of literals + u3_noun* non; // array of literals + } lit_u; // literals + struct { + c3_w len_w; // number of memo slots + u3n_memo* sot_u; // array of memo slots + } mem_u; // memo slot data + struct { + c3_w len_w; // number of calls sites + u3j_site* sit_u; // array of sites + } cal_u; // call site data + struct { + c3_w len_w; // number of registration sites + u3j_rite* rit_u; // array of sites + } reg_u; // registration site data + } u3n_prog; + /** Functions. **/ /* u3n_nock_on(): produce .*(bus fol). @@ -9,6 +46,17 @@ u3_noun u3n_nock_on(u3_noun bus, u3_noun fol); + /* u3n_find(): return prog for given formula, + * split by key (u3_nul for none). RETAIN. + */ + u3p(u3n_prog) + u3n_find(u3_noun key, u3_noun fol); + + /* u3n_burn(): execute u3n_prog with bus as subject. + */ + u3_noun + u3n_burn(u3p(u3n_prog) pog_p, u3_noun bus); + /* u3n_slam_on(): produce (gat sam). */ u3_noun @@ -53,3 +101,23 @@ */ u3_noun u3n_nock_an(u3_noun bus, u3_noun fol); + + /* u3n_reap(): promote bytecode state. + */ + void + u3n_reap(u3p(u3h_root) har_p); + + /* u3n_mark(): mark bytecode cache. + */ + c3_w + u3n_mark(void); + + /* u3n_free(): free bytecode cache. + */ + void + u3n_free(void); + + /* u3n_ream(): refresh after restoring from checkpoint. + */ + void + u3n_ream(void); diff --git a/include/noun/options.h b/include/noun/options.h index 8591dfee3f..7eb5d540b8 100644 --- a/include/noun/options.h +++ b/include/noun/options.h @@ -24,7 +24,8 @@ u3o_check_fatal = 0x8, // check: unrecoverable u3o_verbose = 0x10, // be remarkably wordy u3o_dryrun = 0x20, // don't touch checkpoint - u3o_quiet = 0x40 // disable ~& + u3o_quiet = 0x40, // disable ~& + u3o_hashless = 0x80 // disable hashboard }; /** Globals. diff --git a/include/noun/trace.h b/include/noun/trace.h index 5b847f5216..838ce835f3 100644 --- a/include/noun/trace.h +++ b/include/noun/trace.h @@ -2,12 +2,6 @@ ** ** This file is in the public domain. */ - /** Options. - **/ - /* U3_CPU_DEBUG: activate profiling. - */ -# undef U3_CPU_DEBUG - /** Data structures. **/ /* u3t_trace: fast execution flags. diff --git a/include/vere/vere.h b/include/vere/vere.h index 8486d6a0ad..8e77d7153f 100644 --- a/include/vere/vere.h +++ b/include/vere/vere.h @@ -594,6 +594,7 @@ c3_o fak; // -F, fake carrier c3_o fog; // -X, skip last event c3_o gab; // -g, run with garbage collector + c3_o has; // -S, Skip battery hashes c3_o git; // -s, pill url from arvo git hash c3_o mem; // -M, memory madness c3_o net; // -N, remote networking in -F mode diff --git a/jets/b/levy.c b/jets/b/levy.c index 2a58ce1c45..3f4978b79d 100644 --- a/jets/b/levy.c +++ b/jets/b/levy.c @@ -3,12 +3,8 @@ */ #include "all.h" - -/* functions -*/ - u3_noun - u3qb_levy(u3_noun a, - u3_noun b) + static u3_noun + _levy_in(u3j_site* sit_u, u3_noun a) { if ( 0 == a ) { return c3y; @@ -18,14 +14,28 @@ if ( c3n == u3du(a) ) { return u3m_bail(c3__exit); } - else switch ( (loz = u3n_slam_on(u3k(b), u3k(u3h(a)))) ) { - case c3y: return u3qb_levy(u3t(a), b); + else switch ( (loz = u3j_gate_slam(sit_u, u3k(u3h(a)))) ) { + case c3y: return _levy_in(sit_u, u3t(a)); case c3n: return c3n; default: u3z(loz); return u3m_bail(c3__exit); } } } + +/* functions +*/ + u3_noun + u3qb_levy(u3_noun a, + u3_noun b) + { + u3_noun pro; + u3j_site sit_u; + u3j_gate_prep(&sit_u, u3k(b)); + pro = _levy_in(&sit_u, a); + u3j_gate_lose(&sit_u); + return pro; + } u3_noun u3wb_levy(u3_noun cor) { diff --git a/jets/b/lien.c b/jets/b/lien.c index 6768ab5110..c37b1ee8fe 100644 --- a/jets/b/lien.c +++ b/jets/b/lien.c @@ -3,12 +3,8 @@ */ #include "all.h" - -/* functions -*/ - u3_noun - u3qb_lien(u3_noun a, - u3_noun b) + static u3_noun + _lien_in(u3j_site* sit_u, u3_noun a) { if ( 0 == a ) { return c3n; @@ -18,14 +14,28 @@ if ( c3n == u3du(a) ) { return u3m_bail(c3__exit); } - else switch ( (loz = u3n_slam_on(u3k(b), u3k(u3h(a)))) ) { + else switch ( (loz = u3j_gate_slam(sit_u, u3k(u3h(a)))) ) { case c3y: return c3y; - case c3n: return u3qb_lien(u3t(a), b); + case c3n: return _lien_in(sit_u, u3t(a)); default: u3z(loz); return u3m_bail(c3__exit); } } } + +/* functions +*/ + u3_noun + u3qb_lien(u3_noun a, + u3_noun b) + { + u3_noun pro; + u3j_site sit_u; + u3j_gate_prep(&sit_u, u3k(b)); + pro = _lien_in(&sit_u, a); + u3j_gate_lose(&sit_u); + return pro; + } u3_noun u3wb_lien(u3_noun cor) { diff --git a/jets/b/murn.c b/jets/b/murn.c index 08647c4446..e0dcb8d234 100644 --- a/jets/b/murn.c +++ b/jets/b/murn.c @@ -3,11 +3,8 @@ */ #include "all.h" - -/* functions -*/ u3_noun - u3qb_murn(u3_noun a, u3_noun b) + _murn_in(u3j_site* sit_u, u3_noun a) { if ( 0 == a ) { return a; @@ -16,8 +13,8 @@ return u3m_bail(c3__exit); } else { - u3_noun one = u3n_slam_on(u3k(b), u3k(u3h(a))); - u3_noun two = u3qb_murn(u3t(a), b); + u3_noun one = u3j_gate_slam(sit_u, u3k(u3h(a))); + u3_noun two = _murn_in(sit_u, u3t(a)); u3_noun nex; switch ( u3ud(one) ) { @@ -32,6 +29,19 @@ } } } + +/* functions +*/ + u3_noun + u3qb_murn(u3_noun a, u3_noun b) + { + u3_noun pro; + u3j_site sit_u; + u3j_gate_prep(&sit_u, u3k(b)); + pro = _murn_in(&sit_u, a); + u3j_gate_lose(&sit_u); + return pro; + } u3_noun u3wb_murn(u3_noun cor) { diff --git a/jets/b/reel.c b/jets/b/reel.c index e78e7c8ca1..5cdd9c918e 100644 --- a/jets/b/reel.c +++ b/jets/b/reel.c @@ -3,6 +3,22 @@ */ #include "all.h" + static u3_noun + _reel_in(u3j_site* sit_u, u3_noun a, u3_noun b) + { + if ( 0 == a ) { + return b; + } + else if ( c3n == u3du(a) ) { + return u3m_bail(c3__exit); + } + else { + u3_noun gim = u3k(u3h(a)); + u3_noun hur = _reel_in(sit_u, u3t(a), b); + + return u3j_gate_slam(sit_u, u3nc(gim, hur)); + } + } /* functions */ @@ -10,18 +26,12 @@ u3qb_reel(u3_noun a, u3_noun b) { - if ( 0 == a ) { - return u3k(u3r_at(u3x_sam_3, b)); - } - else if ( c3n == u3du(a) ) { - return u3m_bail(c3__exit); - } - else { - u3_noun gim = u3k(u3h(a)); - u3_noun hur = u3qb_reel(u3t(a), b); - - return u3n_slam_on(u3k(b), u3nc(gim, hur)); - } + u3_noun pro; + u3j_site sit_u; + u3j_gate_prep(&sit_u, u3k(b)); + pro = _reel_in(&sit_u, a, u3k(u3x_at(u3x_sam_3, b))); + u3j_gate_lose(&sit_u); + return pro; } u3_noun u3wb_reel(u3_noun cor) diff --git a/jets/b/roll.c b/jets/b/roll.c index 1d047df48a..a88d4fc1d2 100644 --- a/jets/b/roll.c +++ b/jets/b/roll.c @@ -3,6 +3,20 @@ */ #include "all.h" + static u3_noun + _roll_in(u3j_site* sit_u, u3_noun a, u3_noun b) + { + if ( 0 == a ) { + return b; + } + else if ( c3n == u3du(a) ) { + return u3m_bail(c3__exit); + } + else { + b = u3j_gate_slam(sit_u, u3nc(u3k(u3h(a)), b)); + return _roll_in(sit_u, u3t(a), b); + } + } /* functions */ @@ -10,32 +24,12 @@ u3qb_roll(u3_noun a, u3_noun b) { - if ( 0 == a ) { - return u3k(u3r_at(u3x_sam_3, b)); - } - else if ( c3n == u3du(a) ) { - return u3m_bail(c3__exit); - } - else { - u3_noun gim = u3k(u3h(a)); - u3_noun zor = u3r_at(u3x_sam, b); - - if ( c3n == u3du(zor) ) { - return u3m_bail(c3__exit); - } - - u3_noun daz = u3n_slam_on(u3k(b), u3nc(gim, u3k(u3t(zor)))); - u3_noun vel = u3i_molt(u3k(b), u3x_sam_3, daz, 0); - - if ( u3_none == vel ) { - return u3m_bail(c3__exit); - } else { - u3_noun hox = u3qb_roll(u3t(a), vel); - - u3z(vel); - return hox; - } - } + u3_noun pro; + u3j_site sit_u; + u3j_gate_prep(&sit_u, u3k(b)); + pro = _roll_in(&sit_u, a, u3k(u3x_at(u3x_sam_3, b))); + u3j_gate_lose(&sit_u); + return pro; } u3_noun u3wb_roll(u3_noun cor) diff --git a/jets/b/skid.c b/jets/b/skid.c index 6bb6626ecd..29ab919b08 100644 --- a/jets/b/skid.c +++ b/jets/b/skid.c @@ -3,12 +3,8 @@ */ #include "all.h" - -/* functions -*/ - u3_noun - u3qb_skid(u3_noun a, - u3_noun b) + static u3_noun + _skid_in(u3j_site* sit_u, u3_noun a) { if ( 0 == a ) { return u3nc(u3_nul, u3_nul); @@ -16,8 +12,8 @@ else if ( c3n == u3du(a) ) { return u3m_bail(c3__exit); } else { - u3_noun acc = u3qb_skid(u3t(a), b); - u3_noun hoz = u3n_slam_on(u3k(b), u3k(u3h(a))); + u3_noun acc = _skid_in(sit_u, u3t(a)); + u3_noun hoz = u3j_gate_slam(sit_u, u3k(u3h(a))); u3_noun nex; if ( c3y == hoz ) { @@ -32,6 +28,20 @@ return nex; } } + +/* functions +*/ + u3_noun + u3qb_skid(u3_noun a, + u3_noun b) + { + u3_noun pro; + u3j_site sit_u; + u3j_gate_prep(&sit_u, u3k(b)); + pro = _skid_in(&sit_u, a); + u3j_gate_lose(&sit_u); + return pro; + } u3_noun u3wb_skid(u3_noun cor) { diff --git a/jets/b/skim.c b/jets/b/skim.c index 003e461b12..c5e721ec10 100644 --- a/jets/b/skim.c +++ b/jets/b/skim.c @@ -3,12 +3,8 @@ */ #include "all.h" - -/* functions -*/ - u3_noun - u3qb_skim(u3_noun a, - u3_noun b) + static u3_noun + _skim_in(u3j_site* sit_u, u3_noun a) { if ( 0 == a ) { return a; @@ -16,8 +12,8 @@ else if ( c3n == u3du(a) ) { return u3m_bail(c3__exit); } else { - u3_noun hoz = u3n_slam_on(u3k(b), u3k(u3h(a))); - u3_noun vyr = u3qb_skim(u3t(a), b); + u3_noun hoz = u3j_gate_slam(sit_u, u3k(u3h(a))); + u3_noun vyr = _skim_in(sit_u, u3t(a)); switch ( hoz ) { case c3y: return u3nc(u3k(u3h(a)), vyr); @@ -28,9 +24,22 @@ } } } + +/* functions +*/ u3_noun - u3wb_skim( - u3_noun cor) + u3qb_skim(u3_noun a, + u3_noun b) + { + u3_noun pro; + u3j_site sit_u; + u3j_gate_prep(&sit_u, u3k(b)); + pro = _skim_in(&sit_u, a); + u3j_gate_lose(&sit_u); + return pro; + } + u3_noun + u3wb_skim(u3_noun cor) { u3_noun a, b; diff --git a/jets/b/skip.c b/jets/b/skip.c index 6f44643d68..36ff1a3e6d 100644 --- a/jets/b/skip.c +++ b/jets/b/skip.c @@ -3,12 +3,8 @@ */ #include "all.h" - -/* functions -*/ - u3_noun - u3qb_skip(u3_noun a, - u3_noun b) + static u3_noun + _skip_in(u3j_site* sit_u, u3_noun a) { if ( 0 == a ) { return a; @@ -16,8 +12,8 @@ else if ( c3n == u3du(a) ) { return u3_none; } else { - u3_noun hoz = u3n_slam_on(u3k(b), u3k(u3h(a))); - u3_noun vyr = u3qb_skip(u3t(a), b); + u3_noun hoz = u3j_gate_slam(sit_u, u3k(u3h(a))); + u3_noun vyr = _skip_in(sit_u, u3t(a)); switch ( hoz ) { case c3y: return vyr; @@ -28,6 +24,20 @@ } } } + +/* functions +*/ + u3_noun + u3qb_skip(u3_noun a, + u3_noun b) + { + u3j_site sit_u; + u3_noun pro; + u3j_gate_prep(&sit_u, u3k(b)); + pro = _skip_in(&sit_u, a); + u3j_gate_lose(&sit_u); + return pro; + } u3_noun u3wb_skip(u3_noun cor) { diff --git a/jets/b/turn.c b/jets/b/turn.c index 5489325f10..e183ae4bf4 100644 --- a/jets/b/turn.c +++ b/jets/b/turn.c @@ -3,25 +3,33 @@ */ #include "all.h" + static u3_noun + _turn_in(u3j_site* sit_u, u3_noun a) + { + if ( u3_nul == a ) { + return u3_nul; + } + else { + return u3nc( + u3j_gate_slam(sit_u, u3k(u3h(a))), + _turn_in(sit_u, u3t(a))); + } + } /* functions */ u3_noun u3qb_turn(u3_noun a, u3_noun b) { - if ( 0 == a ) { - return a; - } - else if ( c3n == u3du(a) ) { - return u3m_bail(c3__exit); - } - else { - u3_noun one = u3n_slam_on(u3k(b), u3k(u3h(a))); - u3_noun two = u3qb_turn(u3t(a), b); + u3_noun pro; + u3j_site sit_u; - return u3nc(one, two); - } + u3j_gate_prep(&sit_u, u3k(b)); + pro = _turn_in(&sit_u, a); + u3j_gate_lose(&sit_u); + return pro; } + u3_noun u3wb_turn(u3_noun cor) { diff --git a/jets/e/jam.c b/jets/e/jam.c index 0886dad5a7..5869d657bc 100644 --- a/jets/e/jam.c +++ b/jets/e/jam.c @@ -3,185 +3,166 @@ */ #include "all.h" +typedef struct { + c3_w a_w; + c3_w b_w; + c3_w bit_w; + c3_w* wor_w; +} _jam_buf; + +static void +_jam_buf_grow(_jam_buf* buf_u, c3_w mor_w) +{ + c3_w wan_w = buf_u->bit_w + mor_w; + + if ( wan_w < mor_w ) { + // overflowed c3_w bits + u3m_bail(c3__fail); + } + + if ( wan_w > buf_u->a_w ) { + c3_w old_w, new_w, c_w = 0; + + old_w = buf_u->a_w >> 5; + if ( (old_w << 5) != buf_u->a_w ) { + ++old_w; + } + + // fibonacci growth + while ( c_w < wan_w ) { + c_w = buf_u->a_w + buf_u->b_w; + buf_u->b_w = buf_u->a_w; + buf_u->a_w = c_w; + } + + new_w = c_w >> 5; + if ( (new_w << 5) != c_w ) { + ++new_w; + } + + buf_u->wor_w = u3a_wealloc(buf_u->wor_w, new_w); + memset(buf_u->wor_w + old_w, 0, (new_w - old_w) * sizeof(c3_w)); + } +} + +static void +_jam_buf_chop(_jam_buf* buf_u, c3_w met_w, u3_noun a) +{ + c3_w bit_w = buf_u->bit_w; + _jam_buf_grow(buf_u, met_w); + u3r_chop(0, 0, met_w, bit_w, buf_u->wor_w, a); + buf_u->bit_w += met_w; +} + +static void +_jam_buf_atom(_jam_buf* buf_u, u3_noun a) +{ + if ( 0 == a ) { + _jam_buf_chop(buf_u, 1, 1); + } + else { + c3_w b_w = u3r_met(0, a), + c_w = u3r_met(0, b_w); + c3_assert(c_w <= 32); + _jam_buf_chop(buf_u, c_w+1, 1 << c_w); + _jam_buf_chop(buf_u, c_w-1, b_w & ((1 << (c_w-1)) - 1)); + _jam_buf_chop(buf_u, b_w, a); + } +} + /* functions */ - - static u3_noun - _jam_pair(u3_noun x, u3_noun d, u3_noun e) + /* u3qe_jam_buf(): jam without atom allocation. returns + * atom-suitable words, and *bit_w will + * have the length (in bits). return should + * be freed with u3a_wfree(). + */ + c3_w* + u3qe_jam_buf(u3_noun a, c3_w* bit_w) { - u3_noun r, p_d, q_d, r_d; - u3x_trel(d, &p_d, &q_d, &r_d); - { - u3_noun y = u3qa_add(x, p_d); - u3_noun p_e, q_e, r_e; - - u3x_trel(e, &p_e, &q_e, &r_e); - { - u3_noun z = u3qa_add(p_d, p_e); - - r = u3nt(u3qa_add(2, z), u3k(q_e), 0); - - u3z(z); - } - u3z(y); - } - u3z(x); - u3z(d); - u3z(e); - return r; - } - - static u3_noun - _jam_flat(u3_atom a, u3_noun l) - { - u3_noun d = u3qe_mat(a); - u3_noun x = u3qa_add(1, u3h(d)); - u3_noun y = u3nt - (u3k(x), u3nc(u3nc(x, u3qc_lsh(0, 1, u3t(d))), u3k(l)), 0); - - u3z(d); - u3z(l); - - return y; - } - - static u3_noun - _jam_ptr(u3_atom u_c, u3_noun l) - { - u3_noun d = u3qe_mat(u_c); - u3_atom x = u3qc_lsh(0, 2, u3t(d)); - u3_atom y = u3qa_add(2, u3h(d)); - u3_noun z = u3nt - (u3k(y), u3nc(u3nc(y, u3qc_mix(3, x)), u3k(l)), 0); - - u3z(d); - u3z(x); - u3z(l); - - return z; - } - - #define JAM_NONE 0 - #define JAM_HEAD 1 - #define JAM_TAIL 2 - - typedef struct { - c3_y sat_y; - u3_noun nun; - u3_noun len; - u3_noun lis; - u3_noun hed; - } jamframe; - - static inline jamframe* - _jam_push(c3_ys mov, c3_ys off) - { - u3R->cap_p += mov; - return u3to(jamframe, u3R->cap_p + off); - } - - static inline jamframe* - _jam_pop(c3_ys mov, c3_ys off) - { - u3R->cap_p -= mov; - return u3to(jamframe, u3R->cap_p + off); - } - - static u3_noun - _jam_cap(u3_atom a) - { - u3p(jamframe) empty = u3R->cap_p; u3p(u3h_root) har_p = u3h_new(); c3_o nor_o = u3a_is_north(u3R); - c3_y wis_y = c3_wiseof(jamframe); + c3_y wis_y = c3_wiseof(u3_noun); c3_ys mov = ( c3y == nor_o ? -wis_y : wis_y ); c3_ys off = ( c3y == nor_o ? 0 : -wis_y ); - jamframe* fam = _jam_push(mov, off); - jamframe* don = u3to(jamframe, empty + off); + u3_noun* top, *don = u3to(u3_noun, u3R->cap_p + off); + u3_weak c; + c3_o cel_o; + c3_w len_w; + _jam_buf buf_u; - fam->sat_y = JAM_NONE; - fam->nun = a; - fam->len = 0; - fam->lis = u3_nul; + buf_u.a_w = 144; // fib(12) is small enough to be reasonably fast to allocate. + buf_u.b_w = 89; // fib(11) is needed to get fib(13). + len_w = buf_u.a_w >> 5; + if ( (len_w << 5) != buf_u.a_w ) { + ++len_w; + } + buf_u.wor_w = u3a_walloc(len_w); + buf_u.bit_w = 0; + memset(buf_u.wor_w, 0, len_w * sizeof(c3_w)); - u3_noun q, r = u3_none; + u3R->cap_p += mov; + top = u3to(u3_noun, u3R->cap_p + off); + *top = a; - while ( don != fam ) { - switch ( fam->sat_y ) { - case JAM_NONE: { - u3_noun nun = fam->nun; - u3_noun len = fam->len; - u3_noun lis = fam->lis; - u3_weak got = u3h_get(har_p, nun); - - if ( u3_none == got ) { - u3h_put(har_p, nun, u3k(len)); - if ( c3n == u3du(nun) ) { - r = _jam_flat(nun, lis); - fam = _jam_pop(mov, off); - u3z(len); - } - else { - fam->sat_y = JAM_HEAD; - fam = _jam_push(mov, off); - fam->sat_y = JAM_NONE; - fam->nun = u3h(nun); - fam->len = u3qa_add(2, len); - fam->lis = u3nc(u3nc(2, 1), lis); - } + while ( top != don ) { + a = *top; + cel_o = u3du(a); + c = u3h_git(har_p, a); + if ( u3_none != c ) { + if ( c3y == cel_o ) { + _jam_buf_chop(&buf_u, 2, 3); + _jam_buf_atom(&buf_u, c); + } + else { + if ( u3r_met(0, a) <= u3r_met(0, c) ) { + _jam_buf_chop(&buf_u, 1, 0); + _jam_buf_atom(&buf_u, a); } else { - if ( c3y == u3ud(nun) && (u3r_met(0, nun) <= u3r_met(0, got)) ) { - r = _jam_flat(nun, lis); - } - else { - r = _jam_ptr(got, lis); - } - fam = _jam_pop(mov, off); - u3z(len); + _jam_buf_chop(&buf_u, 2, 3); + _jam_buf_atom(&buf_u, c); } - break; } - case JAM_HEAD: { - u3_noun p_r, q_r, r_r; - u3x_trel(r, &p_r, &q_r, &r_r); - u3_noun nun = fam->nun; - fam->sat_y = JAM_TAIL; - fam->hed = r; - u3_noun z = u3qa_add(2, fam->len); - fam = _jam_push(mov, off); - fam->sat_y = JAM_NONE; - fam->nun = u3t(nun); - fam->len = u3qa_add(z, p_r); - fam->lis = u3k(q_r); - u3z(z); - break; + u3R->cap_p -= mov; + top = u3to(u3_noun, u3R->cap_p + off); + } + else { + u3h_put(har_p, a, buf_u.bit_w); + if ( c3n == cel_o ) { + _jam_buf_chop(&buf_u, 1, 0); + _jam_buf_atom(&buf_u, a); + u3R->cap_p -= mov; + top = u3to(u3_noun, u3R->cap_p + off); } - case JAM_TAIL: { - u3_noun len = fam->len; - r = _jam_pair(u3qa_add(2, len), fam->hed, r); - fam = _jam_pop(mov, off); - u3z(len); - break; + else { + _jam_buf_chop(&buf_u, 2, 1); + *top = u3t(a); + + u3R->cap_p += mov; + top = u3to(u3_noun, u3R->cap_p + off); + *top = u3h(a); } - default: - c3_assert(0); - return u3_none; } } - q = u3qb_flop(u3h(u3t(r))); - u3z(r); - r = u3qc_can(0, q); - u3z(q); + *bit_w = buf_u.bit_w; u3h_free(har_p); - return r; + return buf_u.wor_w; } - u3_noun u3qe_jam(u3_atom a) { - return _jam_cap(a); + c3_w bit_w, *sal_w; + c3_w* wor_w = u3qe_jam_buf(a, &bit_w); + c3_w len_w = bit_w >> 5; + if ( (len_w << 5) != bit_w ) { + ++len_w; + } + sal_w = u3a_slab(len_w); + memcpy(sal_w, wor_w, len_w*sizeof(c3_w)); + u3a_wfree(wor_w); + return u3a_moot(sal_w); } u3_noun u3we_jam(u3_noun cor) diff --git a/jets/e/mule.c b/jets/e/mule.c index 99afc0d34c..3f74b73267 100644 --- a/jets/e/mule.c +++ b/jets/e/mule.c @@ -12,7 +12,7 @@ return u3m_bail(c3__exit); } else { - u3_noun hok = u3j_hook(u3k(cor), "mute"); + u3_noun hok = u3j_cook("u3we_mule-mute", u3k(cor), "mute"); /* this takes advantage of the fact that mute's result, at the typeless * C/Nock level, is identical to what a typed mule would produce, diff --git a/jets/f/ap.c b/jets/f/ap.c index 3603867e6e..daead65082 100644 --- a/jets/f/ap.c +++ b/jets/f/ap.c @@ -992,7 +992,7 @@ _ap_core(u3_noun ter, u3_noun gen) { - u3_noun gat = u3j_hook(u3k(ter), "ap"); + u3_noun gat = u3j_cook("_ap_core-ap", u3k(ter), "ap"); return u3i_molt(gat, u3x_sam, u3k(gen), 0); } diff --git a/jets/f/ut.c b/jets/f/ut.c index 7b07aa5341..9fcf3ec1a3 100644 --- a/jets/f/ut.c +++ b/jets/f/ut.c @@ -14,7 +14,7 @@ u3_noun typ) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(typ), 0); - u3_noun ret = u3j_hook(u3k(von), "dune"); + u3_noun ret = u3j_cook("u3qfu_duck-dune", u3k(von), "dune"); u3z(von); return ret; @@ -28,7 +28,7 @@ u3_noun typ) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(typ), 0); - u3_noun duq = u3j_hook(u3k(von), "dunk"); + u3_noun duq = u3j_cook("u3qfu_dung-dunk", u3k(von), "dunk"); u3_noun ret = u3i_molt(u3k(duq), u3x_sam, u3k(paz), 0); u3z(duq); @@ -44,7 +44,7 @@ u3_noun typ) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(typ), 0); - u3_noun duq = u3j_hook(u3k(von), "dunk"); + u3_noun duq = u3j_cook("u3qfu_dunq-dunk", u3k(von), "dunk"); u3_noun paz = u3i_string(paz_c); u3_noun ret = u3i_molt(u3k(duq), u3x_sam, u3k(paz), 0); @@ -77,7 +77,7 @@ u3qfu_shew(u3_noun van, u3_noun mol) { - u3_noun sho = u3j_hook(u3k(van), "show"); + u3_noun sho = u3j_cook("u3qfu_shew-show", u3k(van), "show"); u3_noun ret = u3i_molt(u3k(sho), u3x_sam, u3k(mol), 0); u3z(sho); diff --git a/jets/f/ut_buss.c b/jets/f/ut_buss.c index df62f73676..144046d8af 100644 --- a/jets/f/ut_buss.c +++ b/jets/f/ut_buss.c @@ -13,7 +13,7 @@ u3_noun gen) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_hook(von, "buss"); + u3_noun gat = u3j_cook("_cqfu_buss-buss", von, "buss"); return u3n_kick_on(u3i_molt(gat, u3x_sam_2, @@ -29,7 +29,7 @@ u3_noun gen) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_hook(von, "busk"); + u3_noun gat = u3j_cook("_cqfu_busk-busk", von, "busk"); return u3n_kick_on(u3i_molt(gat, u3x_sam, diff --git a/jets/f/ut_find.c b/jets/f/ut_find.c index 1d0be3b508..610e4a46f8 100644 --- a/jets/f/ut_find.c +++ b/jets/f/ut_find.c @@ -19,7 +19,7 @@ u3_noun lap) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_hook(von, "felt"); + u3_noun gat = u3j_cook("u3qfu_felt-felt", von, "felt"); return u3n_kick_on(u3i_molt(gat, u3x_sam, @@ -34,7 +34,7 @@ u3_noun gen) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_hook(von, "fund"); + u3_noun gat = u3j_cook("u3qfu_fund-fund", von, "fund"); return u3n_kick_on(u3i_molt(gat, u3x_sam_2, @@ -50,7 +50,7 @@ u3_noun tor) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_hook(von, "fine"); + u3_noun gat = u3j_cook("u3qfu_fine-fine", von, "fine"); return u3n_kick_on(u3i_molt(gat, u3x_sam, diff --git a/jets/f/ut_gain.c b/jets/f/ut_gain.c index d27ee9a18f..509740ab17 100644 --- a/jets/f/ut_gain.c +++ b/jets/f/ut_gain.c @@ -10,7 +10,7 @@ u3_noun gen) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_hook(von, "gain"); + u3_noun gat = u3j_cook("u3qfu_gain-gain", von, "gain"); return u3n_kick_on(u3i_molt(gat, u3x_sam, u3k(gen), 0)); } diff --git a/jets/f/ut_lose.c b/jets/f/ut_lose.c index 2e3e29b8f8..16e9f6c0f0 100644 --- a/jets/f/ut_lose.c +++ b/jets/f/ut_lose.c @@ -10,7 +10,7 @@ u3_noun gen) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_hook(von, "lose"); + u3_noun gat = u3j_cook("u3qfu_lose-lose", von, "lose"); return u3n_kick_on(u3i_molt(gat, u3x_sam, u3k(gen), 0)); } diff --git a/jets/f/ut_mint.c b/jets/f/ut_mint.c index 9f075ae04a..7dd189300b 100644 --- a/jets/f/ut_mint.c +++ b/jets/f/ut_mint.c @@ -188,7 +188,7 @@ u3_noun loc) { u3_noun mol = u3nc('o', u3k(loc)); - u3_noun sho = u3j_hook(u3k(van), "show"); + u3_noun sho = u3j_cook("_mint_loc-show", u3k(van), "show"); u3_noun ret = u3i_molt(u3k(sho), u3x_sam, u3k(mol), 0); u3z(mol); @@ -206,7 +206,7 @@ u3_noun rig) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_hook(von, "emin"); + u3_noun gat = u3j_cook("_mint_cnts-emin", von, "emin"); return u3n_kick_on(u3i_molt(gat, u3x_sam_2, @@ -756,7 +756,7 @@ } else { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_hook(von, "blow"); + u3_noun gat = u3j_cook("_mint_in-blow", von, "blow"); u3_noun pro; pro = u3n_kick_on(u3i_molt(gat, diff --git a/jets/f/ut_mull.c b/jets/f/ut_mull.c index 5654669c8f..e078407433 100644 --- a/jets/f/ut_mull.c +++ b/jets/f/ut_mull.c @@ -21,7 +21,7 @@ u3_noun loc) { u3_noun mol = u3nc('o', u3k(loc)); - u3_noun sho = u3j_hook(u3k(van), "show"); + u3_noun sho = u3j_cook("_mull_loc-show", u3k(van), "show"); u3_noun ret = u3i_molt(u3k(sho), u3x_sam, u3k(mol), 0); u3z(mol); @@ -176,7 +176,7 @@ u3_noun rig) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_hook(von, "emul"); + u3_noun gat = u3j_cook("_mull_cnts-emul", von, "emul"); return u3n_kick_on(u3i_molt(gat, u3x_sam_2, diff --git a/jets/f/ut_play.c b/jets/f/ut_play.c index 5fa98604e5..8f982c28b7 100644 --- a/jets/f/ut_play.c +++ b/jets/f/ut_play.c @@ -70,7 +70,7 @@ u3_noun loc) { u3_noun mol = u3nc('o', u3k(loc)); - u3_noun sho = u3j_hook(u3k(van), "show"); + u3_noun sho = u3j_cook("_play_loc-show", u3k(van), "show"); u3_noun ret = u3i_molt(u3k(sho), u3x_sam, u3k(mol), 0); u3z(mol); @@ -121,7 +121,7 @@ u3_noun rig) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_hook(von, "epla"); + u3_noun gat = u3j_cook("_play_cnts-epla", von, "epla"); return u3n_kick_on(u3i_molt(gat, u3x_sam_2, diff --git a/jets/f/ut_tack.c b/jets/f/ut_tack.c index 6aebab50bc..9328c43aee 100644 --- a/jets/f/ut_tack.c +++ b/jets/f/ut_tack.c @@ -10,7 +10,7 @@ u3_noun mur) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_hook(von, "tack"); + u3_noun gat = u3j_cook("u3qfu_tack-tack", von, "tack"); return u3n_kick_on(u3i_molt(gat, u3x_sam_2, diff --git a/jets/tree.c b/jets/tree.c index 0e35d1b4d9..57f21979ba 100644 --- a/jets/tree.c +++ b/jets/tree.c @@ -2,1389 +2,1086 @@ */ #include "all.h" - static u3j_harm _141_hex_aes_ecba_en_a[] = {{".2", u3wea_ecba_en}, {}}; - static u3j_harm _141_hex_aes_ecba_de_a[] = {{".2", u3wea_ecba_de}, {}}; - static u3j_harm _141_hex_aes_ecbb_en_a[] = {{".2", u3wea_ecbb_en}, {}}; - static u3j_harm _141_hex_aes_ecbb_de_a[] = {{".2", u3wea_ecbb_de}, {}}; - static u3j_harm _141_hex_aes_ecbc_en_a[] = {{".2", u3wea_ecbc_en}, {}}; - static u3j_harm _141_hex_aes_ecbc_de_a[] = {{".2", u3wea_ecbc_de}, {}}; +static u3j_harm _141_hex_aes_ecba_en_a[] = {{".2", u3wea_ecba_en}, {}}; +static c3_c* _141_hex_aes_ecba_en_ha[] = {0}; +static u3j_harm _141_hex_aes_ecba_de_a[] = {{".2", u3wea_ecba_de}, {}}; +static c3_c* _141_hex_aes_ecba_de_ha[] = {0}; +static u3j_harm _141_hex_aes_ecbb_en_a[] = {{".2", u3wea_ecbb_en}, {}}; +static c3_c* _141_hex_aes_ecbb_en_ha[] = {0}; +static u3j_harm _141_hex_aes_ecbb_de_a[] = {{".2", u3wea_ecbb_de}, {}}; +static c3_c* _141_hex_aes_ecbb_de_ha[] = {0}; +static u3j_harm _141_hex_aes_ecbc_en_a[] = {{".2", u3wea_ecbc_en}, {}}; +static c3_c* _141_hex_aes_ecbc_en_ha[] = {0}; +static u3j_harm _141_hex_aes_ecbc_de_a[] = {{".2", u3wea_ecbc_de}, {}}; +static c3_c* _141_hex_aes_ecbc_de_ha[] = {0}; - static u3j_harm _141_hex_aes_cbca_en_a[] = {{".2", u3wea_cbca_en}, {}}; - static u3j_harm _141_hex_aes_cbca_de_a[] = {{".2", u3wea_cbca_de}, {}}; - static u3j_harm _141_hex_aes_cbcb_en_a[] = {{".2", u3wea_cbcb_en}, {}}; - static u3j_harm _141_hex_aes_cbcb_de_a[] = {{".2", u3wea_cbcb_de}, {}}; - static u3j_harm _141_hex_aes_cbcc_en_a[] = {{".2", u3wea_cbcc_en}, {}}; - static u3j_harm _141_hex_aes_cbcc_de_a[] = {{".2", u3wea_cbcc_de}, {}}; +static u3j_harm _141_hex_aes_cbca_en_a[] = {{".2", u3wea_cbca_en}, {}}; +static c3_c* _141_hex_aes_cbca_en_ha[] = {0}; +static u3j_harm _141_hex_aes_cbca_de_a[] = {{".2", u3wea_cbca_de}, {}}; +static c3_c* _141_hex_aes_cbca_de_ha[] = {0}; +static u3j_harm _141_hex_aes_cbcb_en_a[] = {{".2", u3wea_cbcb_en}, {}}; +static c3_c* _141_hex_aes_cbcb_en_ha[] = {0}; +static u3j_harm _141_hex_aes_cbcb_de_a[] = {{".2", u3wea_cbcb_de}, {}}; +static c3_c* _141_hex_aes_cbcb_de_ha[] = {0}; +static u3j_harm _141_hex_aes_cbcc_en_a[] = {{".2", u3wea_cbcc_en}, {}}; +static c3_c* _141_hex_aes_cbcc_en_ha[] = {0}; +static u3j_harm _141_hex_aes_cbcc_de_a[] = {{".2", u3wea_cbcc_de}, {}}; +static c3_c* _141_hex_aes_cbcc_de_ha[] = {0}; - static u3j_core _141_hex_aes_ecba_d[] = - { { "en", _141_hex_aes_ecba_en_a }, - { "de", _141_hex_aes_ecba_de_a }, - {} - }; - - static u3j_core _141_hex_aes_ecbb_d[] = - { { "en", _141_hex_aes_ecbb_en_a }, - { "de", _141_hex_aes_ecbb_de_a }, - {} - }; - - static u3j_core _141_hex_aes_ecbc_d[] = - { { "en", _141_hex_aes_ecbc_en_a }, - { "de", _141_hex_aes_ecbc_de_a }, - {} - }; - - static u3j_core _141_hex_aes_cbca_d[] = - { { "en", _141_hex_aes_cbca_en_a }, - { "de", _141_hex_aes_cbca_de_a }, - {} - }; - - static u3j_core _141_hex_aes_cbcb_d[] = - { { "en", _141_hex_aes_cbcb_en_a }, - { "de", _141_hex_aes_cbcb_de_a }, - {} - }; - - static u3j_core _141_hex_aes_cbcc_d[] = - { { "en", _141_hex_aes_cbcc_en_a }, - { "de", _141_hex_aes_cbcc_de_a }, - {} - }; - - static u3j_core _141_hex_aes_d[] = - { { "ecba", 0, _141_hex_aes_ecba_d }, - { "ecbb", 0, _141_hex_aes_ecbb_d }, - { "ecbc", 0, _141_hex_aes_ecbc_d }, - { "cbca", 0, _141_hex_aes_cbca_d }, - { "cbcb", 0, _141_hex_aes_cbcb_d }, - { "cbcc", 0, _141_hex_aes_cbcc_d }, - {} - }; - - static u3j_harm _141_hex_down_mark_a[] = {{".2", u3wg_down, c3y}, {}}; - static u3j_core _141_hex_down_d[] = - { { "mark", _141_hex_down_mark_a }, - {} - }; - - static u3j_harm _141_hex_lore_a[] = {{".2", u3we_lore}, {}}; - static u3j_harm _141_hex_loss_a[] = {{".2", u3we_loss}, {}}; - static u3j_harm _141_hex_lune_a[] = {{".2", u3we_lune}, {}}; - - static u3j_harm _141_hex_coed__ed_puck_a[] = {{".2", u3wee_puck}, {}}; - static u3j_harm _141_hex_coed__ed_sign_a[] = {{".2", u3wee_sign}, {}}; - static u3j_harm _141_hex_coed__ed_veri_a[] = {{".2", u3wee_veri}, {}}; - static u3j_harm _141_hex_coed__ed_shar_a[] = {{".2", u3wee_shar}, {}}; - - static u3j_core _141_hex_coed__ed_d[] = - { { "sign", _141_hex_coed__ed_sign_a }, - { "puck", _141_hex_coed__ed_puck_a }, - { "veri", _141_hex_coed__ed_veri_a }, - { "shar", _141_hex_coed__ed_shar_a }, - {} - }; -static u3j_core _141_hex_coed_d[] = - { { "ed", 0, _141_hex_coed__ed_d }, +static u3j_core _141_hex_aes_ecba_d[] = + { { "en", 7, _141_hex_aes_ecba_en_a, 0, _141_hex_aes_ecba_en_ha }, + { "de", 7, _141_hex_aes_ecba_de_a, 0, _141_hex_aes_ecba_de_ha }, {} }; +static c3_c* _141_hex_aes_ecba_ha[] = {0}; - static u3j_harm _141_hex_hmac_a[] = {{".2", u3we_hmac}, {}}; +static u3j_core _141_hex_aes_ecbb_d[] = + { { "en", 7, _141_hex_aes_ecbb_en_a, 0, _141_hex_aes_ecbb_en_ha }, + { "de", 7, _141_hex_aes_ecbb_de_a, 0, _141_hex_aes_ecbb_de_ha }, + {} + }; +static c3_c* _141_hex_aes_ecbb_ha[] = {0}; - static u3j_core _141_hex_hmac_d[] = - { { "hmac", _141_hex_hmac_a }, +static u3j_core _141_hex_aes_ecbc_d[] = + { { "en", 7, _141_hex_aes_ecbc_en_a, 0, _141_hex_aes_ecbc_en_ha }, + { "de", 7, _141_hex_aes_ecbc_de_a, 0, _141_hex_aes_ecbc_de_ha }, + {} + }; +static c3_c* _141_hex_aes_ecbc_ha[] = {0}; + +static u3j_core _141_hex_aes_cbca_d[] = + { { "en", 7, _141_hex_aes_cbca_en_a, 0, _141_hex_aes_cbca_en_ha }, + { "de", 7, _141_hex_aes_cbca_de_a, 0, _141_hex_aes_cbca_de_ha }, + {} + }; +static c3_c* _141_hex_aes_cbca_ha[] = {0}; + +static u3j_core _141_hex_aes_cbcb_d[] = + { { "en", 7, _141_hex_aes_cbcb_en_a, 0, _141_hex_aes_cbcb_en_ha }, + { "de", 7, _141_hex_aes_cbcb_de_a, 0, _141_hex_aes_cbcb_de_ha }, + {} + }; +static c3_c* _141_hex_aes_cbcb_ha[] = {0}; + +static u3j_core _141_hex_aes_cbcc_d[] = + { { "en", 7, _141_hex_aes_cbcc_en_a, 0, _141_hex_aes_cbcc_en_ha }, + { "de", 7, _141_hex_aes_cbcc_de_a, 0, _141_hex_aes_cbcc_de_ha }, + {} + }; +static c3_c* _141_hex_aes_cbcc_ha[] = {0}; + +static u3j_core _141_hex_aes_d[] = + { { "ecba", 7, 0, _141_hex_aes_ecba_d, _141_hex_aes_ecba_ha }, + { "ecbb", 7, 0, _141_hex_aes_ecbb_d, _141_hex_aes_ecbb_ha }, + { "ecbc", 7, 0, _141_hex_aes_ecbc_d, _141_hex_aes_ecbc_ha }, + { "cbca", 7, 0, _141_hex_aes_cbca_d, _141_hex_aes_cbca_ha }, + { "cbcb", 7, 0, _141_hex_aes_cbcb_d, _141_hex_aes_cbcb_ha }, + { "cbcc", 7, 0, _141_hex_aes_cbcc_d, _141_hex_aes_cbcc_ha }, + {} + }; +static c3_c* _141_hex_aes_ha[] = {0}; + +static u3j_harm _141_hex_down_mark_a[] = {{".2", u3wg_down, c3y}, {}}; +static c3_c* _141_hex_down_mark_ha[] = {0}; + + static u3j_core _141_hex_down_d[] = + { { "mark", 7, _141_hex_down_mark_a, 0, _141_hex_down_mark_ha }, {} }; +static c3_c* _141_hex_down_ha[] = {0}; + +static u3j_harm _141_hex_lore_a[] = {{".2", u3we_lore}, {}}; +static c3_c* _141_hex_lore_ha[] = {0}; +static u3j_harm _141_hex_loss_a[] = {{".2", u3we_loss}, {}}; +static c3_c* _141_hex_loss_ha[] = {0}; +static u3j_harm _141_hex_lune_a[] = {{".2", u3we_lune}, {}}; +static c3_c* _141_hex_lune_ha[] = {0}; + +static u3j_harm _141_hex_coed__ed_puck_a[] = {{".2", u3wee_puck}, {}}; +static c3_c* _141_hex_coed__ed_puck_ha[] = {0}; +static u3j_harm _141_hex_coed__ed_sign_a[] = {{".2", u3wee_sign}, {}}; +static c3_c* _141_hex_coed__ed_sign_ha[] = {0}; +static u3j_harm _141_hex_coed__ed_veri_a[] = {{".2", u3wee_veri}, {}}; +static c3_c* _141_hex_coed__ed_veri_ha[] = {0}; +static u3j_harm _141_hex_coed__ed_shar_a[] = {{".2", u3wee_shar}, {}}; +static c3_c* _141_hex_coed__ed_shar_ha[] = {0}; + +static u3j_core _141_hex_coed__ed_d[] = + { { "sign", 7, _141_hex_coed__ed_sign_a, 0, _141_hex_coed__ed_sign_ha }, + { "puck", 7, _141_hex_coed__ed_puck_a, 0, _141_hex_coed__ed_puck_ha }, + { "veri", 7, _141_hex_coed__ed_veri_a, 0, _141_hex_coed__ed_veri_ha }, + { "shar", 7, _141_hex_coed__ed_shar_a, 0, _141_hex_coed__ed_shar_ha }, + {} + }; +static c3_c* _141_hex_coed__ed_ha[] = {0}; + +static u3j_core _141_hex_coed_d[] = +{ { "ed", 3, 0, _141_hex_coed__ed_d, _141_hex_coed__ed_ha }, + {} +}; +static c3_c* _141_hex_coed_ha[] = {0}; + + static u3j_harm _141_hex_hmac_hmac_a[] = {{".2", u3we_hmac}, {}}; + static c3_c* _141_hex_hmac_hmac_ha[] = {0}; +static u3j_core _141_hex_hmac_d[] = + { { "hmac", 7, _141_hex_hmac_hmac_a, 0, _141_hex_hmac_hmac_ha }, + {} + }; +static c3_c* _141_hex_hmac_ha[] = {0}; static u3j_harm _141_hex_argon2_a[] = {{".2", u3we_argon2}, {}}; - - static u3j_core _141_hex_argon_d[] = - { { "argon2", _141_hex_argon2_a }, - {} - }; + static c3_c* _141_hex_argon2_ha[] = {0}; +static u3j_core _141_hex_argon_d[] = + { { "argon2", 7, _141_hex_argon2_a, 0, _141_hex_argon2_ha }, + {} + }; +static c3_c* _141_hex_argon_ha[] = {0}; static u3j_harm _141_hex_secp_make_a[] = {{".2", u3we_make, c3y}, {}}; + static c3_c* _141_hex_secp_make_ha[] = {0}; static u3j_harm _141_hex_secp_sign_a[] = {{".2", u3we_sign, c3y}, {}}; + static c3_c* _141_hex_secp_sign_ha[] = {0}; static u3j_harm _141_hex_secp_reco_a[] = {{".2", u3we_reco, c3y}, {}}; + static c3_c* _141_hex_secp_reco_ha[] = {0}; +static u3j_core _141_hex_secp_secp_helper_d[] = + { { "make-k", 7, _141_hex_secp_make_a, 0, _141_hex_secp_make_ha }, + { "ecdsa-raw-sign", 7, _141_hex_secp_sign_a, 0, _141_hex_secp_sign_ha }, + { "ecdsa-raw-recover", 7, _141_hex_secp_reco_a, 0, _141_hex_secp_reco_ha }, + {} + }; +static c3_c* _141_hex_secp_secp_helper_ha[] = {0}; - static u3j_core _141_hex_secp_secp_helper_d[] = - { { "make-k", _141_hex_secp_make_a }, - { "ecdsa-raw-sign", _141_hex_secp_sign_a }, - { "ecdsa-raw-recover", _141_hex_secp_reco_a }, - {} - }; +static u3j_core _141_hex_secp_secp_d[] = + { { "helper", 7, 0, _141_hex_secp_secp_helper_d, _141_hex_secp_secp_helper_ha }, + {} + }; +static c3_c* _141_hex_secp_secp_ha[] = {0}; - static u3j_core _141_hex_secp_secp_d[] = - { { "helper", 0, _141_hex_secp_secp_helper_d }, - {} - }; - - static u3j_core _141_hex_secp_d[] = - { { "secp", 0, _141_hex_secp_secp_d }, - {} - }; +static u3j_core _141_hex_secp_d[] = + { { "secp", 7, 0, _141_hex_secp_secp_d, _141_hex_secp_secp_ha }, + {} + }; +static c3_c* _141_hex_secp_ha[] = {0}; static u3j_harm _141_hex_blake2b_a[] = {{".2", u3we_blake, c3y}, {}}; - - static u3j_core _141_hex_blake_d[] = - { { "blake2b", _141_hex_blake2b_a }, - {} - }; + static c3_c* _141_hex_blake2b_ha[] = {0}; +static u3j_core _141_hex_blake_d[] = + { { "blake2b", 7, _141_hex_blake2b_a, 0, _141_hex_blake2b_ha }, + {} + }; +static c3_c* _141_hex_blake_ha[] = {0}; static u3j_harm _141_hex_ripemd_160_a[] = {{".2", u3we_ripe, c3y}, {}}; - - static u3j_core _141_hex_ripe_d[] = - { { "ripemd160", _141_hex_ripemd_160_a }, - {} - }; + static c3_c* _141_hex_ripemd_160_ha[] = {0}; +static u3j_core _141_hex_ripe_d[] = + { { "ripemd160", 7, _141_hex_ripemd_160_a, 0, _141_hex_ripemd_160_ha }, + {} + }; +static c3_c* _141_hex_ripe_ha[] = {0}; static u3j_core _141_hex_d[] = - { { "down", 0, _141_hex_down_d }, - { "lore", _141_hex_lore_a }, - { "loss", _141_hex_loss_a }, - { "lune", _141_hex_lune_a }, - { "coed", 0, _141_hex_coed_d }, - { "aes", 0, _141_hex_aes_d }, - { "hmac", 0, _141_hex_hmac_d }, - { "argon", 0, _141_hex_argon_d }, - { "blake2b", 0, _141_hex_blake_d }, - { "ripemd", 0, _141_hex_ripe_d }, - { "secp", 0, _141_hex_secp_d }, - {} - }; +{ { "down", 8063, 0, _141_hex_down_d, _141_hex_down_ha }, + + { "lore", 63, _141_hex_lore_a, 0, _141_hex_lore_ha }, + { "loss", 63, _141_hex_loss_a, 0, _141_hex_loss_ha }, + { "lune", 127, _141_hex_lune_a, 0, _141_hex_lune_ha }, + + { "coed", 63, 0, _141_hex_coed_d, _141_hex_coed_ha }, + { "aes", 31, 0, _141_hex_aes_d, _141_hex_aes_ha }, + + { "hmac", 31, 0, _141_hex_hmac_d, _141_hex_hmac_ha }, + { "argon", 15, 0, _141_hex_argon_d, _141_hex_argon_ha }, + { "blake", 15, 0, _141_hex_blake_d, _141_hex_blake_ha }, + { "ripemd", 15, 0, _141_hex_ripe_d, _141_hex_ripe_ha }, + { "secp", 15, 0, _141_hex_secp_d, _141_hex_secp_ha }, + {} +}; +static c3_c* _141_hex_ha[] = {0}; /* layer five */ - static u3j_harm _141_pen_cell_a[] = {{".2", u3wf_cell}, {}}; - static u3j_harm _141_pen_comb_a[] = {{".2", u3wf_comb}, {}}; - static u3j_harm _141_pen_cons_a[] = {{".2", u3wf_cons}, {}}; - static u3j_harm _141_pen_core_a[] = {{".2", u3wf_core}, {}}; - static u3j_harm _141_pen_face_a[] = {{".2", u3wf_face}, {}}; - static u3j_harm _141_pen_fitz_a[] = {{".2", u3wf_fitz}, {}}; - static u3j_harm _141_pen_flan_a[] = {{".2", u3wf_flan}, {}}; - static u3j_harm _141_pen_flip_a[] = {{".2", u3wf_flip}, {}}; - static u3j_harm _141_pen_flor_a[] = {{".2", u3wf_flor}, {}}; - static u3j_harm _141_pen_fork_a[] = {{".2", u3wf_fork}, {}}; - static u3j_harm _141_pen_hike_a[] = {{".2", u3wf_hike}, {}}; - static u3j_harm _141_pen_look_a[] = {{".2", u3wf_look}, {}}; - static u3j_harm _141_pen_loot_a[] = {{".2", u3wf_loot}, {}}; +static u3j_harm _141_pen_cell_a[] = {{".2", u3wf_cell}, {}}; +static c3_c* _141_pen_cell_ha[] = {0}; +static u3j_harm _141_pen_comb_a[] = {{".2", u3wf_comb}, {}}; +static c3_c* _141_pen_comb_ha[] = {0}; +static u3j_harm _141_pen_cons_a[] = {{".2", u3wf_cons}, {}}; +static c3_c* _141_pen_cons_ha[] = {0}; +static u3j_harm _141_pen_core_a[] = {{".2", u3wf_core}, {}}; +static c3_c* _141_pen_core_ha[] = {0}; +static u3j_harm _141_pen_face_a[] = {{".2", u3wf_face}, {}}; +static c3_c* _141_pen_face_ha[] = {0}; +static u3j_harm _141_pen_fitz_a[] = {{".2", u3wf_fitz}, {}}; +static c3_c* _141_pen_fitz_ha[] = {0}; +static u3j_harm _141_pen_flan_a[] = {{".2", u3wf_flan}, {}}; +static c3_c* _141_pen_flan_ha[] = {0}; +static u3j_harm _141_pen_flip_a[] = {{".2", u3wf_flip}, {}}; +static c3_c* _141_pen_flip_ha[] = {0}; +static u3j_harm _141_pen_flor_a[] = {{".2", u3wf_flor}, {}}; +static c3_c* _141_pen_flor_ha[] = {0}; +static u3j_harm _141_pen_fork_a[] = {{".2", u3wf_fork}, {}}; +static c3_c* _141_pen_fork_ha[] = {0}; - static u3j_harm _141_pen__ut_crop_a[] = {{".2", u3wfu_crop}, {}}; - // static u3j_harm _141_pen__ut_fire_a[] = {{".2", u3wfu_fire}, {}}; - static u3j_harm _141_pen__ut_fond_a[] = {{".2", u3wfu_fond}, {}}; - static u3j_harm _141_pen__ut_fish_a[] = {{".2", u3wfu_fish}, {}}; - static u3j_harm _141_pen__ut_fuse_a[] = {{".2", u3wfu_fuse}, {}}; - static u3j_harm _141_pen__ut_mint_a[] = {{".2", u3wfu_mint}, {}}; - static u3j_harm _141_pen__ut_mull_a[] = {{".2", u3wfu_mull}, {}}; - static u3j_harm _141_pen__ut_nest_a[] = {{".2", u3wfu_nest}, {}}; - static u3j_harm _141_pen__ut_peek_a[] = {{".2", u3wfu_peek}, {}}; - static u3j_harm _141_pen__ut_play_a[] = {{".2", u3wfu_play}, {}}; - static u3j_harm _141_pen__ut_rest_a[] = {{".2", u3wfu_rest}, {}}; - static u3j_harm _141_pen__ut_toss_a[] = {{".2", u3wfu_toss}, {}}; - static u3j_harm _141_pen__ut_wrap_a[] = {{".2", u3wfu_wrap}, {}}; - static u3j_core _141_pen__ut_d[] = - { - { "crop", _141_pen__ut_crop_a }, - { "fond", _141_pen__ut_fond_a }, - // { "fire", _141_pen__ut_fire_a }, - { "fish", _141_pen__ut_fish_a }, - { "fuse", _141_pen__ut_fuse_a }, - { "mint", _141_pen__ut_mint_a }, - { "mull", _141_pen__ut_mull_a }, - { "nest", _141_pen__ut_nest_a }, - { "peek", _141_pen__ut_peek_a }, - { "play", _141_pen__ut_play_a }, - { "rest", _141_pen__ut_rest_a }, - { "toss", _141_pen__ut_toss_a }, - { "wrap", _141_pen__ut_wrap_a }, - {} - }; - static u3j_harm _141_pen__ut_a[] = - { {"repo", u3wfu_repo}, - {} - }; +// hike disabled while implementing edit +// static u3j_harm _141_pen_hike_a[] = {{".2", u3wf_hike}, {}}; +// static c3_c* _141_pen_hike_ha[] = {0}; +static u3j_harm _141_pen_look_a[] = {{".2", u3wf_look}, {}}; +static c3_c* _141_pen_look_ha[] = {0}; +static u3j_harm _141_pen_loot_a[] = {{".2", u3wf_loot}, {}}; +static c3_c* _141_pen_loot_ha[] = {0}; + + static u3j_harm _141_pen__ut_crop_a[] = {{".2", u3wfu_crop}, {}}; + static c3_c* _141_pen__ut_crop_ha[] = {0}; + + // XX figure out why this is disabled + // static u3j_harm _141_pen__ut_fire_a[] = {{".2", u3wfu_fire}, {}}; + // static c3_c* _141_pen__ut_fire_ha[] = {0}; + + static u3j_harm _141_pen__ut_fond_a[] = {{".2", u3wfu_fond}, {}}; + static c3_c* _141_pen__ut_fond_ha[] = {0}; + static u3j_harm _141_pen__ut_fish_a[] = {{".2", u3wfu_fish}, {}}; + static c3_c* _141_pen__ut_fish_ha[] = {0}; + static u3j_harm _141_pen__ut_fuse_a[] = {{".2", u3wfu_fuse}, {}}; + static c3_c* _141_pen__ut_fuse_ha[] = {0}; + static u3j_harm _141_pen__ut_mint_a[] = {{".2", u3wfu_mint}, {}}; + static c3_c* _141_pen__ut_mint_ha[] = {0}; + static u3j_harm _141_pen__ut_mull_a[] = {{".2", u3wfu_mull}, {}}; + static c3_c* _141_pen__ut_mull_ha[] = {0}; + static u3j_harm _141_pen__ut_nest_a[] = {{".2", u3wfu_nest}, {}}; + static c3_c* _141_pen__ut_nest_ha[] = {0}; + static u3j_harm _141_pen__ut_peek_a[] = {{".2", u3wfu_peek}, {}}; + static c3_c* _141_pen__ut_peek_ha[] = {0}; + static u3j_harm _141_pen__ut_play_a[] = {{".2", u3wfu_play}, {}}; + static c3_c* _141_pen__ut_play_ha[] = {0}; + static u3j_harm _141_pen__ut_rest_a[] = {{".2", u3wfu_rest}, {}}; + static c3_c* _141_pen__ut_rest_ha[] = {0}; + static u3j_harm _141_pen__ut_toss_a[] = {{".2", u3wfu_toss}, {}}; + static c3_c* _141_pen__ut_toss_ha[] = {0}; + static u3j_harm _141_pen__ut_wrap_a[] = {{".2", u3wfu_wrap}, {}}; + static c3_c* _141_pen__ut_wrap_ha[] = {0}; + +static u3j_core _141_pen__ut_d[] = + { + { "crop", 7, _141_pen__ut_crop_a, 0, _141_pen__ut_crop_ha }, + { "fond", 7, _141_pen__ut_fond_a, 0, _141_pen__ut_fond_ha }, + // { "fire", 7, _141_pen__ut_fire_a, 0, _141_pen__ut_fire_ha }, + { "fish", 7, _141_pen__ut_fish_a, 0, _141_pen__ut_fish_ha }, + { "fuse", 7, _141_pen__ut_fuse_a, 0, _141_pen__ut_fuse_ha }, + { "mint", 7, _141_pen__ut_mint_a, 0, _141_pen__ut_mint_ha }, + { "mull", 7, _141_pen__ut_mull_a, 0, _141_pen__ut_mull_ha }, + { "nest", 7, _141_pen__ut_nest_a, 0, _141_pen__ut_nest_ha }, + { "peek", 7, _141_pen__ut_peek_a, 0, _141_pen__ut_peek_ha }, + { "play", 7, _141_pen__ut_play_a, 0, _141_pen__ut_play_ha }, + { "rest", 7, _141_pen__ut_rest_a, 0, _141_pen__ut_rest_ha }, + { "toss", 7, _141_pen__ut_toss_a, 0, _141_pen__ut_toss_ha }, + { "wrap", 7, _141_pen__ut_wrap_a, 0, _141_pen__ut_wrap_ha }, + {} + }; +static u3j_harm _141_pen__ut_a[] = + { {"repo", u3wfu_repo}, + {} + }; + +static c3_c* _141_pen__ut_ha[] = {0}; + +static u3j_hood _141_pen__ut_ho[] = { + // %ar ar + { "fan", 28, c3n }, + { "rib", 58, c3n }, + { "vet", 118, c3n }, + { "fab", 119, c3n }, + + { "blow", 49131 }, + // %burp burp + { "busk", 0x5ff57 }, + { "buss", 94 }, + { "crop", 4 }, + { "duck", 48087 }, + { "dune", 1524 }, + { "dunk", 763 }, + { "epla", 12283 }, + { "emin", 5998 }, + { "emul", 86 }, + // %feel feel + { "felt", 24046 }, + { "fine", 3004 }, + { "fire", 700 }, + { "fish", 1498 }, + { "fond", 92 }, + { "fund", 1402 }, + { "funk", 0x1757c, c3y, 31 }, + { "fuse", 1534 }, + { "gain", 748 }, + { "lose", 22 }, + // %mile mile + // %mine mine + { "mint", 0x17fd4 }, + { "moot", 2807 }, + { "mull", 11995 }, + { "nest", 380 }, + { "peel", 5999 }, + { "play", 12022 }, + { "peek", 5996 }, + { "repo", 3050 }, + { "rest", 382 }, + { "tack", 351 }, + { "toss", 24042 }, + { "wrap", 6143 }, + {}, +}; + +// XX figure out why this is disabled #if 0 - static u3j_harm _141_pen__ap_a[] = - { {"open", u3wfp_open}, - {"rake", u3wfp_rake}, - {} - }; - static u3j_harm _141_pen__al_a[] = - { {"bunt", u3wfl_bunt}, - {"whip", u3wfl_whip}, - {} - }; +static u3j_harm _141_pen__ap_a[] = + { {"open", u3wfp_open}, + {"rake", u3wfp_rake}, + {} + }; +static c3_c* _141_pen__ap_ha[] = {0}; + +static u3j_harm _141_pen__al_a[] = + { {"bunt", u3wfl_bunt}, + {"whip", u3wfl_whip}, + {} + }; +static c3_c* _141_pen__al_ha[] = {0}; #endif static u3j_core _141_pen_d[] = - { { "hex", 0, _141_hex_d }, +{ { "hex", 3, 0, _141_hex_d, _141_hex_ha }, - { "cell", _141_pen_cell_a }, - { "comb", _141_pen_comb_a }, - { "cons", _141_pen_cons_a }, - { "core", _141_pen_core_a }, - { "face", _141_pen_face_a }, - { "fitz", _141_pen_fitz_a }, - { "flan", _141_pen_flan_a }, - { "flip", _141_pen_flip_a }, - { "flor", _141_pen_flor_a }, - { "fork", _141_pen_fork_a }, - { "hike", _141_pen_hike_a }, - { "look", _141_pen_look_a }, - { "loot", _141_pen_loot_a }, + { "cell", 7, _141_pen_cell_a, 0, _141_pen_cell_ha }, + { "comb", 7, _141_pen_comb_a, 0, _141_pen_comb_ha }, + { "cons", 7, _141_pen_cons_a, 0, _141_pen_cons_ha }, + { "core", 7, _141_pen_core_a, 0, _141_pen_core_ha }, + { "face", 7, _141_pen_face_a, 0, _141_pen_face_ha }, + { "fitz", 7, _141_pen_fitz_a, 0, _141_pen_fitz_ha }, + { "flan", 7, _141_pen_flan_a, 0, _141_pen_flan_ha }, + { "flip", 7, _141_pen_flip_a, 0, _141_pen_flip_ha }, + { "flor", 7, _141_pen_flor_a, 0, _141_pen_flor_ha }, + { "fork", 7, _141_pen_fork_a, 0, _141_pen_fork_ha }, + // { "hike", 7, _141_pen_hike_a, 0, _141_pen_hike_ha }, + { "look", 7, _141_pen_look_a, 0, _141_pen_look_ha }, + { "loot", 7, _141_pen_loot_a, 0, _141_pen_loot_ha }, - // { "ap", _141_pen__ap_a }, - // { "al", _141_pen__al_a }, - { "ut", _141_pen__ut_a, _141_pen__ut_d }, + // { "ap", 7, _141_pen__ap_a, 0, _141_pen__ap_ha }, + // { "al", 7, _141_pen__al_a, 0, _141_pen__al_ha }, + { "ut", 15, _141_pen__ut_a, _141_pen__ut_d, _141_pen__ut_ha, _141_pen__ut_ho }, + {} +}; +static c3_c* _141_pen_ha[] = {0}; - {} - }; +static u3j_hood _141_pen_ho[] = { + { "ap", 24412 }, + { "ut", 11262 }, + {}, +}; /* layer four */ - static u3j_harm _141_qua_trip_a[] = {{".2", u3we_trip}, {}}; +static u3j_harm _141_qua_trip_a[] = {{".2", u3we_trip}, {}}; +static c3_c* _141_qua_trip_ha[] = {0}; - static u3j_harm _141_qua__po_ind_a[] = {{".2", u3wcp_ind}, {}}; - static u3j_harm _141_qua__po_ins_a[] = {{".2", u3wcp_ins}, {}}; - static u3j_harm _141_qua__po_tod_a[] = {{".2", u3wcp_tod}, {}}; - static u3j_harm _141_qua__po_tos_a[] = {{".2", u3wcp_tos}, {}}; - static u3j_core _141_qua__po_d[] = - { { "ind", _141_qua__po_ind_a }, - { "ins", _141_qua__po_ins_a }, - { "tod", _141_qua__po_tod_a }, - { "tos", _141_qua__po_tos_a }, - {} - }; +static u3j_harm _141_qua__po_ind_a[] = {{".2", u3wcp_ind}, {}}; +static c3_c* _141_qua__po_ind_ha[] = {0}; +static u3j_harm _141_qua__po_ins_a[] = {{".2", u3wcp_ins}, {}}; +static c3_c* _141_qua__po_ins_ha[] = {0}; +static u3j_harm _141_qua__po_tod_a[] = {{".2", u3wcp_tod}, {}}; +static c3_c* _141_qua__po_tod_ha[] = {0}; +static u3j_harm _141_qua__po_tos_a[] = {{".2", u3wcp_tos}, {}}; +static c3_c* _141_qua__po_tos_ha[] = {0}; + static u3j_core _141_qua__po_d[] = + { { "ind", 7, _141_qua__po_ind_a, 0, _141_qua__po_ind_ha }, + { "ins", 7, _141_qua__po_ins_a, 0, _141_qua__po_ins_ha }, + { "tod", 7, _141_qua__po_tod_a, 0, _141_qua__po_tod_ha }, + { "tos", 7, _141_qua__po_tos_a, 0, _141_qua__po_tos_ha }, + {} + }; + static c3_c* _141_qua__po_ha[] = {0}; - static u3j_harm _141_qua__bend_fun_a[] = {{".2", u3we_bend_fun}, {}}; - static u3j_core _141_qua__bend_d[] = - { { "fun", _141_qua__bend_fun_a }, - {} - }; +static u3j_harm _141_qua__bend_fun_a[] = {{".2", u3we_bend_fun}, {}}; +static c3_c* _141_qua__bend_fun_ha[] = {0}; + static u3j_core _141_qua__bend_d[] = + { { "fun", 7, _141_qua__bend_fun_a, 0, _141_qua__bend_fun_ha }, + {} + }; + static c3_c* _141_qua__bend_ha[] = {0}; - static u3j_harm _141_qua__cold_fun_a[] = {{".2", u3we_cold_fun}, {}}; - static u3j_core _141_qua__cold_d[] = - { { "fun", _141_qua__cold_fun_a }, - {} - }; +static u3j_harm _141_qua__cold_fun_a[] = {{".2", u3we_cold_fun}, {}}; +static c3_c* _141_qua__cold_fun_ha[] = {0}; + static u3j_core _141_qua__cold_d[] = + { { "fun", 7, _141_qua__cold_fun_a, 0, _141_qua__cold_fun_ha }, + {} + }; + static c3_c* _141_qua__cold_ha[] = {0}; - static u3j_harm _141_qua__cook_fun_a[] = {{".2", u3we_cook_fun}, {}}; - static u3j_core _141_qua__cook_d[] = - { { "fun", _141_qua__cook_fun_a }, - {} - }; +static u3j_harm _141_qua__cook_fun_a[] = {{".2", u3we_cook_fun}, {}}; +static c3_c* _141_qua__cook_fun_ha[] = {0}; + static u3j_core _141_qua__cook_d[] = + { { "fun", 7, _141_qua__cook_fun_a, 0, _141_qua__cook_fun_ha }, + {} + }; + static c3_c* _141_qua__cook_ha[] = {0}; - static u3j_harm _141_qua__comp_fun_a[] = {{".2", u3we_comp_fun}, {}}; - static u3j_core _141_qua__comp_d[] = - { { "fun", _141_qua__comp_fun_a }, - {} - }; +static u3j_harm _141_qua__comp_fun_a[] = {{".2", u3we_comp_fun}, {}}; +static c3_c* _141_qua__comp_fun_ha[] = {0}; + static u3j_core _141_qua__comp_d[] = + { { "fun", 7, _141_qua__comp_fun_a, 0, _141_qua__comp_fun_ha }, + {} + }; + static c3_c* _141_qua__comp_ha[] = {0}; - static u3j_harm _141_qua__easy_fun_a[] = {{".2", u3we_easy_fun}, {}}; - static u3j_core _141_qua__easy_d[] = - { { "fun", _141_qua__easy_fun_a }, - {} - }; +static u3j_harm _141_qua__easy_fun_a[] = {{".2", u3we_easy_fun}, {}}; +static c3_c* _141_qua__easy_fun_ha[] = {0}; + static u3j_core _141_qua__easy_d[] = + { { "fun", 7, _141_qua__easy_fun_a, 0, _141_qua__easy_fun_ha }, + {} + }; + static c3_c* _141_qua__easy_ha[] = {0}; - static u3j_harm _141_qua__glue_fun_a[] = {{".2", u3we_glue_fun}, {}}; - static u3j_core _141_qua__glue_d[] = - { { "fun", _141_qua__glue_fun_a }, - {} - }; +static u3j_harm _141_qua__glue_fun_a[] = {{".2", u3we_glue_fun}, {}}; +static c3_c* _141_qua__glue_fun_ha[] = {0}; + static u3j_core _141_qua__glue_d[] = + { { "fun", 7, _141_qua__glue_fun_a, 0, _141_qua__glue_fun_ha }, + {} + }; + static c3_c* _141_qua__glue_ha[] = {0}; - static u3j_harm _141_qua__here_fun_a[] = {{".2", u3we_here_fun}, {}}; - static u3j_core _141_qua__here_d[] = - { { "fun", _141_qua__here_fun_a }, - {} - }; +static u3j_harm _141_qua__here_fun_a[] = {{".2", u3we_here_fun}, {}}; +static c3_c* _141_qua__here_fun_ha[] = {0}; + static u3j_core _141_qua__here_d[] = + { { "fun", 7, _141_qua__here_fun_a, 0, _141_qua__here_fun_ha }, + {} + }; + static c3_c* _141_qua__here_ha[] = {0}; - static u3j_harm _141_qua__just_fun_a[] = {{".2", u3we_just_fun}, {}}; - static u3j_core _141_qua__just_d[] = - { { "fun", _141_qua__just_fun_a }, - {} - }; +static u3j_harm _141_qua__just_fun_a[] = {{".2", u3we_just_fun}, {}}; +static c3_c* _141_qua__just_fun_ha[] = {0}; + static u3j_core _141_qua__just_d[] = + { { "fun", 7, _141_qua__just_fun_a, 0, _141_qua__just_fun_ha }, + {} + }; + static c3_c* _141_qua__just_ha[] = {0}; - static u3j_harm _141_qua__mask_fun_a[] = {{".2", u3we_mask_fun}, {}}; - static u3j_core _141_qua__mask_d[] = - { { "fun", _141_qua__mask_fun_a }, - {} - }; +static u3j_harm _141_qua__mask_fun_a[] = {{".2", u3we_mask_fun}, {}}; +static c3_c* _141_qua__mask_fun_ha[] = {0}; + static u3j_core _141_qua__mask_d[] = + { { "fun", 7, _141_qua__mask_fun_a, 0, _141_qua__mask_fun_ha }, + {} + }; + static c3_c* _141_qua__mask_ha[] = {0}; - static u3j_harm _141_qua__shim_fun_a[] = {{".2", u3we_shim_fun}, {}}; - static u3j_core _141_qua__shim_d[] = - { { "fun", _141_qua__shim_fun_a }, - {} - }; +static u3j_harm _141_qua__shim_fun_a[] = {{".2", u3we_shim_fun}, {}}; +static c3_c* _141_qua__shim_fun_ha[] = {0}; + static u3j_core _141_qua__shim_d[] = + { { "fun", 7, _141_qua__shim_fun_a, 0, _141_qua__shim_fun_ha }, + {} + }; + static c3_c* _141_qua__shim_ha[] = {0}; - static u3j_harm _141_qua__stag_fun_a[] = {{".2", u3we_stag_fun}, {}}; - static u3j_core _141_qua__stag_d[] = - { { "fun", _141_qua__stag_fun_a }, - {} - }; +static u3j_harm _141_qua__stag_fun_a[] = {{".2", u3we_stag_fun}, {}}; +static c3_c* _141_qua__stag_fun_ha[] = {0}; + static u3j_core _141_qua__stag_d[] = + { { "fun", 7, _141_qua__stag_fun_a, 0, _141_qua__stag_fun_ha }, + {} + }; + static c3_c* _141_qua__stag_ha[] = {0}; - static u3j_harm _141_qua__stew_fun_a[] = {{".2", u3we_stew_fun}, {}}; - static u3j_core _141_qua__stew_d[] = - { { "fun", _141_qua__stew_fun_a }, - {} - }; - - static u3j_harm _141_qua__stir_fun_a[] = {{".2", u3we_stir_fun}, {}}; - static u3j_core _141_qua__stir_d[] = - { { "fun", _141_qua__stir_fun_a }, - {} - }; +static u3j_harm _141_qua__stew_fun_a[] = {{".2", u3we_stew_fun}, {}}; +static c3_c* _141_qua__stew_fun_ha[] = {0}; + static u3j_core _141_qua__stew_d[] = + { { "fun", 7, _141_qua__stew_fun_a, 0, _141_qua__stew_fun_ha }, + {} + }; + static c3_c* _141_qua__stew_ha[] = {0}; - static u3j_harm _141_qua_pfix_a[] = {{".2", u3we_pfix}, {}}; - static u3j_harm _141_qua_plug_a[] = {{".2", u3we_plug}, {}}; - static u3j_harm _141_qua_pose_a[] = {{".2", u3we_pose}, {}}; - static u3j_harm _141_qua_sfix_a[] = {{".2", u3we_sfix}, {}}; +static u3j_harm _141_qua__stir_fun_a[] = {{".2", u3we_stir_fun}, {}}; +static c3_c* _141_qua__stir_fun_ha[] = {0}; + static u3j_core _141_qua__stir_d[] = + { { "fun", 7, _141_qua__stir_fun_a, 0, _141_qua__stir_fun_ha }, + {} + }; + static c3_c* _141_qua__stir_ha[] = {0}; - static u3j_harm _141_qua_mink_a[] = {{".2", u3we_mink}, {}}; - static u3j_harm _141_qua_mule_a[] = {{".2", u3we_mule}, {}}; +// duplicate core re sfix +// static u3j_harm _141_qua_pfix_a[] = {{".2", u3we_pfix}, {}}; +// static c3_c* _141_qua_pfix_ha[] = {0}; + +static u3j_harm _141_qua_plug_a[] = {{".2", u3we_plug}, {}}; +static c3_c* _141_qua_plug_ha[] = {0}; +static u3j_harm _141_qua_pose_a[] = {{".2", u3we_pose}, {}}; +static c3_c* _141_qua_pose_ha[] = {0}; + +// duplicate core re pfix +// static u3j_harm _141_qua_sfix_a[] = {{".2", u3we_sfix}, {}}; +// static c3_c* _141_qua_sfix_ha[] = {0}; + +static u3j_harm _141_qua_mink_a[] = {{".2", u3we_mink}, {}}; +static c3_c* _141_qua_mink_ha[] = {0}; +static u3j_harm _141_qua_mule_a[] = {{".2", u3we_mule}, {}}; +static c3_c* _141_qua_mule_ha[] = {0}; static u3j_core _141_qua_d[] = - { { "pen", 0, _141_pen_d }, +{ { "pen", 3, 0, _141_pen_d, _141_pen_ha, _141_pen_ho }, - { "po", 0, _141_qua__po_d }, + { "po", 7, 0, _141_qua__po_d, _141_qua__po_ha }, - { "trip", _141_qua_trip_a }, + { "trip", 7, _141_qua_trip_a, 0, _141_qua_trip_ha }, - { "bend", 0, _141_qua__bend_d }, - { "cold", 0, _141_qua__cold_d }, - { "comp", 0, _141_qua__comp_d }, - { "cook", 0, _141_qua__cook_d }, - { "easy", 0, _141_qua__easy_d }, - { "glue", 0, _141_qua__glue_d }, - { "here", 0, _141_qua__here_d }, - { "just", 0, _141_qua__just_d }, - { "mask", 0, _141_qua__mask_d }, - { "shim", 0, _141_qua__shim_d }, - { "stag", 0, _141_qua__stag_d }, - { "stew", 0, _141_qua__stew_d }, - { "stir", 0, _141_qua__stir_d }, + { "bend", 7, 0, _141_qua__bend_d, _141_qua__bend_ha }, + { "cold", 7, 0, _141_qua__cold_d, _141_qua__cold_ha }, + { "comp", 7, 0, _141_qua__comp_d, _141_qua__comp_ha }, + { "cook", 7, 0, _141_qua__cook_d, _141_qua__cook_ha }, + { "easy", 7, 0, _141_qua__easy_d, _141_qua__easy_ha }, + { "glue", 7, 0, _141_qua__glue_d, _141_qua__glue_ha }, + { "here", 7, 0, _141_qua__here_d, _141_qua__here_ha }, + { "just", 7, 0, _141_qua__just_d, _141_qua__just_ha }, + { "mask", 7, 0, _141_qua__mask_d, _141_qua__mask_ha }, + { "shim", 7, 0, _141_qua__shim_d, _141_qua__shim_ha }, + { "stag", 7, 0, _141_qua__stag_d, _141_qua__stag_ha }, + { "stew", 7, 0, _141_qua__stew_d, _141_qua__stew_ha }, + { "stir", 7, 0, _141_qua__stir_d, _141_qua__stir_ha }, - { "pfix", _141_qua_pfix_a }, - { "plug", _141_qua_plug_a }, - { "pose", _141_qua_pose_a }, - { "sfix", _141_qua_sfix_a }, + // { "pfix", 7, _141_qua_pfix_a, 0, _141_qua_pfix_ha }, + { "plug", 7, _141_qua_plug_a, 0, _141_qua_plug_ha }, + { "pose", 7, _141_qua_pose_a, 0, _141_qua_pose_ha }, + // { "sfix", 7, _141_qua_sfix_a, 0, _141_qua_sfix_ha }, - { "mink", _141_qua_mink_a }, - { "mule", _141_qua_mule_a }, - {} - }; + { "mink", 7, _141_qua_mink_a, 0, _141_qua_mink_ha }, + { "mule", 7, _141_qua_mule_a, 0, _141_qua_mule_ha }, + {} +}; +static c3_c* _141_qua_ha[] = {0}; + +static u3j_hood _141_qua_ho[] = { + { "mute", 0x17dfc }, + { "show", 0x2fbbaba }, + {}, +}; /* layer three */ - static u3j_harm _141_tri__cofl__drg_a[] = {{".2", u3wef_drg}, {}}; - static u3j_harm _141_tri__cofl__lug_a[] = {{".2", u3wef_lug}, {}}; - static u3j_core _141_tri__cofl_d[] = - { { "drg", _141_tri__cofl__drg_a }, - { "lug", _141_tri__cofl__lug_a }, - {} - }; + static u3j_harm _141_tri__cofl__drg_a[] = {{".2", u3wef_drg}, {}}; + static c3_c* _141_tri__cofl__drg_ha[] = {0}; + static u3j_harm _141_tri__cofl__lug_a[] = {{".2", u3wef_lug}, {}}; + static c3_c* _141_tri__cofl__lug_ha[] = {0}; +static u3j_core _141_tri__cofl_d[] = + { { "drg", 7, _141_tri__cofl__drg_a, 0, _141_tri__cofl__drg_ha }, + { "lug", 7, _141_tri__cofl__lug_a, 0, _141_tri__cofl__lug_ha }, + {} + }; +static c3_c* _141_tri__cofl_ha[] = {0}; - static u3j_harm _141_tri__rd_add_a[] = {{".2", u3wer_add}, {}}; - static u3j_harm _141_tri__rd_sub_a[] = {{".2", u3wer_sub}, {}}; - static u3j_harm _141_tri__rd_mul_a[] = {{".2", u3wer_mul}, {}}; - static u3j_harm _141_tri__rd_div_a[] = {{".2", u3wer_div}, {}}; - static u3j_harm _141_tri__rd_sqt_a[] = {{".2", u3wer_sqt}, {}}; - static u3j_harm _141_tri__rd_fma_a[] = {{".2", u3wer_fma}, {}}; - static u3j_harm _141_tri__rd_lth_a[] = {{".2", u3wer_lth}, {}}; - static u3j_harm _141_tri__rd_lte_a[] = {{".2", u3wer_lte}, {}}; - static u3j_harm _141_tri__rd_equ_a[] = {{".2", u3wer_equ}, {}}; - static u3j_harm _141_tri__rd_gte_a[] = {{".2", u3wer_gte}, {}}; - static u3j_harm _141_tri__rd_gth_a[] = {{".2", u3wer_gth}, {}}; - static u3j_core _141_tri__rd_d[] = - { { "add", _141_tri__rd_add_a }, - { "sub", _141_tri__rd_sub_a }, - { "mul", _141_tri__rd_mul_a }, - { "div", _141_tri__rd_div_a }, - { "sqt", _141_tri__rd_sqt_a }, - { "fma", _141_tri__rd_fma_a }, - { "lth", _141_tri__rd_lth_a }, - { "lte", _141_tri__rd_lte_a }, - { "equ", _141_tri__rd_equ_a }, - { "gte", _141_tri__rd_gte_a }, - { "gth", _141_tri__rd_gth_a }, - {} - }; - static u3j_harm _141_tri__rs_add_a[] = {{".2", u3wet_add}, {}}; - static u3j_harm _141_tri__rs_sub_a[] = {{".2", u3wet_sub}, {}}; - static u3j_harm _141_tri__rs_mul_a[] = {{".2", u3wet_mul}, {}}; - static u3j_harm _141_tri__rs_div_a[] = {{".2", u3wet_div}, {}}; - static u3j_harm _141_tri__rs_sqt_a[] = {{".2", u3wet_sqt}, {}}; - static u3j_harm _141_tri__rs_fma_a[] = {{".2", u3wet_fma}, {}}; - static u3j_harm _141_tri__rs_lth_a[] = {{".2", u3wet_lth}, {}}; - static u3j_harm _141_tri__rs_lte_a[] = {{".2", u3wet_lte}, {}}; - static u3j_harm _141_tri__rs_equ_a[] = {{".2", u3wet_equ}, {}}; - static u3j_harm _141_tri__rs_gte_a[] = {{".2", u3wet_gte}, {}}; - static u3j_harm _141_tri__rs_gth_a[] = {{".2", u3wet_gth}, {}}; - static u3j_core _141_tri__rs_d[] = - { { "add", _141_tri__rs_add_a }, - { "sub", _141_tri__rs_sub_a }, - { "mul", _141_tri__rs_mul_a }, - { "div", _141_tri__rs_div_a }, - { "sqt", _141_tri__rs_sqt_a }, - { "fma", _141_tri__rs_fma_a }, - { "lth", _141_tri__rs_lth_a }, - { "lte", _141_tri__rs_lte_a }, - { "equ", _141_tri__rs_equ_a }, - { "gte", _141_tri__rs_gte_a }, - { "gth", _141_tri__rs_gth_a }, - {} - }; + static u3j_harm _141_tri__rd_add_a[] = {{".2", u3wer_add}, {}}; + static c3_c* _141_tri__rd_add_ha[] = {0}; + static u3j_harm _141_tri__rd_sub_a[] = {{".2", u3wer_sub}, {}}; + static c3_c* _141_tri__rd_sub_ha[] = {0}; + static u3j_harm _141_tri__rd_mul_a[] = {{".2", u3wer_mul}, {}}; + static c3_c* _141_tri__rd_mul_ha[] = {0}; + static u3j_harm _141_tri__rd_div_a[] = {{".2", u3wer_div}, {}}; + static c3_c* _141_tri__rd_div_ha[] = {0}; + static u3j_harm _141_tri__rd_sqt_a[] = {{".2", u3wer_sqt}, {}}; + static c3_c* _141_tri__rd_sqt_ha[] = {0}; + static u3j_harm _141_tri__rd_fma_a[] = {{".2", u3wer_fma}, {}}; + static c3_c* _141_tri__rd_fma_ha[] = {0}; + static u3j_harm _141_tri__rd_lth_a[] = {{".2", u3wer_lth}, {}}; + static c3_c* _141_tri__rd_lth_ha[] = {0}; + static u3j_harm _141_tri__rd_lte_a[] = {{".2", u3wer_lte}, {}}; + static c3_c* _141_tri__rd_lte_ha[] = {0}; + static u3j_harm _141_tri__rd_equ_a[] = {{".2", u3wer_equ}, {}}; + static c3_c* _141_tri__rd_equ_ha[] = {0}; + static u3j_harm _141_tri__rd_gte_a[] = {{".2", u3wer_gte}, {}}; + static c3_c* _141_tri__rd_gte_ha[] = {0}; + static u3j_harm _141_tri__rd_gth_a[] = {{".2", u3wer_gth}, {}}; + static c3_c* _141_tri__rd_gth_ha[] = {0}; +static u3j_core _141_tri__rd_d[] = + { { "add", 7, _141_tri__rd_add_a, 0, _141_tri__rd_add_ha }, + { "sub", 7, _141_tri__rd_sub_a, 0, _141_tri__rd_sub_ha }, + { "mul", 7, _141_tri__rd_mul_a, 0, _141_tri__rd_mul_ha }, + { "div", 7, _141_tri__rd_div_a, 0, _141_tri__rd_div_ha }, + { "sqt", 7, _141_tri__rd_sqt_a, 0, _141_tri__rd_sqt_ha }, + { "fma", 7, _141_tri__rd_fma_a, 0, _141_tri__rd_fma_ha }, + { "lth", 7, _141_tri__rd_lth_a, 0, _141_tri__rd_lth_ha }, + { "lte", 7, _141_tri__rd_lte_a, 0, _141_tri__rd_lte_ha }, + { "equ", 7, _141_tri__rd_equ_a, 0, _141_tri__rd_equ_ha }, + { "gte", 7, _141_tri__rd_gte_a, 0, _141_tri__rd_gte_ha }, + { "gth", 7, _141_tri__rd_gth_a, 0, _141_tri__rd_gth_ha }, + {} + }; +static c3_c* _141_tri__rd_ha[] = {0}; - static u3j_harm _141_tri__rq_add_a[] = {{".2", u3weq_add}, {}}; - static u3j_harm _141_tri__rq_sub_a[] = {{".2", u3weq_sub}, {}}; - static u3j_harm _141_tri__rq_mul_a[] = {{".2", u3weq_mul}, {}}; - static u3j_harm _141_tri__rq_div_a[] = {{".2", u3weq_div}, {}}; - static u3j_harm _141_tri__rq_sqt_a[] = {{".2", u3weq_sqt}, {}}; - static u3j_harm _141_tri__rq_fma_a[] = {{".2", u3weq_fma}, {}}; - static u3j_harm _141_tri__rq_lth_a[] = {{".2", u3weq_lth}, {}}; - static u3j_harm _141_tri__rq_lte_a[] = {{".2", u3weq_lte}, {}}; - static u3j_harm _141_tri__rq_equ_a[] = {{".2", u3weq_equ}, {}}; - static u3j_harm _141_tri__rq_gte_a[] = {{".2", u3weq_gte}, {}}; - static u3j_harm _141_tri__rq_gth_a[] = {{".2", u3weq_gth}, {}}; - static u3j_core _141_tri__rq_d[] = - { { "add", _141_tri__rq_add_a }, - { "sub", _141_tri__rq_sub_a }, - { "mul", _141_tri__rq_mul_a }, - { "div", _141_tri__rq_div_a }, - { "sqt", _141_tri__rq_sqt_a }, - { "fma", _141_tri__rq_fma_a }, - { "lth", _141_tri__rq_lth_a }, - { "lte", _141_tri__rq_lte_a }, - { "equ", _141_tri__rq_equ_a }, - { "gte", _141_tri__rq_gte_a }, - { "gth", _141_tri__rq_gth_a }, - {} - }; + static u3j_harm _141_tri__rs_add_a[] = {{".2", u3wet_add}, {}}; + static c3_c* _141_tri__rs_add_ha[] = {0}; + static u3j_harm _141_tri__rs_sub_a[] = {{".2", u3wet_sub}, {}}; + static c3_c* _141_tri__rs_sub_ha[] = {0}; + static u3j_harm _141_tri__rs_mul_a[] = {{".2", u3wet_mul}, {}}; + static c3_c* _141_tri__rs_mul_ha[] = {0}; + static u3j_harm _141_tri__rs_div_a[] = {{".2", u3wet_div}, {}}; + static c3_c* _141_tri__rs_div_ha[] = {0}; + static u3j_harm _141_tri__rs_sqt_a[] = {{".2", u3wet_sqt}, {}}; + static c3_c* _141_tri__rs_sqt_ha[] = {0}; + static u3j_harm _141_tri__rs_fma_a[] = {{".2", u3wet_fma}, {}}; + static c3_c* _141_tri__rs_fma_ha[] = {0}; + static u3j_harm _141_tri__rs_lth_a[] = {{".2", u3wet_lth}, {}}; + static c3_c* _141_tri__rs_lth_ha[] = {0}; + static u3j_harm _141_tri__rs_lte_a[] = {{".2", u3wet_lte}, {}}; + static c3_c* _141_tri__rs_lte_ha[] = {0}; + static u3j_harm _141_tri__rs_equ_a[] = {{".2", u3wet_equ}, {}}; + static c3_c* _141_tri__rs_equ_ha[] = {0}; + static u3j_harm _141_tri__rs_gte_a[] = {{".2", u3wet_gte}, {}}; + static c3_c* _141_tri__rs_gte_ha[] = {0}; + static u3j_harm _141_tri__rs_gth_a[] = {{".2", u3wet_gth}, {}}; + static c3_c* _141_tri__rs_gth_ha[] = {0}; +static u3j_core _141_tri__rs_d[] = + { { "add", 7, _141_tri__rs_add_a, 0, _141_tri__rs_add_ha }, + { "sub", 7, _141_tri__rs_sub_a, 0, _141_tri__rs_sub_ha }, + { "mul", 7, _141_tri__rs_mul_a, 0, _141_tri__rs_mul_ha }, + { "div", 7, _141_tri__rs_div_a, 0, _141_tri__rs_div_ha }, + { "sqt", 7, _141_tri__rs_sqt_a, 0, _141_tri__rs_sqt_ha }, + { "fma", 7, _141_tri__rs_fma_a, 0, _141_tri__rs_fma_ha }, + { "lth", 7, _141_tri__rs_lth_a, 0, _141_tri__rs_lth_ha }, + { "lte", 7, _141_tri__rs_lte_a, 0, _141_tri__rs_lte_ha }, + { "equ", 7, _141_tri__rs_equ_a, 0, _141_tri__rs_equ_ha }, + { "gte", 7, _141_tri__rs_gte_a, 0, _141_tri__rs_gte_ha }, + { "gth", 7, _141_tri__rs_gth_a, 0, _141_tri__rs_gth_ha }, + {} + }; + static c3_c* _141_tri__rs_ha[] = {0}; - static u3j_harm _141_tri__rh_add_a[] = {{".2", u3wes_add}, {}}; - static u3j_harm _141_tri__rh_sub_a[] = {{".2", u3wes_sub}, {}}; - static u3j_harm _141_tri__rh_mul_a[] = {{".2", u3wes_mul}, {}}; - static u3j_harm _141_tri__rh_div_a[] = {{".2", u3wes_div}, {}}; - static u3j_harm _141_tri__rh_sqt_a[] = {{".2", u3wes_sqt}, {}}; - static u3j_harm _141_tri__rh_fma_a[] = {{".2", u3wes_fma}, {}}; - static u3j_harm _141_tri__rh_lth_a[] = {{".2", u3wes_lth}, {}}; - static u3j_harm _141_tri__rh_lte_a[] = {{".2", u3wes_lte}, {}}; - static u3j_harm _141_tri__rh_equ_a[] = {{".2", u3wes_equ}, {}}; - static u3j_harm _141_tri__rh_gte_a[] = {{".2", u3wes_gte}, {}}; - static u3j_harm _141_tri__rh_gth_a[] = {{".2", u3wes_gth}, {}}; - static u3j_core _141_tri__rh_d[] = - { { "add", _141_tri__rh_add_a }, - { "sub", _141_tri__rh_sub_a }, - { "mul", _141_tri__rh_mul_a }, - { "div", _141_tri__rh_div_a }, - { "sqt", _141_tri__rh_sqt_a }, - { "fma", _141_tri__rh_fma_a }, - { "lth", _141_tri__rh_lth_a }, - { "lte", _141_tri__rh_lte_a }, - { "equ", _141_tri__rh_equ_a }, - { "gte", _141_tri__rh_gte_a }, - { "gth", _141_tri__rh_gth_a }, - {} - }; + static u3j_harm _141_tri__rq_add_a[] = {{".2", u3weq_add}, {}}; + static c3_c* _141_tri__rq_add_ha[] = {0}; + static u3j_harm _141_tri__rq_sub_a[] = {{".2", u3weq_sub}, {}}; + static c3_c* _141_tri__rq_sub_ha[] = {0}; + static u3j_harm _141_tri__rq_mul_a[] = {{".2", u3weq_mul}, {}}; + static c3_c* _141_tri__rq_mul_ha[] = {0}; + static u3j_harm _141_tri__rq_div_a[] = {{".2", u3weq_div}, {}}; + static c3_c* _141_tri__rq_div_ha[] = {0}; + static u3j_harm _141_tri__rq_sqt_a[] = {{".2", u3weq_sqt}, {}}; + static c3_c* _141_tri__rq_sqt_ha[] = {0}; + static u3j_harm _141_tri__rq_fma_a[] = {{".2", u3weq_fma}, {}}; + static c3_c* _141_tri__rq_fma_ha[] = {0}; + static u3j_harm _141_tri__rq_lth_a[] = {{".2", u3weq_lth}, {}}; + static c3_c* _141_tri__rq_lth_ha[] = {0}; + static u3j_harm _141_tri__rq_lte_a[] = {{".2", u3weq_lte}, {}}; + static c3_c* _141_tri__rq_lte_ha[] = {0}; + static u3j_harm _141_tri__rq_equ_a[] = {{".2", u3weq_equ}, {}}; + static c3_c* _141_tri__rq_equ_ha[] = {0}; + static u3j_harm _141_tri__rq_gte_a[] = {{".2", u3weq_gte}, {}}; + static c3_c* _141_tri__rq_gte_ha[] = {0}; + static u3j_harm _141_tri__rq_gth_a[] = {{".2", u3weq_gth}, {}}; + static c3_c* _141_tri__rq_gth_ha[] = {0}; +static u3j_core _141_tri__rq_d[] = + { { "add", 7, _141_tri__rq_add_a, 0, _141_tri__rq_add_ha }, + { "sub", 7, _141_tri__rq_sub_a, 0, _141_tri__rq_sub_ha }, + { "mul", 7, _141_tri__rq_mul_a, 0, _141_tri__rq_mul_ha }, + { "div", 7, _141_tri__rq_div_a, 0, _141_tri__rq_div_ha }, + { "sqt", 7, _141_tri__rq_sqt_a, 0, _141_tri__rq_sqt_ha }, + { "fma", 7, _141_tri__rq_fma_a, 0, _141_tri__rq_fma_ha }, + { "lth", 7, _141_tri__rq_lth_a, 0, _141_tri__rq_lth_ha }, + { "lte", 7, _141_tri__rq_lte_a, 0, _141_tri__rq_lte_ha }, + { "equ", 7, _141_tri__rq_equ_a, 0, _141_tri__rq_equ_ha }, + { "gte", 7, _141_tri__rq_gte_a, 0, _141_tri__rq_gte_ha }, + { "gth", 7, _141_tri__rq_gth_a, 0, _141_tri__rq_gth_ha }, + {} + }; +static c3_c* _141_tri__rq_ha[] = {0}; - static u3j_harm _141_tri__og_raw_a[] = {{".2", u3weo_raw}, {}}; - static u3j_core _141_tri__og_d[] = - { { "raw", _141_tri__og_raw_a }, - {} - }; + static u3j_harm _141_tri__rh_add_a[] = {{".2", u3wes_add}, {}}; + static c3_c* _141_tri__rh_add_ha[] = {0}; + static u3j_harm _141_tri__rh_sub_a[] = {{".2", u3wes_sub}, {}}; + static c3_c* _141_tri__rh_sub_ha[] = {0}; + static u3j_harm _141_tri__rh_mul_a[] = {{".2", u3wes_mul}, {}}; + static c3_c* _141_tri__rh_mul_ha[] = {0}; + static u3j_harm _141_tri__rh_div_a[] = {{".2", u3wes_div}, {}}; + static c3_c* _141_tri__rh_div_ha[] = {0}; + static u3j_harm _141_tri__rh_sqt_a[] = {{".2", u3wes_sqt}, {}}; + static c3_c* _141_tri__rh_sqt_ha[] = {0}; + static u3j_harm _141_tri__rh_fma_a[] = {{".2", u3wes_fma}, {}}; + static c3_c* _141_tri__rh_fma_ha[] = {0}; + static u3j_harm _141_tri__rh_lth_a[] = {{".2", u3wes_lth}, {}}; + static c3_c* _141_tri__rh_lth_ha[] = {0}; + static u3j_harm _141_tri__rh_lte_a[] = {{".2", u3wes_lte}, {}}; + static c3_c* _141_tri__rh_lte_ha[] = {0}; + static u3j_harm _141_tri__rh_equ_a[] = {{".2", u3wes_equ}, {}}; + static c3_c* _141_tri__rh_equ_ha[] = {0}; + static u3j_harm _141_tri__rh_gte_a[] = {{".2", u3wes_gte}, {}}; + static c3_c* _141_tri__rh_gte_ha[] = {0}; + static u3j_harm _141_tri__rh_gth_a[] = {{".2", u3wes_gth}, {}}; + static c3_c* _141_tri__rh_gth_ha[] = {0}; +static u3j_core _141_tri__rh_d[] = + { { "add", 7, _141_tri__rh_add_a, 0, _141_tri__rh_add_ha }, + { "sub", 7, _141_tri__rh_sub_a, 0, _141_tri__rh_sub_ha }, + { "mul", 7, _141_tri__rh_mul_a, 0, _141_tri__rh_mul_ha }, + { "div", 7, _141_tri__rh_div_a, 0, _141_tri__rh_div_ha }, + { "sqt", 7, _141_tri__rh_sqt_a, 0, _141_tri__rh_sqt_ha }, + { "fma", 7, _141_tri__rh_fma_a, 0, _141_tri__rh_fma_ha }, + { "lth", 7, _141_tri__rh_lth_a, 0, _141_tri__rh_lth_ha }, + { "lte", 7, _141_tri__rh_lte_a, 0, _141_tri__rh_lte_ha }, + { "equ", 7, _141_tri__rh_equ_a, 0, _141_tri__rh_equ_ha }, + { "gte", 7, _141_tri__rh_gte_a, 0, _141_tri__rh_gte_ha }, + { "gth", 7, _141_tri__rh_gth_a, 0, _141_tri__rh_gth_ha }, + {} + }; +static c3_c* _141_tri__rh_ha[] = {0}; - static u3j_harm _141_tri_shax_a[] = {{".2", u3we_shax}, {}}; - static u3j_harm _141_tri_shay_a[] = {{".2", u3we_shay}, {}}; - static u3j_harm _141_tri_shas_a[] = {{".2", u3we_shas}, {}}; - static u3j_harm _141_tri_shal_a[] = {{".2", u3we_shal}, {}}; + static u3j_harm _141_tri__og_raw_a[] = {{".2", u3weo_raw}, {}}; + static c3_c* _141_tri__og_raw_ha[] = {0}; +static u3j_core _141_tri__og_d[] = + { { "raw", 7, _141_tri__og_raw_a, 0, _141_tri__og_raw_ha }, + {} + }; +static c3_c* _141_tri__og_ha[] = {0}; + + static u3j_harm _141_tri__sha_sha1_a[] = {{".2", u3we_sha1}, {}}; + static c3_c* _141_tri__sha_sha1_ha[] = {0}; +static u3j_core _141_tri__sha_d[] = + { { "sha1", 7, _141_tri__sha_sha1_a, 0, _141_tri__sha_sha1_ha }, + {} + }; +static c3_c* _141_tri__sha_ha[] = {0}; + +static u3j_harm _141_tri_shax_a[] = {{".2", u3we_shax}, {}}; +static c3_c* _141_tri_shax_ha[] = {0}; +static u3j_harm _141_tri_shay_a[] = {{".2", u3we_shay}, {}}; +static c3_c* _141_tri_shay_ha[] = {0}; +static u3j_harm _141_tri_shas_a[] = {{".2", u3we_shas}, {}}; +static c3_c* _141_tri_shas_ha[] = {0}; +static u3j_harm _141_tri_shal_a[] = {{".2", u3we_shal}, {}}; +static c3_c* _141_tri_shal_ha[] = {0}; static u3j_core _141_tri_d[] = - { { "qua", 0, _141_qua_d }, +{ { "qua", 3, 0, _141_qua_d, _141_qua_ha, _141_qua_ho }, + { "cofl", 7, 0, _141_tri__cofl_d, _141_tri__cofl_ha }, + { "rd", 7, 0, _141_tri__rd_d, _141_tri__rd_ha }, + { "rs", 7, 0, _141_tri__rs_d, _141_tri__rs_ha }, + { "rq", 7, 0, _141_tri__rq_d, _141_tri__rq_ha }, + { "rh", 7, 0, _141_tri__rh_d, _141_tri__rh_ha }, + { "og", 7, 0, _141_tri__og_d, _141_tri__og_ha }, - { "cofl", 0, _141_tri__cofl_d }, - { "rd", 0, _141_tri__rd_d }, - { "rs", 0, _141_tri__rs_d }, - { "rq", 0, _141_tri__rq_d }, - { "rh", 0, _141_tri__rh_d }, - { "og", 0, _141_tri__og_d }, - { "shax", _141_tri_shax_a }, - { "shay", _141_tri_shay_a }, - { "shas", _141_tri_shas_a }, - { "shal", _141_tri_shal_a }, - {} - }; + { "sha", 7, 0, _141_tri__sha_d, _141_tri__sha_ha }, + { "shax", 7, _141_tri_shax_a, 0, _141_tri_shax_ha }, + { "shay", 7, _141_tri_shay_a, 0, _141_tri_shay_ha }, + { "shas", 7, _141_tri_shas_a, 0, _141_tri_shas_ha }, + { "shal", 7, _141_tri_shal_a, 0, _141_tri_shal_ha }, + {} +}; +static c3_c* _141_tri_ha[] = {0}; /* layer two */ - static u3j_harm _141_two_flop_a[] = {{".2", u3wb_flop, c3y}, {}}; - static u3j_harm _141_two_lent_a[] = {{".2", u3wb_lent, c3y}, {}}; - static u3j_harm _141_two_levy_a[] = {{".2", u3wb_levy, c3y}, {}}; - static u3j_harm _141_two_lien_a[] = {{".2", u3wb_lien, c3y}, {}}; - static u3j_harm _141_two_murn_a[] = {{".2", u3wb_murn, c3y}, {}}; - static u3j_harm _141_two_need_a[] = {{".2", u3wb_need, c3y}, {}}; - static u3j_harm _141_two_reap_a[] = {{".2", u3wb_reap, c3y}, {}}; - static u3j_harm _141_two_reel_a[] = {{".2", u3wb_reel, c3y}, {}}; - static u3j_harm _141_two_roll_a[] = {{".2", u3wb_roll, c3y}, {}}; - static u3j_harm _141_two_skid_a[] = {{".2", u3wb_skid, c3y}, {}}; - static u3j_harm _141_two_skim_a[] = {{".2", u3wb_skim, c3y}, {}}; - static u3j_harm _141_two_skip_a[] = {{".2", u3wb_skip, c3y}, {}}; - static u3j_harm _141_two_scag_a[] = {{".2", u3wb_scag, c3y}, {}}; - static u3j_harm _141_two_slag_a[] = {{".2", u3wb_slag, c3y}, {}}; - static u3j_harm _141_two_snag_a[] = {{".2", u3wb_snag, c3y}, {}}; - // static u3j_harm _141_two_sort_a[] = {{".2", u3wb_sort, c3y}, {}}; - static u3j_harm _141_two_turn_a[] = {{".2", u3wb_turn, c3y}, {}}; - static u3j_harm _141_two_weld_a[] = {{".2", u3wb_weld, c3y}, {}}; +static u3j_harm _141_two_flop_a[] = {{".2", u3wb_flop, c3y}, {}}; +static c3_c* _141_two_flop_ha[] = {0}; +static u3j_harm _141_two_lent_a[] = {{".2", u3wb_lent, c3y}, {}}; +static c3_c* _141_two_lent_ha[] = {0}; +static u3j_harm _141_two_levy_a[] = {{".2", u3wb_levy, c3y}, {}}; +static c3_c* _141_two_levy_ha[] = {0}; +static u3j_harm _141_two_lien_a[] = {{".2", u3wb_lien, c3y}, {}}; +static c3_c* _141_two_lien_ha[] = {0}; +static u3j_harm _141_two_murn_a[] = {{".2", u3wb_murn, c3y}, {}}; +static c3_c* _141_two_murn_ha[] = {0}; +static u3j_harm _141_two_need_a[] = {{".2", u3wb_need, c3y}, {}}; +static c3_c* _141_two_need_ha[] = {0}; +static u3j_harm _141_two_reap_a[] = {{".2", u3wb_reap, c3y}, {}}; +static c3_c* _141_two_reap_ha[] = {0}; +static u3j_harm _141_two_reel_a[] = {{".2", u3wb_reel, c3y}, {}}; +static c3_c* _141_two_reel_ha[] = {0}; +static u3j_harm _141_two_roll_a[] = {{".2", u3wb_roll, c3y}, {}}; +static c3_c* _141_two_roll_ha[] = {0}; +static u3j_harm _141_two_skid_a[] = {{".2", u3wb_skid, c3y}, {}}; +static c3_c* _141_two_skid_ha[] = {0}; +static u3j_harm _141_two_skim_a[] = {{".2", u3wb_skim, c3y}, {}}; +static c3_c* _141_two_skim_ha[] = {0}; +static u3j_harm _141_two_skip_a[] = {{".2", u3wb_skip, c3y}, {}}; +static c3_c* _141_two_skip_ha[] = {0}; +static u3j_harm _141_two_scag_a[] = {{".2", u3wb_scag, c3y}, {}}; +static c3_c* _141_two_scag_ha[] = {0}; +static u3j_harm _141_two_slag_a[] = {{".2", u3wb_slag, c3y}, {}}; +static c3_c* _141_two_slag_ha[] = {0}; +static u3j_harm _141_two_snag_a[] = {{".2", u3wb_snag, c3y}, {}}; +static c3_c* _141_two_snag_ha[] = {0}; - static u3j_harm _141_two_bex_a[] = {{".2", u3wc_bex, c3y}, {}}; - static u3j_harm _141_two_can_a[] = {{".2", u3wc_can, c3y}, {}}; - static u3j_harm _141_two_cap_a[] = {{".2", u3wc_cap, c3y}, {}}; - static u3j_harm _141_two_cat_a[] = {{".2", u3wc_cat, c3y}, {}}; - static u3j_harm _141_two_con_a[] = {{".2", u3wc_con, c3y}, {}}; - static u3j_harm _141_two_cut_a[] = {{".2", u3wc_cut, c3y}, {}}; - static u3j_harm _141_two_dis_a[] = {{".2", u3wc_dis, c3y}, {}}; - static u3j_harm _141_two_dor_a[] = {{".2", u3wc_dor, c3y}, {}}; - static u3j_harm _141_two_dvr_a[] = {{".2", u3wc_dvr, c3y}, {}}; - static u3j_harm _141_two_end_a[] = {{".2", u3wc_end, c3y}, {}}; - static u3j_harm _141_two_gor_a[] = {{".2", u3wc_gor, c3y}, {}}; - static u3j_harm _141_two_hor_a[] = {{".2", u3wc_hor, c3y}, {}}; - static u3j_harm _141_two_lsh_a[] = {{".2", u3wc_lsh, c3y}, {}}; - static u3j_harm _141_two_mas_a[] = {{".2", u3wc_mas, c3y}, {}}; - static u3j_harm _141_two_met_a[] = {{".2", u3wc_met, c3y}, {}}; - static u3j_harm _141_two_mix_a[] = {{".2", u3wc_mix, c3y}, {}}; - static u3j_harm _141_two_mug_a[] = {{".2", u3wc_mug, c3y}, {}}; - static u3j_harm _141_two_muk_a[] = {{".2", u3wc_muk, c3y}, {}}; - static u3j_harm _141_two_peg_a[] = {{".2", u3wc_peg, c3y}, {}}; - static u3j_harm _141_two_pow_a[] = {{".2", u3wc_pow, c3y}, {}}; - static u3j_harm _141_two_rap_a[] = {{".2", u3wc_rap, c3y}, {}}; - static u3j_harm _141_two_rep_a[] = {{".2", u3wc_rep, c3y}, {}}; - static u3j_harm _141_two_rip_a[] = {{".2", u3wc_rip, c3y}, {}}; - static u3j_harm _141_two_rsh_a[] = {{".2", u3wc_rsh, c3y}, {}}; - static u3j_harm _141_two_sqt_a[] = {{".2", u3wc_sqt, c3y}, {}}; - static u3j_harm _141_two_vor_a[] = {{".2", u3wc_vor, c3y}, {}}; - static u3j_harm _141_two_xeb_a[] = {{".2", u3wc_xeb, c3y}, {}}; +// https://github.com/urbit/urbit/issues/387 +// static u3j_harm _141_two_sort_a[] = {{".2", u3wb_sort, c3y}, {}}; +// static c3_c* _141_two_sort_ha[] = {0}; +static u3j_harm _141_two_turn_a[] = {{".2", u3wb_turn, c3y}, {}}; +static c3_c* _141_two_turn_ha[] = {0}; +static u3j_harm _141_two_weld_a[] = {{".2", u3wb_weld, c3y}, {}}; +static c3_c* _141_two_weld_ha[] = {0}; +static u3j_harm _141_two_bex_a[] = {{".2", u3wc_bex, c3y}, {}}; +static c3_c* _141_two_bex_ha[] = {0}; +static u3j_harm _141_two_can_a[] = {{".2", u3wc_can, c3y}, {}}; +static c3_c* _141_two_can_ha[] = {0}; +static u3j_harm _141_two_cap_a[] = {{".2", u3wc_cap, c3y}, {}}; +static c3_c* _141_two_cap_ha[] = {0}; +static u3j_harm _141_two_cat_a[] = {{".2", u3wc_cat, c3y}, {}}; +static c3_c* _141_two_cat_ha[] = {0}; +static u3j_harm _141_two_con_a[] = {{".2", u3wc_con, c3y}, {}}; +static c3_c* _141_two_con_ha[] = {0}; +static u3j_harm _141_two_cut_a[] = {{".2", u3wc_cut, c3y}, {}}; +static c3_c* _141_two_cut_ha[] = {0}; +static u3j_harm _141_two_dis_a[] = {{".2", u3wc_dis, c3y}, {}}; +static c3_c* _141_two_dis_ha[] = {0}; +static u3j_harm _141_two_dor_a[] = {{".2", u3wc_dor, c3y}, {}}; +static c3_c* _141_two_dor_ha[] = {0}; +static u3j_harm _141_two_dvr_a[] = {{".2", u3wc_dvr, c3y}, {}}; +static c3_c* _141_two_dvr_ha[] = {0}; +static u3j_harm _141_two_end_a[] = {{".2", u3wc_end, c3y}, {}}; +static c3_c* _141_two_end_ha[] = {0}; +static u3j_harm _141_two_gor_a[] = {{".2", u3wc_gor, c3y}, {}}; +static c3_c* _141_two_gor_ha[] = {0}; +static u3j_harm _141_two_hor_a[] = {{".2", u3wc_hor, c3y}, {}}; +static c3_c* _141_two_hor_ha[] = {0}; +static u3j_harm _141_two_lsh_a[] = {{".2", u3wc_lsh, c3y}, {}}; +static c3_c* _141_two_lsh_ha[] = {0}; +static u3j_harm _141_two_mas_a[] = {{".2", u3wc_mas, c3y}, {}}; +static c3_c* _141_two_mas_ha[] = {0}; +static u3j_harm _141_two_met_a[] = {{".2", u3wc_met, c3y}, {}}; +static c3_c* _141_two_met_ha[] = {0}; +static u3j_harm _141_two_mix_a[] = {{".2", u3wc_mix, c3y}, {}}; +static c3_c* _141_two_mix_ha[] = {0}; +static u3j_harm _141_two_mug_a[] = {{".2", u3wc_mug, c3y}, {}}; +static c3_c* _141_two_mug_ha[] = {0}; +static u3j_harm _141_two_muk_a[] = {{".2", u3wc_muk, c3y}, {}}; +static c3_c* _141_two_muk_ha[] = {0}; +static u3j_harm _141_two_peg_a[] = {{".2", u3wc_peg, c3y}, {}}; +static c3_c* _141_two_peg_ha[] = {0}; +static u3j_harm _141_two_pow_a[] = {{".2", u3wc_pow, c3y}, {}}; +static c3_c* _141_two_pow_ha[] = {0}; +static u3j_harm _141_two_rap_a[] = {{".2", u3wc_rap, c3y}, {}}; +static c3_c* _141_two_rap_ha[] = {0}; +static u3j_harm _141_two_rep_a[] = {{".2", u3wc_rep, c3y}, {}}; +static c3_c* _141_two_rep_ha[] = {0}; +static u3j_harm _141_two_rev_a[] = {{".2", u3wc_rev, c3y}, {}}; +static c3_c* _141_two_rev_ha[] = {0}; +static u3j_harm _141_two_rip_a[] = {{".2", u3wc_rip, c3y}, {}}; +static c3_c* _141_two_rip_ha[] = {0}; +static u3j_harm _141_two_rsh_a[] = {{".2", u3wc_rsh, c3y}, {}}; +static c3_c* _141_two_rsh_ha[] = {0}; +static u3j_harm _141_two_swp_a[] = {{".2", u3wc_swp, c3y}, {}}; +static c3_c* _141_two_swp_ha[] = {0}; +static u3j_harm _141_two_sqt_a[] = {{".2", u3wc_sqt, c3y}, {}}; +static c3_c* _141_two_sqt_ha[] = {0}; +static u3j_harm _141_two_vor_a[] = {{".2", u3wc_vor, c3y}, {}}; +static c3_c* _141_two_vor_ha[] = {0}; +static u3j_harm _141_two_xeb_a[] = {{".2", u3wc_xeb, c3y}, {}}; +static c3_c* _141_two_xeb_ha[] = {0}; - static u3j_harm _141_two__in_bif_a[] = {{".2", u3wdi_bif}, {}}; - static u3j_harm _141_two__in_dif_a[] = {{".2", u3wdi_dif}, {}}; - static u3j_harm _141_two__in_gas_a[] = {{".2", u3wdi_gas}, {}}; - static u3j_harm _141_two__in_has_a[] = {{".2", u3wdi_has}, {}}; - static u3j_harm _141_two__in_mer_a[] = {{".2", u3wdi_mer}, {}}; - // static u3j_harm _141_two__in_int_a[] = {{".2", u3wdi_int}, {}}; - static u3j_harm _141_two__in_put_a[] = {{".2", u3wdi_put}, {}}; - static u3j_harm _141_two__in_tap_a[] = {{".2", u3wdi_tap}, {}}; - static u3j_harm _141_two__in_wyt_a[] = {{".2", u3wdi_wyt}, {}}; - static u3j_harm _141_two__in_uni_a[] = {{".2", u3wdi_uni}, {}}; - static u3j_core _141_two__in_d[] = - { { "bif", _141_two__in_bif_a }, - { "dif", _141_two__in_dif_a }, - { "gas", _141_two__in_gas_a }, - { "has", _141_two__in_has_a }, - { "mer", _141_two__in_mer_a }, - // { "int", _141_two__in_int_a }, - { "put", _141_two__in_put_a }, - { "tap", _141_two__in_tap_a }, - { "wyt", _141_two__in_wyt_a }, - { "uni", _141_two__in_uni_a }, - {} - }; + static u3j_harm _141_two__in_bif_a[] = {{".2", u3wdi_bif}, {}}; + static c3_c* _141_two__in_bif_ha[] = {0}; + static u3j_harm _141_two__in_dif_a[] = {{".2", u3wdi_dif}, {}}; + static c3_c* _141_two__in_dif_ha[] = {0}; + static u3j_harm _141_two__in_gas_a[] = {{".2", u3wdi_gas}, {}}; + static c3_c* _141_two__in_gas_ha[] = {0}; + static u3j_harm _141_two__in_has_a[] = {{".2", u3wdi_has}, {}}; + static c3_c* _141_two__in_has_ha[] = {0}; + static u3j_harm _141_two__in_mer_a[] = {{".2", u3wdi_mer}, {}}; + static c3_c* _141_two__in_mer_ha[] = {0}; - static u3j_harm _141_two__by_bif_a[] = {{".2", u3wdb_bif, c3y}, {}}; - static u3j_harm _141_two__by_dif_a[] = {{".2", u3wdb_dif, c3y}, {}}; - static u3j_harm _141_two__by_gas_a[] = {{".2", u3wdb_gas, c3y}, {}}; - static u3j_harm _141_two__by_get_a[] = {{".2", u3wdb_get, c3y}, {}}; - static u3j_harm _141_two__by_has_a[] = {{".2", u3wdb_has, c3y}, {}}; - // static u3j_harm _141_two__by_int_a[] = {{".2", u3wdb_int, c3y}, {}}; - static u3j_harm _141_two__by_put_a[] = {{".2", u3wdb_put, c3y}, {}}; - static u3j_harm _141_two__by_tap_a[] = {{".2", u3wdb_tap, c3y}, {}}; - // static u3j_harm _141_two__by_uni_a[] = {{".2", u3wdb_uni, c3y}, {}}; - static u3j_core _141_two__by_d[] = - { { "bif", _141_two__by_bif_a }, - { "dif", _141_two__by_dif_a }, - { "gas", _141_two__by_gas_a }, - { "get", _141_two__by_get_a }, - { "has", _141_two__by_has_a }, - // { "int", _141_two__by_int_a }, - { "put", _141_two__by_put_a }, - { "tap", _141_two__by_tap_a }, - // { "uni", _141_two__by_uni_a }, - {} - }; + // https://github.com/urbit/urbit/issues/328 + // static u3j_harm _141_two__in_int_a[] = {{".2", u3wdi_int}, {}}; + // static c3_c* _141_two__in_int_ha[] = {0}; - static u3j_harm _141_two_cue_a[] = {{".2", u3we_cue}, {}}; - static u3j_harm _141_two_jam_a[] = {{".2", u3we_jam}, {}}; - static u3j_harm _141_two_mat_a[] = {{".2", u3we_mat}, {}}; - static u3j_harm _141_two_rub_a[] = {{".2", u3we_rub}, {}}; + static u3j_harm _141_two__in_put_a[] = {{".2", u3wdi_put}, {}}; + static c3_c* _141_two__in_put_ha[] = {0}; + static u3j_harm _141_two__in_tap_a[] = {{".2", u3wdi_tap}, {}}; + static c3_c* _141_two__in_tap_ha[] = {0}; + static u3j_harm _141_two__in_wyt_a[] = {{".2", u3wdi_wyt}, {}}; + static c3_c* _141_two__in_wyt_ha[] = {0}; + static u3j_harm _141_two__in_uni_a[] = {{".2", u3wdi_uni}, {}}; + static c3_c* _141_two__in_uni_ha[] = {0}; +static u3j_core _141_two__in_d[] = + { { "bif", 7, _141_two__in_bif_a, 0, _141_two__in_bif_ha }, + { "dif", 7, _141_two__in_dif_a, 0, _141_two__in_dif_ha }, + { "gas", 7, _141_two__in_gas_a, 0, _141_two__in_gas_ha }, + { "has", 7, _141_two__in_has_a, 0, _141_two__in_has_ha }, + { "mer", 7, _141_two__in_mer_a, 0, _141_two__in_mer_ha }, + // { "int", 7, _141_two__in_int_a, 0, _141_two__in_int_ha }, + { "put", 7, _141_two__in_put_a, 0, _141_two__in_put_ha }, + { "tap", 7, _141_two__in_tap_a, 0, _141_two__in_tap_ha }, + { "wyt", 7, _141_two__in_wyt_a, 0, _141_two__in_wyt_ha }, + { "uni", 7, _141_two__in_uni_a, 0, _141_two__in_uni_ha }, + {} + }; +static c3_c* _141_two__in_ha[] = {0}; + + static u3j_harm _141_two__by_bif_a[] = {{".2", u3wdb_bif, c3y}, {}}; + static c3_c* _141_two__by_bif_ha[] = {0}; + static u3j_harm _141_two__by_dif_a[] = {{".2", u3wdb_dif, c3y}, {}}; + static c3_c* _141_two__by_dif_ha[] = {0}; + static u3j_harm _141_two__by_gas_a[] = {{".2", u3wdb_gas, c3y}, {}}; + static c3_c* _141_two__by_gas_ha[] = {0}; + static u3j_harm _141_two__by_get_a[] = {{".2", u3wdb_get, c3y}, {}}; + static c3_c* _141_two__by_get_ha[] = {0}; + static u3j_harm _141_two__by_has_a[] = {{".2", u3wdb_has, c3y}, {}}; + static c3_c* _141_two__by_has_ha[] = {0}; + + // https://github.com/urbit/urbit/issues/328 + // static u3j_harm _141_two__by_int_a[] = {{".2", u3wdb_int, c3y}, {}}; + // static c3_c* _141_two__by_int_ha[] = {0}; + + static u3j_harm _141_two__by_put_a[] = {{".2", u3wdb_put, c3y}, {}}; + static c3_c* _141_two__by_put_ha[] = {0}; + static u3j_harm _141_two__by_tap_a[] = {{".2", u3wdb_tap, c3y}, {}}; + static c3_c* _141_two__by_tap_ha[] = {0}; + + // https://github.com/urbit/urbit/issues/328 + // static u3j_harm _141_two__by_uni_a[] = {{".2", u3wdb_uni, c3y}, {}}; + // static c3_c* _141_two__by_uni_ha[] = {0}; + +static u3j_core _141_two__by_d[] = + { { "bif", 7, _141_two__by_bif_a, 0, _141_two__by_bif_ha }, + { "dif", 7, _141_two__by_dif_a, 0, _141_two__by_dif_ha }, + { "gas", 7, _141_two__by_gas_a, 0, _141_two__by_gas_ha }, + { "get", 7, _141_two__by_get_a, 0, _141_two__by_get_ha }, + { "has", 7, _141_two__by_has_a, 0, _141_two__by_has_ha }, + // { "int", 7, _141_two__by_int_a, 0, _141_two__by_int_ha }, + { "put", 7, _141_two__by_put_a, 0, _141_two__by_put_ha }, + { "tap", 7, _141_two__by_tap_a, 0, _141_two__by_tap_ha }, + // { "uni", 7, _141_two__by_uni_a, 0, _141_two__by_uni_ha }, + {} + }; +static c3_c* _141_two__by_ha[] = {0}; + +static u3j_harm _141_two_cue_a[] = {{".2", u3we_cue}, {}}; +static c3_c* _141_two_cue_ha[] = {0}; +static u3j_harm _141_two_jam_a[] = {{".2", u3we_jam}, {}}; +static c3_c* _141_two_jam_ha[] = {0}; +static u3j_harm _141_two_mat_a[] = {{".2", u3we_mat}, {}}; +static c3_c* _141_two_mat_ha[] = {0}; +static u3j_harm _141_two_rub_a[] = {{".2", u3we_rub}, {}}; +static c3_c* _141_two_rub_ha[] = {0}; static u3j_core _141_two_d[] = - { { "tri", 0, _141_tri_d }, - { "flop", _141_two_flop_a }, - { "lent", _141_two_lent_a }, - { "levy", _141_two_levy_a }, - { "lien", _141_two_lien_a }, - { "murn", _141_two_murn_a }, - { "need", _141_two_need_a }, - { "reap", _141_two_reap_a }, - { "reel", _141_two_reel_a }, - { "roll", _141_two_roll_a }, - { "skid", _141_two_skid_a }, - { "skim", _141_two_skim_a }, - { "skip", _141_two_skip_a }, - { "scag", _141_two_scag_a }, - { "slag", _141_two_slag_a }, - { "snag", _141_two_snag_a }, -// { "sort", _141_two_sort_a }, - { "turn", _141_two_turn_a }, - { "weld", _141_two_weld_a }, +{ { "tri", 3, 0, _141_tri_d, _141_tri_ha }, - { "bex", _141_two_bex_a }, - { "cat", _141_two_cat_a }, - { "can", _141_two_can_a }, - { "cap", _141_two_cap_a }, - { "con", _141_two_con_a }, - { "cue", _141_two_cue_a }, - { "cut", _141_two_cut_a }, - { "dis", _141_two_dis_a }, - { "dor", _141_two_dor_a }, - { "dvr", _141_two_dvr_a }, - { "end", _141_two_end_a }, - { "gor", _141_two_gor_a }, - { "hor", _141_two_hor_a }, - { "jam", _141_two_jam_a }, - { "lsh", _141_two_lsh_a }, - { "mas", _141_two_mas_a }, - { "mat", _141_two_mat_a }, - { "met", _141_two_met_a }, - { "mix", _141_two_mix_a }, - { "mug", _141_two_mug_a }, - { "muk", _141_two_muk_a }, - { "rap", _141_two_rap_a }, - { "rep", _141_two_rep_a }, - { "rip", _141_two_rip_a }, - { "rsh", _141_two_rsh_a }, - { "rub", _141_two_rub_a }, - { "peg", _141_two_peg_a }, - { "pow", _141_two_pow_a }, - { "sqt", _141_two_sqt_a }, - { "vor", _141_two_vor_a }, - { "xeb", _141_two_xeb_a }, + { "flop", 7, _141_two_flop_a, 0, _141_two_flop_ha }, + { "lent", 7, _141_two_lent_a, 0, _141_two_lent_ha }, + { "levy", 7, _141_two_levy_a, 0, _141_two_levy_ha }, + { "lien", 7, _141_two_lien_a, 0, _141_two_lien_ha }, + { "murn", 7, _141_two_murn_a, 0, _141_two_murn_ha }, + { "need", 7, _141_two_need_a, 0, _141_two_need_ha }, + { "reap", 7, _141_two_reap_a, 0, _141_two_reap_ha }, + { "reel", 7, _141_two_reel_a, 0, _141_two_reel_ha }, + { "roll", 7, _141_two_roll_a, 0, _141_two_roll_ha }, + { "skid", 7, _141_two_skid_a, 0, _141_two_skid_ha }, + { "skim", 7, _141_two_skim_a, 0, _141_two_skim_ha }, + { "skip", 7, _141_two_skip_a, 0, _141_two_skip_ha }, + { "scag", 7, _141_two_scag_a, 0, _141_two_scag_ha }, + { "slag", 7, _141_two_slag_a, 0, _141_two_slag_ha }, + { "snag", 7, _141_two_snag_a, 0, _141_two_snag_ha }, + // { "sort", 7, _141_two_sort_a, 0, _141_two_sort_ha }, + { "turn", 7, _141_two_turn_a, 0, _141_two_turn_ha }, + { "weld", 7, _141_two_weld_a, 0, _141_two_weld_ha }, - { "by", 0, _141_two__by_d }, - { "in", 0, _141_two__in_d }, - }; + { "bex", 7, _141_two_bex_a, 0, _141_two_bex_ha }, + { "cat", 7, _141_two_cat_a, 0, _141_two_cat_ha }, + { "can", 7, _141_two_can_a, 0, _141_two_can_ha }, + { "cap", 7, _141_two_cap_a, 0, _141_two_cap_ha }, + { "con", 7, _141_two_con_a, 0, _141_two_con_ha }, + { "cue", 7, _141_two_cue_a, 0, _141_two_cue_ha }, + { "cut", 7, _141_two_cut_a, 0, _141_two_cut_ha }, + { "dis", 7, _141_two_dis_a, 0, _141_two_dis_ha }, + { "dor", 7, _141_two_dor_a, 0, _141_two_dor_ha }, + { "dvr", 7, _141_two_dvr_a, 0, _141_two_dvr_ha }, + { "end", 7, _141_two_end_a, 0, _141_two_end_ha }, + { "gor", 7, _141_two_gor_a, 0, _141_two_gor_ha }, + { "hor", 7, _141_two_hor_a, 0, _141_two_hor_ha }, + { "jam", 7, _141_two_jam_a, 0, _141_two_jam_ha }, + { "lsh", 7, _141_two_lsh_a, 0, _141_two_lsh_ha }, + { "mas", 7, _141_two_mas_a, 0, _141_two_mas_ha }, + { "mat", 7, _141_two_mat_a, 0, _141_two_mat_ha }, + { "met", 7, _141_two_met_a, 0, _141_two_met_ha }, + { "mix", 7, _141_two_mix_a, 0, _141_two_mix_ha }, + { "mug", 7, _141_two_mug_a, 0, _141_two_mug_ha }, + { "muk", 59, _141_two_muk_a, 0, _141_two_muk_ha }, + { "rap", 7, _141_two_rap_a, 0, _141_two_rap_ha }, + { "rep", 7, _141_two_rep_a, 0, _141_two_rep_ha }, + { "rev", 7, _141_two_rev_a, 0, _141_two_rev_ha }, + { "rip", 7, _141_two_rip_a, 0, _141_two_rip_ha }, + { "rsh", 7, _141_two_rsh_a, 0, _141_two_rsh_ha }, + { "swp", 7, _141_two_swp_a, 0, _141_two_swp_ha }, + { "rub", 7, _141_two_rub_a, 0, _141_two_rub_ha }, + { "peg", 7, _141_two_peg_a, 0, _141_two_peg_ha }, + { "pow", 7, _141_two_pow_a, 0, _141_two_pow_ha }, + { "sqt", 7, _141_two_sqt_a, 0, _141_two_sqt_ha }, + { "vor", 7, _141_two_vor_a, 0, _141_two_vor_ha }, + { "xeb", 7, _141_two_xeb_a, 0, _141_two_xeb_ha }, + { "by", 7, 0, _141_two__by_d, _141_two__by_ha }, + { "in", 7, 0, _141_two__in_d, _141_two__in_ha }, + {} +}; +static c3_c* _141_two_ha[] = {0}; /* layer one */ - static u3j_harm _141_one_add_a[] = {{".2", u3wa_add, c3y}, {}}; - static u3j_harm _141_one_dec_a[] = {{".2", u3wa_dec, c3y}, {}}; - static u3j_harm _141_one_div_a[] = {{".2", u3wa_div, c3y}, {}}; - static u3j_harm _141_one_dvr_a[] = {{".2", u3wc_dvr, c3y}, {}}; - static u3j_harm _141_one_gte_a[] = {{".2", u3wa_gte, c3y}, {}}; - static u3j_harm _141_one_gth_a[] = {{".2", u3wa_gth, c3y}, {}}; - static u3j_harm _141_one_lte_a[] = {{".2", u3wa_lte, c3y}, {}}; - static u3j_harm _141_one_lth_a[] = {{".2", u3wa_lth, c3y}, {}}; - static u3j_harm _141_one_mod_a[] = {{".2", u3wa_mod, c3y}, {}}; - static u3j_harm _141_one_mul_a[] = {{".2", u3wa_mul, c3y}, {}}; - static u3j_harm _141_one_sub_a[] = {{".2", u3wa_sub, c3y}, {}}; +static u3j_harm _141_one_add_a[] = {{".2", u3wa_add, c3y}, {}}; +static c3_c* _141_one_add_ha[] = {0}; +static u3j_harm _141_one_dec_a[] = {{".2", u3wa_dec, c3y}, {}}; +static c3_c* _141_one_dec_ha[] = {0}; +static u3j_harm _141_one_div_a[] = {{".2", u3wa_div, c3y}, {}}; +static c3_c* _141_one_div_ha[] = {0}; +static u3j_harm _141_one_dvr_a[] = {{".2", u3wc_dvr, c3y}, {}}; +static c3_c* _141_one_dvr_ha[] = {0}; +static u3j_harm _141_one_gte_a[] = {{".2", u3wa_gte, c3y}, {}}; +static c3_c* _141_one_gte_ha[] = {0}; +static u3j_harm _141_one_gth_a[] = {{".2", u3wa_gth, c3y}, {}}; +static c3_c* _141_one_gth_ha[] = {0}; +static u3j_harm _141_one_lte_a[] = {{".2", u3wa_lte, c3y}, {}}; +static c3_c* _141_one_lte_ha[] = {0}; +static u3j_harm _141_one_lth_a[] = {{".2", u3wa_lth, c3y}, {}}; +static c3_c* _141_one_lth_ha[] = {0}; +static u3j_harm _141_one_mod_a[] = {{".2", u3wa_mod, c3y}, {}}; +static c3_c* _141_one_mod_ha[] = {0}; +static u3j_harm _141_one_mul_a[] = {{".2", u3wa_mul, c3y}, {}}; +static c3_c* _141_one_mul_ha[] = {0}; +static u3j_harm _141_one_sub_a[] = {{".2", u3wa_sub, c3y}, {}}; +static c3_c* _141_one_sub_ha[] = {0}; - static u3j_harm _141_one_cap_a[] = {{".2", u3wc_cap, c3y}, {}}; - static u3j_harm _141_one_peg_a[] = {{".2", u3wc_peg, c3y}, {}}; - static u3j_harm _141_one_mas_a[] = {{".2", u3wc_mas, c3y}, {}}; +static u3j_harm _141_one_cap_a[] = {{".2", u3wc_cap, c3y}, {}}; +static c3_c* _141_one_cap_ha[] = {0}; +static u3j_harm _141_one_peg_a[] = {{".2", u3wc_peg, c3y}, {}}; +static c3_c* _141_one_peg_ha[] = {0}; +static u3j_harm _141_one_mas_a[] = {{".2", u3wc_mas, c3y}, {}}; +static c3_c* _141_one_mas_ha[] = {0}; static u3j_core _141_one_d[] = - { { "two", 0, _141_two_d }, - { "add", _141_one_add_a }, - { "dec", _141_one_dec_a }, - { "div", _141_one_div_a }, - { "dvr", _141_one_dvr_a }, - { "gte", _141_one_gte_a }, - { "gth", _141_one_gth_a }, - { "lte", _141_one_lte_a }, - { "lth", _141_one_lth_a }, - { "mod", _141_one_mod_a }, - { "mul", _141_one_mul_a }, - { "sub", _141_one_sub_a }, +{ { "two", 3, 0, _141_two_d, _141_two_ha }, - { "cap", _141_one_cap_a }, - { "mas", _141_one_mas_a }, - { "peg", _141_one_peg_a }, + { "add", 7, _141_one_add_a, 0, _141_one_add_ha }, + { "dec", 7, _141_one_dec_a, 0, _141_one_dec_ha }, + { "div", 7, _141_one_div_a, 0, _141_one_div_ha }, + { "dvr", 7, _141_one_dvr_a, 0, _141_one_dvr_ha }, + { "gte", 7, _141_one_gte_a, 0, _141_one_gte_ha }, + { "gth", 7, _141_one_gth_a, 0, _141_one_gth_ha }, + { "lte", 7, _141_one_lte_a, 0, _141_one_lte_ha }, + { "lth", 7, _141_one_lth_a, 0, _141_one_lth_ha }, + { "mod", 7, _141_one_mod_a, 0, _141_one_mod_ha }, + { "mul", 7, _141_one_mul_a, 0, _141_one_mul_ha }, + { "sub", 7, _141_one_sub_a, 0, _141_one_sub_ha }, + + { "cap", 7, _141_one_cap_a, 0, _141_one_cap_ha }, + { "mas", 7, _141_one_mas_a, 0, _141_one_mas_ha }, + { "peg", 7, _141_one_peg_a, 0, _141_one_peg_ha }, + {} +}; +static c3_c* _141_one_ha[] = {0}; - {} - }; u3j_core _k141_d[] = - { { "one", 0, _141_one_d }, - {} - }; - - static u3j_harm _142_hex_aes_ecba_en_a[] = {{".2", u3wea_ecba_en}, {}}; - static u3j_harm _142_hex_aes_ecba_de_a[] = {{".2", u3wea_ecba_de}, {}}; - static u3j_harm _142_hex_aes_ecbb_en_a[] = {{".2", u3wea_ecbb_en}, {}}; - static u3j_harm _142_hex_aes_ecbb_de_a[] = {{".2", u3wea_ecbb_de}, {}}; - static u3j_harm _142_hex_aes_ecbc_en_a[] = {{".2", u3wea_ecbc_en}, {}}; - static u3j_harm _142_hex_aes_ecbc_de_a[] = {{".2", u3wea_ecbc_de}, {}}; - - static u3j_harm _142_hex_aes_cbca_en_a[] = {{".2", u3wea_cbca_en}, {}}; - static u3j_harm _142_hex_aes_cbca_de_a[] = {{".2", u3wea_cbca_de}, {}}; - static u3j_harm _142_hex_aes_cbcb_en_a[] = {{".2", u3wea_cbcb_en}, {}}; - static u3j_harm _142_hex_aes_cbcb_de_a[] = {{".2", u3wea_cbcb_de}, {}}; - static u3j_harm _142_hex_aes_cbcc_en_a[] = {{".2", u3wea_cbcc_en}, {}}; - static u3j_harm _142_hex_aes_cbcc_de_a[] = {{".2", u3wea_cbcc_de}, {}}; - - static u3j_core _142_hex_aes_ecba_d[] = - { { "en", _142_hex_aes_ecba_en_a }, - { "de", _142_hex_aes_ecba_de_a }, - {} - }; - - static u3j_core _142_hex_aes_ecbb_d[] = - { { "en", _142_hex_aes_ecbb_en_a }, - { "de", _142_hex_aes_ecbb_de_a }, - {} - }; - - static u3j_core _142_hex_aes_ecbc_d[] = - { { "en", _142_hex_aes_ecbc_en_a }, - { "de", _142_hex_aes_ecbc_de_a }, - {} - }; - - static u3j_core _142_hex_aes_cbca_d[] = - { { "en", _142_hex_aes_cbca_en_a }, - { "de", _142_hex_aes_cbca_de_a }, - {} - }; - - static u3j_core _142_hex_aes_cbcb_d[] = - { { "en", _142_hex_aes_cbcb_en_a }, - { "de", _142_hex_aes_cbcb_de_a }, - {} - }; - - static u3j_core _142_hex_aes_cbcc_d[] = - { { "en", _142_hex_aes_cbcc_en_a }, - { "de", _142_hex_aes_cbcc_de_a }, - {} - }; - - static u3j_core _142_hex_aes_d[] = - { { "ecba", 0, _142_hex_aes_ecba_d }, - { "ecbb", 0, _142_hex_aes_ecbb_d }, - { "ecbc", 0, _142_hex_aes_ecbc_d }, - { "cbca", 0, _142_hex_aes_cbca_d }, - { "cbcb", 0, _142_hex_aes_cbcb_d }, - { "cbcc", 0, _142_hex_aes_cbcc_d }, - {} - }; - - static u3j_harm _142_hex_down_mark_a[] = {{".2", u3wg_down, c3y}, {}}; - static u3j_core _142_hex_down_d[] = - { { "mark", _142_hex_down_mark_a }, - {} - }; - - static u3j_harm _142_hex_lore_a[] = {{".2", u3we_lore}, {}}; - static u3j_harm _142_hex_loss_a[] = {{".2", u3we_loss}, {}}; - static u3j_harm _142_hex_lune_a[] = {{".2", u3we_lune}, {}}; - - static u3j_harm _142_hex_coed__ed_puck_a[] = {{".2", u3wee_puck}, {}}; - static u3j_harm _142_hex_coed__ed_sign_a[] = {{".2", u3wee_sign}, {}}; - static u3j_harm _142_hex_coed__ed_veri_a[] = {{".2", u3wee_veri}, {}}; - static u3j_harm _142_hex_coed__ed_shar_a[] = {{".2", u3wee_shar}, {}}; - - static u3j_core _142_hex_coed__ed_d[] = - { { "sign", _142_hex_coed__ed_sign_a }, - { "puck", _142_hex_coed__ed_puck_a }, - { "veri", _142_hex_coed__ed_veri_a }, - { "shar", _142_hex_coed__ed_shar_a }, - {} - }; -static u3j_core _142_hex_coed_d[] = - { { "ed", 0, _142_hex_coed__ed_d }, - {} - }; - -static u3j_core _142_hex_d[] = - { { "down", 0, _142_hex_down_d }, - { "lore", _142_hex_lore_a }, - { "loss", _142_hex_loss_a }, - { "lune", _142_hex_lune_a }, - { "coed", 0, _142_hex_coed_d }, - { "aes", 0, _142_hex_aes_d }, - {} - }; - -/* layer five -*/ - static u3j_harm _142_pen_cell_a[] = {{".2", u3wz_cell}, {}}; - static u3j_harm _142_pen_comb_a[] = {{".2", u3wz_comb}, {}}; - static u3j_harm _142_pen_cons_a[] = {{".2", u3wz_cons}, {}}; - static u3j_harm _142_pen_core_a[] = {{".2", u3wz_core}, {}}; - static u3j_harm _142_pen_face_a[] = {{".2", u3wz_face}, {}}; - static u3j_harm _142_pen_fitz_a[] = {{".2", u3wz_fitz}, {}}; - static u3j_harm _142_pen_flan_a[] = {{".2", u3wz_flan}, {}}; - static u3j_harm _142_pen_flip_a[] = {{".2", u3wz_flip}, {}}; - static u3j_harm _142_pen_flor_a[] = {{".2", u3wz_flor}, {}}; - static u3j_harm _142_pen_fork_a[] = {{".2", u3wz_fork}, {}}; - static u3j_harm _142_pen_hike_a[] = {{".2", u3wz_hike}, {}}; - static u3j_harm _142_pen_look_a[] = {{".2", u3wz_look}, {}}; - static u3j_harm _142_pen_loot_a[] = {{".2", u3wz_loot}, {}}; - - static u3j_harm _142_pen__ut_crop_a[] = {{".2", u3wzu_crop}, {}}; - // static u3j_harm _142_pen__ut_fire_a[] = {{".2", u3wzu_fire}, {}}; - static u3j_harm _142_pen__ut_fond_a[] = {{".2", u3wzu_fond}, {}}; - static u3j_harm _142_pen__ut_fish_a[] = {{".2", u3wzu_fish}, {}}; - static u3j_harm _142_pen__ut_fuse_a[] = {{".2", u3wzu_fuse}, {}}; - static u3j_harm _142_pen__ut_mint_a[] = {{".2", u3wzu_mint}, {}}; - static u3j_harm _142_pen__ut_mull_a[] = {{".2", u3wzu_mull}, {}}; - static u3j_harm _142_pen__ut_nest_a[] = {{".2", u3wzu_nest}, {}}; - static u3j_harm _142_pen__ut_peek_a[] = {{".2", u3wzu_peek}, {}}; - static u3j_harm _142_pen__ut_play_a[] = {{".2", u3wzu_play}, {}}; - static u3j_harm _142_pen__ut_rest_a[] = {{".2", u3wzu_rest}, {}}; - static u3j_harm _142_pen__ut_toss_a[] = {{".2", u3wzu_toss}, {}}; - static u3j_harm _142_pen__ut_wrap_a[] = {{".2", u3wzu_wrap}, {}}; - static u3j_core _142_pen__ut_d[] = - { - { "crop", _142_pen__ut_crop_a }, - { "fond", _142_pen__ut_fond_a }, - // { "fire", _142_pen__ut_fire_a }, - { "fish", _142_pen__ut_fish_a }, - { "fuse", _142_pen__ut_fuse_a }, - { "mint", _142_pen__ut_mint_a }, - { "mull", _142_pen__ut_mull_a }, - { "nest", _142_pen__ut_nest_a }, - { "peek", _142_pen__ut_peek_a }, - { "play", _142_pen__ut_play_a }, - { "rest", _142_pen__ut_rest_a }, - { "toss", _142_pen__ut_toss_a }, - { "wrap", _142_pen__ut_wrap_a }, - {} - }; - static u3j_harm _142_pen__ut_a[] = - { {"repo", u3wzu_repo}, - {} - }; - -static u3j_core _142_pen_d[] = - { { "hex", 0, _142_hex_d }, - - { "cell", _142_pen_cell_a }, - { "comb", _142_pen_comb_a }, - { "cons", _142_pen_cons_a }, - { "core", _142_pen_core_a }, - { "face", _142_pen_face_a }, - { "fitz", _142_pen_fitz_a }, - { "flan", _142_pen_flan_a }, - { "flip", _142_pen_flip_a }, - { "flor", _142_pen_flor_a }, - { "fork", _142_pen_fork_a }, - { "hike", _142_pen_hike_a }, - { "look", _142_pen_look_a }, - { "loot", _142_pen_loot_a }, - - // { "ap", _142_pen__ap_a }, - // { "al", _142_pen__al_a }, - { "ut", _142_pen__ut_a, _142_pen__ut_d }, - - {} - }; - -/* layer four -*/ - static u3j_harm _142_qua_trip_a[] = {{".2", u3we_trip}, {}}; - - static u3j_harm _142_qua__po_ind_a[] = {{".2", u3wcp_ind}, {}}; - static u3j_harm _142_qua__po_ins_a[] = {{".2", u3wcp_ins}, {}}; - static u3j_harm _142_qua__po_tod_a[] = {{".2", u3wcp_tod}, {}}; - static u3j_harm _142_qua__po_tos_a[] = {{".2", u3wcp_tos}, {}}; - static u3j_core _142_qua__po_d[] = - { { "ind", _142_qua__po_ind_a }, - { "ins", _142_qua__po_ins_a }, - { "tod", _142_qua__po_tod_a }, - { "tos", _142_qua__po_tos_a }, - {} - }; - - static u3j_harm _142_qua__bend_fun_a[] = {{".2", u3we_bend_fun}, {}}; - static u3j_core _142_qua__bend_d[] = - { { "fun", _142_qua__bend_fun_a }, - {} - }; - - static u3j_harm _142_qua__cold_fun_a[] = {{".2", u3we_cold_fun}, {}}; - static u3j_core _142_qua__cold_d[] = - { { "fun", _142_qua__cold_fun_a }, - {} - }; - - static u3j_harm _142_qua__cook_fun_a[] = {{".2", u3we_cook_fun}, {}}; - static u3j_core _142_qua__cook_d[] = - { { "fun", _142_qua__cook_fun_a }, - {} - }; - - static u3j_harm _142_qua__comp_fun_a[] = {{".2", u3we_comp_fun}, {}}; - static u3j_core _142_qua__comp_d[] = - { { "fun", _142_qua__comp_fun_a }, - {} - }; - - static u3j_harm _142_qua__easy_fun_a[] = {{".2", u3we_easy_fun}, {}}; - static u3j_core _142_qua__easy_d[] = - { { "fun", _142_qua__easy_fun_a }, - {} - }; - - static u3j_harm _142_qua__glue_fun_a[] = {{".2", u3we_glue_fun}, {}}; - static u3j_core _142_qua__glue_d[] = - { { "fun", _142_qua__glue_fun_a }, - {} - }; - - static u3j_harm _142_qua__here_fun_a[] = {{".2", u3we_here_fun}, {}}; - static u3j_core _142_qua__here_d[] = - { { "fun", _142_qua__here_fun_a }, - {} - }; - - static u3j_harm _142_qua__just_fun_a[] = {{".2", u3we_just_fun}, {}}; - static u3j_core _142_qua__just_d[] = - { { "fun", _142_qua__just_fun_a }, - {} - }; - - static u3j_harm _142_qua__mask_fun_a[] = {{".2", u3we_mask_fun}, {}}; - static u3j_core _142_qua__mask_d[] = - { { "fun", _142_qua__mask_fun_a }, - {} - }; - - static u3j_harm _142_qua__shim_fun_a[] = {{".2", u3we_shim_fun}, {}}; - static u3j_core _142_qua__shim_d[] = - { { "fun", _142_qua__shim_fun_a }, - {} - }; - - static u3j_harm _142_qua__stag_fun_a[] = {{".2", u3we_stag_fun}, {}}; - static u3j_core _142_qua__stag_d[] = - { { "fun", _142_qua__stag_fun_a }, - {} - }; - - static u3j_harm _142_qua__stew_fun_a[] = {{".2", u3we_stew_fun}, {}}; - static u3j_core _142_qua__stew_d[] = - { { "fun", _142_qua__stew_fun_a }, - {} - }; - - static u3j_harm _142_qua__stir_fun_a[] = {{".2", u3we_stir_fun}, {}}; - static u3j_core _142_qua__stir_d[] = - { { "fun", _142_qua__stir_fun_a }, - {} - }; - - static u3j_harm _142_qua_pfix_a[] = {{".2", u3we_pfix}, {}}; - static u3j_harm _142_qua_plug_a[] = {{".2", u3we_plug}, {}}; - static u3j_harm _142_qua_pose_a[] = {{".2", u3we_pose}, {}}; - static u3j_harm _142_qua_sfix_a[] = {{".2", u3we_sfix}, {}}; - - static u3j_harm _142_qua_mink_a[] = {{".2", u3we_mink}, {}}; - static u3j_harm _142_qua_mule_a[] = {{".2", u3we_mule}, {}}; - -static u3j_core _142_qua_d[] = - { { "pen", 0, _142_pen_d }, - - { "po", 0, _142_qua__po_d }, - - { "trip", _142_qua_trip_a }, - - { "bend", 0, _142_qua__bend_d }, - { "cold", 0, _142_qua__cold_d }, - { "comp", 0, _142_qua__comp_d }, - { "cook", 0, _142_qua__cook_d }, - { "easy", 0, _142_qua__easy_d }, - { "glue", 0, _142_qua__glue_d }, - { "here", 0, _142_qua__here_d }, - { "just", 0, _142_qua__just_d }, - { "mask", 0, _142_qua__mask_d }, - { "shim", 0, _142_qua__shim_d }, - { "stag", 0, _142_qua__stag_d }, - { "stew", 0, _142_qua__stew_d }, - { "stir", 0, _142_qua__stir_d }, - - { "pfix", _142_qua_pfix_a }, - { "plug", _142_qua_plug_a }, - { "pose", _142_qua_pose_a }, - { "sfix", _142_qua_sfix_a }, - - { "mink", _142_qua_mink_a }, - { "mule", _142_qua_mule_a }, - {} - }; - -/* layer three -*/ - static u3j_harm _142_tri__cofl__drg_a[] = {{".2", u3wef_drg}, {}}; - static u3j_harm _142_tri__cofl__lug_a[] = {{".2", u3wef_lug}, {}}; - static u3j_core _142_tri__cofl_d[] = - { { "drg", _142_tri__cofl__drg_a }, - { "lug", _142_tri__cofl__lug_a }, - {} - }; - - static u3j_harm _142_tri__rd_add_a[] = {{".2", u3wer_add}, {}}; - static u3j_harm _142_tri__rd_sub_a[] = {{".2", u3wer_sub}, {}}; - static u3j_harm _142_tri__rd_mul_a[] = {{".2", u3wer_mul}, {}}; - static u3j_harm _142_tri__rd_div_a[] = {{".2", u3wer_div}, {}}; - static u3j_harm _142_tri__rd_sqt_a[] = {{".2", u3wer_sqt}, {}}; - static u3j_harm _142_tri__rd_fma_a[] = {{".2", u3wer_fma}, {}}; - static u3j_harm _142_tri__rd_lth_a[] = {{".2", u3wer_lth}, {}}; - static u3j_harm _142_tri__rd_lte_a[] = {{".2", u3wer_lte}, {}}; - static u3j_harm _142_tri__rd_equ_a[] = {{".2", u3wer_equ}, {}}; - static u3j_harm _142_tri__rd_gte_a[] = {{".2", u3wer_gte}, {}}; - static u3j_harm _142_tri__rd_gth_a[] = {{".2", u3wer_gth}, {}}; - static u3j_core _142_tri__rd_d[] = - { { "add", _142_tri__rd_add_a }, - { "sub", _142_tri__rd_sub_a }, - { "mul", _142_tri__rd_mul_a }, - { "div", _142_tri__rd_div_a }, - { "sqt", _142_tri__rd_sqt_a }, - { "fma", _142_tri__rd_fma_a }, - { "lth", _142_tri__rd_lth_a }, - { "lte", _142_tri__rd_lte_a }, - { "equ", _142_tri__rd_equ_a }, - { "gte", _142_tri__rd_gte_a }, - { "gth", _142_tri__rd_gth_a }, - {} - }; - static u3j_harm _142_tri__rs_add_a[] = {{".2", u3wet_add}, {}}; - static u3j_harm _142_tri__rs_sub_a[] = {{".2", u3wet_sub}, {}}; - static u3j_harm _142_tri__rs_mul_a[] = {{".2", u3wet_mul}, {}}; - static u3j_harm _142_tri__rs_div_a[] = {{".2", u3wet_div}, {}}; - static u3j_harm _142_tri__rs_sqt_a[] = {{".2", u3wet_sqt}, {}}; - static u3j_harm _142_tri__rs_fma_a[] = {{".2", u3wet_fma}, {}}; - static u3j_harm _142_tri__rs_lth_a[] = {{".2", u3wet_lth}, {}}; - static u3j_harm _142_tri__rs_lte_a[] = {{".2", u3wet_lte}, {}}; - static u3j_harm _142_tri__rs_equ_a[] = {{".2", u3wet_equ}, {}}; - static u3j_harm _142_tri__rs_gte_a[] = {{".2", u3wet_gte}, {}}; - static u3j_harm _142_tri__rs_gth_a[] = {{".2", u3wet_gth}, {}}; - static u3j_core _142_tri__rs_d[] = - { { "add", _142_tri__rs_add_a }, - { "sub", _142_tri__rs_sub_a }, - { "mul", _142_tri__rs_mul_a }, - { "div", _142_tri__rs_div_a }, - { "sqt", _142_tri__rs_sqt_a }, - { "fma", _142_tri__rs_fma_a }, - { "lth", _142_tri__rs_lth_a }, - { "lte", _142_tri__rs_lte_a }, - { "equ", _142_tri__rs_equ_a }, - { "gte", _142_tri__rs_gte_a }, - { "gth", _142_tri__rs_gth_a }, - {} - }; - - static u3j_harm _142_tri__rq_add_a[] = {{".2", u3weq_add}, {}}; - static u3j_harm _142_tri__rq_sub_a[] = {{".2", u3weq_sub}, {}}; - static u3j_harm _142_tri__rq_mul_a[] = {{".2", u3weq_mul}, {}}; - static u3j_harm _142_tri__rq_div_a[] = {{".2", u3weq_div}, {}}; - static u3j_harm _142_tri__rq_sqt_a[] = {{".2", u3weq_sqt}, {}}; - static u3j_harm _142_tri__rq_fma_a[] = {{".2", u3weq_fma}, {}}; - static u3j_harm _142_tri__rq_lth_a[] = {{".2", u3weq_lth}, {}}; - static u3j_harm _142_tri__rq_lte_a[] = {{".2", u3weq_lte}, {}}; - static u3j_harm _142_tri__rq_equ_a[] = {{".2", u3weq_equ}, {}}; - static u3j_harm _142_tri__rq_gte_a[] = {{".2", u3weq_gte}, {}}; - static u3j_harm _142_tri__rq_gth_a[] = {{".2", u3weq_gth}, {}}; - static u3j_core _142_tri__rq_d[] = - { { "add", _142_tri__rq_add_a }, - { "sub", _142_tri__rq_sub_a }, - { "mul", _142_tri__rq_mul_a }, - { "div", _142_tri__rq_div_a }, - { "sqt", _142_tri__rq_sqt_a }, - { "fma", _142_tri__rq_fma_a }, - { "lth", _142_tri__rq_lth_a }, - { "lte", _142_tri__rq_lte_a }, - { "equ", _142_tri__rq_equ_a }, - { "gte", _142_tri__rq_gte_a }, - { "gth", _142_tri__rq_gth_a }, - {} - }; - - static u3j_harm _142_tri__rh_add_a[] = {{".2", u3wes_add}, {}}; - static u3j_harm _142_tri__rh_sub_a[] = {{".2", u3wes_sub}, {}}; - static u3j_harm _142_tri__rh_mul_a[] = {{".2", u3wes_mul}, {}}; - static u3j_harm _142_tri__rh_div_a[] = {{".2", u3wes_div}, {}}; - static u3j_harm _142_tri__rh_sqt_a[] = {{".2", u3wes_sqt}, {}}; - static u3j_harm _142_tri__rh_fma_a[] = {{".2", u3wes_fma}, {}}; - static u3j_harm _142_tri__rh_lth_a[] = {{".2", u3wes_lth}, {}}; - static u3j_harm _142_tri__rh_lte_a[] = {{".2", u3wes_lte}, {}}; - static u3j_harm _142_tri__rh_equ_a[] = {{".2", u3wes_equ}, {}}; - static u3j_harm _142_tri__rh_gte_a[] = {{".2", u3wes_gte}, {}}; - static u3j_harm _142_tri__rh_gth_a[] = {{".2", u3wes_gth}, {}}; - static u3j_core _142_tri__rh_d[] = - { { "add", _142_tri__rh_add_a }, - { "sub", _142_tri__rh_sub_a }, - { "mul", _142_tri__rh_mul_a }, - { "div", _142_tri__rh_div_a }, - { "sqt", _142_tri__rh_sqt_a }, - { "fma", _142_tri__rh_fma_a }, - { "lth", _142_tri__rh_lth_a }, - { "lte", _142_tri__rh_lte_a }, - { "equ", _142_tri__rh_equ_a }, - { "gte", _142_tri__rh_gte_a }, - { "gth", _142_tri__rh_gth_a }, - {} - }; - - static u3j_harm _142_tri__og_raw_a[] = {{".2", u3weo_raw}, {}}; - static u3j_core _142_tri__og_d[] = - { { "raw", _142_tri__og_raw_a }, - {} - }; - - static u3j_harm _142_tri__sha_sha1_a[] = {{".2", u3we_sha1}, {}}; - static u3j_core _142_tri__sha_d[] = - { { "sha1", _142_tri__sha_sha1_a }, - {} - }; - - static u3j_harm _142_tri_shax_a[] = {{".2", u3we_shax}, {}}; - static u3j_harm _142_tri_shay_a[] = {{".2", u3we_shay}, {}}; - static u3j_harm _142_tri_shas_a[] = {{".2", u3we_shas}, {}}; - static u3j_harm _142_tri_shal_a[] = {{".2", u3we_shal}, {}}; - -static u3j_core _142_tri_d[] = - { { "qua", 0, _142_qua_d }, - - { "cofl", 0, _142_tri__cofl_d }, - { "rd", 0, _142_tri__rd_d }, - { "rs", 0, _142_tri__rs_d }, - { "rq", 0, _142_tri__rq_d }, - { "rh", 0, _142_tri__rh_d }, - { "og", 0, _142_tri__og_d }, - { "sha", 0, _142_tri__sha_d }, - { "shax", _142_tri_shax_a }, - { "shay", _142_tri_shay_a }, - { "shas", _142_tri_shas_a }, - { "shal", _142_tri_shal_a }, - {} - }; - -/* layer two -*/ - static u3j_harm _142_two_flop_a[] = {{".2", u3wb_flop, c3y}, {}}; - static u3j_harm _142_two_lent_a[] = {{".2", u3wb_lent, c3y}, {}}; - static u3j_harm _142_two_levy_a[] = {{".2", u3wb_levy, c3y}, {}}; - static u3j_harm _142_two_lien_a[] = {{".2", u3wb_lien, c3y}, {}}; - static u3j_harm _142_two_murn_a[] = {{".2", u3wb_murn, c3y}, {}}; - static u3j_harm _142_two_need_a[] = {{".2", u3wb_need, c3y}, {}}; - static u3j_harm _142_two_reap_a[] = {{".2", u3wb_reap, c3y}, {}}; - static u3j_harm _142_two_reel_a[] = {{".2", u3wb_reel, c3y}, {}}; - static u3j_harm _142_two_roll_a[] = {{".2", u3wb_roll, c3y}, {}}; - static u3j_harm _142_two_skid_a[] = {{".2", u3wb_skid, c3y}, {}}; - static u3j_harm _142_two_skim_a[] = {{".2", u3wb_skim, c3y}, {}}; - static u3j_harm _142_two_skip_a[] = {{".2", u3wb_skip, c3y}, {}}; - static u3j_harm _142_two_scag_a[] = {{".2", u3wb_scag, c3y}, {}}; - static u3j_harm _142_two_slag_a[] = {{".2", u3wb_slag, c3y}, {}}; - static u3j_harm _142_two_snag_a[] = {{".2", u3wb_snag, c3y}, {}}; - // static u3j_harm _142_two_sort_a[] = {{".2", u3wb_sort, c3y}, {}}; - static u3j_harm _142_two_turn_a[] = {{".2", u3wb_turn, c3y}, {}}; - static u3j_harm _142_two_weld_a[] = {{".2", u3wb_weld, c3y}, {}}; - - static u3j_harm _142_two_bex_a[] = {{".2", u3wc_bex, c3y}, {}}; - static u3j_harm _142_two_can_a[] = {{".2", u3wc_can, c3y}, {}}; - static u3j_harm _142_two_cap_a[] = {{".2", u3wc_cap, c3y}, {}}; - static u3j_harm _142_two_cat_a[] = {{".2", u3wc_cat, c3y}, {}}; - static u3j_harm _142_two_con_a[] = {{".2", u3wc_con, c3y}, {}}; - static u3j_harm _142_two_cut_a[] = {{".2", u3wc_cut, c3y}, {}}; - static u3j_harm _142_two_dis_a[] = {{".2", u3wc_dis, c3y}, {}}; - static u3j_harm _142_two_dor_a[] = {{".2", u3wc_dor, c3y}, {}}; - static u3j_harm _142_two_dvr_a[] = {{".2", u3wc_dvr, c3y}, {}}; - static u3j_harm _142_two_end_a[] = {{".2", u3wc_end, c3y}, {}}; - static u3j_harm _142_two_gor_a[] = {{".2", u3wc_gor, c3y}, {}}; - static u3j_harm _142_two_hor_a[] = {{".2", u3wc_hor, c3y}, {}}; - static u3j_harm _142_two_lsh_a[] = {{".2", u3wc_lsh, c3y}, {}}; - static u3j_harm _142_two_mas_a[] = {{".2", u3wc_mas, c3y}, {}}; - static u3j_harm _142_two_met_a[] = {{".2", u3wc_met, c3y}, {}}; - static u3j_harm _142_two_mix_a[] = {{".2", u3wc_mix, c3y}, {}}; - static u3j_harm _142_two_mug_a[] = {{".2", u3wc_mug, c3y}, {}}; - static u3j_harm _142_two_muk_a[] = {{".2", u3wc_muk, c3y}, {}}; - static u3j_harm _142_two_peg_a[] = {{".2", u3wc_peg, c3y}, {}}; - static u3j_harm _142_two_pow_a[] = {{".2", u3wc_pow, c3y}, {}}; - static u3j_harm _142_two_rap_a[] = {{".2", u3wc_rap, c3y}, {}}; - static u3j_harm _142_two_rep_a[] = {{".2", u3wc_rep, c3y}, {}}; - static u3j_harm _142_two_rev_a[] = {{".2", u3wc_rev, c3y}, {}}; - static u3j_harm _142_two_rip_a[] = {{".2", u3wc_rip, c3y}, {}}; - static u3j_harm _142_two_rsh_a[] = {{".2", u3wc_rsh, c3y}, {}}; - static u3j_harm _142_two_swp_a[] = {{".2", u3wc_swp, c3y}, {}}; - static u3j_harm _142_two_sqt_a[] = {{".2", u3wc_sqt, c3y}, {}}; - static u3j_harm _142_two_vor_a[] = {{".2", u3wc_vor, c3y}, {}}; - static u3j_harm _142_two_xeb_a[] = {{".2", u3wc_xeb, c3y}, {}}; - - - - static u3j_harm _142_two__in_bif_a[] = {{".2", u3wdi_bif}, {}}; - static u3j_harm _142_two__in_dif_a[] = {{".2", u3wdi_dif}, {}}; - static u3j_harm _142_two__in_gas_a[] = {{".2", u3wdi_gas}, {}}; - static u3j_harm _142_two__in_has_a[] = {{".2", u3wdi_has}, {}}; - static u3j_harm _142_two__in_mer_a[] = {{".2", u3wdi_mer}, {}}; - // static u3j_harm _142_two__in_int_a[] = {{".2", u3wdi_int}, {}}; - static u3j_harm _142_two__in_put_a[] = {{".2", u3wdi_put}, {}}; - static u3j_harm _142_two__in_tap_a[] = {{".2", u3wdi_tap}, {}}; - static u3j_harm _142_two__in_wyt_a[] = {{".2", u3wdi_wyt}, {}}; - static u3j_harm _142_two__in_uni_a[] = {{".2", u3wdi_uni}, {}}; - static u3j_core _142_two__in_d[] = - { { "bif", _142_two__in_bif_a }, - { "dif", _142_two__in_dif_a }, - { "gas", _142_two__in_gas_a }, - { "has", _142_two__in_has_a }, - { "mer", _142_two__in_mer_a }, - // { "int", _142_two__in_int_a }, - { "put", _142_two__in_put_a }, - { "tap", _142_two__in_tap_a }, - { "wyt", _142_two__in_wyt_a }, - { "uni", _142_two__in_uni_a }, - {} - }; - - static u3j_harm _142_two__by_bif_a[] = {{".2", u3wdb_bif, c3y}, {}}; - static u3j_harm _142_two__by_dif_a[] = {{".2", u3wdb_dif, c3y}, {}}; - static u3j_harm _142_two__by_gas_a[] = {{".2", u3wdb_gas, c3y}, {}}; - static u3j_harm _142_two__by_get_a[] = {{".2", u3wdb_get, c3y}, {}}; - static u3j_harm _142_two__by_has_a[] = {{".2", u3wdb_has, c3y}, {}}; - // static u3j_harm _142_two__by_int_a[] = {{".2", u3wdb_int, c3y}, {}}; - static u3j_harm _142_two__by_put_a[] = {{".2", u3wdb_put, c3y}, {}}; - static u3j_harm _142_two__by_tap_a[] = {{".2", u3wdb_tap, c3y}, {}}; - // static u3j_harm _142_two__by_uni_a[] = {{".2", u3wdb_uni, c3y}, {}}; - static u3j_core _142_two__by_d[] = - { { "bif", _142_two__by_bif_a }, - { "dif", _142_two__by_dif_a }, - { "gas", _142_two__by_gas_a }, - { "get", _142_two__by_get_a }, - { "has", _142_two__by_has_a }, - // { "int", _142_two__by_int_a }, - { "put", _142_two__by_put_a }, - { "tap", _142_two__by_tap_a }, - // { "uni", _142_two__by_uni_a }, - {} - }; - - static u3j_harm _142_two_cue_a[] = {{".2", u3we_cue}, {}}; - static u3j_harm _142_two_jam_a[] = {{".2", u3we_jam}, {}}; - static u3j_harm _142_two_mat_a[] = {{".2", u3we_mat}, {}}; - static u3j_harm _142_two_rub_a[] = {{".2", u3we_rub}, {}}; - -static u3j_core _142_two_d[] = - { { "tri", 0, _142_tri_d }, - { "flop", _142_two_flop_a }, - { "lent", _142_two_lent_a }, - { "levy", _142_two_levy_a }, - { "lien", _142_two_lien_a }, - { "murn", _142_two_murn_a }, - { "need", _142_two_need_a }, - { "reap", _142_two_reap_a }, - { "reel", _142_two_reel_a }, - { "roll", _142_two_roll_a }, - { "skid", _142_two_skid_a }, - { "skim", _142_two_skim_a }, - { "skip", _142_two_skip_a }, - { "scag", _142_two_scag_a }, - { "slag", _142_two_slag_a }, - { "snag", _142_two_snag_a }, -// { "sort", _142_two_sort_a }, - { "turn", _142_two_turn_a }, - { "weld", _142_two_weld_a }, - - { "bex", _142_two_bex_a }, - { "cat", _142_two_cat_a }, - { "can", _142_two_can_a }, - { "cap", _142_two_cap_a }, - { "con", _142_two_con_a }, - { "cue", _142_two_cue_a }, - { "cut", _142_two_cut_a }, - { "dis", _142_two_dis_a }, - { "dor", _142_two_dor_a }, - { "dvr", _142_two_dvr_a }, - { "end", _142_two_end_a }, - { "gor", _142_two_gor_a }, - { "hor", _142_two_hor_a }, - { "jam", _142_two_jam_a }, - { "lsh", _142_two_lsh_a }, - { "mas", _142_two_mas_a }, - { "mat", _142_two_mat_a }, - { "met", _142_two_met_a }, - { "mix", _142_two_mix_a }, - { "mug", _142_two_mug_a }, - { "muk", _142_two_muk_a }, - { "rap", _142_two_rap_a }, - { "rep", _142_two_rep_a }, - { "rev", _142_two_rev_a }, - { "rip", _142_two_rip_a }, - { "rsh", _142_two_rsh_a }, - { "swp", _142_two_swp_a }, - { "rub", _142_two_rub_a }, - { "peg", _142_two_peg_a }, - { "pow", _142_two_pow_a }, - { "sqt", _142_two_sqt_a }, - { "vor", _142_two_vor_a }, - { "xeb", _142_two_xeb_a }, - - { "by", 0, _142_two__by_d }, - { "in", 0, _142_two__in_d }, - }; - - -/* layer one -*/ - static u3j_harm _142_one_add_a[] = {{".2", u3wa_add, c3y}, {}}; - static u3j_harm _142_one_dec_a[] = {{".2", u3wa_dec, c3y}, {}}; - static u3j_harm _142_one_div_a[] = {{".2", u3wa_div, c3y}, {}}; - static u3j_harm _142_one_dvr_a[] = {{".2", u3wc_dvr, c3y}, {}}; - static u3j_harm _142_one_gte_a[] = {{".2", u3wa_gte, c3y}, {}}; - static u3j_harm _142_one_gth_a[] = {{".2", u3wa_gth, c3y}, {}}; - static u3j_harm _142_one_lte_a[] = {{".2", u3wa_lte, c3y}, {}}; - static u3j_harm _142_one_lth_a[] = {{".2", u3wa_lth, c3y}, {}}; - static u3j_harm _142_one_mod_a[] = {{".2", u3wa_mod, c3y}, {}}; - static u3j_harm _142_one_mul_a[] = {{".2", u3wa_mul, c3y}, {}}; - static u3j_harm _142_one_sub_a[] = {{".2", u3wa_sub, c3y}, {}}; - - static u3j_harm _142_one_cap_a[] = {{".2", u3wc_cap, c3y}, {}}; - static u3j_harm _142_one_peg_a[] = {{".2", u3wc_peg, c3y}, {}}; - static u3j_harm _142_one_mas_a[] = {{".2", u3wc_mas, c3y}, {}}; - -static u3j_core _142_one_d[] = - { { "two", 0, _142_two_d }, - { "add", _142_one_add_a }, - { "dec", _142_one_dec_a }, - { "div", _142_one_div_a }, - { "dvr", _142_one_dvr_a }, - { "gte", _142_one_gte_a }, - { "gth", _142_one_gth_a }, - { "lte", _142_one_lte_a }, - { "lth", _142_one_lth_a }, - { "mod", _142_one_mod_a }, - { "mul", _142_one_mul_a }, - { "sub", _142_one_sub_a }, - - { "cap", _142_one_cap_a }, - { "mas", _142_one_mas_a }, - { "peg", _142_one_peg_a }, - - {} - }; - -u3j_core _k142_d[] = - { { "one", 0, _142_one_d }, - {} - }; +{ { "one", 3, 0, _141_one_d, _141_one_ha }, + {} +}; +static c3_c* _k141_ha[] = {0}; static u3j_core _d[] = { - { "k141", 0, _k141_d}, - { "k142", 0, _k142_d}, + { "k141", 0, 0, _k141_d, _k141_ha, 0, (u3j_core*) 141, 0 }, {} }; -u3j_dash +u3j_dash u3j_Dash = { _d, 0, diff --git a/meson.build b/meson.build index 4436c97a0b..5426754de4 100644 --- a/meson.build +++ b/meson.build @@ -272,6 +272,8 @@ incdir = include_directories('include/') conf_data = configuration_data() conf_data.set('URBIT_VERSION', '"0.6.0"') +conf_data.set('U3_MEMORY_DEBUG', get_option('gc')) +conf_data.set('U3_CPU_DEBUG', get_option('prof')) osdet = build_machine.system() os_c_flags = ['-funsigned-char','-ffast-math'] diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000000..a4dd843856 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,4 @@ +option('gc', type : 'boolean', value : false, + description : 'Add debugging information to heap. Run with -g. Breaks image.') +option('prof', type : 'boolean', value : false, + description : 'Activate profiling. Run with -P.') diff --git a/noun/hashtable.c b/noun/hashtable.c index 410119f7f0..c54dc31365 100644 --- a/noun/hashtable.c +++ b/noun/hashtable.c @@ -767,19 +767,19 @@ u3h_free(u3p(u3h_root) har_p) /* _ch_walk_buck(): walk bucket for gc. */ static void -_ch_walk_buck(u3h_buck* hab_u, void (*fun_f)(u3_noun)) +_ch_walk_buck(u3h_buck* hab_u, void (*fun_f)(u3_noun, void*), void* wit) { c3_w i_w; for ( i_w = 0; i_w < hab_u->len_w; i_w++ ) { - fun_f(u3h_slot_to_noun(hab_u->sot_w[i_w])); + fun_f(u3h_slot_to_noun(hab_u->sot_w[i_w]), wit); } } /* _ch_walk_node(): walk node for gc. */ static void -_ch_walk_node(u3h_node* han_u, c3_w lef_w, void (*fun_f)(u3_noun)) +_ch_walk_node(u3h_node* han_u, c3_w lef_w, void (*fun_f)(u3_noun, void*), void* wit) { c3_w len_w = _ch_popcount(han_u->map_w); c3_w i_w; @@ -792,24 +792,27 @@ _ch_walk_node(u3h_node* han_u, c3_w lef_w, void (*fun_f)(u3_noun)) if ( _(u3h_slot_is_noun(sot_w)) ) { u3_noun kev = u3h_slot_to_noun(sot_w); - fun_f(kev); + fun_f(kev, wit); } else { void* hav_v = u3h_slot_to_node(sot_w); if ( 0 == lef_w ) { - _ch_walk_buck(hav_v, fun_f); + _ch_walk_buck(hav_v, fun_f, wit); } else { - _ch_walk_node(hav_v, lef_w, fun_f); + _ch_walk_node(hav_v, lef_w, fun_f, wit); } } } } -/* u3h_walk(): walk hashtable for gc. +/* u3h_walk_with(): traverse hashtable with key, value fn and data + * argument; RETAINS. */ void -u3h_walk(u3p(u3h_root) har_p, void (*fun_f)(u3_noun)) +u3h_walk_with(u3p(u3h_root) har_p, + void (*fun_f)(u3_noun, void*), + void* wit) { u3h_root* har_u = u3to(u3h_root, har_p); c3_w i_w; @@ -820,16 +823,32 @@ u3h_walk(u3p(u3h_root) har_p, void (*fun_f)(u3_noun)) if ( _(u3h_slot_is_noun(sot_w)) ) { u3_noun kev = u3h_slot_to_noun(sot_w); - fun_f(kev); + fun_f(kev, wit); } else if ( _(u3h_slot_is_node(sot_w)) ) { u3h_node* han_u = u3h_slot_to_node(sot_w); - _ch_walk_node(han_u, 25, fun_f); + _ch_walk_node(han_u, 25, fun_f, wit); } } } +/* _ch_walk_plain(): use plain u3_noun fun_f for each node + */ +static void +_ch_walk_plain(u3_noun kev, void* wit) +{ + void (*fun_f)(u3_noun) = wit; + fun_f(kev); +} + +/* u3h_walk(): u3h_walk_with, but with no data argument +*/ +void +u3h_walk(u3p(u3h_root) har_p, void (*fun_f)(u3_noun)) +{ + u3h_walk_with(har_p, _ch_walk_plain, fun_f); +} /* _ch_mark_buck(): mark bucket for gc. */ diff --git a/noun/jets.c b/noun/jets.c index 2066b0262d..f2c4759605 100644 --- a/noun/jets.c +++ b/noun/jets.c @@ -3,45 +3,244 @@ */ #include "all.h" - /* _cj_count(): count and link dashboard entries. - */ - __attribute__((no_sanitize("address"))) - static c3_w - _cj_count(u3j_core* par_u, u3j_core* dev_u) - { - c3_w len_l = 0; - c3_w i_w; +#if defined(U3_OS_osx) +#include +#else +#include +#endif - if ( dev_u ) { - for ( i_w = 0; 0 != dev_u[i_w].cos_c; i_w++ ) { - u3j_core* kid_u = &dev_u[i_w]; +/** Data structures. +**/ +/* _cj_hank: cached hook information. + */ +typedef struct { + u3_weak hax; // axis of hooked inner core + u3j_site sit_u; // call-site data +} _cj_hank; + +/** Functions. +**/ + +/* _cj_count(): count and link dashboard entries. +*/ +static c3_w +_cj_count(u3j_core* par_u, u3j_core* dev_u) +{ + c3_w len_l = 0; + c3_w i_w; + + if ( dev_u ) { + for ( i_w = 0; 0 != dev_u[i_w].cos_c; i_w++ ) { + u3j_core* kid_u = &dev_u[i_w]; + + if ( par_u ) { kid_u->par_u = par_u; - len_l += _cj_count(kid_u, kid_u->dev_u); } + len_l += _cj_count(kid_u, kid_u->dev_u); } - return 1 + len_l; } - /* _cj_install(): install dashboard entries. - */ - __attribute__((no_sanitize("address"))) - static c3_w - _cj_install(u3j_core* ray_u, c3_w jax_l, u3j_core* dev_u) - { - c3_w i_w; + return 1 + len_l; +} - if ( dev_u ) { - for ( i_w = 0; 0 != dev_u[i_w].cos_c; i_w++ ) { - u3j_core* kid_u = &dev_u[i_w]; +/* _cj_core_loc(): location noun from u3j_core. + */ +static u3_noun +_cj_core_loc(u3_noun pel, u3j_core* cop_u) +{ + c3_w i_w; + u3_noun nam = u3i_string(cop_u->cos_c), + huc = u3_nul, + pat; - kid_u->jax_l = jax_l; - ray_u[jax_l++] = *kid_u; + if ( cop_u->huc_u ) { + for ( i_w = 0; 0 != cop_u->huc_u[i_w].nam_c; ++i_w ) { + u3j_hood* huc_u = &(cop_u->huc_u[i_w]); + u3_noun fol = ( c3n == huc_u->kic_o ) + ? u3nc(0, huc_u->axe_l) + : u3nt(9, huc_u->axe_l, u3nc(0, + (0 == huc_u->sax_l) ? 1 : huc_u->sax_l)); + huc = u3kdb_put(huc, u3i_string(huc_u->nam_c), fol); + } + } - jax_l = _cj_install(ray_u, jax_l, kid_u->dev_u); + pat = ( 0 == cop_u->axe_l ) + ? u3nt(c3y, c3y, pel) + : ( (3 == cop_u->axe_l) && (c3y == u3h(u3h(pel))) ) + ? u3nt(c3y, c3n, pel) + : u3nt(c3n, cop_u->axe_l, pel); + + return u3nt(pat, nam, huc); +} + +/* _cj_hash(): noun from pasted-in battery hash + */ +static u3_noun +_cj_hash(c3_c* has_c) +{ + c3_w i_w, len_w = strlen(has_c); + if ( 64 != len_w ) { + fprintf(stderr, "bash not 64 characters: %s\r\n", has_c); + c3_assert(0); + } + c3_assert( 64 == len_w ); + c3_y dig_y[32]; + for ( i_w = 0; i_w < 64; ) { + c3_y hi_y = has_c[i_w++], + lo_y = has_c[i_w++], + hid_y = hi_y >= 'a' ? (hi_y - 'a') + 10 : hi_y - '0', + lod_y = lo_y >= 'a' ? (lo_y - 'a') + 10 : lo_y - '0'; + dig_y[32-(i_w>>1)] = hid_y << 4 | lod_y; + } + u3_noun pro = u3i_bytes(32, dig_y); + return pro; +} + +// in the jam jet file +c3_w* u3qe_jam_buf(u3_noun, c3_w* bit_w); + +/* _cj_bash(): battery hash. RETAIN. + */ +static u3_noun +_cj_bash(u3_noun bat) +{ + if ( u3C.wag_w & u3o_hashless ) { + return u3_nul; + } + + u3_weak pro; + u3a_road* rod_u = u3R; + while ( 1 ) { + pro = u3h_get(rod_u->jed.bas_p, bat); + + if ( u3_none != pro ) { + break; + } + + if ( rod_u->par_p ) { + rod_u = u3to(u3_road, rod_u->par_p); + } + else { + c3_w bit_w, met_w; + c3_w* wor_w; + c3_y* fat_y; + c3_y dig_y[32]; + + wor_w = u3qe_jam_buf(bat, &bit_w); + met_w = bit_w >> 3; + if ( bit_w != met_w << 3 ) { + ++met_w; } + // assume little-endian + fat_y = (c3_y*) wor_w; +#if defined(U3_OS_osx) + CC_SHA256_CTX ctx_h; + + CC_SHA256_Init(&ctx_h); + CC_SHA256_Update(&ctx_h, fat_y, met_w); + CC_SHA256_Final(dig_y, &ctx_h); +#else + SHA256_CTX ctx_h; + + SHA256_Init(&ctx_h); + SHA256_Update(&ctx_h, fat_y, met_w); + SHA256_Final(dig_y, &ctx_h); +#endif + pro = u3i_bytes(32, dig_y); + u3h_put(u3R->jed.bas_p, bat, u3k(pro)); + u3a_wfree(wor_w); + break; } - return jax_l; } + return pro; +} + +/* _cj_mine_par_old(): register hooks and parent location within existing + * axis in ancestor list or u3_none. + */ +static u3_weak +_cj_mine_par_old(u3_noun lan, u3_noun axe, u3_noun pel, u3_noun loc) +{ + u3_noun par; + u3_weak pro; + + if ( u3_nul == lan ) { + pro = u3_none; + u3z(axe); u3z(pel); u3z(loc); + } + else if ( c3y == u3r_sing(axe, u3h(par = u3h(lan))) ) { + u3_noun lol = u3kdb_put(u3k(u3t(par)), pel, loc), + rap = u3nc(axe, lol); + pro = u3nc(rap, u3k(u3t(lan))); + } + else { + u3_weak nex = _cj_mine_par_old(u3k(u3t(lan)), axe, pel, loc); + if ( u3_none == nex ) { + pro = u3_none; + } + else { + pro = u3nc(u3k(par), nex); + } + } + + u3z(lan); + return pro; +} + +/* _cj_mine_par_new(): insert ancestor within lan at sorted index. + */ +static u3_noun +_cj_mine_par_new(u3_noun lan, u3_noun axe, u3_noun pel, u3_noun loc) +{ + u3_weak pro; + + if ( (u3_nul == lan) || (c3y == u3qa_lth(axe, u3h(u3h(lan)))) ) { + u3_noun par = u3nc(axe, u3kdb_put(u3_nul, pel, loc)); + pro = u3nc(par, lan); + } + else { + pro = u3nc(u3k(u3h(lan)), + _cj_mine_par_new(u3k(u3t(lan)), axe, pel, loc)); + u3z(lan); + } + + return pro; +} + +/* _cj_mine_par(): register a location as an ancestor + * in a list of ancestors. + */ +static u3_noun +_cj_mine_par(u3_noun lan, u3_noun axe, u3_noun pel, u3_noun loc) +{ + u3_weak old = _cj_mine_par_old(u3k(lan), u3k(axe), u3k(pel), u3k(loc)); + if ( u3_none != old ) { + u3z(lan); u3z(axe); u3z(pel); u3z(loc); + return old; + } + else { + return _cj_mine_par_new(lan, axe, pel, loc); + } +} + + +/* _cj_gust(): add location to registry. +*/ +static u3_noun +_cj_gust(u3_weak reg, u3_noun axe, u3_noun pel, u3_noun loc) +{ + u3_noun ger; + if ( u3_none == reg ) { + reg = u3nc(u3_nul, u3_nul); + } + + ger = ( 0 == axe ) + ? u3nc(u3kdb_put(u3k(u3h(reg)), pel, loc), u3k(u3t(reg))) + : u3nc(u3k(u3h(reg)), _cj_mine_par(u3k(u3t(reg)), axe, pel, loc)); + + u3z(reg); + return ger; +} /* _cj_axis(): axis from formula, or 0. `fol` is RETAINED. */ @@ -75,6 +274,95 @@ _cj_axis(u3_noun fol) } } +/* _cj_warm_hump(): generate axis-to-arm map. RETAIN. +*/ +static u3_noun +_cj_warm_hump(c3_l jax_l, u3_noun huc) +{ + u3_noun hap = u3_nul; + u3j_core* cop_u; + + /* Compute axes of all correctly declared arms. + */ + if ( jax_l && (cop_u = &u3D.ray_u[jax_l])->arm_u ) { + u3j_harm* jet_u; + c3_l i_l; + + for ( i_l = 0; (jet_u = &cop_u->arm_u[i_l])->fcs_c; i_l++ ) { + c3_l axe_l = 0; + + if ( '.' == *(jet_u->fcs_c) ) { + c3_d axe_d = 0; + + if ( (1 != sscanf(jet_u->fcs_c+1, "%" SCNu64, &axe_d)) || + axe_d >> 32ULL || + ((1 << 31) & (axe_l = (c3_w)axe_d)) || + (axe_l < 2) ) + { + fprintf(stderr, "jets: activate: bad fcs %s\r\n", jet_u->fcs_c); + } + } + else { + u3_noun nam = u3i_string(jet_u->fcs_c); + u3_noun fol = u3kdb_get(u3k(huc), nam); + + if ( u3_none == fol ) { + fprintf(stderr, "jets: activate: bad fcs %s\r\n", jet_u->fcs_c); + } + else { + axe_l = _cj_axis(fol); + u3z(fol); + } + } + if ( 0 != axe_l ) { + hap = u3kdb_put(hap, axe_l, i_l); + } + } + } + return hap; +} + +/* _cj_install(): install dashboard entries. +*/ +static c3_w +_cj_install(u3j_core* ray_u, c3_w jax_l, u3_noun pel, u3_noun lab, u3j_core* dev_u) +{ + c3_w i_w; + c3_assert(u3R == &(u3H->rod_u)); + + if ( dev_u ) { + for ( i_w = 0; 0 != dev_u[i_w].cos_c; i_w++ ) { + u3j_core* kid_u = &dev_u[i_w]; + u3_noun loc = _cj_core_loc(u3k(pel), kid_u), + bal = u3nc(u3k(u3h(u3t(loc))), u3k(lab)); + + kid_u->jax_l = jax_l; + ray_u[jax_l] = *kid_u; + + if ( kid_u->bas_u ) { + c3_w j_w; + for ( j_w = 0; 0 != kid_u->bas_u[j_w]; j_w++ ) { + u3_noun key = _cj_hash(kid_u->bas_u[j_w]), + hot = u3h_get(u3R->jed.hot_p, key), + old = ( u3_none == hot ) ? u3_none : u3k(u3h(hot)), + reg = _cj_gust(old, kid_u->axe_l, u3k(pel), u3k(loc)), + huc = u3t(u3t(loc)), + hap = _cj_warm_hump(jax_l, huc), + toh = u3nq(reg, jax_l, hap, u3k(bal)); + + u3h_put(u3R->jed.hot_p, key, toh); + u3z(key); u3z(hot); + } + } + + jax_l = _cj_install(ray_u, ++jax_l, loc, bal, kid_u->dev_u); + } + } + u3z(pel); + u3z(lab); + return jax_l; +} + #if 0 /* _cj_by_gut(): (~(get by a) b), unifying; RETAINS a, b, AND result. */ @@ -184,31 +472,19 @@ _cj_je_fsck(u3_noun clu) return u3nt(u3i_string(nam_c), axe_l, huk); } -/* _cj_sham(): ++sham. -*/ -static u3_atom -_cj_sham(u3_noun som) // XX wrong, does not match ++sham -{ - u3_atom jam = u3ke_jam(som); - u3_noun sha = u3qe_shax(jam); - u3_noun haf = u3qc_end(7, 1, sha); - - u3z(jam); u3z(sha); - return haf; -} - -/* u3j_find(): in warm state, return u3_none or calx. RETAINS. -*/ -u3_weak -u3j_find(u3_noun bat) +/* _cj_find_cold(): search cold state for `bat`s [bash registry]. + * RETAIN. + */ +static u3_weak +_cj_find_cold(u3_noun bat) { u3a_road* rod_u = u3R; while ( 1 ) { - u3_weak jaw = u3h_gut(rod_u->jed.har_p, bat); + u3_weak bar = u3h_gut(rod_u->jed.cod_p, bat); - if ( u3_none != jaw ) { - return jaw; + if ( u3_none != bar ) { + return bar; } if ( rod_u->par_p ) { @@ -218,61 +494,289 @@ u3j_find(u3_noun bat) } } -/* _cj_warm_hump(): generate axis-to-arm map. RETAIN. +/* _cj_find_warm(): search warm state for `loc`s activation. + * RETAIN. + */ +static u3_weak +_cj_find_warm(u3_noun loc) +{ + u3a_road* rod_u = u3R; + + while ( 1 ) { + u3_weak ank = u3h_gut(rod_u->jed.war_p, loc); + + if ( u3_none != ank ) { + return ank; + } + + if ( rod_u->par_p ) { + rod_u = u3to(u3_road, rod_u->par_p); + } + else return u3_none; + } +} + +static u3_weak _cj_spot(u3_noun cor, u3_weak* bas); + +/* _cj_reg_find(): locate core within registry. RETAIN. + */ +static u3_weak +_cj_reg_find(u3_noun reg, u3_noun cor) +{ + u3_noun rut = u3h(reg), + pas = u3t(reg), + rum = u3qdb_get(rut, u3t(cor)); + if ( u3_nul != rum ) { + u3_noun loc = u3k(u3t(rum)); + u3z(rum); + return loc; + } + else { + while ( u3_nul != pas ) { + u3_noun pap = u3h(pas), + axe = u3h(pap), + lol = u3t(pap); + u3_weak par = u3r_at(axe, cor), + pel; + if ( u3_none != par ) { + pel = _cj_spot(par, NULL); + if ( u3_none != pel ) { + u3_noun nit = u3qdb_get(lol, pel); + u3z(pel); + if ( u3_nul != nit ) { + u3_noun loc = u3k(u3t(nit)); + u3z(nit); + return loc; + } + } + } + pas = u3t(pas); + } + return u3_none; + } +} + +/* _cj_jit(): generate arbitrary warm jet-associated data. RETAIN. */ static u3_noun -_cj_warm_hump(c3_l jax_l, u3_noun huc) +_cj_jit(c3_l jax_l, u3_noun bat) { - u3_noun hap = u3_nul; - u3j_core* cop_u; + return u3_nul; +} - /* Compute axes of all correctly declared arms. - */ - if ( jax_l && (cop_u = &u3D.ray_u[jax_l])->arm_u ) { - u3j_harm* jet_u; - c3_l i_l; +/* _cj_loc_axe(): axis-within-core from location (0 for root). RETAIN. + */ +static u3_noun +_cj_loc_axe(u3_noun loc) +{ + u3_noun pat = u3h(loc); + return ( c3n == u3h(pat) ) + ? u3k(u3h(u3t(pat))) + : (c3y == u3h(u3t(pat))) ? 0 : 3; +} - for ( i_l = 0; (jet_u = &cop_u->arm_u[i_l])->fcs_c; i_l++ ) { - c3_l axe_l = 0; +/* _cj_loc_pel(): parent location (or root noun, if root) of loc. RETAIN. + */ +static u3_noun +_cj_loc_pel(u3_noun loc) +{ + return u3k(u3t(u3t(u3h(loc)))); +} - if ( '.' == *(jet_u->fcs_c) ) { - c3_d axe_d = 0; +/* _cj_spot_cold(): spot, cold dashboard only. *bar is set to + * the [bash registry] found for battery. RETAIN. + */ +static u3_weak +_cj_spot_cold(u3_noun cor, u3_weak* bar) +{ + *bar = _cj_find_cold(u3h(cor)); + if ( u3_none == *bar ) { + return u3_none; + } + else { + return _cj_reg_find(u3t(*bar), cor); + } +} - if ( (1 != sscanf(jet_u->fcs_c+1, "%" SCNu64, &axe_d)) || - axe_d >> 32ULL || - ((1 << 31) & (axe_l = (c3_w)axe_d)) || - (axe_l < 2) ) - { - fprintf(stderr, "jets: activate: bad fcs %s\r\n", jet_u->fcs_c); - } - } - else { - u3_noun nam = u3i_string(jet_u->fcs_c); - u3_noun fol = u3kdb_get(u3k(huc), nam); +/* _cj_spot_hot(): try to locate core by hot dashboard. if found, + * the activation (warm state) is returned and the + * location is produced at *loc. RETAIN. + */ +static u3_weak +_cj_spot_hot(u3_noun cor, u3_noun bas, u3_noun* loc) +{ + u3_noun bat = u3h(cor); + u3_weak act = u3_none, + hot = u3h_get(u3H->rod_u.jed.hot_p, bas); + if ( u3_none != hot ) { + u3_noun reg, jax, hap, bal; + c3_l jax_l; + u3x_qual(hot, ®, &jax, &hap, &bal); + jax_l = (c3_l) jax; + if ( u3_none != (*loc = _cj_reg_find(reg, cor)) ) { + act = u3nq(jax_l, u3k(hap), u3k(bal), _cj_jit(jax_l, bat)); + } + u3z(hot); + } + return act; +} - if ( u3_none == fol ) { - fprintf(stderr, "jets: activate: bad fcs %s\r\n", jet_u->fcs_c); - } - else { - axe_l = _cj_axis(fol); - u3z(fol); - } - } - if ( 0 != axe_l ) { - hap = u3kdb_put(hap, axe_l, i_l); +/* _cj_spot(): find location of cor. expensive. RETAIN. + * bas is complicated to make it easy to cache bashes. + * you can safely ignore it by passing NULL. Otherwise, + * if it points to u3_none, and no location is found, + * a bash will be PRODUCED there. if it contains a bash, + * that will be used instead of calling _cj_bash. + */ +static u3_weak +_cj_spot(u3_noun cor, u3_weak* bas) +{ + u3_weak bak = u3_none, + bar = u3_none, + reg = u3_none, + loc = _cj_spot_cold(cor, &bar); + + if ( NULL == bas ) { + bas = &bak; + } + + if ( u3_none != bar ) { + if ( (u3_none == *bas) ) { + *bas = u3k(u3h(bar)); + } + reg = u3k(u3t(bar)); + u3z(bar); + } + + if ( u3_none == loc ) { + if ( u3_none == *bas ) { + *bas = _cj_bash(u3h(cor)); + } + + if ( !(u3C.wag_w & u3o_hashless) ) { + u3_weak act = _cj_spot_hot(cor, *bas, &loc); + if ( u3_none != act ) { + reg = _cj_gust(reg, _cj_loc_axe(loc), _cj_loc_pel(loc), u3k(loc)); + u3h_put(u3R->jed.cod_p, u3h(cor), u3nc(u3k(*bas), u3k(reg))); + /* caution: could overwrites old value, debug batteries etc. + ** old value contains old _cj_jit (from different + ** battery). if we change jit to (map battery *), + ** will need to merge with that map here. + */ + u3h_put(u3R->jed.war_p, loc, act); } } } - return hap; + if ( u3_none != bak ) { + u3z(bak); + } + if ( u3_none != reg ) { + u3z(reg); + } + return loc; +} + +/* _cj_cast(): create a u3j_fink that can be used to efficiently verify + * that another core is located where this one is. RETAIN. + */ +static u3p(u3j_fink) +_cj_cast(u3_noun cor, u3_noun loc) +{ + c3_w i_w = 0; + u3_noun j, par, bat, dyn, pax, + rev = u3_nul, + pat = u3h(loc); + u3j_fink* fin_u; + + while ( c3n == u3h(pat) ) { + bat = u3h(cor); + dyn = u3t(pat); + pax = u3h(dyn); + loc = u3t(dyn); + pat = u3h(loc); + rev = u3nc(u3nc(u3k(bat), u3k(pax)), rev); + // pax already known-valid + cor = u3r_at(pax, cor); + ++i_w; + } + + fin_u = u3a_walloc(c3_wiseof(u3j_fink) + + (i_w * c3_wiseof(u3j_fist))); + fin_u->len_w = i_w; + fin_u->sat = u3k(cor); + for ( j = rev; i_w-- > 0; j = u3t(j) ) { + u3j_fist* fis_u = &(fin_u->fis_u[i_w]); + par = u3h(j); + fis_u->bat = u3k(u3h(par)); + fis_u->pax = u3k(u3t(par)); + } + u3z(rev); + c3_assert( u3_nul == j ); + + return u3of(u3j_fink, fin_u); +} + +/* _cj_fine(): check that a core matches a u3j_fink. RETAIN. + */ +static c3_o +_cj_fine(u3_noun cor, u3p(u3j_fink) fin_p) +{ + u3j_fink* fin_u = u3to(u3j_fink, fin_p); + c3_w i_w; + for ( i_w = 0; i_w < fin_u->len_w; ++i_w ) { + u3j_fist* fis_u = &(fin_u->fis_u[i_w]); + if ( c3n == u3r_sing(fis_u->bat, u3h(cor)) ) { + return c3n; + } + else { + cor = u3r_at(fis_u->pax, cor); + } + } + return u3r_sing(fin_u->sat, cor); +} + +/* _cj_nail(): resolve hot state for arm at axis within cores located + * at loc. a label will be PRODUCED at *lab, unconditionally. + * Arguments are RETAINED. Return value is yes if a jet driver + * is present. + */ +static c3_o +_cj_nail(u3_noun loc, u3_noun axe, + u3_noun* lab, u3j_core** cop_u, u3j_harm** ham_u) +{ + c3_o ret_o; + u3_noun jax, hap, bal, jit; + u3_weak act; + act = _cj_find_warm(loc); + c3_assert(u3_none != act); + u3x_qual(act, &jax, &hap, &bal, &jit); + + *lab = u3k(bal); + if ( 0 == jax ) { + ret_o = c3n; + } + else { + u3_weak inx = u3kdb_get(u3k(hap), u3k(axe)); + if ( u3_none == inx ) { + ret_o = c3n; + } + else { + c3_l jax_l = jax, + inx_l = inx; + *cop_u = &(u3D.ray_u[jax_l]); + *ham_u = &((*cop_u)->arm_u[inx_l]); + ret_o = c3y; + } + } + + u3z(act); + return ret_o; } /* _cj_hot_mean(): in parent, declare a core. RETAINS. -** -** XX bat is used only for printing, remove. */ -__attribute__((no_sanitize("address"))) static c3_l -_cj_hot_mean(c3_l par_l, u3_noun mop, u3_noun bat) +_cj_hot_mean(c3_l par_l, u3_noun nam) { u3j_core* par_u; u3j_core* dev_u; @@ -291,13 +795,12 @@ _cj_hot_mean(c3_l par_l, u3_noun mop, u3_noun bat) u3j_core* cop_u; while ( (cop_u = &dev_u[i_l])->cos_c ) { - if ( _(u3r_sing_c(cop_u->cos_c, u3h(mop))) ) { + if ( _(u3r_sing_c(cop_u->cos_c, nam)) ) { #if 0 - fprintf(stderr, "hot: bound jet %d/%s/%s/%x\r\n", + fprintf(stderr, "hot: bound jet %d/%s/%s/\r\n", cop_u->jax_l, cop_u->cos_c, - par_u ? par_u->cos_c : "~", - u3r_mug(bat)); + par_u ? par_u->cos_c : "~"); #endif return cop_u->jax_l; } @@ -307,38 +810,13 @@ _cj_hot_mean(c3_l par_l, u3_noun mop, u3_noun bat) return 0; } -/* _cj_hot_mine(): in hot state, declare a core. RETAINS. -*/ -static c3_l -_cj_hot_mine(u3_noun mop, u3_noun cor) -{ - u3_noun p_mop, q_mop, r_mop, hr_mop, tr_mop; - - u3x_trel(mop, &p_mop, &q_mop, &r_mop); - u3x_cell(r_mop, &hr_mop, &tr_mop); - { - c3_l par_l; - - // Calculate parent axis. - // - if ( c3y == hr_mop ) { - u3_noun cax = u3j_find(u3h(u3r_at(q_mop, cor))); - - par_l = u3h(u3h(cax)); - u3z(cax); - } - else par_l = 0; - - return _cj_hot_mean(par_l, mop, u3h(cor)); - } -} - /* u3j_boot(): initialize jet system. */ void -u3j_boot(void) +u3j_boot(c3_o nuu_o) { c3_w jax_l; + c3_assert(u3R == &(u3H->rod_u)); u3D.len_l =_cj_count(0, u3D.dev_u); u3D.all_l = (2 * u3D.len_l) + 1024; // horrid heuristic @@ -346,7 +824,11 @@ u3j_boot(void) u3D.ray_u = (u3j_core*) malloc(u3D.all_l * sizeof(u3j_core)); memset(u3D.ray_u, 0, (u3D.all_l * sizeof(u3j_core))); - jax_l = _cj_install(u3D.ray_u, 1, u3D.dev_u); + if ( c3n == nuu_o ) { + u3h_free(u3R->jed.hot_p); + } + u3R->jed.hot_p = u3h_new(); + jax_l = _cj_install(u3D.ray_u, 1, (c3_l) (long long) u3D.dev_u[0].par_u, u3_nul, u3D.dev_u); fprintf(stderr, "boot: installed %d jets\n", jax_l); } @@ -391,7 +873,6 @@ _cj_kick_z(u3_noun cor, u3j_core* cop_u, u3j_harm* ham_u, u3_atom axe) strncpy(soc_c, cop_u->cos_c, 4); soc_c[4] = 0; cod_w = u3i_string(soc_c); - cod_w = u3a_lush(cod_w); } #endif @@ -411,7 +892,7 @@ _cj_kick_z(u3_noun cor, u3j_core* cop_u, u3j_harm* ham_u, u3_atom axe) u3_weak pro, ame; ham_u->ice = c3y; - pro = ham_u->fun_f(u3k(cor)); + pro = ham_u->fun_f(cor); ham_u->ice = c3n; #ifdef U3_MEMORY_DEBUG @@ -438,7 +919,7 @@ _cj_kick_z(u3_noun cor, u3j_core* cop_u, u3j_harm* ham_u, u3_atom axe) } else { -#if 0 +#if 1 fprintf(stderr, "test: %s %s\r\n", cop_u->cos_c, (!strcmp(".2", ham_u->fcs_c)) ? "$" : ham_u->fcs_c); @@ -458,69 +939,88 @@ _cj_hook_in(u3_noun cor, const c3_c* tam_c, c3_o jet_o) { - u3_noun bat = u3h(cor); + u3_weak loc, col; + u3_noun roc, tem, got, pat, nam, huc; - if ( !_(u3du(cor)) ) { return u3m_bail(c3__fail); } - { - u3_weak cax = u3j_find(bat); + if ( c3n == u3du(cor) ) { + return u3m_bail(c3__fail); + } - if ( u3_none == cax ) { return u3m_bail(c3__fail); } - { - u3_noun p_cax, q_cax, r_cax; - u3_noun jax, soh, mop, huc, hap, jit; - u3_noun p_mop, q_mop, r_mop; + loc = _cj_spot(cor, NULL); + if ( u3_none == loc ) { + return u3m_bail(c3__fail); + } - u3x_trel(cax, &p_cax, &q_cax, &r_cax); - u3x_trel(p_cax, &jax, &hap, &jit); - u3x_cell(q_cax, &soh, &mop); - u3x_trel(mop, &p_mop, &q_mop, &r_mop); + tem = u3i_string(tam_c); + while ( 1 ) { + u3x_trel(loc, &pat, &nam, &huc); + got = u3qdb_get(huc, tem); + if ( u3_nul != got ) { + c3_l axe_l; + u3_noun pro, fol; + u3j_core* cop_u; - huc = u3t(r_cax); - { - c3_l jax_l = jax; - u3j_core* cop_u = &u3D.ray_u[jax_l]; - u3_noun fol = u3kdb_get(u3k(huc), u3i_string(tam_c)); + u3z(tem); + fol = u3k(u3t(got)); + u3z(got); + axe_l = _cj_axis(fol); + if ( 0 == axe_l ) { + u3t_off(glu_o); + pro = u3n_nock_on(cor, fol); + u3t_on(glu_o); + } + else { + c3_l jax_l, inx_l; + u3_noun hap, act; - if ( u3_none == fol ) { - // The caller wants a deeper core. - // - if ( 0 == q_mop ) { return u3m_bail(c3__fail); } - else { - u3_noun inn = u3k(u3x_at(q_mop, cor)); + u3z(fol); + act = _cj_find_warm(loc); + jax_l = u3h(act); + hap = u3h(u3t(act)); + cop_u = &u3D.ray_u[jax_l]; - u3z(cax); u3z(cor); - return _cj_hook_in(inn, tam_c, jet_o); - } - } - else { - u3_noun pro; - c3_l axe_l = _cj_axis(fol); - c3_l inx_l; - - if ( (0 == axe_l) || - (c3n == jet_o) || - (u3_none == (inx_l = u3kdb_get(u3k(hap), axe_l))) || - (u3_none == (pro = _cj_kick_z(cor, - cop_u, - &cop_u->arm_u[inx_l], - axe_l))) ) - { - if ( 0 == axe_l ) { - u3z(cax); - return u3n_nock_on(cor, fol); - } else { - // Tricky: the above case would work here too, but would - // disable jet_o and create some infinite recursions. - // - u3z(cax); u3z(fol); - return u3n_nock_on(cor, u3k(u3x_at(axe_l, cor))); - } - } - else { - u3z(cax); u3z(fol); - return pro; - } + // Tricky: the above case would work here too, but would + // disable jet_o and create some infinite recursions. + // + u3t_off(glu_o); + if ( (c3n == jet_o) || + (u3_none == (inx_l = u3kdb_get(u3k(hap), axe_l))) || + (u3_none == (pro = _cj_kick_z(cor, + cop_u, + &cop_u->arm_u[inx_l], + axe_l))) ) { + pro = u3n_nock_on(cor, u3k(u3x_at(axe_l, cor))); } + u3t_on(glu_o); + u3z(act); + } + u3z(loc); + return pro; + } + else if ( c3n == u3h(pat) ) { + u3_noun dyn = u3t(pat), + axe = u3h(dyn), + pel = u3t(dyn); + // axe already known-valid + roc = u3k(u3r_at(axe, cor)); + u3z(cor); + cor = roc; + col = u3k(pel); + u3z(loc); + loc = col; + } + else { + u3_noun sat = u3t(pat); + if ( c3y == u3h(sat) ) { + return u3m_bail(c3__fail); + } + else { + col = u3k(u3t(sat)); + u3z(loc); + loc = col; + roc = u3k(u3t(cor)); + u3z(cor); + cor = roc; } } } @@ -530,11 +1030,12 @@ _cj_hook_in(u3_noun cor, */ u3_noun u3j_soft(u3_noun cor, - const c3_c* tam_c) + const c3_c* tam_c) { u3_noun pro; - + u3t_on(glu_o); pro = _cj_hook_in(cor, tam_c, c3n); + u3t_off(glu_o); return pro; } @@ -542,64 +1043,178 @@ u3j_soft(u3_noun cor, */ u3_noun u3j_hook(u3_noun cor, - const c3_c* tam_c) + const c3_c* tam_c) { u3_noun pro; - + u3t_on(glu_o); pro = _cj_hook_in(cor, tam_c, c3y); + u3t_off(glu_o); return pro; } -/* _cj_fine(): validate core. RETAIN. -*/ -static c3_o -_cj_fine(u3_noun cup, u3_noun mop, u3_noun cor) +/* _cj_prog(): stop tracing glu and find a nock program + */ +static u3p(u3n_prog) +_cj_prog(u3_weak loc, u3_noun fol) { - if ( c3y == u3h(cup) ) { - return u3r_sing(cor, u3t(cup)); + u3p(u3n_prog) pog_p; + u3t_off(glu_o); + pog_p = u3n_find((loc == u3_none ? u3_nul : loc), fol); + u3t_on(glu_o); + return pog_p; +} + +/* cj_hank_find(): find cached hook information, keyed by arbitrary + * prefix and term cords. RETAIN. + */ +static _cj_hank* +_cj_hank_find(u3_noun pre, u3_noun tam) +{ + u3_noun key = u3nc(u3k(pre), u3k(tam)); + u3_noun got = u3h_git(u3R->jed.han_p, key); + if ( u3_none != got ) { + u3z(key); + return u3to(_cj_hank, got); } else { - u3_noun par = u3t(u3t(mop)); - u3_noun pax = u3h(u3t(mop)); - - if ( c3n == u3h(par) ) { - c3_assert(3 == pax); - if ( c3n == u3r_sing(u3t(par), u3t(cor)) ) { - fprintf(stderr, "fine: core mismatch: %x, %x\r\n", - u3t(par), u3t(cor)); - } - return u3r_sing(u3t(par), u3t(cor)); + _cj_hank* new_u = u3a_walloc(c3_wiseof(_cj_hank)); + u3a_road* rod_u = u3R; + while ( rod_u->par_p && u3_none == got ) { + rod_u = u3to(u3a_road, rod_u->par_p); + got = u3h_git(u3R->jed.han_p, key); + } + if ( u3_none == got ) { + new_u->hax = u3_none; } else { - u3_weak pac = u3r_at(pax, cor); + _cj_hank* old_u = u3to(_cj_hank, got); + if ( u3_none != (new_u->hax = old_u->hax) ) { + u3j_site_copy(&(new_u->sit_u), &(old_u->sit_u), c3n); + } + } + u3h_put(u3R->jed.han_p, key, u3a_outa(new_u)); + u3z(key); + return new_u; + } +} - if ( u3_none == pac || !_(u3du(pac)) ) { - fprintf(stderr, "fail 1\r\n"); - return c3n; - } +/* _cj_hank_fine(): check that cached hook information is valid + * for given core. *inn will point to the hooked + * core on return if valid. RETAIN. + */ +static c3_o +_cj_hank_fine(_cj_hank* han_u, u3_noun cor, u3_noun *inn) +{ + u3_noun hax = han_u->hax; + if ( u3_none == hax ) { + return c3n; + } + else { + *inn = u3r_at(hax, cor); + if ( u3_none == *inn ) { + return c3n; + } + else { + u3j_site* sit_u = &(han_u->sit_u); + c3_assert(u3_none != sit_u->loc); + return _cj_fine(*inn, sit_u->fin_p); + } + } +} + +/* _cj_hank_lose(): release memory maintained in a hook cache. +*/ +static void +_cj_hank_lose(_cj_hank* han_u) +{ + if ( u3_none != han_u->hax ) { + u3z(han_u->hax); + u3j_site_lose(&(han_u->sit_u)); + } +} + +/* _cj_hank_fill(): slow path, populate han_u. + */ +static u3_noun +_cj_hank_fill(_cj_hank* han_u, u3_noun tam, u3_noun cor) +{ + u3_weak loc, col; + u3_noun got, pat, nam, huc; + u3_noun hax = 1; + u3j_site* sit_u = &(han_u->sit_u); + + if ( c3n == u3du(cor) ) { + return u3m_bail(c3__fail); + } + + sit_u->bas = u3_none; + if ( u3_none == (col = loc = _cj_spot(cor, NULL)) ) { + return u3m_bail(c3__fail); + } + + while ( 1 ) { + u3x_trel(loc, &pat, &nam, &huc); + got = u3qdb_get(huc, tam); + if ( u3_nul != got ) { + u3_noun fol = u3k(u3t(got)); + u3z(got); + sit_u->bat = u3k(u3h(cor)); + sit_u->loc = u3k(loc); + sit_u->fin_p = _cj_cast(cor, loc); + sit_u->fon_o = c3y; + if ( 0 == (sit_u->axe = _cj_axis(fol)) ) { + sit_u->jet_o = c3n; + sit_u->pog_p = _cj_prog(loc, fol); + } else { - u3_weak cax = u3j_find(u3h(pac)); - - if ( u3_none == cax ) { - fprintf(stderr, "fine: parent not found (%x)\r\n", u3r_mug(u3h(pac))); - return c3n; - } - else { - c3_o pro_o; - - cup = u3h(u3t(u3t(cax))); - mop = u3t(u3h(u3t(cax))); - cor = pac; - - pro_o = _cj_fine(cup, mop, cor); - u3z(cax); - return pro_o; - } + // loc already known-valid + han_u->sit_u.pog_p = _cj_prog(loc, u3r_at(sit_u->axe, cor)); + han_u->sit_u.jet_o = _cj_nail(loc, sit_u->axe, + &(sit_u->lab), &(sit_u->cop_u), &(sit_u->ham_u)); + } + u3z(fol); + u3z(col); + han_u->hax = hax; + return cor; + } + else if ( c3n == u3h(pat) ) { + u3_noun dyn = u3t(pat), + axe = u3h(dyn), + xah; + // axe already known-valid + cor = u3r_at(axe, cor); + loc = u3t(dyn); + xah = u3qc_peg(axe, hax); + u3z(hax); + hax = xah; + } + else { + u3_noun sat = u3t(pat); + if ( c3y == u3h(sat) ) { + return u3m_bail(c3__fail); + } + else { + u3_noun xah; + cor = u3t(cor); + loc = u3t(sat); + xah = u3qc_peg(3, hax); + u3z(hax); + hax = xah; } } } } +/* _cj_sink(): kick by nock. + */ +static u3_noun +_cj_sink(u3_noun cor, u3_noun axe) +{ + u3_noun fol = u3x_at(axe, cor); + u3z(axe); + return u3n_nock_on(cor, u3k(fol)); +} + /* u3j_kick(): new kick. ** ** `axe` is RETAINED by the caller; `cor` is RETAINED iff there @@ -608,31 +1223,36 @@ _cj_fine(u3_noun cup, u3_noun mop, u3_noun cor) u3_weak u3j_kick(u3_noun cor, u3_noun axe) { - if ( !_(u3du(cor)) ) { return u3_none; } - u3t_on(glu_o); - { - u3_noun bat = u3h(cor); - u3_weak cax = u3j_find(bat); + u3_weak loc = _cj_spot(cor, NULL); + if ( u3_none == loc ) { + u3t_off(glu_o); + return u3_none; + } + else { + u3_weak act = _cj_find_warm(loc); + u3z(loc); + if ( u3_none == act ) { + u3t_off(glu_o); + return u3_none; + } + else { + c3_l jax_l; + u3_noun hap, bal, jit, inx; - if ( u3_none == cax ) { u3t_off(glu_o); return u3_none; } - { - u3_noun mop = u3t(u3h(u3t(cax))); - u3_noun hap = u3h(u3t(u3h(cax))); - u3_noun cup = u3h(u3t(u3t(cax))); - u3_noun inx = u3kdb_get(u3k(hap), u3k(axe)); + u3x_qual(act, &jax_l, &hap, &bal, &jit); - if ( u3_none == inx ) { - u3z(cax); + if ( u3_none == (inx = u3kdb_get(u3k(hap), u3k(axe))) ) { u3t_off(glu_o); { c3_o pof_o = __(u3C.wag_w & u3o_debug_cpu); if ( _(pof_o) ) { - pof_o = u3t_come(bat); + pof_o = u3t_come(bal); } + u3z(act); if ( _(pof_o) ) { - u3_noun pro = u3n_nock_on(cor, u3nq(9, u3k(axe), 0, 1)); + u3_noun pro = _cj_sink(cor, u3k(axe)); u3t_flee(); return pro; @@ -642,34 +1262,23 @@ u3j_kick(u3_noun cor, u3_noun axe) } } } -#if 1 - else if ( !_(_cj_fine(cup, mop, cor)) ) { - fprintf(stderr, "improper core %x\r\n", u3r_mug(cor)); - u3m_p("improper label", u3h(u3t(u3t(u3h(cax))))); - u3m_bail(c3__exit); - - u3t_off(glu_o); - return u3_none; - } -#endif else { - c3_l jax_l = u3h(u3h(cax)); u3j_core* cop_u = &u3D.ray_u[jax_l]; c3_l inx_l = inx; u3j_harm* ham_u = &cop_u->arm_u[inx_l]; c3_o pof_o = __(u3C.wag_w & u3o_debug_cpu); u3_noun pro; - u3z(cax); if ( _(pof_o) ) { - pof_o = u3t_come(bat); + pof_o = u3t_come(bal); } + u3z(act); u3t_off(glu_o); pro = _cj_kick_z(cor, cop_u, ham_u, axe); if ( u3_none == pro ) { if ( _(pof_o) ) { - pro = u3n_nock_on(cor, u3nq(9, u3k(axe), 0, 1)); + pro = _cj_sink(cor, u3k(axe)); u3t_flee(); return pro; @@ -687,127 +1296,594 @@ u3j_kick(u3_noun cor, u3_noun axe) } } +/* _cj_fink_take(): copy u3j_fink from junior road. +*/ +static u3j_fink* +_cj_fink_take(u3j_fink* jun_u) +{ + c3_w i_w, len_w = jun_u->len_w; + u3j_fink* fin_u = u3a_walloc(c3_wiseof(u3j_fink) + + (len_w * c3_wiseof(u3j_fist))); + + fin_u->len_w = len_w; + fin_u->sat = u3a_take(jun_u->sat); + for ( i_w = 0; i_w < len_w; ++i_w ) { + u3j_fist* fis_u = &(fin_u->fis_u[i_w]); + u3j_fist* sif_u = &(jun_u->fis_u[i_w]); + fis_u->bat = u3a_take(sif_u->bat); + fis_u->pax = u3a_take(sif_u->pax); + } + return fin_u; +} + +/* _cj_fink_free(): lose and free everything in a u3j_fink. +*/ +static void +_cj_fink_free(u3p(u3j_fink) fin_p) +{ + c3_w i_w; + u3j_fink* fin_u = u3to(u3j_fink, fin_p); + u3z(fin_u->sat); + for ( i_w = 0; i_w < fin_u->len_w; ++i_w ) { + u3j_fist* fis_u = &(fin_u->fis_u[i_w]); + u3z(fis_u->bat); + u3z(fis_u->pax); + } + u3a_wfree(fin_u); +} + +/* u3j_rite_copy(): copy rite references from src_u to dst_u, +** losing old references if los_o is yes +*/ +void +u3j_rite_copy(u3j_rite* dst_u, u3j_rite* src_u, c3_o los_o) +{ + if ( u3_none == src_u->clu ) { + dst_u->clu = u3_none; + dst_u->fin_p = 0; + } + else { + u3p(u3j_fink) fon_p = dst_u->fin_p; + u3_noun old = dst_u->clu; + c3_o own_o = dst_u->own_o; + if ( c3y == src_u->own_o ) { + dst_u->own_o = c3y; + dst_u->clu = u3a_take(src_u->clu); + dst_u->fin_p = u3of(u3j_fink, _cj_fink_take(u3to(u3j_fink, src_u->fin_p))); + if ( (c3y == los_o) && + (u3_none != old) && + (c3y == own_o) ) { + u3z(old); + _cj_fink_free(fon_p); + } + } + } +} + +/* u3j_site_copy(): copy site references from src_u to dst_u, +** losing old references if los_o is yes +*/ +void +u3j_site_copy(u3j_site* dst_u, u3j_site* src_u, c3_o los_o) +{ + u3_noun old = dst_u->axe; + dst_u->axe = u3a_take(src_u->axe); + + if ( c3y == los_o ) { + u3z(old); + } + else { + dst_u->bat = u3_none; + dst_u->bas = u3_none; + dst_u->pog_p = 0; + dst_u->loc = u3_none; + dst_u->lab = u3_none; + dst_u->jet_o = c3n; + dst_u->fon_o = c3n; + dst_u->cop_u = NULL; + dst_u->ham_u = NULL; + dst_u->fin_p = 0; + } + + if ( u3_none != src_u->loc ) { + u3_noun lob = dst_u->lab, + lod = dst_u->loc; + c3_o fon_o = dst_u->fon_o; + u3p(u3j_fink) fon_p = dst_u->fin_p; + + dst_u->loc = u3a_take(src_u->loc); + dst_u->lab = u3a_take(src_u->lab); + dst_u->cop_u = src_u->cop_u; + dst_u->ham_u = src_u->ham_u; + dst_u->jet_o = src_u->jet_o; + + if ( c3y == src_u->fon_o ) { + dst_u->fin_p = u3of(u3j_fink, _cj_fink_take(u3to(u3j_fink, src_u->fin_p))); + dst_u->fon_o = c3y; + } + else if ( fon_p != src_u->fin_p ) { + dst_u->fin_p = src_u->fin_p; + dst_u->fon_o = c3n; + } + else { + fon_o = c3n; + } + + if ( c3y == los_o ) { + if ( u3_none != lod ) { + u3z(lod); + u3z(lob); + if ( c3y == fon_o ) { + _cj_fink_free(fon_p); + } + } + } + } +} + +/* u3j_site_ream(): refresh u3j_site after restoring from checkpoint +*/ +void +u3j_site_ream(u3j_site* sit_u) +{ + if ( u3_none != sit_u->loc ) { + u3z(sit_u->lab); + sit_u->jet_o = _cj_nail(sit_u->loc, sit_u->axe, + &(sit_u->lab), &(sit_u->cop_u), &(sit_u->ham_u)); + } +} + +/* _cj_site_lock(): ensure site has a valid program pointer + */ +static void +_cj_site_lock(u3_noun loc, u3_noun cor, u3j_site* sit_u) +{ + if ( (u3_none != sit_u->bat) && + (c3y == u3r_sing(sit_u->bat, u3h(cor))) ) { + return; + } + sit_u->pog_p = _cj_prog(loc, u3x_at(sit_u->axe, cor)); + if ( u3_none != sit_u->bat ) { + u3z(sit_u->bat); + } + sit_u->bat = u3k(u3h(cor)); +} + +/* _cj_burn(): stop tracing glu and call a nock program + */ +static u3_noun +_cj_burn(u3p(u3n_prog) pog_p, u3_noun cor) +{ + u3_noun pro; + u3t_off(glu_o); + pro = u3n_burn(pog_p, cor); + u3t_on(glu_o); + return pro; +} + +/* _cj_site_kick_hot(): execute site's kick on located core +** (no validity checks). +*/ +static u3_weak +_cj_site_kick_hot(u3_noun loc, u3_noun cor, u3j_site* sit_u) +{ + u3_weak pro = u3_none; + c3_o jet_o = sit_u->jet_o; + c3_o pof_o = __(u3C.wag_w & u3o_debug_cpu); + if ( c3n == pof_o ) { + if ( c3n == jet_o ) { + pro = u3_none; + } + else { + u3t_off(glu_o); + pro = _cj_kick_z(cor, sit_u->cop_u, sit_u->ham_u, sit_u->axe); + u3t_on(glu_o); + } + if ( u3_none == pro ) { + _cj_site_lock(loc, cor, sit_u); + } + } + else { + pof_o = u3t_come(sit_u->lab); + if ( c3y == jet_o ) { + u3t_off(glu_o); + pro = _cj_kick_z(cor, sit_u->cop_u, sit_u->ham_u, sit_u->axe); + u3t_on(glu_o); + } + if ( u3_none == pro ) { + _cj_site_lock(loc, cor, sit_u); + pro = _cj_burn(sit_u->pog_p, cor); + } + if ( c3y == pof_o ) { + u3t_flee(); + } + } + return pro; +} + +/* _cj_site_kick(): execute site's kick on core. + */ +static u3_weak +_cj_site_kick(u3_noun cor, u3j_site* sit_u) +{ + u3_weak loc, pro; + + loc = pro = u3_none; + + if ( u3_none != sit_u->loc ) { + if ( c3y == _cj_fine(cor, sit_u->fin_p) ) { + loc = sit_u->loc; + if ( c3y == sit_u->jet_o ) { + pro = _cj_site_kick_hot(loc, cor, sit_u); + } + } + } + + if ( u3_none == loc ) { + loc = _cj_spot(cor, &(sit_u->bas)); + if ( u3_none != loc ) { + u3p(u3j_fink) fon_p = 0; + u3_weak lod = u3_none; + u3_weak lob = u3_none; + + if ( u3_none != sit_u->loc ) { + lod = sit_u->loc; + lob = sit_u->lab; + if ( c3y == sit_u->fon_o ) { + fon_p = sit_u->fin_p; + } + } + + sit_u->loc = loc; + sit_u->fin_p = _cj_cast(cor, loc); + sit_u->fon_o = c3y; + if ( c3y == + (sit_u->jet_o = _cj_nail(loc, sit_u->axe, + &(sit_u->lab), &(sit_u->cop_u), &(sit_u->ham_u))) ) + { + pro = _cj_site_kick_hot(loc, cor, sit_u); + } + else { + pro = u3_none; + } + + if ( u3_none != lod ) { + u3z(lod); + u3z(lob); + if ( 0 != fon_p ) { + _cj_fink_free(fon_p); + } + } + } + } + + if ( u3_none == pro ) { + _cj_site_lock(loc, cor, sit_u); + } + + return pro; +} + +/* u3j_site_kick(): kick a core with a u3j_site cache. + */ +u3_weak +u3j_site_kick(u3_noun cor, u3j_site* sit_u) +{ + u3_weak pro; + u3t_on(glu_o); + pro = _cj_site_kick(cor, sit_u); + u3t_off(glu_o); + return pro; +} + +/* u3j_cook(): Execute hook from core, call site cached by arbitrary c string +*/ +u3_noun +u3j_cook(const c3_c* key_c, + u3_noun cor, + const c3_c* tam_c) +{ + u3_noun pro, key, tam, inn; + _cj_hank* han_u; + + u3t_on(glu_o); + key = u3i_string(key_c); + tam = u3i_string(tam_c); + han_u = _cj_hank_find(key, tam); + if ( c3n == _cj_hank_fine(han_u, cor, &inn) ) { + _cj_hank_lose(han_u); + inn = _cj_hank_fill(han_u, tam, cor); + } + pro = _cj_site_kick(u3k(inn), &(han_u->sit_u)); + if ( u3_none == pro ) { + pro = _cj_burn(han_u->sit_u.pog_p, inn); + } + u3z(cor); + + u3z(key); + u3z(tam); + u3t_off(glu_o); + return pro; +} + /* u3j_kink(): kick either by jet or by nock. */ u3_noun -u3j_kink(u3_noun cor, - u3_noun axe) +u3j_kink(u3_noun cor, u3_noun axe) { u3_weak pro = u3j_kick(cor, axe); if ( u3_none != pro ) { return pro; - } else { - return u3n_nock_on(cor, u3nq(9, axe, 0, 1)); + } + else { + return _cj_sink(cor, axe); } } -/* _cj_jit(): generate arbitrary warm jet-associated data. RETAIN. -*/ -static u3_noun -_cj_jit(c3_l jax_l, u3_noun bat) +/* u3j_gate_prep(): prepare a locally cached gate to call repeatedly. + * core is TRANSFERRED. + */ +void +u3j_gate_prep(u3j_site* sit_u, u3_noun cor) { - return u3_nul; -} - -/* _cj_mine(): declare a core. RETAIN. -*/ -static void -_cj_mine(u3_noun cey, u3_noun cor) -{ - u3_noun bat = u3h(cor); - u3_noun p_cey, q_cey, r_cey; - - u3r_trel(cey, &p_cey, &q_cey, &r_cey); - { - /* Calculate semantic identity (cope) and match state (corp). - */ - u3_noun mop; // ++cope - u3_noun cup; // ++corp - u3_noun soh; // ++bash - u3_noun cuz; // ++club - u3_noun lab; // ++path - - if ( 0 == q_cey ) { - mop = u3nq(u3k(p_cey), 3, c3n, u3k(u3t(cor))); - cup = u3nc(c3n, u3k(cor)); - lab = u3_nul; + u3_noun loc; + u3t_on(glu_o); + if ( c3n == u3du(cor) || c3n == u3du(u3t(cor)) ) { + u3m_bail(c3__exit); + return; + } + sit_u->bas = u3_none; + sit_u->axe = 2; + sit_u->bat = cor; // a lie, this isn't really the battery! + sit_u->loc = loc = _cj_spot(cor, &(sit_u->bas)); + sit_u->pog_p = _cj_prog(loc, u3h(cor)); + if ( u3_none != loc ) { + u3_noun pax = _cj_loc_axe(loc), + pay = u3qc_cap(pax), + pam = u3qc_mas(pax); + if ( 3 != pay || 2 == pam || (3 != pam && 3 != u3qc_cap(pam)) ) { + fprintf(stderr, "u3j_gate_prep(): parent axis includes sample\r\n"); + u3m_p("axis", pax); + u3_weak act = _cj_find_warm(loc); + c3_assert( u3_none != act ); + sit_u->jet_o = c3n; + sit_u->lab = u3k(u3h(u3t(u3t(act)))); + u3z(act); } else { - u3_weak rah = u3r_at(q_cey, cor); - - if ( (u3_none == rah) || !_(u3du(rah)) ) { - fprintf(stderr, "fund: %s is bogus\r\n", u3r_string(p_cey)); - return; - } - else { - u3_noun tab = u3h(rah); - u3_weak cax = u3j_find(tab); - - if ( u3_none == cax ) { - fprintf(stderr, "fund: in %s, parent %x not found at %d\r\n", - u3r_string(p_cey), - u3r_mug(u3h(rah)), - q_cey); - return; - } - else { - u3_noun hos = u3h(u3h(u3t(cax))); - u3_noun puc = u3h(u3t(u3t(cax))); - - mop = u3nq(u3k(p_cey), u3k(q_cey), c3y, u3k(hos)); - if ( (3 == q_cey) && (c3y == u3h(puc)) ) { - cup = u3nc(c3y, u3k(cor)); - } - else { - cup = u3nc(c3n, u3k(tab)); - } - lab = u3k(u3h(u3t(u3t(u3h(cax))))); - u3z(cax); - } - } + sit_u->jet_o = _cj_nail(loc, 2, + &(sit_u->lab), &(sit_u->cop_u), &(sit_u->ham_u)); } - soh = _cj_sham(u3k(mop)); - cuz = u3nc(cup, u3k(r_cey)); + u3z(pam); u3z(pax); + } + u3t_off(glu_o); +} - // Save cold state. - // - { - u3_noun hoe = u3kdb_get(u3k(u3R->jed.das), u3k(soh)); - u3_noun sab; +/* u3j_gate_slam(): slam a site prepared by u3j_gate_find() with sample. + * sam is TRANSFERRED. + */ +u3_noun +u3j_gate_slam(u3j_site* sit_u, u3_noun sam) +{ + u3_weak pro; + u3_noun cor; - if ( u3_none == hoe ) { - sab = u3nt(u3nc(u3k(bat), u3k(cuz)), u3_nul, u3_nul); - } - else { - sab = u3kdb_put(u3k(u3t(hoe)), u3k(bat), u3k(cuz)); - u3z(hoe); - } + u3t_on(glu_o); + pro = u3_none; + cor = u3nt(u3k(u3h(sit_u->bat)), + sam, + u3k(u3t(u3t(sit_u->bat)))); + if ( (u3_none != sit_u->loc) && (c3y == sit_u->jet_o) ) { + pro = _cj_site_kick_hot(sit_u->loc, cor, sit_u); + } + if ( u3_none == pro ) { + pro = _cj_burn(sit_u->pog_p, cor); + } + u3t_off(glu_o); + return pro; +} - u3R->jed.das = u3kdb_put(u3R->jed.das, u3k(soh), u3nc(u3k(mop), sab)); +/* u3j_gate_lose(): clean up site prepared by u3j_gate_find(). + */ +void +u3j_gate_lose(u3j_site* sit_u) +{ + u3z(sit_u->bat); + u3z(sit_u->bas); + if ( u3_none != sit_u->loc ) { + u3z(sit_u->loc); + u3z(sit_u->lab); + } +} + +/* _cj_minx(): produce location of core from fsck'd clue. RETAIN. + */ +static u3_weak +_cj_minx(u3_noun cey, u3_noun cor) +{ + u3_noun nam, axe, huc; + u3x_trel(cey, &nam, &axe, &huc); + + if ( 0 == axe ) { + return u3nt(u3nt(c3y, c3y, u3k(u3t(cor))), u3k(nam), u3k(huc)); + } + else { + u3_weak par, pel; + u3_noun pat; + + par = u3r_at(axe, cor); + if ( u3_none == par || c3n == u3du(par) ) { + fprintf(stderr, "fund: %s is bogus\r\n", u3r_string(nam)); + return u3_none; } + pel = _cj_spot(par, NULL); + if ( u3_none == pel ) { + fprintf(stderr, "fund: in %s, parent %x not found at %d\r\n", + u3r_string(nam), + u3r_mug(u3h(par)), + axe); + return u3_none; + } + pat = ( ( 3 == axe ) && (c3y == u3h(u3h(pel))) ) + ? u3nt(c3y, c3n, pel) + : u3nt(c3n, u3k(axe), pel); + return u3nt(pat, u3k(nam), u3k(huc)); + } +} - // Save warm state. - // - { - c3_l jax_l = _cj_hot_mine(mop, cor); - u3_noun bal = u3nc(u3k(p_cey), lab); +static void +_cj_print_tas(FILE* fh, u3_noun tas) +{ + c3_w met_w = u3r_met(3, tas); + c3_c* str_c = alloca(met_w + 1); + u3r_bytes(0, met_w, (c3_y*)str_c, tas); + str_c[met_w] = 0; + fprintf(fh, "/%s", str_c); +} +/* _cj_mine(): declare a core and produce location. RETAIN. +*/ +static u3_weak +_cj_mine(u3_noun cey, u3_noun cor, u3_noun bas) +{ + u3_weak loc = _cj_minx(cey, cor); + if ( u3_none != loc ) { + c3_l par_l, jax_l; + u3_noun pel = _cj_loc_pel(loc), + axe = _cj_loc_axe(loc), + bat = u3h(cor), + nam = u3h(u3t(loc)), + bar = _cj_find_cold(bat), + reg, hap, bal, act; + if ( u3_none == bar ) { + reg = u3_none; + } + else { + reg = u3k(u3t(bar)); + u3z(bar); + } + reg = _cj_gust(reg, u3k(axe), u3k(pel), u3k(loc)); + if ( 0 == axe ) { + par_l = 0; + bal = u3nc(u3k(nam), u3_nul); + } + else { + u3_weak pac = _cj_find_warm(pel); + c3_assert(u3_none != pac); + par_l = u3h(pac); + bal = u3nc(u3k(nam), u3k(u3h(u3t(u3t(pac))))); + u3z(pac); + } + jax_l = _cj_hot_mean(par_l, nam); #if 0 - u3m_p("new jet", bal); - fprintf(stderr, " bat %x, jax %d\r\n", u3r_mug(bat), jax_l); + u3m_p("new jet", bal); + fprintf(stderr, " bat %x, jax %d\r\n", u3r_mug(bat), jax_l); #endif - u3h_put(u3R->jed.har_p, - bat, - u3nt(u3nq(jax_l, - _cj_warm_hump(jax_l, r_cey), - bal, - _cj_jit(jax_l, bat)), - u3nc(soh, mop), - cuz)); - } + if ( !(u3C.wag_w & u3o_hashless) ) { + if ( jax_l ) { + c3_y dig_y[32]; + c3_w i_w; + u3_noun i = bal; + fprintf(stderr, "hot jet: "); + while ( i != u3_nul ) { + _cj_print_tas(stderr, u3h(i)); + i = u3t(i); + } + fprintf(stderr, "\r\n axe %d, jax %d,\r\n bash ", axe, jax_l); + u3r_bytes(0, 32, dig_y, bas); + for ( i_w = 32; i_w > 0; ) { + fprintf(stderr, "%02x", dig_y[--i_w]); + } + fprintf(stderr, "\r\n"); + } + } + + hap = _cj_warm_hump(jax_l, u3t(u3t(loc))); + act = u3nq(jax_l, hap, bal, _cj_jit(jax_l, bat)); + u3h_put(u3R->jed.cod_p, bat, u3nc(u3k(bas), reg)); + u3h_put(u3R->jed.war_p, loc, act); // see note in _cj_spot + u3z(pel); u3z(axe); } + + return loc; +#if 0 + { + u3_noun bas = _cj_bash(bat), + hot = u3h_get(u3D.hot_p, bas); + c3_o hav_o = c3n; + + if ( u3_none != hot ) { + u3_noun her = u3h(hot), + hol = _cj_reg_find(her, cor); + if ( hol != u3_none ) { + hav_o = c3y; + u3z(hol); + } + u3z(hot); + } + + if ( c3n == hav_o ) { + u3m_p("unregistered battery", bal); + fprintf(stderr, "hash: %x\r\n", bas); + } + u3z(bas); + } +#endif +} + +static void +_cj_audit(u3_noun loc, u3_noun cey, u3_noun cor) +{ + u3_noun pat, nam, huc, cax, can, cuc, pax; + + u3x_trel(loc, &pat, &nam, &huc); + u3x_trel(cey, &can, &cax, &cuc); + + pax = _cj_loc_axe(loc); + + if ( (c3n == u3r_sing(nam, can)) || + (c3n == u3r_sing(pax, cax)) || + (c3n == u3r_sing(huc, cuc)) ) { + u3_noun mix = _cj_minx(cey, cor); + u3m_p("bad audit", loc); + u3m_p("hint says", mix); + u3z(mix); + } + + u3z(pax); +} + +/* _cj_mile(): register core for jets, returning location. +*/ +static u3_weak +_cj_mile(u3_noun clu, u3_noun cor) +{ + u3_weak loc = u3_none; + if ( c3n == u3du(cor) ) { + u3z(clu); + u3z(cor); + } + else { + u3_weak cey = _cj_je_fsck(clu); + if ( u3_none != cey ) { + u3_weak bas = u3_none; + loc = _cj_spot(cor, &bas); + if ( u3_none == loc ) { + loc = _cj_mine(cey, cor, bas); + } + else { + _cj_audit(loc, cey, cor); + } + u3z(cey); + if ( u3_none != bas ) { + u3z(bas); + } + } + u3z(cor); + } + return loc; } /* u3j_mine(): register core for jets. @@ -815,117 +1891,45 @@ _cj_mine(u3_noun cey, u3_noun cor) void u3j_mine(u3_noun clu, u3_noun cor) { - u3_noun bat = u3h(cor); - u3_noun cax; - + u3_weak loc; u3t_on(glu_o); - if ( !_(u3du(cor)) ) { - u3z(clu); - } - else if ( u3_none != (cax = u3j_find(bat)) ) { - u3z(cax); u3z(clu); - } - else { - u3_noun cey = _cj_je_fsck(clu); - - if ( u3_none != cey ) { - _cj_mine(cey, cor); - u3z(cey); - } - } - u3z(cor); + loc = _cj_mile(clu, cor); + u3z(loc); u3t_off(glu_o); } -/* _cj_cold_reap_to: reap clog list. RETAINS `sab`, TRANSFERS `bam`. +/* u3j_rite_mine(): mine cor with clue, using u3j_rite for caching */ -static u3_noun -_cj_cold_reap_to(u3_noun sab, u3_noun bam) +void +u3j_rite_mine(u3j_rite* rit_u, u3_noun clu, u3_noun cor) { - if ( u3_nul == sab ) { - return bam; - } - else { - u3_noun n_sab, l_sab, r_sab, pn_sab, qn_sab; + c3_t non_t; + u3t_on(glu_o); - u3x_trel(sab, &n_sab, &l_sab, &r_sab); - u3x_cell(n_sab, &pn_sab, &qn_sab); - { - bam = _cj_cold_reap_to(l_sab, bam); - bam = _cj_cold_reap_to(r_sab, bam); - - // If the battery is not junior, or if it has been - // already collected for the product, promote it. - // - if ( _(u3a_left(pn_sab)) ) { - u3_noun bat = u3a_take(pn_sab); + non_t = (u3_none == rit_u->clu); - bam = u3nc(u3nc(bat, u3a_take(qn_sab)), bam); + if ( non_t || + c3n == u3r_sing(rit_u->clu, clu) || + c3n == _cj_fine(cor, rit_u->fin_p) ) { + u3_weak loc = _cj_mile(u3k(clu), u3k(cor)); + if ( u3_none != loc ) { + u3p(u3j_fink) fon_p = rit_u->fin_p; + u3_noun old = rit_u->clu; + c3_o own_o = rit_u->own_o; + rit_u->own_o = c3y; + rit_u->clu = u3k(clu); + rit_u->fin_p = _cj_cast(cor, loc); + u3z(loc); + + if ( !non_t && (c3y == own_o) ) { + u3z(old); + _cj_fink_free(fon_p); } - return bam; } } -} - -/* _cj_cold_reap_with(): unify old and new battery maps. TRANSFERS. -*/ -static u3_noun -_cj_cold_reap_with(u3_noun sab, u3_noun bam) -{ - u3_noun mab = bam; - - while ( u3_nul != mab ) { - u3_noun i_mab = u3h(mab); - - sab = u3kdb_put(sab, u3k(u3h(i_mab)), u3k(u3t(i_mab))); - mab = u3t(mab); - } - u3z(bam); - return sab; -} - -/* _cj_cold_reap_at(): reap haw node. RETAINS. -*/ -static void -_cj_cold_reap_at(u3_noun soh, u3_noun cag) -{ - u3_noun bam = _cj_cold_reap_to(u3t(cag), u3_nul); - - if ( u3_nul != bam ) { - u3_noun hoe, sab; - - soh = u3a_take(soh); - hoe = u3kdb_get(u3k(u3R->jed.das), u3k(soh)); - - if ( u3_none == hoe ) { - sab = _cj_cold_reap_with(u3_nul, bam); - cag = u3nc(u3a_take(u3h(cag)), sab); - } - else { - sab = _cj_cold_reap_with(u3k(u3t(hoe)), bam); - cag = u3nc(u3k(u3h(hoe)), sab); - } - u3z(hoe); - - u3R->jed.das = u3kdb_put(u3R->jed.das, soh, cag); - } -} - -/* _cj_cold_reap_in(): reap in (junior) haw. RETAINS. -*/ -static void -_cj_cold_reap_in(u3_noun taw) -{ - if ( u3_nul != taw ) { - u3_noun n_taw, l_taw, r_taw, pn_taw, qn_taw; - - u3x_trel(taw, &n_taw, &l_taw, &r_taw); - u3x_cell(n_taw, &pn_taw, &qn_taw); - - _cj_cold_reap_at(pn_taw, qn_taw); - _cj_cold_reap_in(l_taw); - _cj_cold_reap_in(r_taw); - } + u3z(clu); + u3z(cor); + u3t_off(glu_o); } /* _cj_warm_reap(): reap key and value from warm table. @@ -933,177 +1937,324 @@ _cj_cold_reap_in(u3_noun taw) static void _cj_warm_reap(u3_noun kev) { - u3_noun bat = u3h(kev); - u3_noun cax = u3t(kev); - - if ( _(u3a_left(bat)) ) { - if ( !_(u3a_is_junior(u3R, bat)) && - (u3_none != u3h_git(u3R->jed.har_p, bat)) ) { - fprintf(stderr, "reap: promote collision (bat %x)\r\n", u3r_mug(bat)); - u3m_p("collision", u3h(u3t(u3t(u3h(cax))))); - } - else { - u3_noun tab = u3a_take(bat); - u3_noun xac = u3a_take(cax); - -#if 0 - u3m_p("hot jet", u3h(u3t(u3t(u3h(cax))))); - fprintf(stderr, " bat %x\r\n", u3r_mug(tab)); -#endif - u3h_put(u3R->jed.har_p, tab, xac); - u3z(tab); - } - } + u3_noun loc = u3a_take(u3h(kev)); + u3_noun act = u3a_take(u3t(kev)); + u3h_put(u3R->jed.war_p, loc, act); + u3z(loc); } -/* u3j_reap(): promote jet state. RETAINS. +/* _cj_cold_reap(): reap cold dashboard entries. + */ +static void +_cj_cold_reap(u3_noun kev) +{ + u3_noun bat = u3a_take(u3h(kev)); + u3_noun reg = u3a_take(u3t(kev)); + u3h_put(u3R->jed.cod_p, bat, reg); + u3z(bat); +} + +/* _cj_bash_reap(): reap battery hashes. + */ +static void +_cj_bash_reap(u3_noun kev) +{ + u3_noun key = u3a_take(u3h(kev)), + val = u3a_take(u3t(kev)); + u3h_put(u3R->jed.bas_p, key, val); + u3z(key); +} + +/* _cj_hank_reap(): reap hook resolutions. + */ +static void +_cj_hank_reap(u3_noun kev) +{ + u3_noun key = u3a_take(u3h(kev)); + u3_noun got = u3h_git(u3R->jed.han_p, key); + _cj_hank* nah_u = u3to(_cj_hank, u3t(kev)); + _cj_hank* han_u; + + if ( u3_none != got ) { + if ( u3_none != nah_u->hax ) { + u3_weak old; + han_u = u3to(_cj_hank, got); + old = han_u->hax; + han_u->hax = u3a_take(nah_u->hax); + u3j_site_copy(&(han_u->sit_u), &(nah_u->sit_u), c3y); + if ( u3_none != old ) { + u3z(old); + } + } + } + else if ( u3_none != nah_u->hax ) { + han_u = u3a_walloc(c3_wiseof(_cj_hank)); + han_u->hax = u3a_take(nah_u->hax); + u3j_site_copy(&(han_u->sit_u), &(nah_u->sit_u), c3n); + u3h_put(u3R->jed.han_p, key, u3a_outa(han_u)); + } + + u3z(key); +} + +/* u3j_reap(): promote jet state. */ void -u3j_reap(u3_noun das, u3p(u3h_root) har_p) +u3j_reap(u3p(u3h_root) cod_p, u3p(u3h_root) war_p, u3p(u3h_root) han_p, u3p(u3h_root) bas_p) { - _cj_cold_reap_in(das); - u3h_walk(har_p, _cj_warm_reap); + u3h_walk(cod_p, _cj_cold_reap); + u3h_walk(war_p, _cj_warm_reap); + u3h_walk(han_p, _cj_hank_reap); + u3h_walk(bas_p, _cj_bash_reap); } -static c3_l _cj_warm_ream_at(u3_noun soh, u3_noun* lab, u3_noun cag); - -/* _cj_warm_ream_be(): install battery; RETAINS. -*/ +/* _cj_ream(): ream list of battery [bash registry] pairs. RETAIN. + */ static void -_cj_warm_ream_be(c3_l jax_l, - u3_noun soh, - u3_noun lab, - u3_noun mop, - u3_noun bat, - u3_noun cuz) +_cj_ream(u3_noun all) { + c3_l par_l, jax_l; + u3_noun i, j, k, rul, loc, bal, act, lop, kev, rut, hap, + pat, reg, pol, rem, rec, bat, pel, nam, huc; + u3_weak pac; + + for ( i = all, lop = u3_nul; i != u3_nul; i = u3t(i) ) { + kev = u3h(i); + bat = u3h(kev); + reg = u3t(u3t(kev)); + rut = u3h(reg); + + // register roots + rul = u3qdb_tap(rut); + for ( j = rul; j != u3_nul; j = u3t(j) ) { + loc = u3t(u3h(j)); + u3x_trel(loc, &pat, &nam, &huc); + bal = u3nc(u3k(nam), u3_nul); + jax_l = _cj_hot_mean(0, nam); + hap = _cj_warm_hump(jax_l, huc); + act = u3nq(jax_l, hap, bal, _cj_jit(jax_l, bat)); #if 0 - u3m_p("old jet", lab); - fprintf(stderr, " bat %x, soh %x, jax %d\r\n", - u3r_mug(bat), u3r_mug(soh), jax_l); + u3m_p("old jet", bal); + fprintf(stderr, " bat %x, jax %d\r\n", u3r_mug(bat), jax_l); #endif - - u3h_put(u3R->jed.har_p, - bat, - u3nt(u3nq(jax_l, - _cj_warm_hump(jax_l, u3t(cuz)), - u3k(lab), - _cj_jit(jax_l, bat)), - u3nc(u3k(soh), u3k(mop)), - u3k(cuz))); -} - -/* _cj_warm_ream_is(): reream battery; RETAINS. -*/ -static void -_cj_warm_ream_is(c3_l jax_l, - u3_noun soh, - u3_noun lab, - u3_noun mop, - u3_noun sab) -{ - if ( u3_nul != sab ) { - u3_noun n_sab, l_sab, r_sab, pn_sab, qn_sab; - - u3x_trel(sab, &n_sab, &l_sab, &r_sab); - u3x_cell(n_sab, &pn_sab, &qn_sab); - - _cj_warm_ream_be(jax_l, soh, lab, mop, pn_sab, qn_sab); - _cj_warm_ream_is(jax_l, soh, lab, mop, l_sab); - _cj_warm_ream_is(jax_l, soh, lab, mop, r_sab); - } -} - -/* _cj_warm_ream_un(): reream under `soh`; RETAINS, transfers `*lab`. -*/ -static c3_l -_cj_warm_ream_un(u3_noun soh, u3_noun* lab) -{ - u3_noun cag = u3kdb_got(u3k(u3R->jed.das), u3k(soh)); - u3_noun sab = u3t(cag); - u3_noun cax; - c3_l jax_l; - - if ( u3_none != (cax = u3h_get(u3R->jed.har_p, u3h(u3h(sab)))) ) { - jax_l = u3h(u3h(cax)); - *lab = u3k(u3h(u3t(u3t(u3h(cax))))); - u3z(cax); - } - else { - jax_l = _cj_warm_ream_at(soh, lab, cag); - } - u3z(cag); - return jax_l; -} - -/* _cj_warm_ream_at(): reream at `soh` and `cag`; RETAINS, transfers `*lab`. -*/ -static c3_l -_cj_warm_ream_at(u3_noun soh, u3_noun* lab, u3_noun cag) -{ - u3_noun mop = u3h(cag); - u3_noun sab = u3t(cag); - u3_noun p_mop, q_mop, r_mop, hr_mop, tr_mop; - - u3x_trel(mop, &p_mop, &q_mop, &r_mop); - u3x_cell(r_mop, &hr_mop, &tr_mop); - { - c3_l par_l, jax_l; - u3_noun pal = u3_nul; - - if ( c3y == hr_mop ) { - par_l = _cj_warm_ream_un(tr_mop, &pal); + u3h_put(u3R->jed.war_p, loc, act); } - else { - par_l = 0; - pal = u3_nul; + u3z(rul); + + // put ancestors in lop (list [battery=^ parent=location this=location]) + for ( j = u3t(reg); j != u3_nul; j = u3t(j) ) { + pol = lop; + lop = u3qdb_tap(u3t(u3h(j))); + for ( k = lop; u3_nul != k; k = u3t(k) ) { + pol = u3nc(u3nc(u3k(bat), u3k(u3h(k))), pol); + } + u3z(lop); + lop = pol; } - *lab = u3nc(u3k(p_mop), pal); - jax_l = _cj_hot_mean(par_l, mop, 0); - - _cj_warm_ream_is(jax_l, soh, *lab, mop, sab); - return jax_l; } -} -/* _cj_warm_ream_in(): reream in `taw`; RETAINS. -*/ -static void -_cj_warm_ream_in(u3_noun taw) -{ - if ( u3_nul != taw ) { - u3_noun n_taw, l_taw, r_taw, pn_taw, qn_taw; - u3_noun lab; - - u3x_trel(taw, &n_taw, &l_taw, &r_taw); - u3x_cell(n_taw, &pn_taw, &qn_taw); - - _cj_warm_ream_at(pn_taw, &lab, qn_taw); - u3z(lab); - - _cj_warm_ream_in(l_taw); - _cj_warm_ream_in(r_taw); + // ordering is random so we need to push onto rem when parent + // isn't yet present in the warm state + while ( u3_nul != lop ) { + rem = u3_nul; + for ( i = lop; u3_nul != i; i = u3t(i) ) { + rec = u3h(i); + u3x_trel(rec, &bat, &pel, &loc); + pac = _cj_find_warm(pel); + if ( u3_none == pac ) { + rem = u3nc(u3k(rec), rem); + } + else { + u3x_trel(loc, &pat, &nam, &huc); + par_l = u3h(pac); + jax_l = _cj_hot_mean(par_l, nam); + bal = u3nc(u3k(nam), u3k(u3h(u3t(u3t(pac))))); + hap = _cj_warm_hump(jax_l, huc), + u3z(pac); + act = u3nq(jax_l, hap, bal, _cj_jit(jax_l, bat)); +#if 0 + u3m_p("old jet", bal); + fprintf(stderr, " bat %x, jax %d\r\n", u3r_mug(bat), jax_l); +#endif + u3h_put(u3R->jed.war_p, loc, act); + } + } + u3z(lop); + lop = rem; } } -/* _cj_warm_ream(): reream warm from cold state. +/* _cj_warm_tap(): tap war_p to rel */ static void -_cj_warm_ream(void) +_cj_warm_tap(u3_noun kev, void* wit) { - c3_assert(u3R == &(u3H->rod_u)); - { - _cj_warm_ream_in(u3R->jed.das); - } + u3_noun* rel = wit; + *rel = u3nc(u3k(kev), *rel); } -/* u3j_ream(): reream after restoring from checkpoint. +/* _cj_ream_hank(): clear hot state out of hook sites. +*/ +static void +_cj_ream_hank(u3_noun kev) +{ + u3j_site_ream(&(u3to(_cj_hank, u3t(kev))->sit_u)); +} + +/* u3j_ream(): rebuild warm state */ void u3j_ream(void) { - u3h_free(u3R->jed.har_p); - u3R->jed.har_p = u3h_new(); + u3_noun rel = u3_nul; + c3_assert(u3R == &(u3H->rod_u)); + u3h_free(u3R->jed.war_p); + u3R->jed.war_p = u3h_new(); + u3h_walk_with(u3R->jed.cod_p, _cj_warm_tap, &rel); + _cj_ream(rel); + u3z(rel); - _cj_warm_ream(); + u3h_walk(u3R->jed.han_p, _cj_ream_hank); } + +/* _cj_fink_mark(): mark a u3j_fink for gc. +*/ +static c3_w +_cj_fink_mark(u3j_fink* fin_u) +{ + c3_w i_w, tot_w = u3a_mark_noun(fin_u->sat); + for ( i_w = 0; i_w < fin_u->len_w; ++i_w ) { + u3j_fist* fis_u = &(fin_u->fis_u[i_w]); + tot_w += u3a_mark_noun(fis_u->bat); + tot_w += u3a_mark_noun(fis_u->pax); + } + tot_w += u3a_mark_ptr(fin_u); + return tot_w; +} + +/* u3j_site_lose(): lose references of u3j_site (but do not free). + */ +void +u3j_site_lose(u3j_site* sit_u) +{ + u3z(sit_u->axe); + if ( u3_none != sit_u->bat ) { + u3z(sit_u->bat); + } + if ( u3_none != sit_u->bas ) { + u3z(sit_u->bas); + } + if ( u3_none != sit_u->loc ) { + u3z(sit_u->loc); + u3z(sit_u->lab); + if ( c3y == sit_u->fon_o ) { + _cj_fink_free(sit_u->fin_p); + } + } +} + +/* u3j_rite_lose(): lose references of u3j_rite (but do not free). + */ +void +u3j_rite_lose(u3j_rite* rit_u) +{ + if ( (c3y == rit_u->own_o) && u3_none != rit_u->clu ) { + u3z(rit_u->clu); + _cj_fink_free(rit_u->fin_p); + } +} + +/* u3j_rite_mark(): mark u3j_rite for gc. +*/ +c3_w +u3j_rite_mark(u3j_rite* rit_u) +{ + c3_w tot_w = 0; + if ( (c3y == rit_u->own_o) && u3_none != rit_u->clu ) { + tot_w += u3a_mark_noun(rit_u->clu); + tot_w += _cj_fink_mark(u3to(u3j_fink, rit_u->fin_p)); + } + return tot_w; +} + +/* u3j_site_mark(): mark u3j_site for gc. +*/ +c3_w +u3j_site_mark(u3j_site* sit_u) +{ + c3_w tot_w = u3a_mark_noun(sit_u->axe); + if ( u3_none != sit_u->bat ) { + tot_w += u3a_mark_noun(sit_u->bat); + } + if ( u3_none != sit_u->bas ) { + tot_w += u3a_mark_noun(sit_u->bas); + } + if ( u3_none != sit_u->loc ) { + tot_w += u3a_mark_noun(sit_u->loc); + tot_w += u3a_mark_noun(sit_u->lab); + if ( c3y == sit_u->fon_o ) { + tot_w += _cj_fink_mark(u3to(u3j_fink, sit_u->fin_p)); + } + } + return tot_w; +} + +/* _cj_mark_hank(): mark hank cache for gc. +*/ +static void +_cj_mark_hank(u3_noun kev, void* dat) +{ + c3_w* tot_w = (c3_w*) dat; + _cj_hank* han_u = u3to(_cj_hank, u3t(kev)); + *tot_w += u3a_mark_ptr(han_u); + if ( u3_none != han_u->hax ) { + *tot_w += u3a_mark_noun(han_u->hax); + *tot_w += u3j_site_mark(&(han_u->sit_u)); + } +} + +/* u3j_mark(): mark jet state for gc. +*/ +c3_w +u3j_mark(void) +{ + c3_w tot_w = 0; + tot_w += u3h_mark(u3R->jed.war_p); + tot_w += u3h_mark(u3R->jed.cod_p); + tot_w += u3h_mark(u3R->jed.han_p); + tot_w += u3h_mark(u3R->jed.bas_p); + u3h_walk_with(u3R->jed.han_p, _cj_mark_hank, &tot_w); + if ( u3R == &(u3H->rod_u) ) { + tot_w += u3h_mark(u3R->jed.hot_p); + } + return tot_w; +} + +/* _cj_free_hank(): free hank cache. +*/ +static void +_cj_free_hank(u3_noun kev) +{ + _cj_hank* han_u = u3to(_cj_hank, u3t(kev)); + if ( u3_none != han_u->hax ) { + u3z(han_u->hax); + u3j_site_lose(&(han_u->sit_u)); + } + u3a_wfree(han_u); +} + +/* u3j_free(): free jet state. +*/ +void +u3j_free(void) +{ + u3h_walk(u3R->jed.han_p, _cj_free_hank); + u3h_free(u3R->jed.war_p); + u3h_free(u3R->jed.cod_p); + u3h_free(u3R->jed.han_p); + u3h_free(u3R->jed.bas_p); + if ( u3R == &(u3H->rod_u) ) { + u3h_free(u3R->jed.hot_p); + } +} + diff --git a/noun/manage.c b/noun/manage.c index a18d6f0e5c..5f6d4dabd5 100644 --- a/noun/manage.c +++ b/noun/manage.c @@ -481,8 +481,11 @@ static void _pave_parts(void) { u3R->cax.har_p = u3h_new(); - u3R->jed.har_p = u3h_new(); - u3R->jed.das = u3_nul; + u3R->jed.war_p = u3h_new(); + u3R->jed.cod_p = u3h_new(); + u3R->jed.han_p = u3h_new(); + u3R->jed.bas_p = u3h_new(); + u3R->byc.har_p = u3h_new(); } /* u3m_mark(): mark all nouns in the road. @@ -491,8 +494,8 @@ c3_w u3m_mark(void) { c3_w tot_w = 0; - tot_w += u3h_mark(u3R->jed.har_p); - tot_w += u3a_mark_noun(u3R->jed.das); + tot_w += u3j_mark(); + tot_w += u3n_mark(); tot_w += u3a_mark_noun(u3R->ski.gul); tot_w += u3a_mark_noun(u3R->bug.tax); tot_w += u3a_mark_noun(u3R->bug.mer); @@ -530,8 +533,8 @@ void u3m_clear(void) { u3h_free(u3R->cax.har_p); - u3h_free(u3R->jed.har_p); - u3a_lose(u3R->jed.das); + u3j_free(); + u3n_free(); } void @@ -817,14 +820,18 @@ u3_noun u3m_love(u3_noun pro) { { - u3_noun das = u3R->jed.das; - u3p(u3h_root) har_p = u3R->jed.har_p; + u3p(u3h_root) cod_p = u3R->jed.cod_p; + u3p(u3h_root) war_p = u3R->jed.war_p; + u3p(u3h_root) han_p = u3R->jed.han_p; + u3p(u3h_root) bas_p = u3R->jed.bas_p; + u3p(u3h_root) byc_p = u3R->byc.har_p; u3m_fall(); pro = u3a_take(pro); - u3j_reap(das, har_p); + u3j_reap(cod_p, war_p, han_p, bas_p); + u3n_reap(byc_p); u3R->cap_p = u3R->ear_p; u3R->ear_p = 0; @@ -1689,7 +1696,7 @@ u3m_boot(c3_o nuu_o, c3_o bug_o, c3_c* dir_c, /* Initialize the jet system. */ - u3j_boot(); + u3j_boot(nuu_o); /* Install or reactivate the kernel. */ @@ -1708,5 +1715,6 @@ u3m_boot(c3_o nuu_o, c3_o bug_o, c3_c* dir_c, else { u3v_hose(); u3j_ream(); + u3n_ream(); } } diff --git a/noun/nock.c b/noun/nock.c index ff569cb61c..c784d87ab4 100644 --- a/noun/nock.c +++ b/noun/nock.c @@ -3,8 +3,6 @@ */ #include "all.h" -static u3_noun _n_nock_on(u3_noun bus, u3_noun fol); - /* u3_term_io_hija(): hijack console for cooked print. */ FILE* @@ -22,6 +20,48 @@ static u3_noun _n_nock_on(u3_noun bus, u3_noun fol); # define uH u3_term_io_hija() # define uL(x) u3_term_io_loja(x) +// define to have each opcode printed as it executes, +// along with some other debugging info +# undef VERBOSE_BYTECODE + +/* _n_mush_in(): see _n_mush(). +*/ +static u3_noun +_n_mush_in(u3_noun val) +{ + if ( c3n == u3du(val) ) { + return u3_nul; + } + else { + u3_noun h_val = u3h(val); + u3_noun ite; + + if ( c3n == u3ud(h_val) ) { + ite = u3nc(c3__leaf, u3_nul); + } else { + ite = u3nc(c3__leaf, u3qe_trip(h_val)); + } + return u3nc(ite, _n_mush_in(u3t(val))); + } +} + +/* _n_mush(): tank from failed path request. +*/ +static u3_noun +_n_mush(u3_noun val) +{ + u3_noun pro; + + pro = u3nt(c3__rose, + u3nt(u3nc('/', u3_nul), u3nc('/', u3_nul), u3_nul), + _n_mush_in(val)); + u3z(val); + return pro; +} + +#if 0 +// Retained for debugging purposes. +static u3_noun _n_nock_on(u3_noun bus, u3_noun fol); /* _n_hint(): process hint. */ @@ -150,41 +190,6 @@ _n_hint(u3_noun zep, } } -/* _n_mush_in(): see _n_mush(). -*/ -static u3_noun -_n_mush_in(u3_noun val) -{ - if ( c3n == u3du(val) ) { - return u3_nul; - } - else { - u3_noun h_val = u3h(val); - u3_noun ite; - - if ( c3n == u3ud(h_val) ) { - ite = u3nc(c3__leaf, u3_nul); - } else { - ite = u3nc(c3__leaf, u3qe_trip(h_val)); - } - return u3nc(ite, _n_mush_in(u3t(val))); - } -} - -/* _n_mush(): tank from failed path request. -*/ -static u3_noun -_n_mush(u3_noun val) -{ - u3_noun pro; - - pro = u3nt(c3__rose, - u3nt(u3nc('/', u3_nul), u3nc('/', u3_nul), u3_nul), - _n_mush_in(val)); - u3z(val); - return pro; -} - /* _n_nock_on(): produce .*(bus fol). Do not virtualize. */ static u3_noun @@ -426,6 +431,1775 @@ _n_nock_on(u3_noun bus, u3_noun fol) } } } +#endif + +/* These must match the order in the section marked OPCODE TABLE, + * and several opcodes "overflow" (from byte to short index) to + * their successor, so order can matter here. */ +// general purpose +#define HALT 0 +#define BAIL 1 +#define COPY 2 +#define SWAP 3 +#define TOSS 4 +#define AUTO 5 +#define AULT 6 +#define SNOC 7 +#define SNOL 8 +#define HEAD 9 +#define HELD 10 +#define TAIL 11 +#define TALL 12 +// fragment (keep) +#define FABK 13 +#define FASK 14 +#define FIBK 15 +#define FISK 16 +// fragment (lose) +#define FABL 17 +#define FASL 18 +#define FIBL 19 +#define FISL 20 +// literal (keep) +#define LIT0 21 +#define LIT1 22 +#define LITB 23 +#define LITS 24 +#define LIBK 25 +#define LISK 26 +// literal (lose) +#define LIL0 27 +#define LIL1 28 +#define LILB 29 +#define LILS 30 +#define LIBL 31 +#define LISL 32 +// nock +#define NOLK 33 +#define NOCT 34 +#define NOCK 35 +// 3 & 4 +#define DEEP 36 +#define BUMP 37 +// equality +#define SAM0 38 +#define SAM1 39 +#define SAMB 40 +#define SAMS 41 +#define SANB 42 +#define SANS 43 +#define SAME 44 +#define SALM 45 +#define SAMC 46 +// unconditional skips +#define SBIP 47 +#define SIPS 48 +#define SWIP 49 +// conditional skips +#define SBIN 50 +#define SINS 51 +#define SWIN 52 +// nock 9 +#define KICB 53 +#define KICS 54 +#define TICB 55 +#define TICS 56 +// nock 11 +#define WILS 57 +#define WISH 58 +// hint processing +#define BUSH 59 +#define SUSH 60 +#define DROP 61 +#define HECK 62 +#define SLOG 63 +// fast (keep) +#define BAST 64 +#define SAST 65 +// fast (lose) +#define BALT 66 +#define SALT 67 +// memo (keep) +#define SKIB 68 +#define SKIS 69 +// memo (lose) +#define SLIB 70 +#define SLIS 71 +#define SAVE 72 + +/* _n_arg(): return the size (in bytes) of an opcode's argument + */ +static inline c3_y +_n_arg(c3_y cod_y) +{ + switch ( cod_y ) { + case FABK: case FABL: case FIBL: case FIBK: + case LILB: case LITB: case LIBL: case LIBK: + case SAMB: case SANB: case SBIP: case SBIN: + case SLIB: case SKIB: case KICB: case TICB: + case BUSH: case BAST: case BALT: + return sizeof(c3_y); + + case FASK: case FASL: case FISL: case FISK: + case LILS: case LITS: case LISL: case LISK: + case SAMS: case SANS: case SIPS: case SINS: + case SLIS: case SKIS: case KICS: case TICS: + case SUSH: case SAST: case SALT: + return sizeof(c3_s); + + case SWIP: case SWIN: + return sizeof(c3_l); + + default: + c3_assert( cod_y <= SAVE ); + return 0; + } +} + + +/* _n_melt(): measure space for list of ops (from _n_comp) */ +static u3_noun +_n_melt(u3_noun ops, c3_w* byc_w, c3_w* cal_w, + c3_w* reg_w, c3_w* lit_w, c3_w* mem_w) +{ + c3_w len_w = u3qb_lent(ops), + i_w = len_w - 1, + a_w; + c3_y cod_y; + c3_y* siz_y = u3a_malloc(len_w); + u3_noun op, sip = u3_nul; + + while ( u3_nul != ops ) { + op = u3h(ops); + if ( c3n == u3du(op) ) { + switch ( op ) { + default: + siz_y[i_w] = 1; + break; + + case BAST: case BALT: + a_w = (*reg_w)++; + if ( a_w <= 0xFF ) { + siz_y[i_w] = 2; + } + else if ( a_w <= 0xFFFF ) { + siz_y[i_w] = 3; + } + else { + fprintf(stderr, "_n_melt(): over 2^16 registration sites.\r\n"); + c3_assert(0); + } + break; + } + } + else { + cod_y = u3h(op); + + switch ( cod_y ) { + default: + siz_y[i_w] = 1 + _n_arg(cod_y); + break; + + case SBIP: case SBIN: { + c3_l tot_l = 0, + sip_l = u3t(op); + c3_w j_w, k_w = i_w; + for ( j_w = 0; j_w < sip_l; ++j_w ) { + tot_l += siz_y[++k_w]; + } + sip = u3nc(tot_l, sip); + siz_y[i_w] = tot_l <= 0xFF ? 2 : tot_l <= 0xFFFF ? 3 : 5; + break; + } + + case SKIB: case SLIB: { + c3_l tot_l = 0, + sip_l = u3h(u3t(op)); + c3_w j_w, k_w = i_w; + for ( j_w = 0; j_w < sip_l; ++j_w ) { + tot_l += siz_y[++k_w]; + } + sip = u3nc(tot_l, sip); + a_w = (*mem_w)++; + if ( a_w <= 0xFF ) { + siz_y[i_w] = 2; + } + else if ( a_w <= 0xFFFF ) { + siz_y[i_w] = 3; + } + else { + fprintf(stderr, "_n_melt(): over 2^16 memos.\r\n"); + c3_assert(0); + } + break; + } + + case SIPS: case SINS: case SWIP: case SWIN: + case SAST: case SALT: case KICS: case TICS: + case FISK: case FISL: case SUSH: case SANS: + case LISL: case LISK: case SKIS: case SLIS: + c3_assert(0); //overflows + break; + + case KICB: case TICB: + a_w = (*cal_w)++; + if ( a_w <= 0xFF ) { + siz_y[i_w] = 2; + } + else if ( a_w <= 0xFFFF ) { + siz_y[i_w] = 3; + } + else { + fprintf(stderr, "_n_melt(): over 2^16 call sites.\r\n"); + c3_assert(0); + } + break; + + case BUSH: case FIBK: case FIBL: + case SANB: case LIBL: case LIBK: + a_w = (*lit_w)++; + if ( a_w <= 0xFF ) { + siz_y[i_w] = 2; + } + else if ( a_w <= 0xFFFF ) { + siz_y[i_w] = 3; + } + else { + fprintf(stderr, "_n_melt(): over 2^16 literals.\r\n"); + c3_assert(0); + } + break; + } + } + + *(byc_w) += siz_y[i_w--]; + ops = u3t(ops); + } + + u3a_free(siz_y); + return u3kb_flop(sip); +} + +/* _n_prog_dat(): return pointer to program's data segment + */ +static void* +_n_prog_dat(u3n_prog* pog_u) +{ + return ((void*) pog_u) + sizeof(u3n_prog); +} + +/* _n_prog_new(): allocate and set up pointers for u3n_prog + */ +static u3n_prog* +_n_prog_new(c3_w byc_w, c3_w cal_w, + c3_w reg_w, c3_w lit_w, c3_w mem_w) +{ + c3_w cab_w = (sizeof(u3j_site) * cal_w), + reb_w = (sizeof(u3j_rite) * reg_w), + lib_w = (sizeof(u3_noun) * lit_w), + meb_w = (sizeof(u3n_memo) * mem_w), + dat_w = byc_w + cab_w + reb_w + lib_w + meb_w; + + u3n_prog* pog_u = u3a_malloc(sizeof(u3n_prog) + dat_w); + pog_u->byc_u.own_o = c3y; + pog_u->byc_u.len_w = byc_w; + pog_u->byc_u.ops_y = (c3_y*) _n_prog_dat(pog_u); + + pog_u->lit_u.len_w = lit_w; + pog_u->lit_u.non = (u3_noun*) (pog_u->byc_u.ops_y + pog_u->byc_u.len_w); + + pog_u->mem_u.len_w = mem_w; + pog_u->mem_u.sot_u = (u3n_memo*) (pog_u->lit_u.non + pog_u->lit_u.len_w); + + pog_u->cal_u.len_w = cal_w; + pog_u->cal_u.sit_u = (u3j_site*) (pog_u->mem_u.sot_u + pog_u->mem_u.len_w); + + pog_u->reg_u.len_w = reg_w; + pog_u->reg_u.rit_u = (u3j_rite*) (pog_u->cal_u.sit_u + pog_u->cal_u.len_w); + + return pog_u; +} + +/* _n_prog_old(): as _n_prog_new(), + * but leech off senior program's data segment + */ +static u3n_prog* +_n_prog_old(u3n_prog* sep_u) +{ + c3_w cab_w = sizeof(u3j_site) * sep_u->cal_u.len_w, + reb_w = sizeof(u3j_rite) * sep_u->reg_u.len_w, + lib_w = sizeof(u3_noun) * sep_u->lit_u.len_w, + meb_w = sizeof(u3n_memo) * sep_u->mem_u.len_w, + dat_w = cab_w + reb_w + lib_w + meb_w; + + u3n_prog* pog_u = u3a_malloc(sizeof(u3n_prog) + dat_w); + pog_u->byc_u.own_o = c3n; + pog_u->byc_u.len_w = sep_u->byc_u.len_w; + pog_u->byc_u.ops_y = sep_u->byc_u.ops_y; + + pog_u->lit_u.len_w = sep_u->lit_u.len_w; + pog_u->lit_u.non = (u3_noun*) _n_prog_dat(pog_u); + + pog_u->mem_u.len_w = sep_u->mem_u.len_w; + pog_u->mem_u.sot_u = (u3n_memo*) (pog_u->lit_u.non + pog_u->lit_u.len_w); + + pog_u->cal_u.len_w = sep_u->cal_u.len_w; + pog_u->cal_u.sit_u = (u3j_site*) (pog_u->mem_u.sot_u + pog_u->mem_u.len_w); + + pog_u->reg_u.len_w = sep_u->reg_u.len_w; + pog_u->reg_u.rit_u = (u3j_rite*) (pog_u->cal_u.sit_u + pog_u->cal_u.len_w); + + memcpy(pog_u->lit_u.non, sep_u->lit_u.non, dat_w); + return pog_u; +} + +/* _n_prog_asm_inx(): write an index to the bytestream with overflow + */ +static void +_n_prog_asm_inx(c3_y* buf_y, c3_w* i_w, c3_s inx_s, c3_y cod) +{ + if ( inx_s <= 0xFF ) { + buf_y[(*i_w)--] = (c3_y) (inx_s); + buf_y[*i_w] = (c3_y) cod; + } + else { + buf_y[(*i_w)--] = (c3_y) (inx_s >> 8); + buf_y[(*i_w)--] = (c3_y) (inx_s); + // the short-index versions of these opcodes must immediately + // follow the byte-index versions because of this convention + buf_y[(*i_w)] = cod + 1; + } +} + +/* _n_prog_asm(): assemble list of ops (from _n_comp) into u3n_prog + */ +static void +_n_prog_asm(u3_noun ops, u3n_prog* pog_u, u3_noun sip) +{ + u3_noun top = ops; + c3_y* buf_y = pog_u->byc_u.ops_y; + c3_s lit_s = 0, + cal_s = 0, + mem_s = 0, + reg_s = 0; + c3_w i_w = pog_u->byc_u.len_w-1; + + buf_y[i_w] = HALT; + + while ( i_w-- > 0 ) { + u3_noun op = u3h(ops); + if ( c3y == u3ud(op) ) { + switch ( op ) { + default: + buf_y[i_w] = (c3_y) u3h(ops); + break; + + /* registration site index args */ + case BAST: case BALT: { + _n_prog_asm_inx(buf_y, &i_w, reg_s, op); + u3j_rite* rit_u = &(pog_u->reg_u.rit_u[reg_s++]); + rit_u->own_o = c3n; + rit_u->clu = u3_none; + rit_u->fin_p = 0; + break; + } + } + } + else { + u3_noun cod = u3h(op); + switch ( cod ) { + default: + c3_assert(0); + return; + + /* memo index args */ + case SKIB: case SLIB: { + u3n_memo* mem_u; + c3_l sip_l = u3h(sip); + u3_noun tmp = sip; + sip = u3k(u3t(sip)); + u3z(tmp); + _n_prog_asm_inx(buf_y, &i_w, mem_s, cod); + mem_u = &(pog_u->mem_u.sot_u[mem_s++]); + mem_u->sip_l = sip_l; + mem_u->key = u3k(u3t(u3t(op))); + break; + } + + /* skips */ + case SBIP: case SBIN: { + c3_l sip_l = u3h(sip); + u3_noun tmp = sip; + sip = u3k(u3t(sip)); + u3z(tmp); + if ( sip_l <= 0xFF ) { + buf_y[i_w--] = (c3_y) sip_l; + buf_y[i_w] = (c3_y) cod; + } + else if ( sip_l <= 0xFFFF ) { + buf_y[i_w--] = (c3_y) (sip_l >> 8); + buf_y[i_w--] = (c3_y) sip_l; + buf_y[i_w] = (c3_y) cod + 1; + } + else { + buf_y[i_w--] = (c3_y) (sip_l >> 24); + buf_y[i_w--] = (c3_y) (sip_l >> 16); + buf_y[i_w--] = (c3_y) (sip_l >> 8); + buf_y[i_w--] = (c3_y) sip_l; + buf_y[i_w] = (c3_y) cod + 2; + } + break; + } + + /* 8-bit direct args */ + case FABK: case FABL: + case LITB: case LILB: + case SAMB: + buf_y[i_w--] = (c3_y) u3t(op); + buf_y[i_w] = (c3_y) cod; + break; + + /* 16-bit direct args */ + case FASK: case FASL: + case LILS: case LITS: + case SAMS: case SIPS: case SINS: { + c3_s off_s = u3t(op); + buf_y[i_w--] = (c3_y) (off_s >> 8); + buf_y[i_w--] = (c3_y) off_s; + buf_y[i_w] = (c3_y) cod; + break; + } + + /* 31-bit direct args */ + case SWIP: case SWIN: { + c3_w off_l = u3t(op); + buf_y[i_w--] = (c3_y) (off_l >> 24); + buf_y[i_w--] = (c3_y) (off_l >> 16); + buf_y[i_w--] = (c3_y) (off_l >> 8); + buf_y[i_w--] = (c3_y) off_l; + buf_y[i_w] = (c3_y) cod; + break; + } + + /* literal index args */ + case FIBK: case FIBL: + case LIBK: case LIBL: + case BUSH: case SANB: + _n_prog_asm_inx(buf_y, &i_w, lit_s, cod); + pog_u->lit_u.non[lit_s++] = u3k(u3t(op)); + break; + + /* call site index args */ + case TICB: case KICB: { + _n_prog_asm_inx(buf_y, &i_w, cal_s, cod); + u3j_site* sit_u = &(pog_u->cal_u.sit_u[cal_s++]); + sit_u->axe = u3k(u3t(op)); + sit_u->pog_p = 0; + sit_u->bat = u3_none; + sit_u->bas = u3_none; + sit_u->loc = u3_none; + sit_u->lab = u3_none; + sit_u->jet_o = c3n; + sit_u->fon_o = c3n; + sit_u->cop_u = NULL; + sit_u->ham_u = NULL; + sit_u->fin_p = 0; + break; + } + } + } + ops = u3t(ops); + } + u3z(top); + // this assert will fail if we overflow a c3_w worth of instructions + c3_assert(u3_nul == ops); + // this is just a sanity check + c3_assert(u3_nul == sip); +} + +/* _n_prog_from_ops(): new program from _n_comp() product + */ +static u3n_prog* +_n_prog_from_ops(u3_noun ops) +{ + u3_noun sip; + u3n_prog* pog_u; + c3_w byc_w = 1, // HALT + cal_w = 0, + reg_w = 0, + lit_w = 0, + mem_w = 0; + + sip = _n_melt(ops, &byc_w, &cal_w, ®_w, &lit_w, &mem_w); + pog_u = _n_prog_new(byc_w, cal_w, reg_w, lit_w, mem_w); + _n_prog_asm(ops, pog_u, sip); + return pog_u; +} + +#if 0 +/* _n_print_stack(): print out the cap stack up to a designated "empty" + * used only for debugging + */ +static void _n_print_stack(u3p(u3_noun) empty) { + c3_w cur_p = u3R->cap_p; + fprintf(stderr, "["); + int first = 1; + while ( cur_p != empty ) { + if ( first ) { + first = 0; + } + else { + fprintf(stderr, " "); + } + if ( c3y == u3a_is_north(u3R) ) { + fprintf(stderr, "%u", *(u3to(u3_noun, cur_p))); + cur_p++; + } + else { + fprintf(stderr, "%u", *(u3to(u3_noun, cur_p-1))); + cur_p--; + } + } + fprintf(stderr, "]\r\n"); +} +#endif + +#ifdef VERBOSE_BYTECODE +// match to OPCODE TABLE +static char* opcode_names[] = { + "halt", "bail", + "copy", "swap", "toss", + "auto", "ault", "snoc", "snol", + "head", "held", "tail", "tall", + "fabk", "fask", "fibk", "fisk", + "fabl", "fasl", "fibl", "fisl", + "lit0", "lit1", "litb", "lits", + "libk", "lisk", + "lil0", "lil1", "lilb", "lils", + "libl", "lisl", + "nolk", "noct", "nock", + "deep", "bump", + "sam0", "sam1", "samb", "sams", + "sanb", "sans", + "same", "salm", "samc", + "sbip", "sips", "swip", + "sbin", "sins", "swin", + "kicb", "kics", "ticb", "tics", + "wils", "wish", + "bush", "sush", + "drop", "heck", "slog", + "bast", "sast", + "balt", "salt", + "skib", "skis", "slib", "slis", + "save", +}; +#endif + +/* _n_apen(): emit the instructions contained in src to dst + */ +static inline void +_n_apen(u3_noun* dst, u3_noun src) +{ + *dst = u3kb_weld(src, *dst); +} + +/* _n_emit(): emit a single instruction to ops + */ +static inline void +_n_emit(u3_noun *ops, u3_noun op) +{ + *ops = u3nc(op, *ops); +} + +static c3_w _n_comp(u3_noun*, u3_noun, c3_o, c3_o); + +/* _n_bint(): hint-processing helper for _n_comp. + * hif: hint-formula (first part of 10). RETAIN. + * nef: next-formula (second part of 10). RETAIN. + */ +static c3_w +_n_bint(u3_noun* ops, u3_noun hif, u3_noun nef, c3_o los_o, c3_o tel_o) +{ + if ( c3n == u3du(hif) ) { + // no currently recognized static hints + return _n_comp(ops, nef, los_o, tel_o); + } + else { + c3_w tot_w = 0; + u3_noun zep, hod; + u3x_cell(hif, &zep, &hod); + + switch ( zep ) { + default: + tot_w += _n_comp(ops, hod, c3n, c3n); + ++tot_w; _n_emit(ops, TOSS); + tot_w += _n_comp(ops, nef, los_o, tel_o); + break; + + case c3__hunk: + case c3__lose: + case c3__mean: + case c3__spot: + tot_w += _n_comp(ops, hod, c3n, c3n); + ++tot_w; _n_emit(ops, u3nc(BUSH, zep)); // overflows to SUSH + tot_w += _n_comp(ops, nef, los_o, c3n); + ++tot_w; _n_emit(ops, DROP); + break; + + case c3__live: + tot_w += _n_comp(ops, hod, c3n, c3n); + ++tot_w; _n_emit(ops, HECK); + tot_w += _n_comp(ops, nef, los_o, tel_o); + break; + + case c3__slog: + tot_w += _n_comp(ops, hod, c3n, c3n); + ++tot_w; _n_emit(ops, SLOG); + tot_w += _n_comp(ops, nef, los_o, tel_o); + break; + + // germ and sole are unused... + + case c3__fast: + tot_w += _n_comp(ops, hod, c3n, c3n); + ++tot_w; _n_emit(ops, SWAP); + tot_w += _n_comp(ops, nef, c3n, c3n); + // overflows to SALT / SAST + ++tot_w; _n_emit(ops, (c3y == los_o) ? BALT : BAST); + break; + + case c3__memo: { + u3_noun mem = u3_nul; + c3_w mem_w = 0; + c3_y op_y; + + // we just throw away the hint (why is this not a static hint?) + tot_w += _n_comp(ops, hod, c3n, c3n); + ++tot_w; _n_emit(ops, TOSS); + + // memoizing code always loses TOS because SAVE needs [pro key] + mem_w += _n_comp(&mem, nef, c3y, c3n); + ++mem_w; _n_emit(&mem, SAVE); + + op_y = (c3y == los_o) ? SLIB : SKIB; // overflows to SLIS / SKIS + ++tot_w; _n_emit(ops, u3nt(op_y, mem_w, u3k(nef))); + tot_w += mem_w; _n_apen(ops, mem); + break; + } + } + return tot_w; + } +} + +/* _n_comp(): compile nock formula to reversed opcode list + * ops is a pointer to a list (to be emitted to) + * fol is the nock formula to compile. RETAIN. + * los_o indicates whether we should remove our + * subject from the stack + * tel_o is yes if this formula is in tail position + * return: number of instructions added to the opcode list + */ +static c3_w +_n_comp(u3_noun* ops, u3_noun fol, c3_o los_o, c3_o tel_o) +{ + c3_y op_y; + c3_w tot_w = 0; + u3_noun cod, arg, hed, tel; + u3x_cell(fol, &cod, &arg); + if ( c3y == u3du(cod) ) { + tot_w += _n_comp(ops, cod, c3n, c3n); + ++tot_w; _n_emit(ops, SWAP); + tot_w += _n_comp(ops, arg, c3n, c3n); + ++tot_w; _n_emit(ops, (c3y == los_o ) ? AULT : AUTO); + } + else switch ( cod ) { + case 0: + if ( c3n == u3ud(arg) ) { + u3m_bail(c3__exit); + return 0; + } + switch ( arg ) { + case 0: + ++tot_w; _n_emit(ops, BAIL); + break; + case 1: + if ( c3n == los_o ) { + ++tot_w; _n_emit(ops, COPY); + } + break; + case 2: + ++tot_w; _n_emit(ops, (c3y == los_o) ? HELD : HEAD); + break; + case 3: + ++tot_w; _n_emit(ops, (c3y == los_o) ? TALL : TAIL); + break; + default: + op_y = (c3y == los_o) + ? (arg <= 0xFF ? FABL : arg <= 0xFFFF ? FASL : FIBL) // overflows to FISL + : (arg <= 0xFF ? FABK : arg <= 0xFFFF ? FASK : FIBK); // overflows to FISK + ++tot_w; _n_emit(ops, u3nc(op_y, arg)); + break; + } + break; + + case 1: + switch ( arg ) { + case 0: + ++tot_w; _n_emit(ops, (c3y == los_o) ? LIL0 : LIT0); + break; + case 1: + ++tot_w; _n_emit(ops, (c3y == los_o) ? LIL1 : LIT1); + break; + default: + op_y = (c3y == los_o) + ? (arg <= 0xFF ? LILB : arg <= 0xFFFF ? LILS : LIBL) // overflows to LISL + : (arg <= 0xFF ? LITB : arg <= 0xFFFF ? LITS : LIBK); // overflows to LISK + ++tot_w; _n_emit(ops, u3nc(op_y, u3k(arg))); + break; + } + break; + + case 2: + u3x_cell(arg, &hed, &tel); + tot_w += _n_comp(ops, hed, c3n, c3n); + ++tot_w; _n_emit(ops, SWAP); + tot_w += _n_comp(ops, tel, c3n, c3n); + /* things in tail position replace (so, lose) top of stack, + * so NOCT "loses" and there is no non-losing version */ + op_y = (c3y == tel_o) ? NOCT + : ((c3y == los_o) ? NOLK : NOCK); + ++tot_w; _n_emit(ops, op_y); + break; + + case 3: + tot_w += _n_comp(ops, arg, los_o, c3n); + ++tot_w; _n_emit(ops, DEEP); + break; + + case 4: + tot_w += _n_comp(ops, arg, los_o, c3n); + ++tot_w; _n_emit(ops, BUMP); + break; + + case 5: { + u3x_cell(arg, &hed, &tel); + + if ( c3n == u3du(hed) ) { + tot_w += _n_comp(ops, arg, los_o, c3n); + ++tot_w; _n_emit(ops, SAMC); + } + else { + c3_t hec_t, tec_t; + hec_t = (1 == u3h(hed)); + if ( c3n == u3du(tel) ) { + u3m_bail(c3__exit); + break; + } + else { + tec_t = (1 == u3h(tel)); + } + if ( hec_t && tec_t ) { + if ( c3y == u3r_sing(u3t(hed), u3t(tel)) ) { + ++tot_w; _n_emit(ops, (c3y == los_o) ? LIL0 : LIT0); + } + else { + ++tot_w; _n_emit(ops, (c3y == los_o) ? LIL1 : LIT1); + } + } + else if ( !hec_t && !tec_t ) { + tot_w += _n_comp(ops, hed, c3n, c3n); + ++tot_w; _n_emit(ops, SWAP); + tot_w += _n_comp(ops, tel, c3n, c3n); + ++tot_w; _n_emit(ops, (c3y == los_o) ? SALM : SAME); + } + else { + tot_w += _n_comp(ops, (hec_t ? tel : hed), los_o, c3n); + u3_noun lit = u3t(hec_t ? hed : tel); + switch ( lit ) { + case 0: + ++tot_w; _n_emit(ops, SAM0); + break; + case 1: + ++tot_w; _n_emit(ops, SAM1); + break; + default: + // overflows to SANS + op_y = lit <= 0xFF ? SAMB : lit <= 0xFFFF ? SAMS : SANB; + ++tot_w; _n_emit(ops, u3nc(op_y, u3k(lit))); + } + } + } + break; + } + + case 6: { + u3_noun mid, + yep = u3_nul, + nop = u3_nul; + c3_w yep_w, nop_w; + u3x_trel(arg, &hed, &mid, &tel); + tot_w += _n_comp(ops, hed, c3n, c3n); + yep_w = _n_comp(&yep, mid, los_o, tel_o); + nop_w = _n_comp(&nop, tel, los_o, tel_o); + // SBIP and SBIN get sized during assembly + ++yep_w; _n_emit(&yep, u3nc(SBIP, nop_w)); + ++tot_w; _n_emit(ops, u3nc(SBIN, yep_w)); + tot_w += yep_w; _n_apen(ops, yep); + tot_w += nop_w; _n_apen(ops, nop); + break; + } + + case 7: + u3x_cell(arg, &hed, &tel); + tot_w += _n_comp(ops, hed, los_o, c3n); + tot_w += _n_comp(ops, tel, c3y, tel_o); + break; + + case 8: + u3x_cell(arg, &hed, &tel); + tot_w += _n_comp(ops, hed, c3n, c3n); + ++tot_w; _n_emit(ops, (c3y == los_o) ? SNOL : SNOC); + tot_w += _n_comp(ops, tel, c3y, tel_o); + break; + + case 9: + u3x_cell(arg, &hed, &tel); + if ( 3 == u3qc_cap(hed) ) { + u3_noun mac = u3nq(7, u3k(tel), 2, u3nt(u3nc(0, 1), 0, u3k(hed))); + tot_w += _n_comp(ops, mac, los_o, tel_o); + u3z(mac); + } + else { + tot_w += _n_comp(ops, tel, (c3y == tel_o ? c3y : los_o), c3n); + op_y = (c3y == tel_o) ? TICB : KICB; // overflows to TICS/KICS + ++tot_w; _n_emit(ops, u3nc(op_y, u3k(hed))); + } + break; + + case 10: + u3x_cell(arg, &hed, &tel); + tot_w += _n_bint(ops, hed, tel, los_o, tel_o); + break; + + case 11: + u3x_cell(arg, &hed, &tel); + tot_w += _n_comp(ops, hed, c3n, c3n); + ++tot_w; _n_emit(ops, SWAP); + tot_w += _n_comp(ops, tel, c3n, c3n); + ++tot_w; _n_emit(ops, (c3y == los_o) ? WILS : WISH); + break; + + default: + u3m_bail(c3__exit); + return 0; + } + return tot_w; +} + +/* _n_push(): push a noun onto the stack. RETAIN + * mov: -1 north, 1 south + * off: 0 north, -1 south + */ +static inline void +_n_push(c3_ys mov, c3_ys off, u3_noun a) +{ + u3R->cap_p += mov; + u3_noun* p = u3to(u3_noun, u3R->cap_p + off); + *p = a; +} + +/* _n_peek(): pointer to noun at top of stack + * off: 0 north, -1 south + */ +static inline u3_noun* +_n_peek(c3_ys off) +{ + return u3to(u3_noun, u3R->cap_p + off); +} + +/* _n_peet(): address of the next-to-top of stack + * mov: -1 north, 1 south + * off: 0 north, -1 south + */ +static inline u3_noun* +_n_peet(c3_ys mov, c3_ys off) +{ + return u3to(u3_noun, (u3R->cap_p - mov) + off); +} + +/* _n_pop(): pop a noun from the cap stack + * mov: -1 north, 1 south + */ +static inline void +_n_pop(c3_ys mov) +{ + u3R->cap_p -= mov; +} + +/* _n_pep(): pop and return noun from the cap stack + * mov: -1 north, 1 south + * off: 0 north, -1 south + */ +static inline u3_noun +_n_pep(c3_ys mov, c3_ys off) +{ + u3_noun r = *(_n_peek(off)); + _n_pop(mov); + return r; +} + +/* _n_toss(): pep and lose + */ +static inline void +_n_toss(c3_ys mov, c3_ys off) +{ + u3z(_n_pep(mov, off)); +} + +/* _n_resh(): read a c3_s from the bytecode stream + */ +static inline c3_s +_n_resh(c3_y* buf, c3_w* ip_w) +{ + c3_y les = buf[(*ip_w)++]; + c3_y mos = buf[(*ip_w)++]; + return les | (mos << 8); +} + +/* _n_rewo(): read a c3_w from the bytecode stream. + */ +static inline c3_w +_n_rewo(c3_y* buf, c3_w* ip_w) +{ + c3_y one = buf[(*ip_w)++], + two = buf[(*ip_w)++], + tre = buf[(*ip_w)++], + qua = buf[(*ip_w)++]; + return one | (two << 8) | (tre << 16) | (qua << 24); +} + +#ifdef VERBOSE_BYTECODE +/* _n_print_byc(): print bytecode. used for debugging. + */ +static void +_n_print_byc(c3_y* pog, c3_w her_w) +{ + c3_w ip_w = 0; + if ( her_w == 0 ) { + fprintf(stderr, "begin: {"); + } + else { + fprintf(stderr, "resume: {"); + } + int first = 1; + while ( pog[ip_w] ) { + if ( first ) { + first = 0; + } + else if (ip_w == her_w) { + fprintf(stderr, " [*]"); + } + else { + fprintf(stderr, " "); + } + switch ( _n_arg(pog[ip_w]) ) { + case 0: + fprintf(stderr, "%s", opcode_names[pog[ip_w++]]); + break; + + case 1: + fprintf(stderr, "[%s ", opcode_names[pog[ip_w++]]); + fprintf(stderr, "%u]", pog[ip_w++]); + break; + + case 2: + fprintf(stderr, "[%s ", opcode_names[pog[ip_w++]]); + fprintf(stderr, "%u]", _n_resh(pog, &ip_w)); + break; + + case 4: + fprintf(stderr, "[%s", opcode_names[pog[ip_w++]]); + fprintf(stderr, "%u]", _n_rewo(pog, &ip_w)); + break; + default: + c3_assert(0); + break; + } + } + fprintf(stderr, " halt}\r\n"); +} +#endif + +/* _n_bite(): compile a nock formula to bytecode. RETAIN. + */ +static inline u3n_prog* +_n_bite(u3_noun fol) { + u3_noun ops = u3_nul; + _n_comp(&ops, fol, c3y, c3y); + return _n_prog_from_ops(ops); +} + +/* _n_find(): return prog for given formula with prefix (u3_nul for none). + * RETAIN. + */ +static u3n_prog* +_n_find(u3_noun pre, u3_noun fol) +{ + u3_noun key = u3nc(u3k(pre), u3k(fol)); + u3_weak pog = u3h_git(u3R->byc.har_p, key); + if ( u3_none != pog ) { + u3z(key); + return u3to(u3n_prog, pog); + } + else if ( u3R != &u3H->rod_u ) { + u3a_road* rod_u = u3R; + while ( rod_u->par_p ) { + rod_u = u3to(u3a_road, rod_u->par_p); + pog = u3h_git(rod_u->byc.har_p, key); + if ( u3_none != pog ) { + c3_w i_w; + u3n_prog* old = _n_prog_old(u3to(u3n_prog, pog)); + for ( i_w = 0; i_w < old->reg_u.len_w; ++i_w ) { + u3j_rite* rit_u = &(old->reg_u.rit_u[i_w]); + rit_u->own_o = c3n; + } + for ( i_w = 0; i_w < old->cal_u.len_w; ++i_w ) { + u3j_site* sit_u = &(old->cal_u.sit_u[i_w]); + sit_u->bat = u3_none; + sit_u->pog_p = 0; + sit_u->fon_o = c3n; + } + u3h_put(u3R->byc.har_p, key, u3a_outa(old)); + u3z(key); + return old; + } + } + } + + { + u3n_prog* gop = _n_bite(fol); + u3h_put(u3R->byc.har_p, key, u3a_outa(gop)); + u3z(key); + return gop; + } +} + +/* u3n_find(): return prog for given formula, + * split by key (u3_nul for no key). RETAIN. + */ +u3p(u3n_prog) +u3n_find(u3_noun key, u3_noun fol) +{ + u3p(u3n_prog) pog_p; + u3t_on(noc_o); + pog_p = u3of(u3n_prog, _n_find(key, fol)); + u3t_off(noc_o); + return pog_p; +} + +/* _n_swap(): swap two items on the top of the stack, return pointer to top + */ +static inline u3_noun* +_n_swap(c3_ys mov, c3_ys off) +{ + u3_noun* top = _n_peek(off); + u3_noun* up = _n_peet(mov, off); + u3_noun tmp = *up; + *up = *top; + *top = tmp; + return top; +} + +/* _n_kick(): stop tracing noc and kick a u3j_site. + */ +static u3_weak +_n_kick(u3_noun cor, u3j_site* sit_u) +{ + u3_weak pro; + u3t_off(noc_o); + pro = u3j_site_kick(cor, sit_u); + u3t_on(noc_o); + return pro; +} + +/* _n_kale(): bail(exit) if not cell + */ +static inline u3_noun +_n_kale(u3_noun a) +{ + if ( c3n == u3du(a) ) { + u3m_bail(c3__exit); + } + return a; +} + +typedef struct { + u3n_prog* pog_u; + c3_w ip_w; +} burnframe; + +/* _n_burn(): pog: program + * bus: subject (TRANSFER) + * mov: -1 north, 1 south + * off: 0 north, -1 south + */ +static u3_noun +_n_burn(u3n_prog* pog_u, u3_noun bus, c3_ys mov, c3_ys off) +{ + /* OPCODE TABLE */ + static void* lab[] = { + &&do_halt, &&do_bail, + &&do_copy, &&do_swap, &&do_toss, + &&do_auto, &&do_ault, &&do_snoc, &&do_snol, + &&do_head, &&do_held, &&do_tail, &&do_tall, + &&do_fabk, &&do_fask, &&do_fibk, &&do_fisk, + &&do_fabl, &&do_fasl, &&do_fibl, &&do_fisl, + &&do_lit0, &&do_lit1, &&do_litb, &&do_lits, + &&do_libk, &&do_lisk, + &&do_lil0, &&do_lil1, &&do_lilb, &&do_lils, + &&do_libl, &&do_lisl, + &&do_nolk, &&do_noct, &&do_nock, + &&do_deep, &&do_bump, + &&do_sam0, &&do_sam1, &&do_samb, &&do_sams, + &&do_sanb, &&do_sans, + &&do_same, &&do_salm, &&do_samc, + &&do_sbip, &&do_sips, &&do_swip, + &&do_sbin, &&do_sins, &&do_swin, + &&do_kicb, &&do_kics, &&do_ticb, &&do_tics, + &&do_wils, &&do_wish, + &&do_bush, &&do_sush, + &&do_drop, &&do_heck, &&do_slog, + &&do_bast, &&do_sast, + &&do_balt, &&do_salt, + &&do_skib, &&do_skis, &&do_slib, &&do_slis, + &&do_save, + }; + + u3j_site* sit_u; + u3j_rite* rit_u; + u3n_memo* mem_u; + c3_y *pog = pog_u->byc_u.ops_y; + c3_w sip_w, ip_w = 0; + u3_noun* top; + u3_noun x, o; + u3p(void) empty; + burnframe* fam; + + empty = u3R->cap_p; + _n_push(mov, off, bus); + +#ifdef U3_CPU_DEBUG + u3R->pro.nox_d += 1; +#endif +#ifdef VERBOSE_BYTECODE + #define BURN() fprintf(stderr, "%s ", opcode_names[pog[ip_w]]); goto *lab[pog[ip_w++]] +#else + #define BURN() goto *lab[pog[ip_w++]] +#endif + BURN(); + { + do_halt: // [product ...burnframes...] + x = _n_pep(mov, off); +#ifdef VERBOSE_BYTECODE + fprintf(stderr, "return\r\n"); +#endif + if ( empty == u3R->cap_p ) { + return x; + } + else { + fam = u3to(burnframe, u3R->cap_p) + off; + pog_u = fam->pog_u; + pog = pog_u->byc_u.ops_y; + ip_w = fam->ip_w; + + u3R->cap_p = u3of(burnframe, fam - (mov+off)); + _n_push(mov, off, x); +#ifdef VERBOSE_BYTECODE + _n_print_byc(pog, ip_w); +#endif + BURN(); + } + + do_bail: + u3m_bail(c3__exit); + return u3_none; + + do_copy: + top = _n_peek(off); + _n_push(mov, off, u3k(*top)); + BURN(); + + do_swap: + _n_swap(mov, off); + BURN(); + + do_toss: + _n_toss(mov, off); + BURN(); + + do_auto: // [tel bus hed] + x = _n_pep(mov, off); // [bus hed] + top = _n_swap(mov, off); // [hed bus] + *top = u3nc(*top, x); // [pro bus] + BURN(); + + do_ault: // [tel bus hed] + x = _n_pep(mov, off); // [bus hed] + _n_toss(mov, off); // [hed] + top = _n_peek(off); + *top = u3nc(*top, x); // [pro] + BURN(); + + do_snoc: // [hed tel] + x = _n_pep(mov, off); + top = _n_peek(off); + _n_push(mov, off, u3nc(x, u3k(*top))); + BURN(); + + do_snol: + x = _n_pep(mov, off); + top = _n_peek(off); + *top = u3nc(x, *top); + BURN(); + + do_head: + top = _n_peek(off); + _n_push(mov, off, u3k(u3h(_n_kale(*top)))); + BURN(); + + do_held: + top = _n_peek(off); + o = _n_kale(*top); + *top = u3k(u3h(o)); + u3z(o); + BURN(); + + do_tail: + top = _n_peek(off); + _n_push(mov, off, u3k(u3t(_n_kale(*top)))); + BURN(); + + do_tall: + top = _n_peek(off); + o = _n_kale(*top); + *top = u3k(u3t(o)); + u3z(o); + BURN(); + + do_fisk: + x = pog_u->lit_u.non[_n_resh(pog, &ip_w)]; + goto frag_in; + + do_fibk: + x = pog_u->lit_u.non[pog[ip_w++]]; + goto frag_in; + + do_fask: + x = _n_resh(pog, &ip_w); + goto frag_in; + + do_fabk: + x = pog[ip_w++]; + frag_in: + top = _n_peek(off); + _n_push(mov, off, u3k(u3x_at(x, *top))); + BURN(); + + do_fisl: + x = pog_u->lit_u.non[_n_resh(pog, &ip_w)]; + goto flag_in; + + do_fibl: + x = pog_u->lit_u.non[pog[ip_w++]]; + goto flag_in; + + do_fasl: + x = _n_resh(pog, &ip_w); + goto flag_in; + + do_fabl: + x = pog[ip_w++]; + flag_in: + top = _n_peek(off); + o = *top; + *top = u3k(u3x_at(x, o)); + u3z(o); + BURN(); + + do_lit0: + _n_push(mov, off, 0); + BURN(); + + do_lit1: + _n_push(mov, off, 1); + BURN(); + + do_litb: + _n_push(mov, off, pog[ip_w++]); + BURN(); + + do_lits: + _n_push(mov, off, _n_resh(pog, &ip_w)); + BURN(); + + do_libk: + _n_push(mov, off, u3k(pog_u->lit_u.non[pog[ip_w++]])); + BURN(); + + do_lisk: + _n_push(mov, off, u3k(pog_u->lit_u.non[_n_resh(pog, &ip_w)])); + BURN(); + + do_lil1: + x = 1; + goto lil_in; + + do_lilb: + x = pog[ip_w++]; + goto lil_in; + + do_lils: + x = _n_resh(pog, &ip_w); + goto lil_in; + + do_libl: + x = u3k(pog_u->lit_u.non[pog[ip_w++]]); + goto lil_in; + + do_lisl: + x = u3k(pog_u->lit_u.non[_n_resh(pog, &ip_w)]); + goto lil_in; + + do_lil0: + x = 0; + lil_in: + top = _n_peek(off); + u3z(*top); + *top = x; + BURN(); + + do_noct: // [fol old bus] + o = _n_pep(mov, off); // [old bus] + _n_toss(mov, off); // [bus] + goto nock_out; + + do_nolk: // [fol old bus] + o = _n_pep(mov, off); // [old bus] + _n_toss(mov, off); // [bus] + goto nock_in; + + do_nock: // [fol old bus] + o = _n_pep(mov, off); // [old bus] + _n_swap(mov, off); // [bus old] + nock_in: + x = _n_pep(mov, off); + fam = u3to(burnframe, u3R->cap_p) + off + mov; + u3R->cap_p = u3of(burnframe, fam - off); + fam->ip_w = ip_w; + fam->pog_u = pog_u; + _n_push(mov, off, x); + nock_out: + pog_u = _n_find(u3_nul, o); + pog = pog_u->byc_u.ops_y; + ip_w = 0; +#ifdef U3_CPU_DEBUG + u3R->pro.nox_d += 1; +#endif +#ifdef VERBOSE_BYTECODE + fprintf(stderr, "\r\nnock jump: %u\r\n", o); + _n_print_byc(pog, ip_w); +#endif + u3z(o); + BURN(); + + do_deep: + top = _n_peek(off); + o = *top; + *top = u3du(o); + u3z(o); + BURN(); + + do_bump: + top = _n_peek(off); + *top = u3i_vint(*top); + BURN(); + + do_sam0: + top = _n_peek(off); + if ( *top == 0 ) { + *top = c3y; + } + else { + u3z(*top); + *top = c3n; + } + BURN(); + + do_sam1: + top = _n_peek(off); + if ( *top == 1 ) { + *top = c3y; + } + else { + u3z(*top); + *top = c3n; + } + BURN(); + + do_samb: + top = _n_peek(off); + if ( *top == pog[ip_w++] ) { + *top = c3y; + } + else { + u3z(*top); + *top = c3n; + } + BURN(); + + do_sams: + top = _n_peek(off); + if ( *top == _n_resh(pog, &ip_w) ) { + *top = c3y; + } + else { + u3z(*top); + *top = c3n; + } + BURN(); + + do_sans: + x = pog_u->lit_u.non[_n_resh(pog, &ip_w)]; + goto samn_in; + do_sanb: + x = pog_u->lit_u.non[pog[ip_w++]]; + samn_in: + top = _n_peek(off); + o = *top; + *top = u3r_sing(o, x); + u3z(o); + BURN(); + + do_same: + x = _n_pep(mov, off); + _n_swap(mov, off); + goto same_in; + + do_salm: + x = _n_pep(mov, off); + _n_toss(mov, off); + goto same_in; + + same_in: + top = _n_peek(off); + o = *top; + *top = u3r_sing(x, o); + u3z(o); + u3z(x); + BURN(); + + do_samc: + top = _n_peek(off); + o = *top; + *top = u3r_sing(u3h(o), u3t(o)); + u3z(o); + BURN(); + + do_sbip: + sip_w = pog[ip_w++]; + ip_w += sip_w; + BURN(); + + do_sips: + sip_w = _n_resh(pog, &ip_w); + ip_w += sip_w; + BURN(); + + do_swip: + sip_w = _n_rewo(pog, &ip_w); + ip_w += sip_w; + BURN(); + + do_swin: + sip_w = _n_rewo(pog, &ip_w); + goto skin_in; + + do_sins: + sip_w = _n_resh(pog, &ip_w); + goto skin_in; + + do_sbin: + sip_w = pog[ip_w++]; + skin_in: + x = _n_pep(mov, off); + if ( c3n == x ) { + ip_w += sip_w; + } + else if ( c3y != x ) { + u3m_bail(c3__exit); + return u3_none; + } + BURN(); + + do_kics: + x = _n_resh(pog, &ip_w); + goto kick_in; + + do_kicb: + x = pog[ip_w++]; + kick_in: + sit_u = &(pog_u->cal_u.sit_u[x]); + top = _n_peek(off); + o = *top; + *top = _n_kick(o, sit_u); + if ( u3_none == *top ) { + _n_toss(mov, off); + + fam = u3to(burnframe, u3R->cap_p) + off + mov; + u3R->cap_p = u3of(burnframe, fam - off); + fam->ip_w = ip_w; + fam->pog_u = pog_u; + + pog_u = u3to(u3n_prog, sit_u->pog_p); + pog = pog_u->byc_u.ops_y; + ip_w = 0; +#ifdef U3_CPU_DEBUG + u3R->pro.nox_d += 1; +#endif +#ifdef VERBOSE_BYTECODE + fprintf(stderr, "\r\nhead kick jump: %u, sp: %p\r\n", u3r_at(sit_u->axe, cor), top); + _n_print_byc(pog, ip_w); +#endif + _n_push(mov, off, o); + } +#ifdef VERBOSE_BYTECODE + else { + fprintf(stderr, "head jet\r\n"); + } +#endif + BURN(); + + do_tics: + x = _n_resh(pog, &ip_w); + goto tick_in; + + do_ticb: + x = pog[ip_w++]; + tick_in: + sit_u = &(pog_u->cal_u.sit_u[x]); + top = _n_peek(off); + o = *top; + *top = _n_kick(o, sit_u); + if ( u3_none == *top ) { + *top = o; + pog_u = u3to(u3n_prog, sit_u->pog_p); + pog = pog_u->byc_u.ops_y; + ip_w = 0; +#ifdef U3_CPU_DEBUG + u3R->pro.nox_d += 1; +#endif +#ifdef VERBOSE_BYTECODE + fprintf(stderr, "\r\ntail kick jump: %u, sp: %p\r\n", u3x_at(sit_u->axe, o);, top); + _n_print_byc(pog, ip_w); +#endif + } +#ifdef VERBOSE_BYTECODE + else { + fprintf(stderr, "tail jet\r\n"); + } +#endif + BURN(); + + do_wils: // [gof bus ref] + o = _n_pep(mov,off); // [bus ref] + _n_toss(mov, off); // [ref] + top = _n_peek(off); + goto wish_in; + + do_wish: // [gof bus ref] + o = _n_pep(mov,off); // [bus ref] + top = _n_swap(mov, off); // [ref bus] + wish_in: + u3t_off(noc_o); + x = u3m_soft_esc(*top, u3k(o)); + u3t_on(noc_o); + + if ( c3n == u3du(x) ) { + u3m_bail(u3nt(1, o, 0)); + return u3_none; + } + else if ( c3n == u3du(u3t(x)) ) { + // replace with proper error stack push + u3t_push(u3nc(c3__hunk, _n_mush(o))); + u3m_bail(c3__exit); + return u3_none; + } + else { + u3z(o); + *top = u3k(u3t(u3t(x))); + u3z(x); + BURN(); + } + + do_sush: + x = _n_resh(pog, &ip_w); + goto cush_in; + + do_bush: + x = pog[ip_w++]; + cush_in: + x = u3k(pog_u->lit_u.non[x]); + o = _n_pep(mov, off); + u3t_push(u3nc(x, o)); + BURN(); + + do_drop: + u3t_drop(); + BURN(); + + do_heck: + x = _n_pep(mov, off); + if ( c3y == u3ud(x) ) { + u3t_off(noc_o); + u3t_heck(x); + u3t_on(noc_o); + } + else { + u3z(x); + } + BURN(); + + do_slog: + x = _n_pep(mov, off); + if ( !(u3C.wag_w & u3o_quiet) ) { + u3t_off(noc_o); + u3t_slog(x); + u3t_on(noc_o); + } + else { + u3z(x); + } + BURN(); + + + do_sast: + x = _n_resh(pog, &ip_w); + goto fast_in; + + do_bast: + x = pog[ip_w++]; + goto fast_in; + + do_salt: + x = _n_resh(pog, &ip_w); + goto falt_in; + do_balt: + x = pog[ip_w++]; + falt_in: // [pro bus clu] + o = _n_pep(mov, off); // [bus clu] + _n_toss(mov, off); // [clu] + top = _n_peek(off); + goto fast_out; + + fast_in: // [pro bus clu] + o = _n_pep(mov, off); // [bus clu] + top = _n_swap(mov, off); // [clu bus] + fast_out: + rit_u = &(pog_u->reg_u.rit_u[x]); + u3t_off(noc_o); + u3j_rite_mine(rit_u, *top, u3k(o)); + u3t_on(noc_o); + *top = o; + BURN(); + + do_skis: + x = _n_resh(pog, &ip_w); + goto skim_in; + + do_skib: + x = pog[ip_w++]; + skim_in: + mem_u = &(pog_u->mem_u.sot_u[x]); + top = _n_peek(off); + x = u3k(*top); + goto skim_out; + + do_slis: + x = _n_resh(pog, &ip_w); + goto slim_in; + + do_slib: + x = pog[ip_w++]; + slim_in: + mem_u = &(pog_u->mem_u.sot_u[x]); + x = _n_pep(mov, off); + skim_out: + o = u3k(mem_u->key); + x = u3nc(x, o); + o = u3z_find(144 + c3__nock, x); + if ( u3_none == o ) { + _n_push(mov, off, x); + _n_push(mov, off, u3k(u3h(x))); + } + else { + ip_w += mem_u->sip_l; + _n_push(mov, off, o); + u3z(x); + } + BURN(); + + do_save: + x = _n_pep(mov, off); + top = _n_peek(off); + o = *top; + if ( &(u3H->rod_u) != u3R ) { + u3z_save(144 + c3__nock, o, x); + } + *top = x; + u3z(o); + BURN(); + } +} + +/* _n_burn_out(): execute u3n_prog with bus as subject. + */ +static u3_noun +_n_burn_out(u3_noun bus, u3n_prog* pog_u) +{ + c3_ys mov, off; + if ( c3y == u3a_is_north(u3R) ) { + mov = -1; + off = 0; + } + else { + mov = 1; + off = -1; + } + return _n_burn(pog_u, bus, mov, off); +} + +/* u3n_burn(): execute u3n_prog with bus as subject. + */ +u3_noun +u3n_burn(u3p(u3n_prog) pog_p, u3_noun bus) +{ + u3_noun pro; + u3t_on(noc_o); + pro = _n_burn_out(bus, u3to(u3n_prog, pog_p)); + u3t_off(noc_o); + return pro; +} + +/* _n_burn_on(): produce .*(bus fol) with bytecode interpreter + */ +static u3_noun +_n_burn_on(u3_noun bus, u3_noun fol) +{ + u3n_prog* pog_u = _n_find(u3_nul, fol); + + u3z(fol); + return _n_burn_out(bus, pog_u); +} /* u3n_nock_on(): produce .*(bus fol). Do not virtualize. */ @@ -435,12 +2209,230 @@ u3n_nock_on(u3_noun bus, u3_noun fol) u3_noun pro; u3t_on(noc_o); +#if 0 pro = _n_nock_on(bus, fol); +#else + pro = _n_burn_on(bus, fol); +#endif u3t_off(noc_o); return pro; } +/* _n_prog_take_dat(): copy references from src u3n_prog. overwritten + * values in dst u3n_prog are lost/freed only if + * los_o is yes. + */ +static void +_n_prog_take_dat(u3n_prog* dst_u, u3n_prog* src_u, c3_o los_o) +{ + c3_w i_w; + for ( i_w = 0; i_w < src_u->lit_u.len_w; ++i_w ) { + u3_noun* dst = &(dst_u->lit_u.non[i_w]); + u3_noun* src = &(src_u->lit_u.non[i_w]); + u3_noun old = *dst; + *dst = u3a_take(*src); + if ( c3y == los_o ) { + u3z(old); + } + } + + for ( i_w = 0; i_w < src_u->mem_u.len_w; ++i_w ) { + u3n_memo* dst = &(dst_u->mem_u.sot_u[i_w]); + u3n_memo* src = &(src_u->mem_u.sot_u[i_w]); + u3_noun old = dst->key; + dst->sip_l = src->sip_l; + dst->key = u3a_take(src->key); + if ( c3y == los_o ) { + u3z(old); + } + } + + for ( i_w = 0; i_w < src_u->cal_u.len_w; ++i_w ) { + u3j_site_copy(&(dst_u->cal_u.sit_u[i_w]), + &(src_u->cal_u.sit_u[i_w]), los_o); + } + + for ( i_w = 0; i_w < src_u->reg_u.len_w; ++i_w ) { + u3j_rite_copy(&(dst_u->reg_u.rit_u[i_w]), + &(src_u->reg_u.rit_u[i_w]), los_o); + } +} + +/* _n_prog_take(): copy program from a junior road + */ +static u3n_prog* +_n_prog_take(u3n_prog* pog_u) +{ + u3n_prog* gop_u; + + if ( c3y == pog_u->byc_u.own_o ) { + gop_u = _n_prog_new(pog_u->byc_u.len_w, + pog_u->cal_u.len_w, pog_u->reg_u.len_w, + pog_u->lit_u.len_w, pog_u->mem_u.len_w); + memcpy(gop_u->byc_u.ops_y, pog_u->byc_u.ops_y, pog_u->byc_u.len_w); + } + else { + gop_u = _n_prog_old(pog_u); + } + _n_prog_take_dat(gop_u, pog_u, c3n); + + return gop_u; +} + + +/* _n_prog_free(): free memory retained by program +*/ +static void +_n_prog_free(u3n_prog* pog_u) +{ + c3_w i_w; + + for ( i_w = 0; i_w < pog_u->lit_u.len_w; ++i_w ) { + u3z(pog_u->lit_u.non[i_w]); + } + + for ( i_w = 0; i_w < pog_u->mem_u.len_w; ++i_w ) { + u3z(pog_u->mem_u.sot_u[i_w].key); + } + + for ( i_w = 0; i_w < pog_u->cal_u.len_w; ++i_w ) { + u3j_site_lose(&(pog_u->cal_u.sit_u[i_w])); + } + + for ( i_w = 0; i_w < pog_u->reg_u.len_w; ++i_w ) { + u3j_rite_lose(&(pog_u->reg_u.rit_u[i_w])); + } + + u3a_free(pog_u); +} + +/* _n_reap(): reap key and value from byc table. +*/ +static void +_n_reap(u3_noun kev) +{ + u3_noun fol = u3h(kev); + u3_noun got = u3t(kev); + u3_noun lof = u3a_take(fol); + u3_noun tog; + u3_weak con = u3h_get(u3R->byc.har_p, lof); + u3n_prog* pog_u = u3to(u3n_prog, got); + + if ( u3_none == con ) { + tog = u3a_outa(_n_prog_take(pog_u)); + u3h_put(u3R->byc.har_p, lof, tog); + } + else { + u3n_prog* sep_u = u3to(u3n_prog, con); + _n_prog_take_dat(sep_u, pog_u, c3y); + tog = u3a_outa(sep_u); + } + u3z(lof); +} + +/* u3n_reap(): promote bytecode state. +*/ +void +u3n_reap(u3p(u3h_root) har_p) +{ + u3h_walk(har_p, _n_reap); +} + +/* _n_ream(): ream program call sites +*/ +void +_n_ream(u3_noun kev) +{ + c3_w i_w; + u3n_prog* pog_u = u3to(u3n_prog, u3t(kev)); + + // fix up pointers for loom portability + pog_u->byc_u.ops_y = (c3_y*) _n_prog_dat(pog_u); + pog_u->lit_u.non = (u3_noun*) (pog_u->byc_u.ops_y + pog_u->byc_u.len_w); + pog_u->mem_u.sot_u = (u3n_memo*) (pog_u->lit_u.non + pog_u->lit_u.len_w); + pog_u->cal_u.sit_u = (u3j_site*) (pog_u->mem_u.sot_u + pog_u->mem_u.len_w); + pog_u->reg_u.rit_u = (u3j_rite*) (pog_u->cal_u.sit_u + pog_u->cal_u.len_w); + + for ( i_w = 0; i_w < pog_u->cal_u.len_w; ++i_w ) { + u3j_site_ream(&(pog_u->cal_u.sit_u[i_w])); + } +} + +/* u3n_ream(): refresh after restoring from checkpoint. +*/ +void +u3n_ream() +{ + c3_assert(u3R == &(u3H->rod_u)); + u3h_walk(u3R->byc.har_p, _n_ream); +} + +/* _n_prog_mark(): mark program for gc. +*/ +static c3_w +_n_prog_mark(u3n_prog* pog_u) +{ + c3_w i_w, tot_w = u3a_mark_mptr(pog_u); + + for ( i_w = 0; i_w < pog_u->lit_u.len_w; ++i_w ) { + tot_w += u3a_mark_noun(pog_u->lit_u.non[i_w]); + } + + for ( i_w = 0; i_w < pog_u->mem_u.len_w; ++i_w ) { + tot_w += u3a_mark_noun(pog_u->mem_u.sot_u[i_w].key); + } + + for ( i_w = 0; i_w < pog_u->cal_u.len_w; ++i_w ) { + tot_w += u3j_site_mark(&(pog_u->cal_u.sit_u[i_w])); + } + + for ( i_w = 0; i_w < pog_u->reg_u.len_w; ++i_w ) { + tot_w += u3j_rite_mark(&(pog_u->reg_u.rit_u[i_w])); + } + + return tot_w; +} + +/* _n_bam(): u3h_walk_with helper for u3n_mark + */ +static void +_n_bam(u3_noun kev, void* dat) +{ + c3_w* bam_w = dat; + u3n_prog* pog = u3to(u3n_prog, u3t(kev)); + *bam_w += _n_prog_mark(pog); +} + +/* u3n_mark(): mark the bytecode cache for gc. + */ +c3_w +u3n_mark() +{ + c3_w bam_w = 0; + u3p(u3h_root) har_p = u3R->byc.har_p; + u3h_walk_with(har_p, _n_bam, &bam_w); + return bam_w + u3h_mark(har_p); +} + +/* _n_feb(): u3h_walk helper for u3n_bree + */ +static void +_n_feb(u3_noun kev) +{ + _n_prog_free(u3to(u3n_prog, u3t(kev))); +} + +/* u3n_free(): free bytecode cache + */ +void +u3n_free() +{ + u3p(u3h_root) har_p = u3R->byc.har_p; + u3h_walk(har_p, _n_feb); + u3h_free(har_p); +} + /* u3n_kick_on(): fire `gat` without changing the sample. */ u3_noun @@ -462,7 +2454,7 @@ u3n_slam_on(u3_noun gat, u3_noun sam) if ( &u3H->rod_u == u3R ) { if ( exc_w == 1 ) { c3_assert(0); - } + } exc_w++; } #endif diff --git a/noun/trace.c b/noun/trace.c index bc69998385..a482b2e107 100644 --- a/noun/trace.c +++ b/noun/trace.c @@ -5,6 +5,8 @@ #include "all.h" #include +static c3_o _ct_lop_o; + /* u3t_push(): push on trace stack. */ void @@ -110,24 +112,17 @@ u3t_heck(u3_atom cog) #endif } -/* _t_jet_label(): -*/ -u3_weak -_t_jet_label(u3a_road* rod_u, u3_noun bat) +#if 0 +static void +_ct_sane(u3_noun lab) { - while ( 1 ) { - u3_weak cax = u3h_git(rod_u->jed.har_p, bat); - - if ( u3_none != cax ) { - return u3h(u3t(u3t(u3h(cax)))); - } - - if ( rod_u->par_p ) { - rod_u = u3to(u3_road, rod_u->par_p); - } - else return u3_none; + if ( u3_nul != lab ) { + c3_assert(c3y == u3du(lab)); + c3_assert(c3y == u3ud(u3h(lab))); + _ct_sane(u3t(lab)); } } +#endif #if 1 /* _t_samp_process(): process raw sample data from live road. @@ -145,22 +140,13 @@ _t_samp_process(u3_road* rod_u) u3_noun don = rod_u->pro.don; while ( u3_nul != don ) { - u3_noun bat = u3h(don); - u3_noun lab; - - // Find the label from this battery, surface allocated. + // Get surface allocated label // - { - u3_noun laj = _t_jet_label(rod_u, bat); - - if ( u3_none == laj ) { - don = u3t(don); - continue; - } + // u3_noun lab = u3nc(u3i_string("foobar"), 0); + u3_noun laj = u3h(don), + lab = u3a_take(laj); + u3a_wash(laj); - // lab = u3nc(u3i_string("foobar"), u3_nul); - lab = u3a_take(laj); u3a_wash(laj); - } // Add the label to the traced label stack, trimming recursion. // { @@ -218,6 +204,12 @@ _t_samp_process(u3_road* rod_u) void u3t_samp(void) { + if ( c3y == _ct_lop_o ) { + // _ct_lop_o here is a mutex for modifying pro.don. we + // do not want to sample in the middle of doing that, as + // it can cause memory errors. + return; + } u3C.wag_w &= ~u3o_debug_cpu; static int home = 0; @@ -279,10 +271,13 @@ u3t_samp(void) /* u3t_come(): push on profile stack; return yes if active push. RETAIN. */ c3_o -u3t_come(u3_noun bat) +u3t_come(u3_noun lab) { - if ( (u3_nul == u3R->pro.don) || !_(u3r_sing(bat, u3h(u3R->pro.don))) ) { - u3R->pro.don = u3nc(u3k(bat), u3R->pro.don); + if ( (u3_nul == u3R->pro.don) || !_(u3r_sing(lab, u3h(u3R->pro.don))) ) { + u3a_gain(lab); + _ct_lop_o = c3y; + u3R->pro.don = u3nc(lab, u3R->pro.don); + _ct_lop_o = c3n; return c3y; } else return c3n; @@ -293,10 +288,11 @@ u3t_come(u3_noun bat) void u3t_flee(void) { - u3_noun t_don = u3k(u3t(u3R->pro.don)); - - u3z(u3R->pro.don); - u3R->pro.don = t_don; + _ct_lop_o = c3y; + u3_noun don = u3R->pro.don; + u3R->pro.don = u3k(u3t(don)); + _ct_lop_o = c3n; + u3z(don); } extern FILE* @@ -391,6 +387,7 @@ void u3t_boot(void) { if ( u3C.wag_w & u3o_debug_cpu ) { + _ct_lop_o = c3n; #if defined(U3_OS_osx) #if 1 { diff --git a/vere/http.c b/vere/http.c index ddd509a80d..2741ad1d91 100644 --- a/vere/http.c +++ b/vere/http.c @@ -1383,7 +1383,8 @@ _http_serv_start_all(void) c3_assert( 0 != for_u ); - u3_lo_open(); + // disabled, as this causes a memory leak + // u3_lo_open(); // if the SSL_CTX existed, it'll be freed with the servers u3_Host.tls_u = 0; @@ -1444,7 +1445,8 @@ _http_serv_start_all(void) _http_write_ports_file(u3_Host.dir_c); _http_form_free(); - u3_lo_shut(c3y); + // disabled, see above + // u3_lo_shut(c3y); } /* _http_serv_restart(): gracefully shutdown, then start servers. @@ -1499,15 +1501,26 @@ _http_form_free(void) void u3_http_ef_form(u3_noun fig) { - // XX validate / test axes? - u3_noun sec = u3h(fig); - u3_noun lob = u3t(fig); + u3_noun sec, pro, log, red; + + if ( (c3n == u3r_qual(fig, &sec, &pro, &log, &red) ) || + // confirm sec is a valid (unit ^) + !( u3_nul == sec || ( c3y == u3du(sec) && + c3y == u3du(u3t(sec)) && + u3_nul == u3h(sec) ) ) || + // confirm valid flags ("loobeans") + !( c3y == pro || c3n == pro ) || + !( c3y == log || c3n == log ) || + !( c3y == red || c3n == red ) ) { + uL(fprintf(uH, "http: form: invalid card\n")); + u3z(fig); + return; + } u3_form* for_u = c3_malloc(sizeof(*for_u)); - - for_u->pro = (c3_o)u3h(lob); - for_u->log = (c3_o)u3h(u3t(lob)); - for_u->red = (c3_o)u3t(u3t(lob)); + for_u->pro = (c3_o)pro; + for_u->log = (c3_o)log; + for_u->red = (c3_o)red; if ( u3_nul != sec ) { u3_noun key = u3h(u3t(sec)); @@ -2811,15 +2824,13 @@ _proxy_serv_start(u3_prox* lis_u) void u3_http_ef_that(u3_noun tat) { - u3_noun sip = u3h(tat); - u3_noun por = u3h(u3t(tat)); - u3_noun sec = u3h(u3t(u3t(tat))); - u3_noun non = u3t(u3t(u3t(tat))); + u3_noun sip, por, sec, non; - if( c3n == u3ud(sip) || - c3n == u3a_is_cat(por) || - !( c3y == sec || c3n == sec ) || - c3n == u3ud(non) ) { + if ( ( c3n == u3r_qual(tat, &sip, &por, &sec, &non) ) || + ( c3n == u3ud(sip) ) || + ( c3n == u3a_is_cat(por) ) || + !( c3y == sec || c3n == sec ) || + ( c3n == u3ud(non) ) ) { uL(fprintf(uH, "http: that: invalid card\n")); u3z(tat); return; @@ -2859,6 +2870,7 @@ u3_http_ef_that(u3_noun tat) if ( c3n == u3_Host.ops_u.net ) { cli_u->ipf_w = INADDR_LOOPBACK; _proxy_ward_connect(cli_u); + u3z(tat); return; } diff --git a/vere/main.c b/vere/main.c index 93cb26fc76..74901d7900 100644 --- a/vere/main.c +++ b/vere/main.c @@ -81,6 +81,7 @@ _main_getopt(c3_i argc, c3_c** argv) u3_Host.ops_u.fog = c3n; u3_Host.ops_u.gab = c3n; u3_Host.ops_u.git = c3n; + u3_Host.ops_u.has = c3n; u3_Host.ops_u.net = c3n; u3_Host.ops_u.mem = c3n; u3_Host.ops_u.nuu = c3n; @@ -91,7 +92,7 @@ _main_getopt(c3_i argc, c3_c** argv) u3_Host.ops_u.veb = c3n; u3_Host.ops_u.kno_w = DefaultKernel; - while ( (ch_i=getopt(argc, argv,"G:B:A:H:I:w:u:t:f:k:l:n:p:r:NabcdgqsvxFMPDXR")) != -1 ) { + while ( (ch_i=getopt(argc, argv,"G:B:A:H:I:w:u:t:f:k:l:n:p:r:NabcdgqsvxFMPDXRS")) != -1 ) { switch ( ch_i ) { case 'M': { u3_Host.ops_u.mem = c3y; @@ -186,6 +187,7 @@ _main_getopt(c3_i argc, c3_c** argv) case 'q': { u3_Host.ops_u.qui = c3y; break; } case 'v': { u3_Host.ops_u.veb = c3y; break; } case 's': { u3_Host.ops_u.git = c3y; break; } + case 'S': { u3_Host.ops_u.has = c3y; break; } case '?': default: { return c3n; } @@ -596,6 +598,12 @@ main(c3_i argc, if ( _(u3_Host.ops_u.dry) ) { u3C.wag_w |= u3o_dryrun; } + + /* Set hashboard flag + */ + if ( _(u3_Host.ops_u.has) ) { + u3C.wag_w |= u3o_hashless; + } } u3m_boot(u3_Host.ops_u.nuu, u3_Host.ops_u.gab, diff --git a/vere/raft.c b/vere/raft.c index bfd4036dd5..6f66b31b0d 100644 --- a/vere/raft.c +++ b/vere/raft.c @@ -1880,11 +1880,11 @@ _raft_grab(u3_noun ova) fprintf(stderr, "arvo stuff: "); _raft_print_memory(utv_w); - har_w = u3h_mark(u3R->jed.har_p); + har_w = u3h_mark(u3R->jed.war_p); fprintf(stderr, " warm jet state: "); _raft_print_memory(har_w); - das_w = u3a_mark_noun(u3R->jed.das); + das_w = u3h_mark(u3R->jed.cod_p); fprintf(stderr, " cold jet state: "); _raft_print_memory(das_w);