【PHP筆記】 zend常用數據結構及宏

1、zend_execute_data:opcode執行期間非常重要的一個結構,記錄着當前執行的zend_op、返回值、所屬函數/對象指針、符號表等

struct _zend_execute_data {
    const zend_op       *opline;           /* executed opline 指向第一條opcode */
    zend_execute_data   *call;             /* current call                   */
    zval                *return_value;
    zend_function       *func;             /* executed op_array              */
    zval                 This;
#if ZEND_EX_USE_RUN_TIME_CACHE
    void               **run_time_cache;
#endif
#if ZEND_EX_USE_LITERALS
    zval                *literals;
#endif
    zend_class_entry    *called_scope;
    zend_execute_data   *prev_execute_data;
    zend_array          *symbol_table;
};

2、zend_op:zend指令

//zend.compile.h
struct _zend_op {
    const void *handler;  //該指令調用的處理函數
    znode_op op1; //操作數1
    znode_op op2; //操作數2
    znode_op result; 
    uint32_t extended_value;
    uint32_t lineno;
    zend_uchar opcode; //opcode指令編號
    zend_uchar op1_type; //操作數1類型
    zend_uchar op2_type; 
    zend_uchar result_type;
};



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章