source: trunk/opcode_spec.c @ 393

Last change on this file since 393 was 393, checked in by moo, 7 years ago

set svn:eol-style

  • Property svn:eol-style set to native
File size: 1019 bytes
RevLine 
[1]1#include "xcache.h"
2#include "opcode_spec.h"
3#include "const_string.h"
4
[8]5#ifdef HAVE_XCACHE_OPCODE_SPEC_DEF
[1]6/* {{{ opcode_spec */
7#define OPSPEC(ext, op1, op2, res) { OPSPEC_##ext, OPSPEC_##op1, OPSPEC_##op2, OPSPEC_##res },
8#ifdef ZEND_ENGINE_2
9#   define OPSPEC_VAR_2 OPSPEC_STD
10#else
11#   define OPSPEC_VAR_2 OPSPEC_VAR
12#endif
13#include "opcode_spec_def.h"
14
[20]15zend_uchar xc_get_opcode_spec_count()
[1]16{
17    return sizeof(xc_opcode_spec) / sizeof(xc_opcode_spec[0]);
18}
19
20const xc_opcode_spec_t *xc_get_opcode_spec(zend_uchar opcode)
21{
22    assert(xc_get_opcode_count() == xc_get_opcode_spec_count());
23    assert(opcode < xc_get_opcode_spec_count());
24    return &xc_opcode_spec[opcode];
25}
26/* }}} */
[8]27#endif
[1]28/* {{{ op_spec */
29
30#define OPSPECS_DEF_NAME(name) #name,
31static const char *xc_op_spec[] = { OPSPECS(OPSPECS_DEF_NAME) };
32
[20]33zend_uchar xc_get_op_spec_count()
[1]34{
35    return sizeof(xc_op_spec) / sizeof(xc_op_spec[0]);
36}
37
38const char *xc_get_op_spec(zend_uchar spec)
39{
40    assert(spec < xc_get_op_spec_count());
41    return xc_op_spec[spec];
42}
43/* }}} */
Note: See TracBrowser for help on using the repository browser.