Add ability to disable JIT for a particular auto global

This commit is contained in:
Zeev Suraski 2004-03-16 19:46:04 +00:00
parent 6d7f04307d
commit e2a5ebf597
2 changed files with 13 additions and 1 deletions

View File

@ -98,6 +98,18 @@ int zend_auto_global_arm(zend_auto_global *auto_global TSRMLS_DC)
}
int zend_auto_global_disable_jit(char *varname, zend_uint varname_length TSRMLS_DC)
{
zend_auto_global *auto_global;
if (zend_hash_find(CG(auto_globals), varname, varname_length+1, (void **) &auto_global)==FAILURE) {
return FAILURE;
}
auto_global->armed = 0;
return SUCCESS;
}
static void init_compiler_declarables(TSRMLS_D)
{
CG(declarables).ticks.type = IS_LONG;
@ -105,7 +117,6 @@ static void init_compiler_declarables(TSRMLS_D)
}
void zend_init_compiler_data_structures(TSRMLS_D)
{
zend_stack_init(&CG(bp_stack));

View File

@ -529,6 +529,7 @@ typedef struct _zend_auto_global {
void zend_auto_global_dtor(zend_auto_global *auto_global);
ZEND_API int zend_register_auto_global(char *name, uint name_len, zend_auto_global_callback auto_global_callback TSRMLS_DC);
ZEND_API zend_bool zend_is_auto_global(char *name, uint name_len TSRMLS_DC);
ZEND_API int zend_auto_global_disable_jit(char *varname, zend_uint varname_length TSRMLS_DC);
int zendlex(znode *zendlval TSRMLS_DC);