diff options
author | Andi Gutmans <andi@php.net> | 2004-09-23 21:43:32 +0000 |
---|---|---|
committer | Andi Gutmans <andi@php.net> | 2004-09-23 21:43:32 +0000 |
commit | f82ed136259b8f12c1dbb29a3b2b8c398414ed1a (patch) | |
tree | dc453af45ed4d9f10685fffccffcdeaf098ca608 /Zend/zend_vm.h | |
parent | 1fc2b79172fb10030e499b0c40566dae1514a9d1 (diff) | |
download | php-git-f82ed136259b8f12c1dbb29a3b2b8c398414ed1a.tar.gz |
- Commit new VM architecture. This one allows people (aka Derick) to
- ask the engine to use function handler mode. Will update the README
- about that.
Diffstat (limited to 'Zend/zend_vm.h')
-rw-r--r-- | Zend/zend_vm.h | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/Zend/zend_vm.h b/Zend/zend_vm.h index f4a51b5e34..cac6b1629b 100644 --- a/Zend/zend_vm.h +++ b/Zend/zend_vm.h @@ -21,15 +21,24 @@ #ifndef ZEND_VM_H #define ZEND_VM_H +#define ZEND_VM_HAVE_OLD_EXECUTOR + #define ZEND_VM_KIND_CALL 1 #define ZEND_VM_KIND_SWITCH 2 #define ZEND_VM_KIND_GOTO 3 -/* #define ZEND_VM_KIND ZEND_VM_KIND_CALL */ -#define ZEND_VM_SPEC +#ifndef ZEND_VM_OLD_EXECUTOR +/*# define ZEND_VM_KIND ZEND_VM_KIND_CALL */ +# define ZEND_VM_SPEC +#endif /* don't edit the rest of the file */ +#ifdef ZEND_VM_HAVE_OLD_EXECUTOR +ZEND_API void zend_vm_use_old_executor(); +void zend_vm_set_opcode_handler(zend_op* opcode); +#endif + #define _CONST_CODE 0 #define _TMP_CODE 1 #define _VAR_CODE 2 @@ -43,7 +52,7 @@ # endif #endif -#if defined(__GNUC__) && !defined(__INTEL_COMPILER) +#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(ZEND_VM_OLD_EXECUTOR) # define ZEND_VM_ALWAYS_INLINE __attribute__ ((always_inline)) void zend_error_noreturn(int type, const char *format, ...) __attribute__ ((alias("zend_error"),noreturn)); /*extern void zend_error_noreturn(int type, const char *format, ...) __asm__("zend_error") __attribute__ ((noreturn));*/ @@ -55,8 +64,13 @@ void zend_error_noreturn(int type, const char *format, ...) __attribute__ ((alia #ifndef ZEND_VM_SPEC # define ZEND_VM_CODE(opcode, op1, op2) opcode # define ZEND_VM_SPEC_OPCODE(opcode, op1, op2) opcode -# define ZEND_VM_SET_OPCODE_HANDLER(opline) \ - opline->handler = zend_opcode_handlers[opline->opcode]; +# ifdef ZEND_VM_HAVE_OLD_EXECUTOR +# define ZEND_VM_SET_OPCODE_HANDLER(opline) \ + zend_vm_set_opcode_handler(opline) +# else +# define ZEND_VM_SET_OPCODE_HANDLER(opline) \ + opline->handler = zend_opcode_handlers[opline->opcode] +# endif #else static const int zend_vm_decode[] = { _UNUSED_CODE, /* 0 */ @@ -74,8 +88,13 @@ static const int zend_vm_decode[] = { opcode * 16 + op1 * 4 + op2 # define ZEND_VM_SPEC_OPCODE(opcode, op1, op2) \ ZEND_VM_CODE(opcode, zend_vm_decode[op1], zend_vm_decode[op2]) -# define ZEND_VM_SET_OPCODE_HANDLER(opline) \ - opline->handler = zend_opcode_handlers[ZEND_VM_SPEC_OPCODE(opline->opcode, opline->op1.op_type, opline->op2.op_type)] +# ifdef ZEND_VM_HAVE_OLD_EXECUTOR +# define ZEND_VM_SET_OPCODE_HANDLER(opline) \ + zend_vm_set_opcode_handler(opline) +# else +# define ZEND_VM_SET_OPCODE_HANDLER(opline) \ + opline->handler = zend_opcode_handlers[ZEND_VM_SPEC_OPCODE(opline->opcode, opline->op1.op_type, opline->op2.op_type)] +# endif #endif |