Commit Graph

10458 Commits

Author SHA1 Message Date
Dmitry Stogov
89be15c56d Micro optimizations 2015-04-28 12:41:39 +03:00
Xinchen Hui
33e32cbe5b Make it inline 2015-04-28 11:30:25 +08:00
Xinchen Hui
e563386582 Fixed interned string leaks after new STATIC_KEY flag is introduced 2015-04-28 11:14:21 +08:00
Nikita Popov
422de8a7a7 Drop compile_class_decl return value
Was introduced for anon classes, but no longer needed.
2015-04-27 22:54:02 +02:00
Dmitry Stogov
98e9296f34 Restored accedently removed line that caused memory leak 2015-04-27 23:05:24 +03:00
hakre
6551f996b9 Minor Typo in Comment 2015-04-27 20:06:55 +02:00
Dmitry Stogov
1800bed104 Micro optimizations 2015-04-27 18:30:33 +03:00
Dmitry Stogov
5af7743cf5 Merge branch 'anon'
* anon:
  Pass class_entry through IS_VAR to avoid hash lookup in ZEND_NEW.
  Use "safe" anonymous class names. Don't show the mangled names through var_dump().
  Refactored using specialized opcodes
  Fix implementing_class handling
  More cleanup (mainly retab)
  Don't issue FETCH_CLASS for anon classes
  More retab
  Simply anon class name generation
  Retab
  Revert unrelated changes / rebase fixup
  Rebase Joe's anon classes implementation
2015-04-27 17:18:35 +03:00
Dmitry Stogov
ffe804a50c Use new hash iteration API. 2015-04-27 16:50:47 +03:00
Dmitry Stogov
0182eb4717 Eliminate useless checks 2015-04-27 15:54:41 +03:00
Dmitry Stogov
8acd7f49da Pass class_entry through IS_VAR to avoid hash lookup in ZEND_NEW. 2015-04-27 14:16:29 +03:00
Dmitry Stogov
2a1b0b1121 Use "safe" anonymous class names. Don't show the mangled names through var_dump(). 2015-04-27 13:08:22 +03:00
Dmitry Stogov
94245bc14c Refactored using specialized opcodes 2015-04-27 12:24:39 +03:00
Nikita Popov
8361893444 Fix implementing_class handling 2015-04-26 16:03:58 +02:00
Nikita Popov
f2f890a256 More cleanup (mainly retab) 2015-04-26 15:54:30 +02:00
Nikita Popov
03d7042d5c Don't issue FETCH_CLASS for anon classes 2015-04-26 15:44:48 +02:00
Nikita Popov
929fdc1c1a More retab 2015-04-26 15:28:55 +02:00
Nikita Popov
4a7061b0e3 Simply anon class name generation
Drop dead "parent" code
2015-04-26 15:24:13 +02:00
Nikita Popov
f16eca58a2 Retab 2015-04-26 15:17:53 +02:00
Nikita Popov
9a1797d48e Revert unrelated changes / rebase fixup 2015-04-26 15:13:49 +02:00
krakjoe
49608e0608 Rebase Joe's anon classes implementation 2015-04-26 15:04:22 +02:00
Bob Weinand
a9a6799964 Add line_start/end info to main op_array 2015-04-25 19:10:58 +02:00
Nikita Popov
75b4fa079f Fix bug #69532
Partial revert of ea2fc7f935.
2015-04-25 18:47:26 +02:00
Dmitry Stogov
b250f46703 Optimized HashTable copy and cleanup function for cases without holes. 2015-04-24 22:43:50 +03:00
Dmitry Stogov
ef36d8a91e Optimized zend_hash_rehash(), added some exoectations to generate better code 2015-04-24 13:00:56 +03:00
Dmitry Stogov
6265687768 Added HashTable flag HASH_FLAG_STATIC_KEYS that is maintaned to be set if all hash table keys are numbers or interned strings.
Take this flag into account when copy or destroy HashTable to avoud useless checks for each key.
2015-04-24 09:34:50 +03: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
fc80305e48 Cleanup comments and add related tests. 2015-04-23 17:52:05 +03:00
Xinchen Hui
ea2fc7f935 Slight improvement 2015-04-23 21:50:38 +08:00
Kalle Sommer Nielsen
f2435bd252 Fixed compiler warning 2015-04-23 12:31:02 +02: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
Dmitry Stogov
15a5f61cf4 Use fast method to check if first arguments should be passed by reference (not tested onbig endian). 2015-04-22 21:46:13 +03:00
Dmitry Stogov
af33279a6c Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Fix "invalid opcode" error
2015-04-22 20:40:47 +03:00
Nikita Popov
62aabf5d9f Fix "invalid opcode" error
Method call can happen on CONST, it'll just throw an error.

