Browse Source

Code cleanup

pull/686/merge
Dmitry Stogov 12 years ago
parent
commit
87b667221e
  1. 18
      ext/opcache/Optimizer/block_pass.c
  2. 3
      ext/opcache/Optimizer/compact_literals.c

18
ext/opcache/Optimizer/block_pass.c

@ -397,7 +397,6 @@ static inline void del_source(zend_code_block *from, zend_code_block *to)
/* move 'to'`s references to 'from' */ /* move 'to'`s references to 'from' */
to->start_opline = NULL; to->start_opline = NULL;
to->access = 0; to->access = 0;
//???A efree(to->sources);
to->sources = NULL; to->sources = NULL;
from_block->follow_to = to->follow_to; from_block->follow_to = to->follow_to;
if (to->op1_to) { if (to->op1_to) {
@ -487,17 +486,10 @@ static void zend_rebuild_access_path(zend_cfg *cfg, zend_op_array *op_array, int
/* Mark all blocks as unaccessible and destroy back references */ /* Mark all blocks as unaccessible and destroy back references */
b = blocks; b = blocks;
while (b != NULL) { while (b != NULL) {
zend_block_source *cs;
if (!start && b->access) { if (!start && b->access) {
start = b; start = b;
} }
b->access = 0; b->access = 0;
//???A cs = b->sources;
//???A while (cs) {
//???A zend_block_source *n = cs->next;
//???A efree(cs);
//???A cs = n;
//???A }
b->sources = NULL; b->sources = NULL;
b = b->next; b = b->next;
} }
@ -2109,15 +2101,5 @@ static void zend_block_optimization(zend_op_array *op_array, zend_optimizer_ctx
assemble_code_blocks(&cfg, op_array); assemble_code_blocks(&cfg, op_array);
/* Destroy CFG */ /* Destroy CFG */
/* ???A
for (cur_block = cfg.blocks; cur_block; cur_block = cur_block->next) {
zend_block_source *cs = cur_block->sources;
while (cs) {
zend_block_source *n = cs->next;
efree(cs);
cs = n;
}
}
*/
zend_arena_release(&ctx->arena, checkpoint); zend_arena_release(&ctx->arena, checkpoint);
} }

3
ext/opcache/Optimizer/compact_literals.c

@ -284,8 +284,7 @@ static void optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_c
j = 0; cache_slots = 0; j = 0; cache_slots = 0;
zend_hash_init(&hash, 16, NULL, NULL, 0); zend_hash_init(&hash, 16, NULL, NULL, 0);
map = (int*)zend_arena_alloc(&ctx->arena, op_array->last_literal * sizeof(int)); map = (int*)zend_arena_alloc(&ctx->arena, op_array->last_literal * sizeof(int));
//???A
memset(map, 0, op_array->last_literal * sizeof(int));
memset(map, 0, op_array->last_literal * sizeof(int));
for (i = 0; i < op_array->last_literal; i++) { for (i = 0; i < op_array->last_literal; i++) {
if (!info[i].flags) { if (!info[i].flags) {
/* unsed literal */ /* unsed literal */

Loading…
Cancel
Save