Skip to content

Stackless execution of magic __call() and __callStatick() methods. #1234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 20 commits into from

Conversation

dstogov
Copy link
Member

@dstogov dstogov commented Apr 9, 2015

  • __call() and __callStatic() don't call execute_ex() recursively any more.
  • Recursive calls trough __call() won't lead to crash because of stack overflow.
  • We don't keep temporary call frames for "fake" functions (save VM stack).
  • Now __call() almost 2 times faster

laruence and others added 18 commits April 8, 2015 18:21
…defy-call

* 'opcodefy-call' of github.com:laruence/php-src:
  Ready for PR
  Fixed static call
  Improve performance by using prealloated op_arrray
  Respect called_scope
  Support internal magical __call/__callStatic
  opcode-fy magical __callStatic
  Opcode-fy magical __call
* master:
  Fixed GOTO executor
  Fixed typo
  Changed ArrayIterator implementation using zend_hash_iterator_... API. Allowed modification of itterated ArrayObject using the same behavior as proposed in `Fix "foreach" behavior`. Removed "Array was modified outside object and internal position is no longer valid" hack.
…rom zend_objects_API to zend_object_handlers.
Generalize API to allow reuse EG(trampline) for other purposes.
…. Keep ZEND_ACC_CALL_VIA_HANDLER for compatibility.

ZEND_ASSERT(!(fbc->common.fn_flags & ZEND_ACC_GENERATOR));

EG(scope) = fbc->common.scope;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EG(scope) is already set properly by previously call to this function (trampoline op_array). we don't need set it again here...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree. This may be removed.

@dstogov
Copy link
Member Author

dstogov commented Apr 10, 2015

Merger into master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants