Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 282 lines (197 sloc) 6.424 kb
573b460 @andigutmans Zend Library
andigutmans authored
1 /*
2 +----------------------------------------------------------------------+
3 | Zend Engine |
4 +----------------------------------------------------------------------+
d1dded8 MFH: Bump copyright year, 2 of 2.
Sebastian Bergmann authored
5 | Copyright (c) 1998-2008 Zend Technologies Ltd. (http://www.zend.com) |
573b460 @andigutmans Zend Library
andigutmans authored
6 +----------------------------------------------------------------------+
d863d52 Update headers.
Sebastian Bergmann authored
7 | This source file is subject to version 2.00 of the Zend license, |
b5b1117 @zsuraski License update
zsuraski authored
8 | that is bundled with this package in the file LICENSE, and is |
f68c7ff updating license information in the headers.
James Cox authored
9 | available through the world-wide-web at the following url: |
d863d52 Update headers.
Sebastian Bergmann authored
10 | http://www.zend.com/license/2_00.txt. |
b5b1117 @zsuraski License update
zsuraski authored
11 | If you did not receive a copy of the Zend license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@zend.com so we can mail you a copy immediately. |
573b460 @andigutmans Zend Library
andigutmans authored
14 +----------------------------------------------------------------------+
15 | Authors: Andi Gutmans <andi@zend.com> |
16 | Zeev Suraski <zeev@zend.com> |
17 +----------------------------------------------------------------------+
18 */
19
333406b - Added some missing CVS $Id$ tags, headers and footers.
foobar authored
20 /* $Id$ */
b5b1117 @zsuraski License update
zsuraski authored
21
a617217 Replace macros which begin with an underscore through an appropiately
Sascha Schumann authored
22 #ifndef ZEND_GLOBALS_H
23 #define ZEND_GLOBALS_H
573b460 @andigutmans Zend Library
andigutmans authored
24
99947a2 @andigutmans - Shift around header files.
andigutmans authored
25
573b460 @andigutmans Zend Library
andigutmans authored
26 #include <setjmp.h>
27
99947a2 @andigutmans - Shift around header files.
andigutmans authored
28 #include "zend_globals_macros.h"
29
573b460 @andigutmans Zend Library
andigutmans authored
30 #include "zend_stack.h"
31 #include "zend_ptr_stack.h"
32 #include "zend_hash.h"
33 #include "zend_llist.h"
6608f07 @smalyshev Mega-commit: Enter the new object model
smalyshev authored
34 #include "zend_objects.h"
f75f3cf @smalyshev Generalize object storage and reference bookkeeping
smalyshev authored
35 #include "zend_objects_API.h"
5230321 - Fix Reflection class names
Marcus Boerger authored
36 #include "zend_modules.h"
573b460 @andigutmans Zend Library
andigutmans authored
37
7a87fcb @zsuraski Thread safety patch. We're still not quite there but it compiles again,...
zsuraski authored
38 /* Define ZTS if you want a thread-safe Zend */
52fcaa4 @zsuraski Thread-safe project
zsuraski authored
39 /*#undef ZTS*/
573b460 @andigutmans Zend Library
andigutmans authored
40
41 #ifdef ZTS
1aa2c5c @zsuraski Ok, call me crazy, because I probably am.
zsuraski authored
42
43 BEGIN_EXTERN_C()
e06a1ed @zsuraski Thread safety fixes
zsuraski authored
44 ZEND_API extern int compiler_globals_id;
45 ZEND_API extern int executor_globals_id;
1aa2c5c @zsuraski Ok, call me crazy, because I probably am.
zsuraski authored
46 END_EXTERN_C()
47
573b460 @andigutmans Zend Library
andigutmans authored
48 #endif
49
50 #define SYMTABLE_CACHE_SIZE 32
51
52
53 #include "zend_compile.h"
54
b510a6d More portability stuff
Sascha Schumann authored
55 /* excpt.h on Digital Unix 4.0 defines function_table */
56 #undef function_table
fafbf6d @zsuraski - Implement declare() with declarables framework
zsuraski authored
57
58
59 typedef struct _zend_declarables {
60 zval ticks;
61 } zend_declarables;
62
0b68251 Changed EG(argument_stack) implementation.
Dmitry Stogov authored
63 typedef struct _zend_vm_stack *zend_vm_stack;
fafbf6d @zsuraski - Implement declare() with declarables framework
zsuraski authored
64
573b460 @andigutmans Zend Library
andigutmans authored
65 struct _zend_compiler_globals {
66 zend_stack bp_stack;
67 zend_stack switch_cond_stack;
22f066e @andigutmans - Add foreach() freeing code.
andigutmans authored
68 zend_stack foreach_copy_stack;
573b460 @andigutmans Zend Library
andigutmans authored
69 zend_stack object_stack;
fafbf6d @zsuraski - Implement declare() with declarables framework
zsuraski authored
70 zend_stack declare_stack;
573b460 @andigutmans Zend Library
andigutmans authored
71
26578c3 @andigutmans - Initial support for nested class definitions
andigutmans authored
72 zend_class_entry *active_class_entry;
573b460 @andigutmans Zend Library
andigutmans authored
73
74 /* variables for list() compilation */
75 zend_llist list_llist;
76 zend_llist dimension_llist;
43ebb86 @zsuraski Fix bug #10287 - avoid crashing under a bogus usage of list()
zsuraski authored
77 zend_stack list_stack;
573b460 @andigutmans Zend Library
andigutmans authored
78
79 zend_stack function_call_stack;
80
81 char *compiled_filename;
82
83 int zend_lineno;
86a0efc @zsuraski Fix #2744
zsuraski authored
84 int comment_start_line;
573b460 @andigutmans Zend Library
andigutmans authored
85 char *heredoc;
86 int heredoc_len;
87
88 zend_op_array *active_op_array;
89
90 HashTable *function_table; /* function symbol table */
91 HashTable *class_table; /* class table */
92
c34f41b @zsuraski Eliminate run-time leak with eval()'s
zsuraski authored
93 HashTable filenames_table;
573b460 @andigutmans Zend Library
andigutmans authored
94
9d11db1 @andigutmans - Merge new $_GET, $_POST etc. patch from Engine 1 tree
andigutmans authored
95 HashTable *auto_globals;
96
b6197bc @zsuraski Maintain a state of whether we're compiling and/or executing
zsuraski authored
97 zend_bool in_compilation;
9ece796 @zsuraski define zend_bool
zsuraski authored
98 zend_bool short_tags;
99 zend_bool asp_tags;
ced9cee @zsuraski - Implement return by reference:
zsuraski authored
100 zend_bool allow_call_time_pass_reference;
573b460 @andigutmans Zend Library
andigutmans authored
101
fafbf6d @zsuraski - Implement declare() with declarables framework
zsuraski authored
102 zend_declarables declarables;
103
573b460 @andigutmans Zend Library
andigutmans authored
104 /* For extensions support */
9ece796 @zsuraski define zend_bool
zsuraski authored
105 zend_bool extended_info; /* generate extension information for debugger/profiler */
106 zend_bool handle_op_arrays; /* run op_arrays through op_array handlers */
1aa2c5c @zsuraski Ok, call me crazy, because I probably am.
zsuraski authored
107
9ece796 @zsuraski define zend_bool
zsuraski authored
108 zend_bool unclean_shutdown;
87ba08d @zsuraski Avoid leaking fd's in case of failures
zsuraski authored
109
9596255 @zsuraski Final touches on the INI parser
zsuraski authored
110 zend_bool ini_parser_unbuffered_errors;
111
87ba08d @zsuraski Avoid leaking fd's in case of failures
zsuraski authored
112 zend_llist open_files;
85b4df5 @zsuraski Improved interactive mode - it is now available in all builds, without a...
zsuraski authored
113
f1e8815 @andigutmans - Change exception handling to use the Java-like catch(MyException $exce...
andigutmans authored
114 long catch_begin;
29f5dbe @andigutmans - Initial support for exceptions.
andigutmans authored
115
609d58a @zsuraski Merge from branch - move to standard C scanners in thread safe mode
zsuraski authored
116 struct _zend_ini_parser_param *ini_parser_param;
117
85b4df5 @zsuraski Improved interactive mode - it is now available in all builds, without a...
zsuraski authored
118 int interactive;
7ade3b3 @zsuraski Fix an off by one lineno issue, in case of an implicit ;
zsuraski authored
119
cf05f34 @zsuraski MFZE1 - lineno fix
zsuraski authored
120 zend_uint start_lineno;
7ade3b3 @zsuraski Fix an off by one lineno issue, in case of an implicit ;
zsuraski authored
121 zend_bool increment_lineno;
b90d80b @andigutmans - Initial patch to support importing from class scopes (for Stig).
andigutmans authored
122
26dd849 @zsuraski Add support for interfaces
zsuraski authored
123 znode implementing_class;
e062dff @zsuraski - Implement public/protected/private methods.
zsuraski authored
124
471947b @zsuraski Reimplement PPP properties
zsuraski authored
125 zend_uint access_type;
bdd3b60 Implement a different way to catch documentation comments.
Andrei Zmievski authored
126
127 char *doc_comment;
128 zend_uint doc_comment_len;
ab9dcec @fujimoto - added script encoding support to Zend Engine 2.
fujimoto authored
129
f32ffe9 Namespaces
Dmitry Stogov authored
130 zval *current_namespace;
131 HashTable *current_import;
132
8768ab9 Fixed bug #34729 (Crash in ZTS mode under Apache)
Dmitry Stogov authored
133 #ifdef ZTS
134 HashTable **static_members;
135 int last_static_member;
136 #endif
573b460 @andigutmans Zend Library
andigutmans authored
137 };
138
139
140 struct _zend_executor_globals {
ced9cee @zsuraski - Implement return by reference:
zsuraski authored
141 zval **return_value_ptr_ptr;
573b460 @andigutmans Zend Library
andigutmans authored
142
143 zval uninitialized_zval;
144 zval *uninitialized_zval_ptr;
145
146 zval error_zval;
147 zval *error_zval_ptr;
148
149 zend_ptr_stack arg_types_stack;
223c674 @zsuraski - Made things work again (Thies, everybody - please check the latest CVS...
zsuraski authored
150
573b460 @andigutmans Zend Library
andigutmans authored
151 /* symbol table cache */
152 HashTable *symtable_cache[SYMTABLE_CACHE_SIZE];
153 HashTable **symtable_cache_limit;
154 HashTable **symtable_cache_ptr;
155
156 zend_op **opline_ptr;
157
158 HashTable *active_symbol_table;
159 HashTable symbol_table; /* main symbol table */
160
5951b16 @andigutmans - Quick way of supporting include_once().
andigutmans authored
161 HashTable included_files; /* files already included */
5463dd5 @andigutmans - Add use support (behaves like require, but will not use the same file ...
andigutmans authored
162
14f6b91 Optimized zend_try/zend_catch macroses (eliminated memcpy())
Dmitry Stogov authored
163 jmp_buf *bailout;
573b460 @andigutmans Zend Library
andigutmans authored
164
165 int error_reporting;
fde2e61 @zsuraski error_reporting fix
zsuraski authored
166 int orig_error_reporting;
2ef6b68 Pass on the exit status
Sascha Schumann authored
167 int exit_status;
573b460 @andigutmans Zend Library
andigutmans authored
168
169 zend_op_array *active_op_array;
170
171 HashTable *function_table; /* function symbol table */
172 HashTable *class_table; /* class table */
173 HashTable *zend_constants; /* constants table */
174
90bd453 @andigutmans - Remove use of C++ reserved words namespace/this
andigutmans authored
175 zend_class_entry *scope;
166266d Added support for Late Static Binding. (Dmitry, Etienne Kneuss)
Dmitry Stogov authored
176 zend_class_entry *called_scope; /* Scope of the calling class */
4248619 @andigutmans - Initial work on changing namespace scope. Only methods & variables
andigutmans authored
177
90bd453 @andigutmans - Remove use of C++ reserved words namespace/this
andigutmans authored
178 zval *This;
a4248dd @andigutmans - Significantly improve the performance of method calls and $this->membe...
andigutmans authored
179
573b460 @andigutmans Zend Library
andigutmans authored
180 long precision;
181
fafbf6d @zsuraski - Implement declare() with declarables framework
zsuraski authored
182 int ticks_count;
183
b6197bc @zsuraski Maintain a state of whether we're compiling and/or executing
zsuraski authored
184 zend_bool in_execution;
55cf45a New autoload protection schema was implemented (Using HashTable instead ...
Dmitry Stogov authored
185 HashTable *in_autoload;
b7a8297 - Boost up __autoload() calls by caching the lookup
Marcus Boerger authored
186 zend_function *autoload_func;
aecd5b8 @zsuraski MFZE1
zsuraski authored
187 zend_bool full_tables_cleanup;
51d4958 @zsuraski Restore ZE1 compatibility mode (Zend Engine part - the modules patches
zsuraski authored
188 zend_bool ze1_compatibility_mode;
b6197bc @zsuraski Maintain a state of whether we're compiling and/or executing
zsuraski authored
189
573b460 @andigutmans Zend Library
andigutmans authored
190 /* for extended information support */
741ca16 @andigutmans - Fixed various inheritance problems & Andrey's leak
andigutmans authored
191 zend_bool no_extensions;
573b460 @andigutmans Zend Library
andigutmans authored
192
84eb48f @zsuraski Ok, this time here's some real Win32 system programming :)
zsuraski authored
193 #ifdef ZEND_WIN32
194 zend_bool timed_out;
195 #endif
196
573b460 @andigutmans Zend Library
andigutmans authored
197 HashTable regular_list;
198 HashTable persistent_list;
199
0b68251 Changed EG(argument_stack) implementation.
Dmitry Stogov authored
200 zend_vm_stack argument_stack;
1c0f136 @andigutmans - Hooray. This might actually work. (I hope)
andigutmans authored
201
a72c1ab @zsuraski Added error mask to set_error_handler()
zsuraski authored
202 int user_error_handler_error_reporting;
67f6974 @zsuraski Initial support for trapping errors (not complete and disabled; will be...
zsuraski authored
203 zval *user_error_handler;
fd0d44f @felipensp User error handlers no longer catch supressed errors (patch by Etienne K...
felipensp authored
204 zval *user_error_handler_old;
04788f9 @- Added set_exception_handler() function for registering a global,
Stig Bakken authored
205 zval *user_exception_handler;
a72c1ab @zsuraski Added error mask to set_error_handler()
zsuraski authored
206 zend_stack user_error_handlers_error_reporting;
34c2b0a @zsuraski - Add restore_error_handler()
zsuraski authored
207 zend_ptr_stack user_error_handlers;
04788f9 @- Added set_exception_handler() function for registering a global,
Stig Bakken authored
208 zend_ptr_stack user_exception_handlers;
67f6974 @zsuraski Initial support for trapping errors (not complete and disabled; will be...
zsuraski authored
209
fd0d44f @felipensp User error handlers no longer catch supressed errors (patch by Etienne K...
felipensp authored
210 zend_error_handling_t error_handling;
211 zend_class_entry *exception_class;
212
ef0bd3d @zsuraski - Move timeout code to Zend
zsuraski authored
213 /* timeout support */
214 int timeout_seconds;
215
0b7a9ce @zsuraski - Fix Win32 compilation (Use winsock2.h from now on)
zsuraski authored
216 int lambda_count;
217
8831b9c @andigutmans - MFZE1.
andigutmans authored
218 HashTable *ini_directives;
14cad8f Optimized shutdown sequence to iterate only over modified ini directives
Dmitry Stogov authored
219 HashTable *modified_ini_directives;
220
f75f3cf @smalyshev Generalize object storage and reference bookkeeping
smalyshev authored
221 zend_objects_store objects_store;
29f5dbe @andigutmans - Initial support for exceptions.
andigutmans authored
222 zval *exception;
9e60cb5 @zsuraski Rewrote exception support. Fixes a few limitations and bugs in the old
zsuraski authored
223 zend_op *opline_before_exception;
fa47e90 Changed exception handling. Now each op_array doesn't contain ZEND_HANDL...
Dmitry Stogov authored
224 zend_op exception_op[3];
54d5305 @zsuraski Make the INI mechanism thread safe (or at least thread safer :)
zsuraski authored
225
7e5ec2d @andigutmans Initial support for built-in backtracing.
andigutmans authored
226 struct _zend_execute_data *current_execute_data;
227
5230321 - Fix Reflection class names
Marcus Boerger authored
228 struct _zend_module_entry *current_module;
9e60cb5 @zsuraski Rewrote exception support. Fixes a few limitations and bugs in the old
zsuraski authored
229
fce275e @zsuraski Improve PPP handling of properties
zsuraski authored
230 zend_property_info std_property_info;
231
d6ee9d4 @tony2001 MFH: fix #38779 (engine crashes when require()'ing file with syntax erro...
tony2001 authored
232 zend_bool active;
233
b5f5e9a @andigutmans - Optimize the execute stack a bit.
andigutmans authored
234 void *reserved[ZEND_MAX_RESERVED_RESOURCES];
573b460 @andigutmans Zend Library
andigutmans authored
235 };
236
af31602 - Rewrite scanner to be based on re2c instead of flex
Marcus Boerger authored
237 struct _zend_ini_scanner_globals {
e52aac9 @wez Implement simple stream support in the ZE scanners.
wez authored
238 zend_file_handle *yy_in;
239 zend_file_handle *yy_out;
af31602 - Rewrite scanner to be based on re2c instead of flex
Marcus Boerger authored
240
241 unsigned int yy_leng;
242 unsigned char *yy_start;
243 unsigned char *yy_text;
244 unsigned char *yy_cursor;
245 unsigned char *yy_marker;
246 unsigned char *yy_limit;
247 int yy_state;
248 zend_stack state_stack;
249
250 char *filename;
fac8eaf MFZE1
Ilia Alshanetsky authored
251 int lineno;
af31602 - Rewrite scanner to be based on re2c instead of flex
Marcus Boerger authored
252
253 /* Modes are: ZEND_INI_SCANNER_NORMAL, ZEND_INI_SCANNER_RAW */
09b6f37 MFH:
Jani Taskinen authored
254 int scanner_mode;
af31602 - Rewrite scanner to be based on re2c instead of flex
Marcus Boerger authored
255 };
256
257 struct _zend_php_scanner_globals {
258 zend_file_handle *yy_in;
259 zend_file_handle *yy_out;
09b6f37 MFH:
Jani Taskinen authored
260
af31602 - Rewrite scanner to be based on re2c instead of flex
Marcus Boerger authored
261 unsigned int yy_leng;
262 unsigned char *yy_start;
263 unsigned char *yy_text;
264 unsigned char *yy_cursor;
265 unsigned char *yy_marker;
266 unsigned char *yy_limit;
267 int yy_state;
268 zend_stack state_stack;
269
270 zend_llist used_state_stacks;
609d58a @zsuraski Merge from branch - move to standard C scanners in thread safe mode
zsuraski authored
271 };
272
a617217 Replace macros which begin with an underscore through an appropiately
Sascha Schumann authored
273 #endif /* ZEND_GLOBALS_H */
333406b - Added some missing CVS $Id$ tags, headers and footers.
foobar authored
274
275 /*
276 * Local variables:
277 * tab-width: 4
278 * c-basic-offset: 4
279 * indent-tabs-mode: t
280 * End:
281 */
Something went wrong with that request. Please try again.