Not forbidding this at compile-time, so this can be overridden in
an extension.
2015-04-22 17:46:25 +02:00
Dmitry Stogov
d71105b90a Use string primitive 2015-04-22 14:23:22 +03:00
Dmitry Stogov
a2d87429d5 Removred temporary code 2015-04-22 13:14:03 +03:00
Dmitry Stogov
8ef7e14117 Improved property inheritance code 2015-04-22 12:53:54 +03:00
Dmitry Stogov
770cb1da71 Keep realpath and PCRE caches in consistency with opcache SHM. 2015-04-22 02:29:06 +03:00
Dmitry Stogov
c9da004a18 Slight zend_hash_find() optimization. 2015-04-21 23:27:44 +03:00
Dmitry Stogov
a0c07c90f2 Fixed zend_string related inconsistencies 2015-04-21 23:26:34 +03:00
Bob Weinand
4376373da3 Fix yield from with iterator (first element missing) 2015-04-21 19:42:23 +02:00
Nikita Popov
d2607a0110 Move more stuff to file_context
Introduce helper macro FC(x) for CG(file_context).x.

end_compilation() now handled by file_context_end().

While at it, dropped zval wrapper for ticcks.
2015-04-21 17:39:07 +02:00
Xinchen Hui
29c449ce98 Merge branch 'PHP-5.5' into PHP-5.6 2015-04-21 22:44:45 +08:00
Xinchen Hui
a508693874 Remove tail blank which is committed by accident 2015-04-21 22:44:22 +08:00
Xinchen Hui
a090977419 Merge branch 'PHP-5.6'
Conflicts:
	Zend/zend_compile.c
2015-04-21 22:39:46 +08:00
Xinchen Hui
9d9ba493a2 Merge branch 'PHP-5.5' into PHP-5.6 2015-04-21 22:37:00 +08:00
Xinchen Hui
c667c26f61 Fixed Bug #69467 (Wrong checked for the interface by using Trait) 2015-04-21 22:36:32 +08:00
Xinchen Hui
8362aebdbf Fixed mem leak in assign_to_obj with reference 2015-04-21 21:04:20 +08:00
Nikita Popov
0381c1b79e Fixed bug #69388
Renamed compiler_context to oparray_context. Introduced per-file
file_context. Moved import tables into the file_context.

context_stack no longer exists, instead keeping backups of contexts
on C stack. Same for file contexts.

TODO: Move more things out of CG into file_context. There should be
a number of other things that we should not try to reuse in nested
compilations.
2015-04-20 18:18:52 +02:00
Dmitry Stogov
b99174136c Fixed reference counting 2015-04-20 18:49:17 +03:00
Xinchen Hui
1c3b99c4ff Throw exception will override EX(opline) 2015-04-20 11:58:23 +08:00
Xinchen Hui
d66045fe73 Fixed bug #69485 (Double free on zend_list_dtor). 2015-04-20 11:48:21 +08:00
Xinchen Hui
a819404e9e Refix opline usage 2015-04-20 10:53:58 +08:00
Bob Weinand
b1bd6f502f Properly define ZEND_OP_DATA in zend_vm_def.h
This allows zend_vm_gen.php to define them in zend_vm_opcodes.{c,h} without further hacks.
2015-04-19 23:21:57 +02:00
Nikita Popov
aef96d5169 Partially enable leak reports for objects
Cycle leaks are currently not reported, because this needs further
work.

