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_globals.h | |
| 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_globals.h')
| -rw-r--r-- | Zend/zend_globals.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h index 8253ff3ba0..b387c5db1a 100644 --- a/Zend/zend_globals.h +++ b/Zend/zend_globals.h @@ -55,6 +55,9 @@ END_EXTERN_C() /* excpt.h on Digital Unix 4.0 defines function_table */ #undef function_table +#define ZEND_EARLY_BINDING_COMPILE_TIME 0 +#define ZEND_EARLY_BINDING_DELAYED 1 +#define ZEND_EARLY_BINDING_DELAYED_ALL 2 typedef struct _zend_declarables { zval ticks; @@ -101,10 +104,6 @@ struct _zend_compiler_globals { zend_declarables declarables; - /* For extensions support */ - zend_bool extended_info; /* generate extension information for debugger/profiler */ - zend_bool handle_op_arrays; /* run op_arrays through op_array handlers */ - zend_bool unclean_shutdown; zend_bool ini_parser_unbuffered_errors; @@ -127,6 +126,8 @@ struct _zend_compiler_globals { char *doc_comment; zend_uint doc_comment_len; + zend_uint compiler_options; /* set of ZEND_COMPILE_* constants */ + zval *current_namespace; HashTable *current_import; |
