diff options
| author | Dmitry Stogov <dmitry@php.net> | 2008-03-18 08:36:30 +0000 |
|---|---|---|
| committer | Dmitry Stogov <dmitry@php.net> | 2008-03-18 08:36:30 +0000 |
| commit | 8c885b89130e3549297316c0769b27d9d3657902 (patch) | |
| tree | fb311427f56f1cf255c0065bf1720aa4275fd1b9 /Zend/zend.c | |
| parent | 7c8ff91218425d8976ada68b7743eef8a1b4ba5c (diff) | |
| download | php-git-8c885b89130e3549297316c0769b27d9d3657902.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.c')
| -rw-r--r-- | Zend/zend.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Zend/zend.c b/Zend/zend.c index 5d8eeffd01..97fe82080c 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -443,15 +443,15 @@ static void register_standard_class(TSRMLS_D) /* {{{ */ /* }}} */ #ifdef ZTS -static zend_bool asp_tags_default = 0; -static zend_bool short_tags_default = 1; -static zend_bool ct_pass_ref_default = 1; -static zend_bool extended_info_default = 0; +static zend_bool asp_tags_default = 0; +static zend_bool short_tags_default = 1; +static zend_bool ct_pass_ref_default = 1; +static zend_uint compiler_options_default = ZEND_COMPILE_DEFAULT; #else -# define asp_tags_default 0 -# define short_tags_default 1 -# define ct_pass_ref_default 1 -# define extended_info_default 0 +# define asp_tags_default 0 +# define short_tags_default 1 +# define ct_pass_ref_default 1 +# define compiler_options_default ZEND_COMPILE_DEFAULT #endif static void zend_set_default_compile_time_values(TSRMLS_D) /* {{{ */ @@ -460,7 +460,7 @@ static void zend_set_default_compile_time_values(TSRMLS_D) /* {{{ */ CG(asp_tags) = asp_tags_default; CG(short_tags) = short_tags_default; CG(allow_call_time_pass_reference) = ct_pass_ref_default; - CG(extended_info) = extended_info_default; + CG(compiler_options) = compiler_options_default; } /* }}} */ @@ -721,7 +721,7 @@ void zend_post_startup(TSRMLS_D) /* {{{ */ asp_tags_default = CG(asp_tags); short_tags_default = CG(short_tags); ct_pass_ref_default = CG(allow_call_time_pass_reference); - extended_info_default = CG(extended_info); + compiler_options_default = CG(compiler_options); zend_destroy_rsrc_list(&EG(persistent_list) TSRMLS_CC); free(compiler_globals->function_table); |
