summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2015-12-19 00:20:18 +0800
committerXinchen Hui <laruence@gmail.com>2015-12-19 00:20:18 +0800
commit916f10ac315bcca24d546404771792cc54b2168e (patch)
tree1321ff3d09e3ba35fe9270f6012e56c7c0d767d2 /ext
parent512498d08344f72072aef4b72700120d85253508 (diff)
parentb715845650a5793c647fdf2604664af569cc5661 (diff)
downloadphp-git-916f10ac315bcca24d546404771792cc54b2168e.tar.gz
Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0
Diffstat (limited to 'ext')
-rw-r--r--ext/opcache/Optimizer/pass1_5.c5
-rw-r--r--ext/opcache/Optimizer/zend_optimizer.h3
-rw-r--r--ext/opcache/tests/bug71127.phpt1
3 files changed, 5 insertions, 4 deletions
diff --git a/ext/opcache/Optimizer/pass1_5.c b/ext/opcache/Optimizer/pass1_5.c
index 7e0d14ac60..24c28e976e 100644
--- a/ext/opcache/Optimizer/pass1_5.c
+++ b/ext/opcache/Optimizer/pass1_5.c
@@ -42,9 +42,8 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx)
int i = 0;
zend_op *opline = op_array->opcodes;
zend_op *end = opline + op_array->last;
- /* bug #71127*
- zend_bool collect_constants = (op_array == &ctx->script->main_op_array); */
- zend_bool collect_constants = 0;
+ zend_bool collect_constants = (ZEND_OPTIMIZER_PASS_15 & OPTIMIZATION_LEVEL)?
+ (op_array == &ctx->script->main_op_array) : 0;
while (opline < end) {
switch (opline->opcode) {
diff --git a/ext/opcache/Optimizer/zend_optimizer.h b/ext/opcache/Optimizer/zend_optimizer.h
index 27c6159b7d..8c1b8eace8 100644
--- a/ext/opcache/Optimizer/zend_optimizer.h
+++ b/ext/opcache/Optimizer/zend_optimizer.h
@@ -39,9 +39,10 @@
#define ZEND_OPTIMIZER_PASS_12 (1<<11) /* Adjust used stack */
#define ZEND_OPTIMIZER_PASS_13 (1<<12)
#define ZEND_OPTIMIZER_PASS_14 (1<<13)
+#define ZEND_OPTIMIZER_PASS_15 (1<<14) /* Collect constants */
#define ZEND_OPTIMIZER_ALL_PASSES 0xFFFFFFFF
-#define DEFAULT_OPTIMIZATION_LEVEL "0xFFFFFFFF"
+#define DEFAULT_OPTIMIZATION_LEVEL "0xFFFFBFFF"
#endif
diff --git a/ext/opcache/tests/bug71127.phpt b/ext/opcache/tests/bug71127.phpt
index 78c5535062..5770aea1fb 100644
--- a/ext/opcache/tests/bug71127.phpt
+++ b/ext/opcache/tests/bug71127.phpt
@@ -3,6 +3,7 @@ Bug #71127 (Define in auto_prepend_file is overwrite)
--INI--
opcache.enable=1
opcache.enable_cli=1
+opcache.optimization_level=0xFFFFBFFF
--SKIPIF--
<?php if (!extension_loaded('Zend OPcache')) die("skip"); ?>
--FILE--