]> granicus.if.org Git - php/commit
Implemented concept of "delayed early binding" that allows opcode caches to perform...
authorDmitry Stogov <dmitry@php.net>
Tue, 18 Mar 2008 08:36:30 +0000 (08:36 +0000)
committerDmitry Stogov <dmitry@php.net>
Tue, 18 Mar 2008 08:36:30 +0000 (08:36 +0000)
commit8c885b89130e3549297316c0769b27d9d3657902
treefb311427f56f1cf255c0065bf1720aa4275fd1b9
parent7c8ff91218425d8976ada68b7743eef8a1b4ba5c
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);
}
13 files changed:
NEWS
Zend/zend.c
Zend/zend_compile.c
Zend/zend_compile.h
Zend/zend_execute_API.c
Zend/zend_globals.h
Zend/zend_opcode.c
Zend/zend_vm_def.h
Zend/zend_vm_execute.h
Zend/zend_vm_opcodes.h
sapi/cgi/cgi_main.c
sapi/cli/php_cli.c
sapi/milter/php_milter.c