1999-04-08 02:10:10 +08:00
|
|
|
/*
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
| Zend Engine |
|
|
|
|
+----------------------------------------------------------------------+
|
2015-01-15 23:27:30 +08:00
|
|
|
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
1999-04-08 02:10:10 +08:00
|
|
|
+----------------------------------------------------------------------+
|
2001-12-11 23:16:21 +08:00
|
|
|
| This source file is subject to version 2.00 of the Zend license, |
|
2012-10-05 14:14:20 +08:00
|
|
|
| that is bundled with this package in the file LICENSE, and is |
|
2003-06-11 04:04:29 +08:00
|
|
|
| available through the world-wide-web at the following url: |
|
2001-12-11 23:16:21 +08:00
|
|
|
| http://www.zend.com/license/2_00.txt. |
|
1999-07-16 22:58:16 +08:00
|
|
|
| If you did not receive a copy of the Zend license and are unable to |
|
|
|
|
| obtain it through the world-wide-web, please send a note to |
|
|
|
|
| license@zend.com so we can mail you a copy immediately. |
|
1999-04-08 02:10:10 +08:00
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
| Authors: Andi Gutmans <andi@zend.com> |
|
|
|
|
| Zeev Suraski <zeev@zend.com> |
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
*/
|
|
|
|
|
2003-02-01 09:49:15 +08:00
|
|
|
/* $Id$ */
|
1999-07-16 22:58:16 +08:00
|
|
|
|
2000-07-03 08:55:36 +08:00
|
|
|
#ifndef ZEND_EXECUTE_H
|
|
|
|
#define ZEND_EXECUTE_H
|
1999-04-08 02:10:10 +08:00
|
|
|
|
|
|
|
#include "zend_compile.h"
|
|
|
|
#include "zend_hash.h"
|
2001-07-29 16:24:38 +08:00
|
|
|
#include "zend_operators.h"
|
2006-05-10 07:53:23 +08:00
|
|
|
#include "zend_variables.h"
|
1999-04-08 02:10:10 +08:00
|
|
|
|
2002-05-20 15:17:30 +08:00
|
|
|
BEGIN_EXTERN_C()
|
2012-10-05 14:14:20 +08:00
|
|
|
struct _zend_fcall_info;
|
2014-12-14 06:06:14 +08:00
|
|
|
ZEND_API extern void (*zend_execute_ex)(zend_execute_data *execute_data);
|
|
|
|
ZEND_API extern void (*zend_execute_internal)(zend_execute_data *execute_data, zval *return_value);
|
|
|
|
|
|
|
|
void init_executor(void);
|
|
|
|
void shutdown_executor(void);
|
|
|
|
void shutdown_destructors(void);
|
|
|
|
ZEND_API void zend_init_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value);
|
|
|
|
ZEND_API zend_execute_data *zend_create_generator_execute_data(zend_execute_data *call, zend_op_array *op_array, zval *return_value);
|
|
|
|
ZEND_API void zend_execute(zend_op_array *op_array, zval *return_value);
|
|
|
|
ZEND_API void execute_ex(zend_execute_data *execute_data);
|
|
|
|
ZEND_API void execute_internal(zend_execute_data *execute_data, zval *return_value);
|
|
|
|
ZEND_API zend_class_entry *zend_lookup_class(zend_string *name);
|
|
|
|
ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *key, int use_autoload);
|
2015-04-23 17:16:37 +08:00
|
|
|
ZEND_API zend_class_entry *zend_get_called_scope(zend_execute_data *ex);
|
|
|
|
ZEND_API zend_object *zend_get_this_object(zend_execute_data *ex);
|
2014-12-14 06:06:14 +08:00
|
|
|
ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name);
|
|
|
|
ZEND_API int zend_eval_stringl(char *str, size_t str_len, zval *retval_ptr, char *string_name);
|
|
|
|
ZEND_API int zend_eval_string_ex(char *str, zval *retval_ptr, char *string_name, int handle_exceptions);
|
|
|
|
ZEND_API int zend_eval_stringl_ex(char *str, size_t str_len, zval *retval_ptr, char *string_name, int handle_exceptions);
|
|
|
|
|
|
|
|
ZEND_API char * zend_verify_internal_arg_class_kind(const zend_internal_arg_info *cur_arg_info, char **class_name, zend_class_entry **pce);
|
|
|
|
ZEND_API char * zend_verify_arg_class_kind(const zend_arg_info *cur_arg_info, char **class_name, zend_class_entry **pce);
|
2015-03-19 00:23:09 +08:00
|
|
|
ZEND_API void zend_verify_arg_error(const zend_function *zf, uint32_t arg_num, const char *need_msg, const char *need_kind, const char *given_msg, const char *given_kind, zval *arg);
|
|
|
|
ZEND_API void zend_verify_return_error(const zend_function *zf, const char *need_msg, const char *need_kind, const char *returned_msg, const char *returned_kind);
|
2015-03-19 03:22:21 +08:00
|
|
|
ZEND_API void zend_verify_internal_return_error(const zend_function *zf, const char *need_msg, const char *need_kind, const char *returned_msg, const char *returned_kind);
|
2014-12-14 06:06:14 +08:00
|
|
|
|
|
|
|
static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value, zend_uchar value_type)
|
2014-11-25 01:33:27 +08:00
|
|
|
{
|
2015-04-03 06:32:20 +08:00
|
|
|
zend_refcounted *ref = NULL;
|
|
|
|
|
|
|
|
if ((value_type & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) {
|
|
|
|
ref = Z_COUNTED_P(value);
|
|
|
|
value = Z_REFVAL_P(value);
|
|
|
|
}
|
|
|
|
|
2014-11-25 01:33:27 +08:00
|
|
|
do {
|
2015-01-03 17:22:58 +08:00
|
|
|
if (UNEXPECTED(Z_REFCOUNTED_P(variable_ptr))) {
|
2014-11-25 01:33:27 +08:00
|
|
|
zend_refcounted *garbage;
|
|
|
|
|
|
|
|
if (Z_ISREF_P(variable_ptr)) {
|
|
|
|
variable_ptr = Z_REFVAL_P(variable_ptr);
|
|
|
|
if (EXPECTED(!Z_REFCOUNTED_P(variable_ptr))) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (Z_TYPE_P(variable_ptr) == IS_OBJECT &&
|
|
|
|
UNEXPECTED(Z_OBJ_HANDLER_P(variable_ptr, set) != NULL)) {
|
2014-12-14 06:06:14 +08:00
|
|
|
Z_OBJ_HANDLER_P(variable_ptr, set)(variable_ptr, value);
|
2014-11-25 01:33:27 +08:00
|
|
|
return variable_ptr;
|
|
|
|
}
|
|
|
|
if ((value_type & (IS_VAR|IS_CV)) && variable_ptr == value) {
|
|
|
|
return variable_ptr;
|
|
|
|
}
|
|
|
|
garbage = Z_COUNTED_P(variable_ptr);
|
|
|
|
if (--GC_REFCOUNT(garbage) == 0) {
|
|
|
|
ZVAL_COPY_VALUE(variable_ptr, value);
|
|
|
|
if (value_type == IS_CONST) {
|
|
|
|
/* IS_CONST can't be IS_OBJECT, IS_RESOURCE or IS_REFERENCE */
|
|
|
|
if (UNEXPECTED(Z_OPT_COPYABLE_P(variable_ptr))) {
|
|
|
|
zval_copy_ctor_func(variable_ptr);
|
|
|
|
}
|
2015-04-03 06:32:20 +08:00
|
|
|
} else if (value_type == IS_CV) {
|
2014-11-25 01:33:27 +08:00
|
|
|
if (UNEXPECTED(Z_OPT_REFCOUNTED_P(variable_ptr))) {
|
|
|
|
Z_ADDREF_P(variable_ptr);
|
|
|
|
}
|
2015-04-03 06:32:20 +08:00
|
|
|
} else if (/* value_type == IS_VAR && */ UNEXPECTED(ref)) {
|
|
|
|
if (UNEXPECTED(--GC_REFCOUNT(ref) == 0)) {
|
|
|
|
efree_size(ref, sizeof(zend_reference));
|
|
|
|
} else if (Z_OPT_REFCOUNTED_P(variable_ptr)) {
|
|
|
|
Z_ADDREF_P(variable_ptr);
|
|
|
|
}
|
2014-11-25 01:33:27 +08:00
|
|
|
}
|
2015-04-03 06:32:20 +08:00
|
|
|
zval_dtor_func_for_ptr(garbage);
|
2014-11-25 01:33:27 +08:00
|
|
|
return variable_ptr;
|
|
|
|
} else { /* we need to split */
|
|
|
|
/* optimized version of GC_ZVAL_CHECK_POSSIBLE_ROOT(variable_ptr) */
|
|
|
|
if ((Z_COLLECTABLE_P(variable_ptr)) &&
|
|
|
|
UNEXPECTED(!GC_INFO(garbage))) {
|
2014-12-14 06:06:14 +08:00
|
|
|
gc_possible_root(garbage);
|
2014-11-25 01:33:27 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} while (0);
|
|
|
|
|
|
|
|
ZVAL_COPY_VALUE(variable_ptr, value);
|
|
|
|
if (value_type == IS_CONST) {
|
|
|
|
/* IS_CONST can't be IS_OBJECT, IS_RESOURCE or IS_REFERENCE */
|
|
|
|
if (UNEXPECTED(Z_OPT_COPYABLE_P(variable_ptr))) {
|
|
|
|
zval_copy_ctor_func(variable_ptr);
|
|
|
|
}
|
2015-04-03 06:32:20 +08:00
|
|
|
} else if (value_type == IS_CV) {
|
2014-11-25 01:33:27 +08:00
|
|
|
if (UNEXPECTED(Z_OPT_REFCOUNTED_P(variable_ptr))) {
|
|
|
|
Z_ADDREF_P(variable_ptr);
|
|
|
|
}
|
2015-04-03 06:32:20 +08:00
|
|
|
} else if (/* value_type == IS_VAR && */ UNEXPECTED(ref)) {
|
|
|
|
if (UNEXPECTED(--GC_REFCOUNT(ref) == 0)) {
|
|
|
|
efree_size(ref, sizeof(zend_reference));
|
|
|
|
} else if (Z_OPT_REFCOUNTED_P(variable_ptr)) {
|
|
|
|
Z_ADDREF_P(variable_ptr);
|
|
|
|
}
|
2014-11-25 01:33:27 +08:00
|
|
|
}
|
|
|
|
return variable_ptr;
|
|
|
|
}
|
|
|
|
|
2014-12-14 06:06:14 +08:00
|
|
|
ZEND_API int zval_update_constant(zval *pp, zend_bool inline_change);
|
|
|
|
ZEND_API int zval_update_constant_ex(zval *pp, zend_bool inline_change, zend_class_entry *scope);
|
1999-04-08 02:10:10 +08:00
|
|
|
|
1999-04-13 02:29:09 +08:00
|
|
|
/* dedicated Zend executor functions - do not use! */
|
2008-01-24 17:41:39 +08:00
|
|
|
struct _zend_vm_stack {
|
2014-02-10 14:04:30 +08:00
|
|
|
zval *top;
|
|
|
|
zval *end;
|
2008-01-24 17:41:39 +08:00
|
|
|
zend_vm_stack prev;
|
|
|
|
};
|
|
|
|
|
2014-09-29 23:41:00 +08:00
|
|
|
#define ZEND_VM_STACK_HEADER_SLOTS \
|
2014-06-27 03:51:14 +08:00
|
|
|
((ZEND_MM_ALIGNED_SIZE(sizeof(struct _zend_vm_stack)) + ZEND_MM_ALIGNED_SIZE(sizeof(zval)) - 1) / ZEND_MM_ALIGNED_SIZE(sizeof(zval)))
|
|
|
|
|
2014-09-29 23:41:00 +08:00
|
|
|
#define ZEND_VM_STACK_ELEMETS(stack) \
|
|
|
|
(((zval*)(stack)) + ZEND_VM_STACK_HEADER_SLOTS)
|
|
|
|
|
2014-12-14 06:06:14 +08:00
|
|
|
ZEND_API void zend_vm_stack_init(void);
|
|
|
|
ZEND_API void zend_vm_stack_destroy(void);
|
|
|
|
ZEND_API void* zend_vm_stack_extend(size_t size);
|
2014-09-29 23:41:00 +08:00
|
|
|
|
2014-12-14 06:06:14 +08:00
|
|
|
static zend_always_inline zval* zend_vm_stack_alloc(size_t size)
|
2014-09-29 23:41:00 +08:00
|
|
|
{
|
2014-10-10 00:29:02 +08:00
|
|
|
char *top = (char*)EG(vm_stack_top);
|
2014-09-29 23:41:00 +08:00
|
|
|
|
2014-10-10 00:29:02 +08:00
|
|
|
if (UNEXPECTED(size > (size_t)(((char*)EG(vm_stack_end)) - top))) {
|
2014-12-14 06:06:14 +08:00
|
|
|
return (zval*)zend_vm_stack_extend(size);
|
2014-09-29 23:41:00 +08:00
|
|
|
}
|
2014-10-10 00:29:02 +08:00
|
|
|
EG(vm_stack_top) = (zval*)(top + size);
|
2014-09-29 23:41:00 +08:00
|
|
|
return (zval*)top;
|
2008-01-24 17:41:39 +08:00
|
|
|
}
|
|
|
|
|
2015-04-15 22:02:21 +08:00
|
|
|
static zend_always_inline zend_execute_data *zend_vm_stack_push_call_frame_ex(uint32_t used_stack, uint32_t call_info, zend_function *func, uint32_t num_args, zend_class_entry *called_scope, zend_object *object)
|
2014-06-24 06:17:16 +08:00
|
|
|
{
|
2014-12-14 06:06:14 +08:00
|
|
|
zend_execute_data *call = (zend_execute_data*)zend_vm_stack_alloc(used_stack);
|
2014-12-12 14:01:42 +08:00
|
|
|
|
2014-06-24 06:17:16 +08:00
|
|
|
call->func = func;
|
2014-11-28 15:33:03 +08:00
|
|
|
Z_OBJ(call->This) = object;
|
|
|
|
ZEND_SET_CALL_INFO(call, call_info);
|
2014-12-16 23:40:52 +08:00
|
|
|
ZEND_CALL_NUM_ARGS(call) = num_args;
|
2014-10-07 22:12:09 +08:00
|
|
|
call->called_scope = called_scope;
|
2014-06-24 06:17:16 +08:00
|
|
|
return call;
|
|
|
|
}
|
|
|
|
|
2014-12-12 14:01:42 +08:00
|
|
|
static zend_always_inline uint32_t zend_vm_calc_used_stack(uint32_t num_args, zend_function *func)
|
|
|
|
{
|
|
|
|
uint32_t used_stack = ZEND_CALL_FRAME_SLOT + num_args;
|
2015-01-03 17:22:58 +08:00
|
|
|
|
2014-12-12 14:01:42 +08:00
|
|
|
if (ZEND_USER_CODE(func->type)) {
|
|
|
|
used_stack += func->op_array.last_var + func->op_array.T - MIN(func->op_array.num_args, num_args);
|
|
|
|
}
|
|
|
|
return used_stack * sizeof(zval);
|
|
|
|
}
|
|
|
|
|
2015-04-15 22:02:21 +08:00
|
|
|
static zend_always_inline zend_execute_data *zend_vm_stack_push_call_frame(uint32_t call_info, zend_function *func, uint32_t num_args, zend_class_entry *called_scope, zend_object *object)
|
2014-12-12 14:01:42 +08:00
|
|
|
{
|
|
|
|
uint32_t used_stack = zend_vm_calc_used_stack(num_args, func);
|
2015-01-03 17:22:58 +08:00
|
|
|
|
2014-12-16 23:40:52 +08:00
|
|
|
return zend_vm_stack_push_call_frame_ex(used_stack, call_info,
|
2015-04-15 22:02:21 +08:00
|
|
|
func, num_args, called_scope, object);
|
2014-12-12 14:01:42 +08:00
|
|
|
}
|
|
|
|
|
2015-04-16 17:16:03 +08:00
|
|
|
static zend_always_inline void zend_vm_stack_free_extra_args_ex(uint32_t call_info, zend_execute_data *call)
|
2012-10-05 14:14:20 +08:00
|
|
|
{
|
2015-04-16 19:46:54 +08:00
|
|
|
if (UNEXPECTED(call_info & ZEND_CALL_FREE_EXTRA_ARGS)) {
|
2014-12-27 03:34:44 +08:00
|
|
|
zval *end = ZEND_CALL_VAR_NUM(call, call->func->op_array.last_var + call->func->op_array.T);
|
|
|
|
zval *p = end + (ZEND_CALL_NUM_ARGS(call) - call->func->op_array.num_args);
|
2014-06-27 03:51:14 +08:00
|
|
|
do {
|
|
|
|
p--;
|
2015-04-17 02:45:40 +08:00
|
|
|
if (Z_REFCOUNTED_P(p)) {
|
|
|
|
if (!Z_DELREF_P(p)) {
|
|
|
|
zend_refcounted *r = Z_COUNTED_P(p);
|
|
|
|
ZVAL_NULL(p);
|
|
|
|
zval_dtor_func_for_ptr(r);
|
|
|
|
} else {
|
|
|
|
GC_ZVAL_CHECK_POSSIBLE_ROOT(p);
|
|
|
|
}
|
|
|
|
}
|
2014-06-27 03:51:14 +08:00
|
|
|
} while (p != end);
|
|
|
|
}
|
2009-09-03 22:33:11 +08:00
|
|
|
}
|
|
|
|
|
2015-04-16 17:16:03 +08:00
|
|
|
static zend_always_inline void zend_vm_stack_free_extra_args(zend_execute_data *call)
|
|
|
|
{
|
|
|
|
zend_vm_stack_free_extra_args_ex(ZEND_CALL_INFO(call), call);
|
|
|
|
}
|
|
|
|
|
2014-12-14 06:06:14 +08:00
|
|
|
static zend_always_inline void zend_vm_stack_free_args(zend_execute_data *call)
|
2000-06-14 01:58:33 +08:00
|
|
|
{
|
2014-11-28 15:28:49 +08:00
|
|
|
uint32_t num_args = ZEND_CALL_NUM_ARGS(call);
|
2000-06-14 01:58:33 +08:00
|
|
|
|
2014-12-17 17:16:02 +08:00
|
|
|
if (EXPECTED(num_args > 0)) {
|
2014-07-07 19:50:44 +08:00
|
|
|
zval *end = ZEND_CALL_ARG(call, 1);
|
|
|
|
zval *p = end + num_args;
|
2014-06-27 16:25:36 +08:00
|
|
|
|
2014-06-16 17:25:23 +08:00
|
|
|
do {
|
|
|
|
p--;
|
2015-04-17 02:45:40 +08:00
|
|
|
if (Z_REFCOUNTED_P(p)) {
|
|
|
|
if (!Z_DELREF_P(p)) {
|
|
|
|
zend_refcounted *r = Z_COUNTED_P(p);
|
|
|
|
ZVAL_NULL(p);
|
|
|
|
zval_dtor_func_for_ptr(r);
|
|
|
|
}
|
|
|
|
}
|
2014-06-16 17:25:23 +08:00
|
|
|
} while (p != end);
|
2000-06-14 01:58:33 +08:00
|
|
|
}
|
2014-06-27 03:51:14 +08:00
|
|
|
}
|
|
|
|
|
2014-12-14 06:06:14 +08:00
|
|
|
static zend_always_inline void zend_vm_stack_free_call_frame(zend_execute_data *call)
|
2014-06-27 03:51:14 +08:00
|
|
|
{
|
2014-10-10 00:29:02 +08:00
|
|
|
zend_vm_stack p = EG(vm_stack);
|
2014-09-30 19:19:51 +08:00
|
|
|
if (UNEXPECTED(ZEND_VM_STACK_ELEMETS(p) == (zval*)call)) {
|
2014-10-10 00:29:02 +08:00
|
|
|
zend_vm_stack prev = p->prev;
|
|
|
|
|
|
|
|
EG(vm_stack_top) = prev->top;
|
|
|
|
EG(vm_stack_end) = prev->end;
|
|
|
|
EG(vm_stack) = prev;
|
2014-06-27 03:51:14 +08:00
|
|
|
efree(p);
|
2012-12-13 21:29:30 +08:00
|
|
|
} else {
|
2014-10-10 00:29:02 +08:00
|
|
|
EG(vm_stack_top) = (zval*)call;
|
2012-12-13 21:29:30 +08:00
|
|
|
}
|
2000-06-14 01:58:33 +08:00
|
|
|
}
|
|
|
|
|
1999-04-08 02:10:10 +08:00
|
|
|
/* services */
|
2014-12-14 06:06:14 +08:00
|
|
|
ZEND_API const char *get_active_class_name(const char **space);
|
|
|
|
ZEND_API const char *get_active_function_name(void);
|
|
|
|
ZEND_API const char *zend_get_executed_filename(void);
|
2015-03-05 23:18:39 +08:00
|
|
|
ZEND_API zend_string *zend_get_executed_filename_ex(void);
|
2014-12-14 06:06:14 +08:00
|
|
|
ZEND_API uint zend_get_executed_lineno(void);
|
|
|
|
ZEND_API zend_bool zend_is_executing(void);
|
1999-04-08 02:10:10 +08:00
|
|
|
|
2014-08-26 01:24:55 +08:00
|
|
|
ZEND_API void zend_set_timeout(zend_long seconds, int reset_signals);
|
2014-12-14 06:06:14 +08:00
|
|
|
ZEND_API void zend_unset_timeout(void);
|
2000-07-02 23:39:54 +08:00
|
|
|
ZEND_API void zend_timeout(int dummy);
|
2014-12-14 06:06:14 +08:00
|
|
|
ZEND_API zend_class_entry *zend_fetch_class(zend_string *class_name, int fetch_type);
|
|
|
|
ZEND_API zend_class_entry *zend_fetch_class_by_name(zend_string *class_name, const zval *key, int fetch_type);
|
|
|
|
void zend_verify_abstract_class(zend_class_entry *ce);
|
2000-06-16 22:27:28 +08:00
|
|
|
|
2014-12-14 06:06:14 +08:00
|
|
|
ZEND_API void zend_fetch_dimension_by_zval(zval *result, zval *container, zval *dim);
|
2014-04-12 00:21:46 +08:00
|
|
|
|
2014-08-26 01:28:33 +08:00
|
|
|
ZEND_API zval* zend_get_compiled_variable_value(const zend_execute_data *execute_data_ptr, uint32_t var);
|
2005-01-22 10:29:18 +08:00
|
|
|
|
2005-06-10 17:54:38 +08:00
|
|
|
#define ZEND_USER_OPCODE_CONTINUE 0 /* execute next opcode */
|
|
|
|
#define ZEND_USER_OPCODE_RETURN 1 /* exit from executor (return from function) */
|
|
|
|
#define ZEND_USER_OPCODE_DISPATCH 2 /* call original opcode handler */
|
2009-08-18 18:12:32 +08:00
|
|
|
#define ZEND_USER_OPCODE_ENTER 3 /* enter into new op_array without recursion */
|
|
|
|
#define ZEND_USER_OPCODE_LEAVE 4 /* return to calling op_array within the same executor */
|
2005-06-10 17:54:38 +08:00
|
|
|
|
2005-06-16 14:00:48 +08:00
|
|
|
#define ZEND_USER_OPCODE_DISPATCH_TO 0x100 /* call original handler of returned opcode */
|
|
|
|
|
2008-06-11 21:18:41 +08:00
|
|
|
ZEND_API int zend_set_user_opcode_handler(zend_uchar opcode, user_opcode_handler_t handler);
|
|
|
|
ZEND_API user_opcode_handler_t zend_get_user_opcode_handler(zend_uchar opcode);
|
2005-06-10 17:54:38 +08:00
|
|
|
|
2005-06-16 19:50:08 +08:00
|
|
|
/* former zend_execute_locks.h */
|
2014-11-18 14:05:48 +08:00
|
|
|
typedef zval* zend_free_op;
|
2005-06-16 19:50:08 +08:00
|
|
|
|
2014-12-14 06:06:14 +08:00
|
|
|
ZEND_API zval *zend_get_zval_ptr(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type);
|
2005-06-16 19:50:08 +08:00
|
|
|
|
2014-12-14 06:06:14 +08:00
|
|
|
ZEND_API void zend_clean_and_cache_symbol_table(zend_array *symbol_table);
|
|
|
|
void zend_free_compiled_variables(zend_execute_data *execute_data);
|
2012-05-28 12:43:18 +08:00
|
|
|
|
2015-02-25 06:52:35 +08:00
|
|
|
#define CACHE_ADDR(num) \
|
|
|
|
((void**)((char*)EX_RUN_TIME_CACHE() + (num)))
|
|
|
|
|
2010-05-24 22:11:39 +08:00
|
|
|
#define CACHED_PTR(num) \
|
2015-02-25 06:52:35 +08:00
|
|
|
((void**)((char*)EX_RUN_TIME_CACHE() + (num)))[0]
|
2010-05-24 22:11:39 +08:00
|
|
|
|
|
|
|
#define CACHE_PTR(num, ptr) do { \
|
2015-02-25 06:52:35 +08:00
|
|
|
((void**)((char*)EX_RUN_TIME_CACHE() + (num)))[0] = (ptr); \
|
2010-05-24 22:11:39 +08:00
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define CACHED_POLYMORPHIC_PTR(num, ce) \
|
2015-02-25 06:52:35 +08:00
|
|
|
((((void**)((char*)EX_RUN_TIME_CACHE() + (num)))[0] == (void*)(ce)) ? \
|
|
|
|
((void**)((char*)EX_RUN_TIME_CACHE() + (num)))[1] : \
|
2010-05-24 22:11:39 +08:00
|
|
|
NULL)
|
|
|
|
|
|
|
|
#define CACHE_POLYMORPHIC_PTR(num, ce, ptr) do { \
|
2015-02-25 06:52:35 +08:00
|
|
|
void **slot = (void**)((char*)EX_RUN_TIME_CACHE() + (num)); \
|
|
|
|
slot[0] = (ce); \
|
|
|
|
slot[1] = (ptr); \
|
2014-04-17 20:36:04 +08:00
|
|
|
} while (0)
|
|
|
|
|
2014-07-08 00:54:31 +08:00
|
|
|
#define CACHED_PTR_EX(slot) \
|
|
|
|
(slot)[0]
|
2014-04-17 20:36:04 +08:00
|
|
|
|
2014-07-08 00:54:31 +08:00
|
|
|
#define CACHE_PTR_EX(slot, ptr) do { \
|
|
|
|
(slot)[0] = (ptr); \
|
2014-04-17 20:36:04 +08:00
|
|
|
} while (0)
|
|
|
|
|
2014-07-08 00:54:31 +08:00
|
|
|
#define CACHED_POLYMORPHIC_PTR_EX(slot, ce) \
|
|
|
|
(((slot)[0] == (ce)) ? (slot)[1] : NULL)
|
2014-04-17 20:36:04 +08:00
|
|
|
|
2014-07-08 00:54:31 +08:00
|
|
|
#define CACHE_POLYMORPHIC_PTR_EX(slot, ce, ptr) do { \
|
|
|
|
(slot)[0] = (ce); \
|
|
|
|
(slot)[1] = (ptr); \
|
2010-05-24 22:11:39 +08:00
|
|
|
} while (0)
|
|
|
|
|
2002-05-20 15:17:30 +08:00
|
|
|
END_EXTERN_C()
|
|
|
|
|
2000-07-03 08:55:36 +08:00
|
|
|
#endif /* ZEND_EXECUTE_H */
|
2003-02-01 09:49:15 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Local variables:
|
|
|
|
* tab-width: 4
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* indent-tabs-mode: t
|
|
|
|
* End:
|
|
|
|
*/
|