version 1.1.1.1, 2012/02/21 23:47:52
|
version 1.1.1.3, 2013/07/22 01:32:15
|
Line 2
|
Line 2
|
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| Zend Engine | |
| Zend Engine | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | | | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| This source file is subject to version 2.00 of the Zend license, | |
| This source file is subject to version 2.00 of the Zend license, | |
| that is bundled with this package in the file LICENSE, and is | |
| that is bundled with this package in the file LICENSE, and is | |
Line 35 typedef union _temp_variable {
|
Line 35 typedef union _temp_variable {
|
zend_bool fcall_returned_reference; |
zend_bool fcall_returned_reference; |
} var; |
} var; |
struct { |
struct { |
zval **ptr_ptr; | zval **ptr_ptr; /* shared with var.ptr_ptr */ |
zval *ptr; | |
zend_bool fcall_returned_reference; | |
zval *str; |
zval *str; |
zend_uint offset; |
zend_uint offset; |
} str_offset; |
} str_offset; |
struct { |
struct { |
zval **ptr_ptr; | zval **ptr_ptr; /* shared with var.ptr_ptr */ |
zval *ptr; | zval *ptr; /* shared with var.ptr */ |
zend_bool fcall_returned_reference; | |
HashPointer fe_pos; |
HashPointer fe_pos; |
} fe; |
} fe; |
zend_class_entry *class_entry; |
zend_class_entry *class_entry; |
Line 62 ZEND_API void execute(zend_op_array *op_array TSRMLS_D
|
Line 59 ZEND_API void execute(zend_op_array *op_array TSRMLS_D
|
ZEND_API void execute_internal(zend_execute_data *execute_data_ptr, int return_value_used TSRMLS_DC); |
ZEND_API void execute_internal(zend_execute_data *execute_data_ptr, int return_value_used TSRMLS_DC); |
ZEND_API int zend_is_true(zval *op); |
ZEND_API int zend_is_true(zval *op); |
#define safe_free_zval_ptr(p) safe_free_zval_ptr_rel(p ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) |
#define safe_free_zval_ptr(p) safe_free_zval_ptr_rel(p ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) |
static inline void safe_free_zval_ptr_rel(zval *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) | static zend_always_inline void safe_free_zval_ptr_rel(zval *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) |
{ |
{ |
TSRMLS_FETCH(); |
TSRMLS_FETCH(); |
|
|
Line 71 static inline void safe_free_zval_ptr_rel(zval *p ZEND
|
Line 68 static inline void safe_free_zval_ptr_rel(zval *p ZEND
|
} |
} |
} |
} |
ZEND_API int zend_lookup_class(const char *name, int name_length, zend_class_entry ***ce TSRMLS_DC); |
ZEND_API int zend_lookup_class(const char *name, int name_length, zend_class_entry ***ce TSRMLS_DC); |
ZEND_API int zend_lookup_class_ex(const char *name, int name_length, int use_autoload, zend_class_entry ***ce TSRMLS_DC); | ZEND_API int zend_lookup_class_ex(const char *name, int name_length, const zend_literal *key, int use_autoload, zend_class_entry ***ce TSRMLS_DC); |
ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name TSRMLS_DC); |
ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name TSRMLS_DC); |
ZEND_API int zend_eval_stringl(char *str, int str_len, zval *retval_ptr, char *string_name TSRMLS_DC); |
ZEND_API int zend_eval_stringl(char *str, int str_len, zval *retval_ptr, char *string_name TSRMLS_DC); |
ZEND_API int zend_eval_string_ex(char *str, zval *retval_ptr, char *string_name, int handle_exceptions TSRMLS_DC); |
ZEND_API int zend_eval_string_ex(char *str, zval *retval_ptr, char *string_name, int handle_exceptions TSRMLS_DC); |
ZEND_API int zend_eval_stringl_ex(char *str, int str_len, zval *retval_ptr, char *string_name, int handle_exceptions TSRMLS_DC); |
ZEND_API int zend_eval_stringl_ex(char *str, int str_len, zval *retval_ptr, char *string_name, int handle_exceptions TSRMLS_DC); |
|
|
static inline int i_zend_is_true(zval *op) | ZEND_API char * zend_verify_arg_class_kind(const zend_arg_info *cur_arg_info, ulong fetch_type, const char **class_name, zend_class_entry **pce TSRMLS_DC); |
| ZEND_API int zend_verify_arg_error(int error_type, const zend_function *zf, zend_uint arg_num, const char *need_msg, const char *need_kind, const char *given_msg, const char *given_kind TSRMLS_DC); |
| |
| static zend_always_inline void i_zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC) |
{ |
{ |
|
if (!Z_DELREF_P(zval_ptr)) { |
|
TSRMLS_FETCH(); |
|
|
|
if (zval_ptr != &EG(uninitialized_zval)) { |
|
GC_REMOVE_ZVAL_FROM_BUFFER(zval_ptr); |
|
zval_dtor(zval_ptr); |
|
efree_rel(zval_ptr); |
|
} |
|
} else { |
|
TSRMLS_FETCH(); |
|
|
|
if (Z_REFCOUNT_P(zval_ptr) == 1) { |
|
Z_UNSET_ISREF_P(zval_ptr); |
|
} |
|
|
|
GC_ZVAL_CHECK_POSSIBLE_ROOT(zval_ptr); |
|
} |
|
} |
|
|
|
static zend_always_inline int i_zend_is_true(zval *op) |
|
{ |
int result; |
int result; |
|
|
switch (Z_TYPE_P(op)) { |
switch (Z_TYPE_P(op)) { |
Line 140 ZEND_API int zval_update_constant_no_inline_change(zva
|
Line 161 ZEND_API int zval_update_constant_no_inline_change(zva
|
ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *scope TSRMLS_DC); |
ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *scope TSRMLS_DC); |
|
|
/* dedicated Zend executor functions - do not use! */ |
/* dedicated Zend executor functions - do not use! */ |
#define ZEND_VM_STACK_PAGE_SIZE ((64 * 1024) - 64) | #define ZEND_VM_STACK_PAGE_SIZE ((16 * 1024) - 16) |
|
|
struct _zend_vm_stack { |
struct _zend_vm_stack { |
void **top; |
void **top; |
Line 159 struct _zend_vm_stack {
|
Line 180 struct _zend_vm_stack {
|
} \ |
} \ |
} while (0) |
} while (0) |
|
|
static inline zend_vm_stack zend_vm_stack_new_page(int count) { | static zend_always_inline zend_vm_stack zend_vm_stack_new_page(int count) { |
zend_vm_stack page = (zend_vm_stack)emalloc(ZEND_MM_ALIGNED_SIZE(sizeof(*page)) + sizeof(void*) * count); |
zend_vm_stack page = (zend_vm_stack)emalloc(ZEND_MM_ALIGNED_SIZE(sizeof(*page)) + sizeof(void*) * count); |
|
|
page->top = ZEND_VM_STACK_ELEMETS(page); |
page->top = ZEND_VM_STACK_ELEMETS(page); |
Line 168 static inline zend_vm_stack zend_vm_stack_new_page(int
|
Line 189 static inline zend_vm_stack zend_vm_stack_new_page(int
|
return page; |
return page; |
} |
} |
|
|
static inline void zend_vm_stack_init(TSRMLS_D) | static zend_always_inline void zend_vm_stack_init(TSRMLS_D) |
{ |
{ |
EG(argument_stack) = zend_vm_stack_new_page(ZEND_VM_STACK_PAGE_SIZE); |
EG(argument_stack) = zend_vm_stack_new_page(ZEND_VM_STACK_PAGE_SIZE); |
} |
} |
|
|
static inline void zend_vm_stack_destroy(TSRMLS_D) | static zend_always_inline void zend_vm_stack_destroy(TSRMLS_D) |
{ |
{ |
zend_vm_stack stack = EG(argument_stack); |
zend_vm_stack stack = EG(argument_stack); |
|
|
Line 184 static inline void zend_vm_stack_destroy(TSRMLS_D)
|
Line 205 static inline void zend_vm_stack_destroy(TSRMLS_D)
|
} |
} |
} |
} |
|
|
static inline void zend_vm_stack_extend(int count TSRMLS_DC) | static zend_always_inline void zend_vm_stack_extend(int count TSRMLS_DC) |
{ |
{ |
zend_vm_stack p = zend_vm_stack_new_page(count >= ZEND_VM_STACK_PAGE_SIZE ? count : ZEND_VM_STACK_PAGE_SIZE); |
zend_vm_stack p = zend_vm_stack_new_page(count >= ZEND_VM_STACK_PAGE_SIZE ? count : ZEND_VM_STACK_PAGE_SIZE); |
p->prev = EG(argument_stack); |
p->prev = EG(argument_stack); |
EG(argument_stack) = p; |
EG(argument_stack) = p; |
} |
} |
|
|
static inline void **zend_vm_stack_top(TSRMLS_D) | static zend_always_inline void **zend_vm_stack_top(TSRMLS_D) |
{ |
{ |
return EG(argument_stack)->top; |
return EG(argument_stack)->top; |
} |
} |
|
|
static inline void zend_vm_stack_push(void *ptr TSRMLS_DC) | static zend_always_inline void zend_vm_stack_push(void *ptr TSRMLS_DC) |
{ |
{ |
ZEND_VM_STACK_GROW_IF_NEEDED(1); |
ZEND_VM_STACK_GROW_IF_NEEDED(1); |
*(EG(argument_stack)->top++) = ptr; |
*(EG(argument_stack)->top++) = ptr; |
} |
} |
|
|
static inline void zend_vm_stack_push_nocheck(void *ptr TSRMLS_DC) | static zend_always_inline void zend_vm_stack_push_nocheck(void *ptr TSRMLS_DC) |
{ |
{ |
*(EG(argument_stack)->top++) = ptr; |
*(EG(argument_stack)->top++) = ptr; |
} |
} |
|
|
static inline void *zend_vm_stack_pop(TSRMLS_D) | static zend_always_inline void *zend_vm_stack_pop(TSRMLS_D) |
{ |
{ |
void *el = *(--EG(argument_stack)->top); |
void *el = *(--EG(argument_stack)->top); |
|
|
Line 219 static inline void *zend_vm_stack_pop(TSRMLS_D)
|
Line 240 static inline void *zend_vm_stack_pop(TSRMLS_D)
|
return el; |
return el; |
} |
} |
|
|
static inline void *zend_vm_stack_alloc(size_t size TSRMLS_DC) | static zend_always_inline void *zend_vm_stack_alloc(size_t size TSRMLS_DC) |
{ |
{ |
void *ret; |
void *ret; |
|
|
Line 248 static inline void *zend_vm_stack_alloc(size_t size TS
|
Line 269 static inline void *zend_vm_stack_alloc(size_t size TS
|
return ret; |
return ret; |
} |
} |
|
|
static inline void zend_vm_stack_free_int(void *ptr TSRMLS_DC) | static zend_always_inline void zend_vm_stack_free_int(void *ptr TSRMLS_DC) |
{ |
{ |
if (UNEXPECTED(ZEND_VM_STACK_ELEMETS(EG(argument_stack)) == (void**)ptr)) { |
if (UNEXPECTED(ZEND_VM_STACK_ELEMETS(EG(argument_stack)) == (void**)ptr)) { |
zend_vm_stack p = EG(argument_stack); |
zend_vm_stack p = EG(argument_stack); |
Line 260 static inline void zend_vm_stack_free_int(void *ptr TS
|
Line 281 static inline void zend_vm_stack_free_int(void *ptr TS
|
} |
} |
} |
} |
|
|
static inline void zend_vm_stack_free(void *ptr TSRMLS_DC) | static zend_always_inline void zend_vm_stack_free(void *ptr TSRMLS_DC) |
{ |
{ |
if (UNEXPECTED(ZEND_VM_STACK_ELEMETS(EG(argument_stack)) == (void**)ptr)) { |
if (UNEXPECTED(ZEND_VM_STACK_ELEMETS(EG(argument_stack)) == (void**)ptr)) { |
zend_vm_stack p = EG(argument_stack); |
zend_vm_stack p = EG(argument_stack); |
Line 278 static inline void zend_vm_stack_free(void *ptr TSRMLS
|
Line 299 static inline void zend_vm_stack_free(void *ptr TSRMLS
|
} |
} |
} |
} |
|
|
static inline void** zend_vm_stack_push_args(int count TSRMLS_DC) | static zend_always_inline void** zend_vm_stack_push_args(int count TSRMLS_DC) |
{ |
{ |
|
|
if (UNEXPECTED(EG(argument_stack)->top - ZEND_VM_STACK_ELEMETS(EG(argument_stack)) < count) || |
if (UNEXPECTED(EG(argument_stack)->top - ZEND_VM_STACK_ELEMETS(EG(argument_stack)) < count) || |
Line 307 static inline void** zend_vm_stack_push_args(int count
|
Line 328 static inline void** zend_vm_stack_push_args(int count
|
return EG(argument_stack)->top++; |
return EG(argument_stack)->top++; |
} |
} |
|
|
static inline void zend_vm_stack_clear_multiple(TSRMLS_D) | static zend_always_inline void zend_vm_stack_clear_multiple(TSRMLS_D) |
{ |
{ |
void **p = EG(argument_stack)->top - 1; |
void **p = EG(argument_stack)->top - 1; |
int delete_count = (int)(zend_uintptr_t) *p; |
int delete_count = (int)(zend_uintptr_t) *p; |
Line 315 static inline void zend_vm_stack_clear_multiple(TSRMLS
|
Line 336 static inline void zend_vm_stack_clear_multiple(TSRMLS
|
while (--delete_count>=0) { |
while (--delete_count>=0) { |
zval *q = *(zval **)(--p); |
zval *q = *(zval **)(--p); |
*p = NULL; |
*p = NULL; |
zval_ptr_dtor(&q); | i_zval_ptr_dtor(q ZEND_FILE_LINE_CC); |
} |
} |
zend_vm_stack_free_int(p TSRMLS_CC); |
zend_vm_stack_free_int(p TSRMLS_CC); |
} |
} |
|
|
static inline zval** zend_vm_stack_get_arg(int requested_arg TSRMLS_DC) | static zend_always_inline zval** zend_vm_stack_get_arg(int requested_arg TSRMLS_DC) |
{ |
{ |
void **p = EG(current_execute_data)->prev_execute_data->function_state.arguments; |
void **p = EG(current_execute_data)->prev_execute_data->function_state.arguments; |
int arg_count = (int)(zend_uintptr_t) *p; |
int arg_count = (int)(zend_uintptr_t) *p; |
Line 331 static inline zval** zend_vm_stack_get_arg(int request
|
Line 352 static inline zval** zend_vm_stack_get_arg(int request
|
return (zval**)p - arg_count + requested_arg - 1; |
return (zval**)p - arg_count + requested_arg - 1; |
} |
} |
|
|
static inline void zend_arg_types_stack_2_pop(zend_ptr_stack *stack, zval **object, zend_function **fbc) | static zend_always_inline void zend_arg_types_stack_2_pop(zend_ptr_stack *stack, zval **object, zend_function **fbc) |
{ |
{ |
void *a, *b; |
void *a, *b; |
|
|
Line 341 static inline void zend_arg_types_stack_2_pop(zend_ptr
|
Line 362 static inline void zend_arg_types_stack_2_pop(zend_ptr
|
*fbc = (zend_function *) b; |
*fbc = (zend_function *) b; |
} |
} |
|
|
static inline void zend_arg_types_stack_3_pop(zend_ptr_stack *stack, zend_class_entry **called_scope, zval **object, zend_function **fbc) | static zend_always_inline void zend_arg_types_stack_3_pop(zend_ptr_stack *stack, zend_class_entry **called_scope, zval **object, zend_function **fbc) |
{ |
{ |
void *a, *b, *c; |
void *a, *b, *c; |
|
|
Line 356 void execute_new_code(TSRMLS_D);
|
Line 377 void execute_new_code(TSRMLS_D);
|
|
|
|
|
/* services */ |
/* services */ |
ZEND_API char *get_active_class_name(char **space TSRMLS_DC); | ZEND_API const char *get_active_class_name(const char **space TSRMLS_DC); |
ZEND_API char *get_active_function_name(TSRMLS_D); | ZEND_API const char *get_active_function_name(TSRMLS_D); |
ZEND_API char *zend_get_executed_filename(TSRMLS_D); | ZEND_API const char *zend_get_executed_filename(TSRMLS_D); |
ZEND_API uint zend_get_executed_lineno(TSRMLS_D); |
ZEND_API uint zend_get_executed_lineno(TSRMLS_D); |
ZEND_API zend_bool zend_is_executing(TSRMLS_D); |
ZEND_API zend_bool zend_is_executing(TSRMLS_D); |
|
|
Line 366 ZEND_API void zend_set_timeout(long seconds, int reset
|
Line 387 ZEND_API void zend_set_timeout(long seconds, int reset
|
ZEND_API void zend_unset_timeout(TSRMLS_D); |
ZEND_API void zend_unset_timeout(TSRMLS_D); |
ZEND_API void zend_timeout(int dummy); |
ZEND_API void zend_timeout(int dummy); |
ZEND_API zend_class_entry *zend_fetch_class(const char *class_name, uint class_name_len, int fetch_type TSRMLS_DC); |
ZEND_API zend_class_entry *zend_fetch_class(const char *class_name, uint class_name_len, int fetch_type TSRMLS_DC); |
|
ZEND_API zend_class_entry *zend_fetch_class_by_name(const char *class_name, uint class_name_len, const zend_literal *key, int fetch_type TSRMLS_DC); |
void zend_verify_abstract_class(zend_class_entry *ce TSRMLS_DC); |
void zend_verify_abstract_class(zend_class_entry *ce TSRMLS_DC); |
|
|
#ifdef ZEND_WIN32 |
#ifdef ZEND_WIN32 |
Line 404 typedef struct _zend_free_op {
|
Line 426 typedef struct _zend_free_op {
|
/* int is_var; */ |
/* int is_var; */ |
} zend_free_op; |
} zend_free_op; |
|
|
ZEND_API zval *zend_get_zval_ptr(znode *node, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC); | ZEND_API zval *zend_get_zval_ptr(int op_type, const znode_op *node, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC); |
ZEND_API zval **zend_get_zval_ptr_ptr(const znode *node, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC); | ZEND_API zval **zend_get_zval_ptr_ptr(int op_type, const znode_op *node, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC); |
|
|
ZEND_API int zend_do_fcall(ZEND_OPCODE_HANDLER_ARGS); |
ZEND_API int zend_do_fcall(ZEND_OPCODE_HANDLER_ARGS); |
|
|
|
#define CACHED_PTR(num) \ |
|
EG(active_op_array)->run_time_cache[(num)] |
|
|
|
#define CACHE_PTR(num, ptr) do { \ |
|
EG(active_op_array)->run_time_cache[(num)] = (ptr); \ |
|
} while (0) |
|
|
|
#define CACHED_POLYMORPHIC_PTR(num, ce) \ |
|
((EG(active_op_array)->run_time_cache[(num)] == (ce)) ? \ |
|
EG(active_op_array)->run_time_cache[(num) + 1] : \ |
|
NULL) |
|
|
|
#define CACHE_POLYMORPHIC_PTR(num, ce, ptr) do { \ |
|
EG(active_op_array)->run_time_cache[(num)] = (ce); \ |
|
EG(active_op_array)->run_time_cache[(num) + 1] = (ptr); \ |
|
} while (0) |
|
|
END_EXTERN_C() |
END_EXTERN_C() |
|
|