Skip to content

Commit

Permalink
Optimize ZEND_POW (Rouven Weßling)
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov committed May 18, 2014
1 parent 1759905 commit 3fff53f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ext/opcache/Optimizer/pass1_5.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) {
case ZEND_MUL:
case ZEND_DIV:
case ZEND_MOD:
#if ZEND_EXTENSION_API_NO >= PHP_5_6_X_API_NO
case ZEND_POW:
#endif
case ZEND_SL:
case ZEND_SR:
case ZEND_CONCAT:
Expand Down
8 changes: 8 additions & 0 deletions ext/opcache/Optimizer/pass3.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ if (ZEND_OPTIMIZER_PASS_3 & OPTIMIZATION_LEVEL) {
case ZEND_MUL:
case ZEND_DIV:
case ZEND_MOD:
#if ZEND_EXTENSION_API_NO >= PHP_5_6_X_API_NO
case ZEND_POW:
#endif
case ZEND_CONCAT:
case ZEND_SL:
case ZEND_SR:
Expand Down Expand Up @@ -104,6 +107,11 @@ if (ZEND_OPTIMIZER_PASS_3 & OPTIMIZATION_LEVEL) {
case ZEND_MOD:
opline->opcode = ZEND_ASSIGN_MOD;
break;
#if ZEND_EXTENSION_API_NO >= PHP_5_6_X_API_NO
case ZEND_POW:
opline->opcode = ZEND_ASSIGN_POW;
break;
#endif
case ZEND_CONCAT:
opline->opcode = ZEND_ASSIGN_CONCAT;
break;
Expand Down
1 change: 1 addition & 0 deletions ext/opcache/ZendAccelerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
#define PHP_5_3_X_API_NO 220090626
#define PHP_5_4_X_API_NO 220100525
#define PHP_5_5_X_API_NO 220121212
#define PHP_5_6_X_API_NO 220131226

/*** file locking ***/
#ifndef ZEND_WIN32
Expand Down

0 comments on commit 3fff53f

Please sign in to comment.