Commit Graph

1117 Commits

Author SHA1 Message Date
Dmitry Stogov
7f39ee7159 Delay checks for undefined CV variables after checks for fast paths. 2015-06-05 01:53:32 +03:00
Dmitry Stogov
aca6a1a1c9 Convert "switch" into series of "if". This allows better fast-path placement, additional specialization and makes final code less. 2015-06-04 19:14:16 +03:00
Dmitry Stogov
0040efb170 Avoid useless copying and duplication 2015-06-04 19:13:40 +03:00
Dmitry Stogov
f07d770f0b Specialize out useless checks. Only IS_VAR may be EG(error). 2015-06-04 17:20:37 +03:00
Dmitry Stogov
2fcdad6a58 Removed useless code (there is nothing to free for string offsets). 2015-06-03 22:23:06 +03:00
Dmitry Stogov
36c36ee56d Removed dead code (IS_CONST operand can't be IS_OBJECT) 2015-06-03 19:29:03 +03:00
Dmitry Stogov
544fb5c7bc Separate rare used increment/decrement/assign_op of overloaded properies into non inlined functions. 2015-06-03 18:44:25 +03:00
Dmitry Stogov
58dc22cc13 Reorder conditions to check for fast paths first 2015-06-03 17:20:47 +03:00
Dmitry Stogov
ce2a78939d isset() micro-optimisation 2015-06-03 16:27:38 +03:00
Dmitry Stogov
b21191ba78 Removed commented code 2015-06-03 14:49:29 +03:00
Dmitry Stogov
c09698753e CONCAT optimization 2015-06-03 11:15:28 +03:00
Dmitry Stogov
0d054f5faf Avoid useless duplication. Constant values have to be duplicated only for internal constants in ZTS build, to prevent simultaneous modification of reference counters from different threads. 2015-06-02 12:01:34 +03:00
Dmitry Stogov
ce862a25d5 Reorder conditions to check for fast paths first. 2015-06-01 17:22:04 +03:00
Bob Weinand
b73f87b1e4 Add test for memory leak with wrong return type 2015-05-27 01:37:00 +02:00
Bob Weinand
f7f7d6e385 Fix memory leak with return types upon failure
TMP/VAR wasn't being freed in VERIFY_RETURN
2015-05-27 01:18:06 +02:00
Dmitry Stogov
18cd4b17cc Fixed typo 2015-05-25 19:20:52 +03:00
Dmitry Stogov
c436e25fd5 Fixed bug #69700 (tests/lang/this_assignment.phpt memory errors) 2015-05-25 18:29:31 +03:00
Nikita Popov
8542befa7b Remove ZEND_BRK/ZEND_CONT from VM
These are no longer used at run-time now, only temporarily during
compilation.
2015-05-23 10:51:33 +02:00
Nikita Popov
9325ada725 Embed break/continue depth into opline
Previously a separate lval literal was used - this is probably a
leftover from the time where the break level could still be
specified dynamically.
2015-05-23 10:51:33 +02:00
Nikita Popov
d0e265392f Drop FREE_ON_RETURN flag, check brk_cont->start instead
Start >= 0 already tells us whether or not the loop has a loop
variable, no need to add extra flags to opcodes.

Also added a test for a case where FREE_ON_RETURN is relevant,
we didn't seem to have any coverage for this.
2015-05-23 10:51:33 +02:00
Dmitry Stogov
d6bcf2bf2e Micro optimization 2015-05-20 22:51:45 +03:00
Dmitry Stogov
cee88571d9 Fixed bug #69649 (segfault with --enable-dtrace) 2015-05-18 12:44:40 +03:00
Nikita Popov
0df2f470fa Don't write prop if read prop threw exception 2015-05-17 13:46:54 +02:00
Dmitry Stogov
fc75d07652 Fixed memory leak 2015-05-14 17:07:32 +03:00
Dmitry Stogov
d72a94468e Merged FE_FETCH_R[W] with the following ASSIGN[_REF] when assigne to CV. 2015-05-13 12:55:42 +03:00
Dmitry Stogov
0586702d32 Mark first call frames of stack segment with ZEND_CALL_ALLOCATED flag to simplify checks on stack deallocation. 2015-05-12 15:56:42 +03:00
Aaron Piotrowski
071111ecfc Add support for $callable() sytnax with 'Class::method'
Using the $callable() syntax when used with a string of
the form 'Class::method' would error as an undefined
function, even if the string passed is_callable() or the
callable type-hint. The fix adds support for the $callable()
syntax for any string accepted by is_callable() or the
callable type-hint.

Fix bug 68475 test with deprecated notice

Reduced scope of unit test.

Added tests with arguments.
2015-05-12 13:33:28 +02:00
Nikita Popov
8f9f21e8d2 Fix static closure error in call_user_func opcode
I'm assuming this is the only error that is_callable() can generate
with retval=1.

This problem manifested after making closures in static methods
not implicitly static, but would also occur when binding any non-static
closure to a scope without a $this.
2015-05-08 15:17:15 +02:00
Dmitry Stogov
a989c0a1a9 Improved fast path locality 2015-05-07 17:26:35 +03:00
Dmitry Stogov
ab4ccffc4c Avoid unnecessary reference counter incrementation on $this when call methods 2015-05-07 16:28:23 +03:00
Nikita Popov
d9c2959c27 Fix LSB handling for closures
Closures will now use the called_scope from their instantiation
site. If they are rebound either the class of $this is used or if
no $this is provided the bound scope is used.

With this change the scope for static closures can be changed back
to use EG(scope) rather than EX(called_scope), thus fixing
bug #69568.
2015-05-05 21:14:03 +02:00
Nikita Popov
dc546bdc4d Throw exception from FETCH_CLASS_NAME
Instead of empty strings.

This does not affect the existing case of __CLASS__ in traits as
a scope will always exists in that case.
2015-05-05 21:14:03 +02:00
Nikita Popov
dd1fdfb17c Use ZEND_FETCH_CLASS_NAME for dynamic self::class etc
Extend the opcode to support getting the parent and static name and
then use it for dynamic ::class resolution.
2015-05-05 21:14:03 +02:00
Dmitry Stogov
a8172353ba Micro optimization 2015-05-05 18:50:47 +03:00
Xinchen Hui
ce9248b6ef Merge branch 'PHP-5.6' 2015-05-04 19:26:07 +08:00
Xinchen Hui
7289981c61 Merge branch 'PHP-5.5' into PHP-5.6 2015-05-04 19:22:22 +08:00
Xinchen Hui
7af9ba23a7 Saving the latter checking in most cases 2015-05-04 19:21:54 +08:00
Dmitry Stogov
d880ead8a7 Improve fast_is_[not_]identical() functions to teturn value instead of takeing additional arguments.
Pair INSTANCEOF with the following JMPZ/JMPNZ.
2015-04-29 16:43:23 +03:00
Dmitry Stogov
762a774c40 Fixed repeatable opcodes on CALL VM without global registers 2015-04-29 14:20:44 +03:00
Dmitry Stogov
690440771a Paired instuctions frequientiy used together (e.g. comparisons + conditional jumps) 2015-04-29 04:17:59 +03:00
Dmitry Stogov
d271d2cf7b Make ZEND_RECV_INIT and ZEND_BIND_GLOBALS opcodes to be "repeatabe" with inner-loop instead of main interpreter loop. 2015-04-29 00:40:43 +03:00
Dmitry Stogov
3057034608 Optimize opcodes for fast path 2015-04-28 23:57:21 +03:00
Dmitry Stogov
612de5214f Simplified code 2015-04-28 19:11:23 +03:00
Dmitry Stogov
89be15c56d Micro optimizations 2015-04-28 12:41:39 +03:00
Dmitry Stogov
94245bc14c Refactored using specialized opcodes 2015-04-27 12:24:39 +03:00
Nikita Popov
03d7042d5c Don't issue FETCH_CLASS for anon classes 2015-04-26 15:44:48 +02:00
krakjoe
49608e0608 Rebase Joe's anon classes implementation 2015-04-26 15:04:22 +02:00
Dmitry Stogov
000d5d7ec9 Dont't use DO_ICALL for internal functions returned by reference 2015-04-24 00:34:11 +03:00
Dmitry Stogov
49cf7c5d12 Don't propogate "fake" EX(called_scope) and EX(This) into each internal function.
They need quite seldom and it's cheaper to get them from corresponfing upper stack frame.
2015-04-23 12:16:37 +03:00
Dmitry Stogov
6d4da2db8a Make internal non-static methods to be executed in context of class. Set EG(scope) accordingly. 2015-04-23 03:41:50 +03:00