Commit Graph

109 Commits

Author SHA1 Message Date
Andi Gutmans
db507dd153 - Commit the variable fetch optimization.
- Extensions which delete global variables need to use new special function
- delete_global_variable() (I'm about to rename it) to remove them.
- Will post to internals@ or via commit messages if there's anything else.
2004-10-04 19:54:35 +00:00
Andi Gutmans
f82ed13625 - Commit new VM architecture. This one allows people (aka Derick) to
- ask the engine to use function handler mode. Will update the README
- about that.
2004-09-23 21:43:32 +00:00
Andi Gutmans
96ab56e146 - Roll back VM commit 2004-09-09 16:47:22 +00:00
Andi Gutmans
8eb8850c90 - Some architectural changes:
a) We specialize opcodes according to op_type fields. Each opcode has to
    be marked with which op_type's it uses.
 b) We support different execution methods. Function handlers, switch()
    and goto dispatching. goto seems to be the fastest but it really
    depends on the compiler and how well it optimizes. I suggest playing
    around with optimization flags.

- Warning: Things might break so keep us posted on how things are going.
  (Dmitry, Andi)
2004-09-08 22:14:12 +00:00
Sara Golemon
d96e7a170c Revert goto opcode 2004-07-29 17:45:31 +00:00
Sara Golemon
5865b3680a Add goto operator by popular request. 2004-07-29 15:23:47 +00:00
Stefan Esser
fb5cb59035 Fixed Zend Function Destructor to use correct TSRM handle. 2004-06-06 08:37:12 +00:00
Zeev Suraski
36a751840d - Abstract methods cannot have defaults for arguments
- Make function foo($a, $b=null) satisfy both foo($a) and foo($a, $b)
  prototypes
2004-02-25 09:25:37 +00:00
foobar
acf7a5e262 ws fix 2004-02-20 06:59:37 +00:00
Zeev Suraski
723641590a Optimize 2004-02-04 15:51:07 +00:00
Zeev Suraski
9e60cb553f Rewrote exception support. Fixes a few limitations and bugs in the old
implementation, and allows exceptions to 'fire' much earlier than before.

Instructions on how to use the new mechanism will follow on internals@
shortly...

Note - this (most probably) breaks the current implementation of
set_exception_handler()
2004-02-03 12:17:09 +00:00
foobar
ccfc46b0aa - Happy new year and PHP 5 for rest of the files too..
# Should the LICENSE and Zend/LICENSE dates be updated too?
2004-01-08 17:33:29 +00:00
Zeev Suraski
6f53e48bb9 This check shouldn't be necessary 2003-08-04 07:52:09 +00:00
Marcus Boerger
1f8fd69e78 Fix crash 2003-08-03 22:28:14 +00:00
Zeev Suraski
f8bbafd604 ntroduce infrastructure for supplying information about arguments,
including:

- Whether or not to pass by ref (replaces the old arg_types, with arg_info)
- Argument name (for future use, maybe introspection)
- Class/Interface name (for type hints)
- If a class/interface name is available, whether to allow a null instance

Both user and builtin functions share the same data structures.

To declare a builtin function that expects its first arg to be an instance
of class 'Person', its second argument as a regular arg, and its third by
reference, use:

ZEND_BEGIN_ARG_INFO(my_func_arg_info, 0)
    ZEND_ARG_OBJ_INFO(0, someone, Person, 1)
    ZEND_ARG_PASS_INFO(0)
    ZEND_ARG_PASS_INFO(1)
ZEND_END_ARG_INFO();

and use my_func_arg_info as the arg_info parameter to the ZEND_FE() family
of macros.

The first arg to each ZEND_ARG_*() macro is whether or not to pass by ref.

