summaryrefslogtreecommitdiff
path: root/Zend/zend_execute_API.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2008-03-18 08:36:49 +0000
committerDmitry Stogov <dmitry@php.net>2008-03-18 08:36:49 +0000
commitea9305c543823220d16ba17da0650eefcffb6e57 (patch)
tree72e7d7728b49b3ad6e5ac7b77597f2d357c0f43c /Zend/zend_execute_API.c
parenta0378d35146ba36e3449343b6fab908c9b062f03 (diff)
downloadphp-git-ea9305c543823220d16ba17da0650eefcffb6e57.tar.gz
Implemented concept of "delayed early binding" that allows opcode caches to perform class declaration (early and/or run-time binding) in exactly the same order as vanila php.
The following pseudo-code explains how it should be used in opcode cache. function cache_compile_file($filename) { if (!is_cached($filename)) { ... orig_compiler_options = CG(compiler_optins); CG(compiler_options) |= ZEND_COMPILE_IGNORE_INTERNAL_CLASSES | ZEND_COMPILE_DELAYED_BINDING; $op_array = orig_compile_file($filename); CG(compiler_options) = orig_copiler_options; ... } else { $op_array = restore_from_cache($filename); } zend_do_delayed_early_binding($op_array); }
Diffstat (limited to 'Zend/zend_execute_API.c')
-rw-r--r--Zend/zend_execute_API.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 216680ee3c..09d4b1cf7c 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -1409,7 +1409,7 @@ ZEND_API int zend_u_eval_string(zend_uchar type, zstr string, zval *retval_ptr,
zval pv;
zend_op_array *new_op_array;
zend_op_array *original_active_op_array = EG(active_op_array);
- zend_uchar original_handle_op_arrays;
+ zend_uint original_compiler_options;
int retval;
if (type == IS_UNICODE) {
@@ -1443,10 +1443,10 @@ ZEND_API int zend_u_eval_string(zend_uchar type, zstr string, zval *retval_ptr,
/*printf("Evaluating '%s'\n", Z_STRVAL(pv));*/
- original_handle_op_arrays = CG(handle_op_arrays);
- CG(handle_op_arrays) = 0;
+ original_compiler_options = CG(compiler_options);
+ CG(compiler_options) = ZEND_COMPILE_DEFAULT_FOR_EVAL;
new_op_array = zend_compile_string(&pv, string_name TSRMLS_CC);
- CG(handle_op_arrays) = original_handle_op_arrays;
+ CG(compiler_options) = original_compiler_options;
if (new_op_array) {
zval *local_retval_ptr=NULL;