Re: [ZEND-ENGINE-CVS] Zend Opcode

From: Date: Thu, 29 May 2008 09:13:21 +0000
Subject: Re: [ZEND-ENGINE-CVS] Zend Opcode
References: 1 2  Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-6750@lists.php.net to get a copy of this message
Thanks.. but now.. i read the zend_vm_def.h ... ZEND_VM_HANDLER(1, ZEND_ADD, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) { zend_op *opline = EX(opline); zend_free_op free_op1, free_op2; add_function(&EX_T(opline->result.u.var).tmp_var, GET_OP1_ZVAL_PTR(BP_VAR_R), GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); FREE_OP1(); FREE_OP2(); ZEND_VM_NEXT_OPCODE(); where the add_function is defined? i want to create an intermediate form for all operation (function) in order to obtain a "readable" control flow graph.. i find the function in zend_operators.c but nothing for the array management! Thanks On Wed, May 28, 2008 at 4:58 PM, Etienne Kneuss <colder@php.net> wrote: > Hello, > > Take a look at Zend/zend_vm_def.h which defines how the opcodes will > get executed depending on their operands types. > This zend_vm_def.h is used to generate (using zend_vm_gen.php, not > automatically) zend_vm_execute.h which is the actual code being run. > > Regards > > On Wed, May 28, 2008 at 3:49 PM, Matteo Tamborini <teotambox@gmail.com> > wrote: > > In what way (in what file of zend source file list) i can find a c > > implementation of a opcode? > > > > i mean.. > > > > in e.g i have a ZEND_INIT_ARRAY; for this i understand that: > > > > Initializes an array with none or one element. > > > > Op1: Key of the first element or null > > Op2: Value of the first element or null > > Result: Array variable (!!!) > > > > Example: > > > > $arr = array(); > > $arr = array(1 => 2, 3 => 4); > > > > Gives: > > > > 0x9BF7F8 ZEND_INIT_ARRAY -, - => ~0 > > 0x9BF8B8 ZEND_INIT_ARRAY 2, 1 => ~2 > > > > where i can find a (c) definition of the ZEND_INIT_ARRAY? > > -all the operation that zend engine really do just before to translate > the > > operation in one bytecode (INIT_ARRAY in this case). > > > > > > -- > Etienne Kneuss > http://www.colder.ch > > Men never do evil so completely and cheerfully as > when they do it from a religious conviction. > -- Pascal >

« previous php.zend-engine.cvs (#6750) next »