> a) Performance wise the right thing to do is to use static labels and > pre-compute them during compile-time (I remembered you were aware of that). > b) We therefore should not require an additional opcode for goto. > I did consider that, but the idea of computed targets (goto "foo$bar";) souded sexy enough to go with. Someone suggested mixing pre-computed static gotos (using ZEND_JMP) and runtime dynamic gotos (using ZEND_GOTO) to get the best of speed and flexibility.
I don't think we should be using computed targets. It'd be more of a nightmare than sexy. I prefer doing as much at compile-time as possible and I don't think that allowing indirect goto's would lead to anything than chaos. Most arguments in favor of goto were for circumstances where this would not be required. (And yes, even if we pre-compute what we can and add the hash and opcode for the instances we can't pre-compute I think it's a very bad idea). I feel about 1000 times stronger about that than goto :)
> c) I don't think you are creating the necessary switch_free's and other > frees when jumping out of a scope unexpectedly. > Entirely possible. The tests I've run don't complain but that doesn't mean something bad isn't happening.
Leaks but it's not always easy to reproduce those.
> d) Due to (c) it would make it pretty much impossible to jump into code > blocks (i.e. the C# example). > Again, for some reason it "works" in my simple test cases, but it sounds like I need to do some more digging and find out what's not being done and where it'll break in more complex code.
You will have situations where values accessed by the engine are not initialized and therefore most probably crash. There is no magic bullet solution and I assume C# has this limitation for similar reasons (Although I have no idea).
> Again, I in no way meant to offend you, I just got the impression you > were aware of some of these problems and just did it for fun. > Assumptions are bad, and I've made my own fair number, but if I thought there were significant problems I wouldn't have let anyone see the code in the first place. :)
I only thought that because I remembered seeing you mention a couple but I was obviously wrong :)
Andi
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php