The last GC run has been moved to run earlier (before the object
store free), so that array cycles that hold references to objects
don't show up as leaks. Fingers crossed that this doesn't adversely
affect anything else.
2015-04-18 17:31:11 +02:00
Nikita Popov
9f0f93b00f Fix CALL_TRAMPOLINE without global regs
The opline needs to be loaded here in any case. However
LOAD_OPLINE() is a no-op if global VM registers are not used.
2015-04-18 15:44:04 +02:00
Nikita Popov
9a0cb734a3 Fix memory error when throwing into a generator
throw_exception_internal will access opline+1, which is not always
defined at the current opline of the generator. To avoid this
decrement the opline before throwing (so the throw occurs at the
YIELD opcode instead of one after it).
2015-04-17 22:19:41 +02:00
Nikita Popov
38da85f313 Initialize VAR_FLAGS for generators 2015-04-17 21:51:49 +02:00
Dmitry Stogov
736b7cf419 Added test 2015-04-17 18:45:46 +03:00
Dmitry Stogov
6718b56e45 Change the GC approach to inner-loops handling. Switch to less efficient but more robust algorithm. Destructors handling is still not completely accurate. 2015-04-17 18:35:57 +03:00
Dmitry Stogov
276080ec3a Added GC checks and improvements 2015-04-17 03:55:37 +03:00
Dmitry Stogov
10d4fdb34a Fixed memory-leak 2015-04-17 01:27:54 +03:00
Dmitry Stogov
5b0d86edcc Safe destruction (variables and arguments may need to be cuptured by exception) 2015-04-16 21:45:40 +03:00
Nikita Popov
018bcc6388 Use temporary debug_info for closures 2015-04-16 15:33:47 +02:00
Dmitry Stogov
2ca2d0938b Micro optimizations for the more frequently paths 2015-04-16 14:46:54 +03:00
Dmitry Stogov
e38ed4c28f Changed zend_smart_str allocation granularity to do the better job together with Zend MM and avoid useless calls to erealloc().
The actual reallocation routiones are seprated from inlined code to reduce code size.
2015-04-16 14:45:08 +03:00
Dmitry Stogov
05232cc810 Revert "Changed zend_smart_str allocation granularity to do the better job together with Zend MM and avoid useless calls to erealloc()." That commit significantly increased the code size because of intensive inlining and more expensive reallocation code.
This reverts commit 5275e5560b.
2015-04-16 13:11:54 +03:00
Dmitry Stogov
5275e5560b Changed zend_smart_str allocation granularity to do the better job together with Zend MM and avoid useless calls to erealloc(). 2015-04-16 12:32:56 +03:00
Dmitry Stogov
a759967dd1 Mark call frames to closures with ZEND_CALL_CLOSURE flag to avoid expensive check at zend_leave_helper() 2015-04-16 12:16:03 +03:00
Xinchen Hui
ec8671d429 Remove duplicated assignment 2015-04-16 11:58:50 +08:00
Nikita Popov
5c214fc10d Add test for recursive __debugInfo()
This also got fixed by switching to object apply count.
2015-04-15 22:38:50 +02:00
Bob Weinand
7c2fbdf58d Remove some redundant exception checking/continuing VM instructions 2015-04-15 22:18:05 +02:00
Nikita Popov
dc764bf644 Use object apply count in var_dump / print_r
Instead of using the array apply count on the debug_info array, use
the object apply count for recursion detection when dumping. This
handles recursion in a more generic way and does not require each
debug_info handler to deal with this.

