mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
. The VM stacks for passing function arguments and syntaticaly nested calls were merged into a single stack. The stack size needed for op_array execution is calculated at compile time and preallocated at once. As result all the stack push operatins don't require checks for stack overflow any more.
. Generators implementation was improved using the new VM stack. Now it's a bit more clear and faster.
This commit is contained in:
parent
9f7e53fde8
commit
70f83f35d0
20 changed files with 1477 additions and 1307 deletions
|
@ -110,23 +110,6 @@ ZEND_API int zend_ptr_stack_num_elements(zend_ptr_stack *stack)
|
|||
{
|
||||
return stack->top;
|
||||
}
|
||||
|
||||
ZEND_API void zend_ptr_stack_push_from_memory(zend_ptr_stack *stack, int count, void **pointers)
|
||||
{
|
||||
ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, count);
|
||||
|
||||
memcpy(stack->top_element, pointers, count * sizeof(void *));
|
||||
stack->top_element += count;
|
||||
stack->top += count;
|
||||
}
|
||||
|
||||
ZEND_API void zend_ptr_stack_pop_into_memory(zend_ptr_stack *stack, int count, void **pointers)
|
||||
{
|
||||
memcpy(pointers, stack->top_element - count, count * sizeof(void *));
|
||||
stack->top_element -= count;
|
||||
stack->top -= count;
|
||||
}
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue