- switch (node->code) {
- case jit_code_prolog:
- _jitc->function = _jitc->functions.ptr + node->w.w;
- break;
- case jit_code_epilog:
- _jitc->function = NULL;
- break;
- case jit_code_beqi:
- redundant_store(node, 1);
- break;
- case jit_code_bnei:
- redundant_store(node, 0);
- break;
- default:
+ if (node->code == jit_code_beqi) {
+ if (redundant_store(node, 1)) {
+ block = _jitc->blocks.ptr + ((jit_node_t *)node->u.n)->v.w;
+ block->again = 1;
+ todo = 1;
+ }
+ }
+ else if (node->code == jit_code_bnei) {
+ if (redundant_store(node, 0)) {
+ block = _jitc->blocks.ptr + ((jit_node_t *)node->u.n)->v.w;
+ block->again = 1;
+ todo = 1;
+ }
+ }
+ }
+
+ if (!todo)
+ todo = check_block_again();
+
+ /* If instructions were removed or first pass did modify the entry
+ * state of any block */
+ if (todo) {
+ do_setup();
+ todo = 0;
+ do {
+ do_follow(0);
+ /* If any block again has the entry state modified. */
+ todo = check_block_again();
+ } while (todo);
+ }
+
+ for (node = _jitc->head; node; node = node->next) {
+ mask = jit_classify(node->code);
+ if (mask & jit_cc_a0_reg)
+ node->u.w &= ~jit_regno_patch;
+ if (mask & jit_cc_a1_reg)
+ node->v.w &= ~jit_regno_patch;
+ if (mask & jit_cc_a2_reg)
+ node->w.w &= ~jit_regno_patch;
+ if (node->code == jit_code_prolog)
+ _jitc->function = _jitc->functions.ptr + node->w.w;
+ else if(node->code == jit_code_epilog)
+ _jitc->function = NULL;
+ else {