This allows returning a temporary debug_info array, instead of
having to store it in the object (thus delaying destruction of the
values).

Switch SPL debug_info handlers to use a temporary array.
2015-04-15 22:00:12 +02:00
Bob Weinand
3dcad2eea2 Fix bug #69458 2015-04-15 21:56:11 +02:00
Bob Weinand
4e76d58b2b Fix object leak for yield from (added proper refcounting) 2015-04-15 21:42:27 +02:00
Bob Weinand
27033f9818 Forgot to transform some errors to engine exceptions 2015-04-15 21:42:26 +02:00
Dmitry Stogov
d5d2032898 eliminate unnecessary EX(opline) <-> opline reloading 2015-04-15 20:53:27 +03:00
Dmitry Stogov
6aee1ee4a1 Optimization of stack-frame construction 2015-04-15 17:02:21 +03:00
Dmitry Stogov
8144795133 Avoid double refcounting 2015-04-15 13:34:23 +03:00
Xinchen Hui
0d562a8f44 Fixed res leak 2015-04-14 21:15:50 -07:00
Xinchen Hui
caf4beab2d Merge branch 'PHP-5.5' into PHP-5.6 2015-04-15 10:39:17 +08:00
Xinchen Hui
82ec0d5fc5 Fixed res leak 2015-04-15 10:38:55 +08:00
Nikita Popov
108ae7961e Fix leak when calling ->get() on tmp property 2015-04-14 22:16:18 +02:00
Nikita Popov
38eb3cdf67 Drop ??? for AST_ZNODE in ast pretty printer 2015-04-14 21:35:38 +02:00
Nikita Popov
acd61be985 Add "yield from" support to ast pretty printer 2015-04-14 19:15:40 +02:00
Dmitry Stogov
7bf5b341e4 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Add NEWS/UPGRADING and some implementation notes
2015-04-14 19:54:30 +03:00
Dmitry Stogov
00445ba22d Fixed bug #69446 (GC leak relating to removal of nested data after dtors run) 2015-04-14 19:53:56 +03:00
Bob Weinand
a029ec9ee0 Add NEWS/UPGRADING and some implementation notes 2015-04-14 18:35:47 +02:00
Bob Weinand
f3e124d58d Merge branch 'coroutineDelegation' of https://github.com/bwoebi/php-src 2015-04-14 17:58:58 +02:00
Nikita Popov
a7059f1eac Merge branch 'PHP-5.6'
Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2015-04-14 16:38:09 +02:00
Nikita Popov
ed7e6d4758 Merge branch 'PHP-5.5' into PHP-5.6 2015-04-14 16:36:36 +02:00
Nikita Popov
95650d0942 Fixed bug #69419 2015-04-14 16:35:23 +02:00
Dmitry Stogov
65baab7741 Merge branch 'PHP-5.6'
* PHP-5.6:
  Bug #63336 is not a bug
  fix test

Conflicts:
	Zend/tests/bug63336.phpt
2015-04-14 17:18:55 +03:00
Dmitry Stogov
e8fb5201ba Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Bug #63336 is not a bug
2015-04-14 17:16:57 +03:00
Dmitry Stogov
dc024f0bdc Bug #63336 is not a bug 2015-04-14 17:15:50 +03:00
Xinchen Hui
e68b851217 Merge branch 'PHP-5.6'
Conflicts:
	Zend/zend_exceptions.c
2015-04-14 19:33:46 +08:00
Xinchen Hui
5fc635548e Merge branch 'PHP-5.5' into PHP-5.6 2015-04-14 19:32:28 +08:00
Xinchen Hui
4b27569dc3 codes standard 2015-04-14 19:32:01 +08:00
Dmitry Stogov
26a6d707a1 Fixed memory leak in ext/standard/tests/array/compact_variation1.phpt 2015-04-14 13:45:05 +03:00