]> granicus.if.org Git - php/commitdiff
- Also tune jmpz_ex
authorAndi Gutmans <andi@php.net>
Thu, 24 Oct 2002 18:24:55 +0000 (18:24 +0000)
committerAndi Gutmans <andi@php.net>
Thu, 24 Oct 2002 18:24:55 +0000 (18:24 +0000)
Zend/zend_execute.c
Zend/zend_opcode.c

index 7709d4bab034ad952f6bcc5def3c2bc64704dc01..1e2bbec0b75d162f556482d93f2fe322092bf407 100644 (file)
@@ -1939,7 +1939,7 @@ int zend_jmpz_ex_handler(ZEND_OPCODE_HANDLER_ARGS)
 #if DEBUG_ZEND>=2
                printf("Conditional jmp to %d\n", EX(opline)->op2.u.opline_num);
 #endif
-               EX(opline) = &op_array->opcodes[EX(opline)->op2.u.opline_num];
+               EX(opline) = EX(opline)->op2.u.jmp_addr;
                return 0; /* CHECK_ME */
        }
        NEXT_OPCODE();
@@ -1957,7 +1957,7 @@ int zend_jmpnz_ex_handler(ZEND_OPCODE_HANDLER_ARGS)
 #if DEBUG_ZEND>=2
                printf("Conditional jmp to %d\n", EX(opline)->op2.u.opline_num);
 #endif
-               EX(opline) = &op_array->opcodes[EX(opline)->op2.u.opline_num];
+               EX(opline) = EX(opline)->op2.u.jmp_addr;
                return 0; /* CHECK_ME */
        }
        NEXT_OPCODE();
index fb7b8b27871cba427bf1455d81f68fa964906d43..5feb70599695c3f21550befa0c587bd8084b199a 100644 (file)
@@ -309,11 +309,16 @@ int pass_two(zend_op_array *op_array TSRMLS_DC)
                        opline->op2.u.constant.is_ref = 1;
                        opline->op2.u.constant.refcount = 2;
                }
-               if (opline->opcode == ZEND_JMP) {
-                       opline->op1.u.jmp_addr = &op_array->opcodes[opline->op1.u.opline_num];
-               }
-               if (opline->opcode == ZEND_JMPZ || opline->opcode == ZEND_JMPNZ) {
-                       opline->op2.u.jmp_addr = &op_array->opcodes[opline->op2.u.opline_num];
+               switch (opline->opcode) {
+                       case ZEND_JMP:
+                               opline->op1.u.jmp_addr = &op_array->opcodes[opline->op1.u.opline_num];
+                               break;
+                       case ZEND_JMPZ:
+                       case ZEND_JMPNZ:
+                       case ZEND_JMPZ_EX:
+                       case ZEND_JMPNZ_EX:
+                               opline->op2.u.jmp_addr = &op_array->opcodes[opline->op2.u.opline_num];
+                               break;
                }
                opline->handler = zend_opcode_handlers[opline->opcode];
                opline++;