Changeset 993
- Timestamp:
- 07/18/2012 10:27:29 AM (10 months ago)
- Location:
- trunk
- Files:
-
- 5 modified
-
submodules/xc_coverager.h (modified) (1 diff)
-
submodules/xc_disassembler.c (modified) (2 diffs)
-
submodules/xc_disassembler.h (modified) (1 diff)
-
submodules/xc_optimizer.h (modified) (1 diff)
-
xcache.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/submodules/xc_coverager.h
r992 r993 11 11 PHP_FUNCTION(xcache_coverager_stop); 12 12 PHP_FUNCTION(xcache_coverager_get); 13 #define XCACHE_COVERAGER_FUNCTIONS() \ 14 PHP_FE(xcache_coverager_decode, NULL) \ 15 PHP_FE(xcache_coverager_start, NULL) \ 16 PHP_FE(xcache_coverager_stop, NULL) \ 17 PHP_FE(xcache_coverager_get, NULL) -
trunk/submodules/xc_disassembler.c
r987 r993 119 119 120 120 zval *output; 121 } xc_dasm_sandboxed_t; /* {{{ */ 122 123 zend_op_array *xc_dasm_sandboxed(void *data TSRMLS_DC) 121 } xc_dasm_sandboxed_t; /* }}} */ 122 zend_op_array *xc_dasm_sandboxed(void *data TSRMLS_DC) /* {{{ */ 124 123 { 125 124 zend_bool catched = 0; … … 189 188 } 190 189 /* }}} */ 190 191 /* {{{ proto array xcache_dasm_file(string filename) 192 Disassemble file into opcode array by filename */ 193 PHP_FUNCTION(xcache_dasm_file) 194 { 195 char *filename; 196 int filename_len; 197 198 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { 199 return; 200 } 201 if (!filename_len) RETURN_FALSE; 202 203 xc_dasm_file(return_value, filename TSRMLS_CC); 204 } 205 /* }}} */ 206 /* {{{ proto array xcache_dasm_string(string code) 207 Disassemble php code into opcode array */ 208 PHP_FUNCTION(xcache_dasm_string) 209 { 210 zval *code; 211 212 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &code) == FAILURE) { 213 return; 214 } 215 xc_dasm_string(return_value, code TSRMLS_CC); 216 } 217 /* }}} */ -
trunk/submodules/xc_disassembler.h
r982 r993 1 1 #include "php.h" 2 2 3 void xc_dasm_string(zval *return_value, zval *code TSRMLS_DC); 4 void xc_dasm_file(zval *return_value, const char *filename TSRMLS_DC); 3 PHP_FUNCTION(xcache_dasm_file); 4 PHP_FUNCTION(xcache_dasm_string); 5 #define XCACHE_DISASSEMBLER_FUNCTIONS() \ 6 PHP_FE(xcache_dasm_file, NULL) \ 7 PHP_FE(xcache_dasm_string, NULL) -
trunk/submodules/xc_optimizer.h
r982 r993 3 3 4 4 void xc_optimizer_op_array_handler(zend_op_array *op_array); 5 #define XCACHE_OPTIMIZER_FUNCTIONS() -
trunk/xcache.c
r992 r993 27 27 #include "ext/date/php_date.h" 28 28 #endif 29 #include "submodules/xc_optimizer.h" 30 #include "submodules/xc_coverager.h" 31 #include "submodules/xc_disassembler.h" 29 30 #ifdef HAVE_XCACHE_OPTIMIZER 31 # include "submodules/xc_optimizer.h" 32 #else 33 # define XCACHE_OPTIMIZER_FUNCTIONS() 34 #endif 35 #ifdef HAVE_XCACHE_COVERAGER 36 # include "submodules/xc_coverager.h" 37 #else 38 # define XCACHE_COVERAGER_FUNCTIONS() 39 #endif 40 #ifdef HAVE_XCACHE_DISASSEMBLER 41 # include "submodules/xc_disassembler.h" 42 #else 43 # define XCACHE_DISASSEMBLER_FUNCTIONS() 44 #endif 45 32 46 #include "xcache_globals.h" 33 47 #include "xc_processor.h" … … 3173 3187 #endif 3174 3188 /* }}} */ 3175 #ifdef HAVE_XCACHE_DISASSEMBLER3176 /* {{{ proto array xcache_dasm_file(string filename)3177 Disassemble file into opcode array by filename */3178 PHP_FUNCTION(xcache_dasm_file)3179 {3180 char *filename;3181 int filename_len;3182 3183 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {3184 return;3185 }3186 if (!filename_len) RETURN_FALSE;3187 3188 xc_dasm_file(return_value, filename TSRMLS_CC);3189 }3190 /* }}} */3191 /* {{{ proto array xcache_dasm_string(string code)3192 Disassemble php code into opcode array */3193 PHP_FUNCTION(xcache_dasm_string)3194 {3195 zval *code;3196 3197 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &code) == FAILURE) {3198 return;3199 }3200 xc_dasm_string(return_value, code TSRMLS_CC);3201 }3202 /* }}} */3203 #endif3204 3189 /* {{{ proto string xcache_encode(string filename) 3205 3190 Encode php file into XCache opcode encoded format */ … … 3374 3359 PHP_FE(xcache_clear_cache, NULL) 3375 3360 PHP_FE(xcache_coredump, NULL) 3361 XCACHE_OPTIMIZER_FUNCTIONS() 3376 3362 #ifdef HAVE_XCACHE_ASSEMBLER 3377 3363 PHP_FE(xcache_asm, NULL) 3378 3364 #endif 3379 #ifdef HAVE_XCACHE_DISASSEMBLER 3380 PHP_FE(xcache_dasm_file, NULL) 3381 PHP_FE(xcache_dasm_string, NULL) 3382 #endif 3365 XCACHE_DISASSEMBLER_FUNCTIONS() 3383 3366 #ifdef HAVE_XCACHE_ENCODER 3384 3367 PHP_FE(xcache_encode, NULL) … … 3388 3371 PHP_FE(xcache_decode_string, NULL) 3389 3372 #endif 3390 #ifdef HAVE_XCACHE_COVERAGER 3391 PHP_FE(xcache_coverager_decode, NULL) 3392 PHP_FE(xcache_coverager_start, NULL) 3393 PHP_FE(xcache_coverager_stop, NULL) 3394 PHP_FE(xcache_coverager_get, NULL) 3395 #endif 3373 XCACHE_COVERAGER_FUNCTIONS() 3396 3374 PHP_FE(xcache_get_special_value, NULL) 3397 3375 PHP_FE(xcache_get_type, NULL)

