Commit Graph

474 Commits

Author SHA1 Message Date
Dmitry Stogov
d3b6fbe39b Fixed bug #52940 (call_user_func_array still allows call-time pass-by-reference). (cataphract@php.net) 2010-10-01 11:53:04 +00:00
Dmitry Stogov
f2df6a4a3e - Improved memory usage
. zend_function.pass_rest_by_reference is replaced by
    ZEND_ACC_PASS_REST_BY_REFERENCE in zend_function.fn_flags
  . zend_function.return_reference is replaced by ZEND_ACC_RETURN_REFERENCE
    in zend_function.fn_flags
  . zend_arg_info.required_num_args removed. it was needed only for internal
    functions. Now the first arg_info for internal function (which has special
    meaning) is represented by zend_internal_function_info structure.
  . zend_op_array.size, size_var, size_literal, current_brk_cont,
    backpatch_count moved into CG(context), because they are used only during
    compilation.
  . zend_op_array.start_op is moved into EG(start_op), because it's used
    only for 'interactive' execution of single top-level op-array.
  . zend_op_array.done_pass_two is replaced by ZEND_ACC_DONE_PASS_TWO in
    zend_op_array.fn_flags.
  . op_array.vars array is trimmed (reallocated) during pass_two.
  . zend_class_entry.constants_updated is replaced by
     ZEND_ACC_CONSTANTS_UPDATED in zend_class_entry.ce_flags
  . the size of zend_class_entry is reduced by sharing the same memory space
    by different information for internal and user classes.
    See zend_class_inttry.info union.
2010-09-15 07:38:52 +00:00
Dmitry Stogov
f0c8366a9e - use interned strings for auto globals
- $GLOBALS became a JIT autoglobal, so it's initialized only if used (this may affect opcode caches)
2010-07-08 14:05:11 +00:00
Dmitry Stogov
1a1178a685 eliminated unnecessary iterations during request startup/shutdown 2010-07-06 11:40:17 +00:00
Felipe Pena
79d2aaf0f1 - Fixed bug #51905 (ReflectionParameter fails if default value is an array with an access to self::) 2010-05-26 00:00:58 +00:00
Dmitry Stogov
3c179430ec Fixed crash in Zend/tests/unset_cv09.phpt 2010-04-26 13:51:46 +00:00
Antony Dovgal
a9a55f77c0 fix WS 2010-04-23 09:11:44 +00:00
Dmitry Stogov
f06d839e59 Use fast class fetch function 2010-04-23 08:56:03 +00:00
Stefan Marr
cd6415f1a9 Implemented Traits for PHP as proposed in the RFC [TRAITS]
# RFC http://wiki.php.net/rfc/horizontalreuse#traits_-_reuse_of_behavior
# Ok, here we go, I guess that will result in more discussion, which is fine
# by me. But now, the patch is here, and properly archived.
# 
# See below a list of notes to the patch, it also includes a list of
# points which should be fixed
# 
# Internals of the Traits Patch
# -----------------------------
# 
# Open TODOs
# """"""""""
# 
# - Reflection API
# - support for traits for internal classes
#   - currently destroy_zend_class does not handle that case 
# 
# Introduced Structures
# """""""""""""""""""""
# 
# Data structures to encode the composition information specified in the
# source:
#  - zend_trait_method_reference
#  - zend_trait_precedence
#  - zend_trait_alias
# 
# Changes
# """""""
# 
# zend_class_entry
#  - uses NULL terminated lists of pointers for
#    - trait_aliases
#    - trait_precedences
#    - do you prefer an explicit counter?
#    - the information is only necessary during class composition
#      but might be interesting for reflection
#    - did not want to blow up class further with not really necessary length counters
# 
# added keywords
#   - trait
#   - insteadof
# 
# Added opcodes
#  ZEND_ADD_TRAIT
#    - similar to ZEND_ADD_INTERFACE
#    - adds the trait to the list of traits of a class, no actual composition done
#  ZEND_BIND_TRAITS
#    - emitted in zend_do_end_class_declaration
#    - concludes the class definition and will initiate the trait composition
#      when the class definition is encountered during runtime
# 
# Added Flags
#   ZEND_ACC_TRAIT = 0x120
#   ZEND_ACC_IMPLEMENT_TRAITS = 0x400000
#   ZEND_FETCH_CLASS_TRAIT = 14
# 
# zend_vm_execute.h
#  - not sure whether the handler initialization (ZEND_ADD_TRAIT_SPEC_HANDLER,
#    ZEND_BIND_TRAITS_SPEC_HANDLER) is correct, maybe it should be more selective
# 
# zend_compile.c
#  - refactored do_inherit_method_check
#    split into do_inherit_method_check and do_inheritance_check_on_method
#  - added helper functions use a '_' as prefix and are not mentioned in the
#    headers
#  - _copy_functions
#    prepare hash-maps of functions which should be merged into a class
#    here the aliases are handled
#  - _merge_functions
#    builds a hash-table of the methods which need to be added to a class
#    does the conflict detection
#  - reused php_runkit_function_copy_ctor
#    - it is not identical with the original code anymore, needed to update it
#      think I fixed some bugs, not sure whether all have been reported back to runkit
#    - has to be renamed, left the name for the moment, to make its origin obvious
#    - here might be optimization potential
#    - not sure whether everything needs to be copied
#      - copying the literals might be broken
#        - added it since the literals array is freed by efree and gave problems
#          with doubled frees
#      - all immutable parts of the zend_op array should not be copied
#        - am not sure which parts are immutable
#        - and not sure how to avoid doubled frees on the same arrays on shutdown
#  - _merge_functions_to_class
#    does the final merging with the target class to handle inherited
#    and overridden methods
#  - small helper for NULL terminated lists
#    zend_init_list, zend_add_to_list
# 
# zend_language_parser.y
#  - reused class definition for traits
#    - there should be something with regard to properties
#      - if they get explicitly defined, it might be worthwhile to
#        check that there are no collisions with other traits in a composition
#        (however, I would not introduce elaborate language features to control that
#         but a notice for such conflicts might be nice to the developers)
2010-04-22 22:05:56 +00:00
Dmitry Stogov
453b49ed20 Added a number of small performance tweaks and optimizations
. ZEND_RECV now always has IS_CV as its result
  . ZEND_CATCH now has to be used only with constant class names
  . ZEND_FETCH_DIM_? may fetch array and dimension operans in a different order
