|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-06-19 01:06 UTC] xuefer at 21cn dot com
Description:
------------
apc.optimization=1
i have tested on my code, but i don't have a stripped down testcase script
this patch solved the problem.
logically, RESTART_PEEPHOLE_LOOP should be done only when opcode is modified
apc is still SEGV with this patch for my script, but at least it won't hang
Index: apc_optimizer.c
===================================================================
RCS file: /repository/pecl/apc/apc_optimizer.c,v
retrieving revision 3.24
diff -u -r3.24 apc_optimizer.c
--- apc_optimizer.c 20 Jul 2003 00:07:02 -0000 3.24
+++ apc_optimizer.c 19 Jun 2004 05:09:40 -0000
@@ -790,15 +790,15 @@
if ((p = peephole_inc(op_array->opcodes, i, op_array->last))) {
if (!are_branch_targets(cdr(p), jumps)) {
rewrite_inc(op_array->opcodes, p);
+ RESTART_PEEPHOLE_LOOP;
}
- RESTART_PEEPHOLE_LOOP;
}
if ((p = peephole_print(op_array->opcodes, i, op_array->last))) {
if (!are_branch_targets(cdr(p), jumps)) {
rewrite_print(op_array->opcodes, p);
+ RESTART_PEEPHOLE_LOOP;
}
- RESTART_PEEPHOLE_LOOP;
}
if ((p = peephole_multiple_echo(op_array->opcodes, i, op_array->last))) {
@@ -810,27 +810,27 @@
if ((p = peephole_constant_fold(op_array->opcodes, i, op_array->last))) {
if (!are_branch_targets(cdr(p), jumps)) {
rewrite_constant_fold(op_array->opcodes, p);
+ RESTART_PEEPHOLE_LOOP;
}
- RESTART_PEEPHOLE_LOOP;
}
if ((p = peephole_fcall(op_array->opcodes, i, op_array->last))) {
if (!are_branch_targets(cdr(p), jumps)) {
rewrite_fcall(op_array->opcodes, p);
+ RESTART_PEEPHOLE_LOOP;
}
- RESTART_PEEPHOLE_LOOP;
}
if ((p = peephole_add_string(op_array->opcodes, i, op_array->last))) {
if (!are_branch_targets(cdr(p), jumps)) {
rewrite_add_string(op_array->opcodes, p);
+ RESTART_PEEPHOLE_LOOP;
}
- RESTART_PEEPHOLE_LOOP;
}
if ((p = peephole_needless_bool(op_array->opcodes, i, op_array->last))) {
if (!are_branch_targets(cdr(p), jumps)) {
rewrite_needless_bool(op_array->opcodes, p);
+ RESTART_PEEPHOLE_LOOP;
}
- RESTART_PEEPHOLE_LOOP;
}
}
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 03:00:01 2025 UTC |
OPTIMIZE1(cast); should be OPTIMIZE1(const_cast); and: @@ -518,7 +523,7 @@ /* {{{ peephole match functions */ -static Pair* peephole_cast(zend_op* ops, int i, int num_ops) +static Pair* peephole_const_cast(zend_op* ops, int i, int num_ops) { if (ops[i].opcode == ZEND_CAST && ops[i].op1.op_type == IS_CONST &&