phpng-int
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
phpng-int [2018/01/09 15:49] – kalle | phpng-int [2018/01/09 16:34] (current) – fixed typos kelunik | ||
---|---|---|---|
Line 334: | Line 334: | ||
New implementation assumes, that we store zval structures (not pointers) in arrays and function stack frames. It must not be a problem for arrays because scalar values are going to be just duplicated, and compound values may point to shared reference-couned structures anyway. However it is a problem for local variables (IS_CV), because they may be referenced through stack frame (by index) and through symbol table (by name). Both must point to the same structure. Values of IS_INDIRECT types are just weak pointers to real values. When we lazily create local symbol tables, we store IS_INDIRECT values in symbol tables and initialize them with the pointers to corresponding CV slots. It means that CV access by index became extremely efficient, as we don't need to perform double or even triple dereferences as before. | New implementation assumes, that we store zval structures (not pointers) in arrays and function stack frames. It must not be a problem for arrays because scalar values are going to be just duplicated, and compound values may point to shared reference-couned structures anyway. However it is a problem for local variables (IS_CV), because they may be referenced through stack frame (by index) and through symbol table (by name). Both must point to the same structure. Values of IS_INDIRECT types are just weak pointers to real values. When we lazily create local symbol tables, we store IS_INDIRECT values in symbol tables and initialize them with the pointers to corresponding CV slots. It means that CV access by index became extremely efficient, as we don't need to perform double or even triple dereferences as before. | ||
- | Global symbol | + | Global symbol |
The same concept is used for object properties access. In case dynamic properties table is required it's first initialized with IS_INDIRECT references to predefined object properties slots. | The same concept is used for object properties access. In case dynamic properties table is required it's first initialized with IS_INDIRECT references to predefined object properties slots. | ||
Line 367: | Line 367: | ||
===== VM Changes ===== | ===== VM Changes ===== | ||
- | With new zval implementation IS_TMP_VAR, IS_VAR and IS_CV operands are handled in very similar way. All three operands | + | With new zval implementation IS_TMP_VAR, IS_VAR and IS_CV operands are handled in very similar way. All three operands |
==== Function Stack Frame (zend_execute_data) ==== | ==== Function Stack Frame (zend_execute_data) ==== |
phpng-int.txt · Last modified: 2018/01/09 16:34 by kelunik