Changeset 657
- Timestamp:
- 2009-07-31T14:43:19+02:00 (4 years ago)
- File:
-
- 1 edited
-
trunk/optimizer.c (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/optimizer.c
r543 r657 36 36 37 37 bbid_t fall; 38 #ifdef ZEND_ENGINE_2 38 39 bbid_t catch; 40 #endif 39 41 40 42 int opnum; /* opnum after joining basic block */ … … 133 135 /* break=will fall */ 134 136 switch (opline->opcode) { 137 #ifdef ZEND_HANDLE_EXCEPTION 135 138 case ZEND_HANDLE_EXCEPTION: 139 #endif 136 140 case ZEND_RETURN: 137 141 case ZEND_EXIT: … … 253 257 254 258 bb->fall = BBID_INVALID; 259 #ifdef ZEND_ENGINE_2 255 260 bb->catch = BBID_INVALID; 261 #endif 256 262 257 263 if (opcodes) { … … 284 290 op_flowinfo_t fi; 285 291 zend_op *last = bb->opcodes + bb->count - 1; 292 bbid_t catchbbid; 293 #ifdef ZEND_ENGINE_2 294 catchbbid = BBID_INVALID; 295 #else 296 catchbbid = bb->catch; 297 #endif 286 298 287 299 op_get_flowinfo(&fi, last); … … 293 305 , bb->id, bb->count, bb->alloc ? -1 : line 294 306 , bb->used ? 'U' : ' ', bb->alloc ? 'A' : ' ' 295 , fi.jmpout_op1, fi.jmpout_op2, fi.jmpout_ext, bb->fall, bb->catch, xc_get_opcode(last->opcode)307 , fi.jmpout_op1, fi.jmpout_op2, fi.jmpout_ext, bb->fall, catchbbid, xc_get_opcode(last->opcode) 296 308 ); 297 309 op_print(line, bb->opcodes, last + 1); … … 354 366 ALLOCA_FLAG(use_heap_markbbhead) 355 367 bbid_t *bbids = my_do_alloca(count * sizeof(bbid_t), use_heap_bbids); 368 #ifdef ZEND_ENGINE_2 356 369 bbid_t *catchbbids = my_do_alloca(count * sizeof(bbid_t), use_heap_catchbbids); 370 #endif 357 371 zend_bool *markbbhead = my_do_alloca(count * sizeof(zend_bool), use_heap_markbbhead); 358 372 … … 377 391 } 378 392 } 393 #ifdef ZEND_ENGINE_2 379 394 /* mark try start */ 380 395 for (i = 0; i < op_array->last_try_catch; i ++) { 381 396 markbbhead[op_array->try_catch_array[i].try_op] = 1; 382 397 } 398 #endif 383 399 /* }}} */ 384 400 /* {{{ fill op lines with newly allocated id */ … … 396 412 } 397 413 /* }}} */ 414 #ifdef ZEND_ENGINE_2 398 415 /* {{{ fill op lines with catch id */ 399 416 for (i = 0; i < count; i ++) { … … 414 431 #endif 415 432 /* }}} */ 433 #endif 416 434 /* {{{ create basic blocks */ 417 435 start = 0; … … 425 443 opline = op_array->opcodes + start; 426 444 pbb = bbs_new_bb_ex(bbs, opline, i - start); 445 #ifdef ZEND_ENGINE_2 427 446 pbb->catch = catchbbids[start]; 447 #endif 428 448 429 449 /* last */ … … 457 477 458 478 my_free_alloca(markbbhead, use_heap_markbbhead); 479 #ifdef ZEND_ENGINE_2 459 480 my_free_alloca(catchbbids, use_heap_catchbbids); 481 #endif 460 482 my_free_alloca(bbids, use_heap_bbids); 461 483 return SUCCESS; … … 465 487 { 466 488 int i; 489 #ifdef ZEND_ENGINE_2 467 490 bbid_t lasttrybbid; 468 491 bbid_t lastcatchbbid; 492 #endif 469 493 470 494 for (i = 0; i < bbs_count(bbs); i ++) { … … 489 513 } 490 514 515 #ifdef ZEND_ENGINE_2 491 516 lasttrybbid = BBID_INVALID; 492 517 lastcatchbbid = BBID_INVALID; … … 508 533 } 509 534 /* it is impossible to have last bb catched */ 535 #endif 510 536 } 511 537 /* }}} */
Note: See TracChangeset
for help on using the changeset viewer.