The boolean arg to ZEND_BEGIN_ARG_INFO() tells the engine whether to treat
the arguments for which there's no explicit information as pass by reference
or not.
The boolean argument to ZEND_ARG_OBJ_INFO() (4th arg) is whether or not to allownull values.
2003-08-03 17:40:44 +00:00
Stanislav Malyshev
237116aa27 Remove namespace leftovers 2003-07-23 08:58:46 +00:00
Andi Gutmans
288dacca0c - ZE coding style requires if ( instead of if( 2003-06-30 20:22:35 +00:00
James Cox
f68c7ff249 updating license information in the headers. 2003-06-10 20:04:29 +00:00
Stanislav Malyshev
f7f5a5ea6b MEGA-patch: namespaces are R.I.P. 2003-06-02 12:13:11 +00:00
Marcus Boerger
a023c1034b Bugfix #23670: implements and extends cause Apache 2 crash 2003-06-01 17:28:52 +00:00
Sterling Hughes
48b3303217 Patch by Marcus Börger to fix some memleaks 2003-04-18 18:40:53 +00:00
Andrei Zmievski
62f9eb8006 Split ZEND_NAMESPACE into user and internal namespaces. Hope this is
okay with engine folks.
2003-04-01 19:37:04 +00:00
Andrei Zmievski
5657b83691 Multi-purpose patch:
- The fields of zend_namespace were not completely initialized which
   led to a variety of problems.
 - The occurrence of class/interface/namespace definition is now
   captured.
 - Functions/classes/interfaces/namespaces can be preceded by doc
   comments which are stored for use by extensions.
2003-03-31 20:42:01 +00:00
Sebastian Bergmann
3fc852824f Eliminate TSRMLS_FETCH() calls in destroy_op_array() and zend_get_class_entry(). 2003-03-26 07:44:11 +00:00
Zeev Suraski
26dd8492ed Add support for interfaces 2003-03-05 11:14:44 +00:00
Stanislav Malyshev
e645f20d07 Allow namespaces to have a number of parts. I.e., now you can do:
namespace foo {
	function abc() {}
}
...
namespace foo {
	functio def() {}
}
2003-02-20 19:01:53 +00:00
Zeev Suraski
955636af69 Avoid using a C++ reserved word 2003-02-18 17:18:28 +00:00
Stanislav Malyshev
a4c3b2ce80 Namespace patch. Big changes:
1. Nested classes are gone.
2. New syntax for namespaces:
namespace foo {
	class X { ... }
	function bar { ... }
	var x = 1;
	const ZZ = 2;
}
3. Namespaced symbol access: $x = new foo::X; - etc.
For now, namespaces are case insensitive, just like classes.
Also, there can be no global class and namespace with the same name
(to avoid ambiguities in :: resolution).
2003-02-16 11:12:43 +00:00
Zeev Suraski
17439aa9c4 Rework static class properties - now supports access restrictions 2003-02-05 13:35:52 +00:00
Zeev Suraski
471947b188 Reimplement PPP properties 2003-02-04 12:12:34 +00:00
foobar
333406bdc2 - Added some missing CVS $Id$ tags, headers and footers. 2003-02-01 01:49:15 +00:00
Stanislav Malyshev
03f88ac2b2 Add additional stage to post-session cleanup.
We need separate cleanup stage because of the following problem:
Suppose we destroy class X, which destroys function table,
and in function table we have function foo() that has static $bar. Now if
object of class X was assigned to $bar, its destructor will be called and will
fail since X's function table is in mid-destruction.
So we want first of all to clean up all data and then move to tables
destruction.
Note that only run-time accessed data need to be cleaned up, pre-defined
data can not contain objects and thus are not probelmatic.
# Looks like we are having a lots of pain in the various parts of the body
# because of the destructors...
2003-01-29 17:54:48 +00:00
Sebastian Bergmann
2c5d4b8c23 Bump year. 2002-12-31 15:59:15 +00:00
Andi Gutmans
671fff2fde h WHitespace 2002-11-30 11:20:25 +00:00
Andi Gutmans
023836ae25 - Also tune jmpz_ex 2002-10-24 18:24:55 +00:00
Andi Gutmans
80109314b9 - Improve performance of part of the jmps. More to follow. 2002-10-24 18:04:12 +00:00
Andi Gutmans
536d4d8aab - Improve opcode dispatching 2002-10-19 09:45:51 +00:00
Andi Gutmans
bc5ea87e28 - Commit patch to support protected member variables (by Timm Friebe w/
- some fixes by me).
- You can't access protected variables from outside the object. If you want
- to see a protected member from your ancestors you need to declare the
- member as protected in the class you want to use it in. You can't
- redeclare a protected variable as private nor the other way around.
2002-07-15 18:09:56 +00:00
Harald Radi
51e797f1e3 some type cleanup work 2002-04-23 18:06:54 +00:00
Andi Gutmans
0ce019f715 - Fix issues with $this when using it by itself without indirection such as
- $this->foo.
2002-03-15 15:09:46 +00:00
Andi Gutmans
fb6976e46d - Another couple of indirection fixes.
- Make class_entry->refcount be part of the structure and not allocated.
2002-03-12 19:22:29 +00:00
Andi Gutmans
c8c629b3fc - Fix bug introduced with latest class hash table change. 2002-03-12 18:53:27 +00:00
Stanislav Malyshev
92dd5e611b - make class tables contain class_entry *, not class_entry
- fix isset($this)
2002-03-12 10:08:47 +00:00
Andi Gutmans
d1eea3de9c - Fix bug in nested try/catch's
- Infrastructure for implementing imports of methods.
2002-03-01 14:04:51 +00:00
Andi Gutmans
00e90f2ff3 - Experimental support for private members.
<?
	class MyClass {
		private $Hello = "Hello, World!\n";

		function printHello()
		{
			print $this->Hello;
		}
	}

	class MyClass2 extends MyClass {
		function printHello()
		{
			MyClass::printHello(); /* Should print */
			print $this->Hello; /* Shouldn't print out anything */
		}
	}

	$obj = new MyClass();
	print $obj->Hello; /* Shouldn't print out anything */
	$obj->printHello(); /* Should print */

	$obj = new MyClass2();
	print $obj->Hello; /* Shouldn't print out anything */
	$obj->printHello();
?>
2002-02-21 11:50:44 +00:00
Andi Gutmans
7309a6ed21 - First destructor hell fix. There was a situation where an object's
- destructor could be run after its class was already dead. Right now
- object destructors is the first thing whic happens during shutdown in
- order to prevent this problem. It's very likely that destructors will
- cause more grief and we'll have to outline exactly when you should use
- them and what kind of logic you're allowed to do inside of them.
- This bug was reported by sebastian.
2002-01-25 12:55:03 +00:00
Andi Gutmans
2131b019c7 - Improve performance of functions that use $GLOBALS[]
- Please check this and make sure it doesn't break anything.
2002-01-20 20:42:15 +00:00
Sebastian Bergmann
62dc854bb0 Happy New Year. 2002-01-06 15:21:36 +00:00
Andi Gutmans
f4b832d277 - Fix crash bug in startup code.
- Start work on being able to reference global and local scope
2001-12-13 16:55:04 +00:00
Andi Gutmans
4cb97fa3b9 - Rename zend_class_entry.constants -> zend_class_entry.constants_table 2001-12-11 18:46:43 +00:00