2010-04-20 11:16:39 +00:00
Dmitry Stogov
dd5c478be6 Added concept of interned strings. All strings constants known at compile time are allocated in a single copy and never changed. 2010-04-20 11:05:54 +00:00
Dmitry Stogov
94dd83722b Changed the structure of op_array.opcodes. The constant values are moved from opcode operands into a separate literal table 2010-04-20 10:57:45 +00:00
Stanislav Malyshev
cf4ea31bff fix #51394 - try harder to find script lineno when exception happens 2010-04-01 19:36:56 +00:00
Felipe Pena
c302509726 - Fixed bug #50731 (Inconsistent namespaces sent to functions registered with spl_autoload_register) 2010-03-03 00:15:34 +00:00
Pierre Joye
5eb4db5e8f - Ensure that stderr output are not buffered, portability for tests 2010-01-25 14:47:19 +00:00
Sebastian Bergmann
d2281d1dff sed -i "s#1998-2009#1998-2010#g" **/*.c **/*.h **/*.php 2010-01-05 20:46:53 +00:00
Stanislav Malyshev
fc1e17ee76 fix regression bug #50394: Reference argument converted to value in __call 2009-12-18 19:12:11 +00:00
Dmitry Stogov
10b30b51bc Fixed unnecessary invokation of setitimer when timeouts have been disabled (Arvind Srinivasan) 2009-11-05 09:33:19 +00:00
Moriyoshi Koizumi
b91e3db105 - WS fix (spaces to tabs) 2009-09-15 00:09:13 +00:00
Stanislav Malyshev
d6ba6c69fb fix crash when unexpectedly passed by-ref parameter is modified 2009-08-18 20:51:49 +00:00
Stanislav Malyshev
9fd8469e94 fix for bug #49000 2009-07-30 05:01:53 +00:00
Matt Wilmas
d55300298e MFH: Added zend_eval_stringl and made create_function(), etc. binary-safe 2009-06-05 18:50:32 +00:00
Matt Wilmas
b907aa4331 MFH:
Restored double->long conversion behavior to that of PHP 5.2 (on most platforms) and prior:
 * Out-of-range numbers overflow/preserve least significant bits (no LONG_MAX/MIN limit)
 * See bug #42868 (presumably-rare platform with different results in 5.2)
 * On 32-bit platforms with 64-bit long type, a zend_long64 cast has been added,
    otherwise it's the same as 5.2
 * Use this conversion method everywhere instead of some plain (long) casts

Added 'L' parameter parsing specifier to ensure a LONG_MAX/MIN limit:
 * Essentially what 5.3's new conversion was doing in most cases
 * Functions with "limit" or "length" type params could be updated to use this,
    and prevent confusing overflow behavior with huge numbers (*also* in 5.2)
  - See bug #47854, for example; or even #42868 again

# Test updates coming
2009-06-04 18:20:45 +00:00
Dmitry Stogov
c8e5bc5988 Calculate hash value once 2009-04-08 13:17:58 +00:00
Matt Wilmas
021e5d168f MFH: Removed extra space from eval string 2009-03-19 18:34:16 +00:00
Dmitry Stogov
c6e55db534 Forgotten include 2009-03-18 10:41:39 +00:00
Dmitry Stogov
31c0af245e Fixed floating point mathematic speed degradation (Christian) 2009-03-18 10:18:10 +00:00
Felipe Pena
2bc612bc0c - Fixed typo 2009-03-05 16:49:47 +00:00
Felipe Pena
c43b935b65 - MFH: Fixed bug #47572 (zval_update_constant_ex: Segmentation fault) 2009-03-05 16:25:43 +00:00
Dmitry Stogov
c277ebc6c8 Fixed bug #47320 ($php_errormsg out of scope in functions) 2009-02-09 09:20:35 +00:00
Marcus Boerger
2aba368462 - MFH Catch exceptions in cli -a 2009-01-02 13:14:49 +00:00
Sebastian Bergmann
08659c2dcd MFH: Bump copyright year, 3 of 3. 2008-12-31 11:15:49 +00:00
Dmitry Stogov
7d4fd3fd38 Fixed bug #46409 (__invoke method called outside of object context when using array_map) 2008-11-27 19:01:23 +00:00
Felipe Pena
8f32490ca3 - Fixed bug #46665 (Triggering autoload with a variable classname causes truncated autoload param) 2008-11-25 21:14:23 +00:00
Etienne Kneuss
3919b16f04 MFH: Fix #46241 (stacked error_handlers, error_handling in general) 2008-11-19 02:00:53 +00:00
Antony Dovgal
512b812761 make sure the slash is actually thre before reading past it 2008-11-12 09:05:48 +00:00
Stanislav Malyshev
1b4134c07b Namespace resolution streamlining patch
[DOC] new resolution rules should be documented soon
2008-11-11 19:45:29 +00:00
Felipe Pena
2f26deb0e0 - Fixed Windows build 2008-11-05 11:00:38 +00:00
Marcus Boerger
7126de4912 - Next step in namespaces, using / as namespace separator. 2008-11-04 15:58:55 +00:00
Etienne Kneuss
b879459973 MFH: Use enum alternative instead of explicit value 2008-10-02 19:54:03 +00:00
Antony Dovgal
f5b09f1907 MFH: initialize variable 2008-10-01 14:31:01 +00:00
Dmitry Stogov
e46d328934 Fixed bug #46106 (Memory leaks when using global statement) 2008-09-17 15:11:28 +00:00
Etienne Kneuss
6ebc3a8b9b MFH: Fix #45656 (new Class silenting exceptions in autoloaders) 2008-09-15 10:19:53 +00:00
Dmitry Stogov
03f4121452 Fixed bug #45910 (Cannot declare self-referencing constant) 2008-08-26 08:38:26 +00:00
Marcus Boerger
32f9d0e180 - MFH Improve exception linking 2008-08-14 10:24:52 +00:00
Nuno Lopes
f87d4530c2 mark empty_fcall_info and empty_fcall_info_cache as constant. a few less bytes in the dirty page :P 2008-08-12 21:45:52 +00:00
Marcus Boerger
3053a62621 - MFH Fix shutdown order 2008-08-11 17:44:15 +00:00
Marcus Boerger
3f7a4b7e90 - MFH error handling, now with save, replace, restore 2008-08-08 17:47:31 +00:00
Marcus Boerger
5a59d41305 - MFH store error handling mode on stack when executing internal
or overloaded functions and methods. [...]
2008-08-08 13:21:52 +00:00
Dmitry Stogov
37a769353f Fixed bug #44100 (Inconsistent handling of static array declarations with duplicate keys). 2008-08-01 14:22:03 +00:00