Skip to content

Commit 9a79e98

Browse files
committed
Update Trace Linking Rules comment
1 parent 2e70a89 commit 9a79e98

File tree

1 file changed

+33
-15
lines changed

1 file changed

+33
-15
lines changed

ext/opcache/jit/zend_jit_vm_helpers.c

+33-15
Original file line numberDiff line numberDiff line change
@@ -613,20 +613,38 @@ static int zend_jit_trace_subtrace(zend_jit_trace_rec *trace_buffer, int start,
613613
* Trace Linking Rules
614614
* ===================
615615
*
616-
* flags
617-
* +----------+----------+----------++----------+----------+----------+
618-
* | || JIT |
619-
* +----------+----------+----------++----------+----------+----------+
620-
* start | LOOP | ENTER | RETURN || LOOP | ENTER | RETURN |
621-
* +========+==========+==========+==========++==========+==========+==========+
622-
* | LOOP | loop | | loop-ret || COMPILED | LINK | LINK |
623-
* +--------+----------+----------+----------++----------+----------+----------+
624-
* | ENTER |INNER_LOOP| rec-call | return || LINK | LINK | LINK |
625-
* +--------+----------+----------+----------++----------+----------+----------+
626-
* | RETURN |INNER_LOOP| | rec-ret || LINK | | LINK |
627-
* +--------+----------+----------+----------++----------+----------+----------+
628-
* | SIDE | unroll | | side-ret || LINK | LINK | LINK |
629-
* +--------+----------+----------+----------++----------+----------+----------+
616+
* We consider the start flags of the current trace, as well as the trace flags
617+
* of the opline to be recorded.
618+
*
619+
* opline trace flags
620+
* +----------+----------+----------+
621+
* | LOOP | ENTER | RETURN |
622+
* +========+==========+==========+==========+
623+
* | LOOP | loop | | loop-ret |
624+
* +--------+----------+----------+----------+
625+
* | ENTER |INNER_LOOP| rec-call | return |
626+
* start +--------+----------+----------+----------+
627+
* flags | RETURN |INNER_LOOP| | rec-ret |
628+
* +--------+----------+----------+----------+
629+
* | SIDE | unroll | | side-ret |
630+
* +--------+----------+----------+----------+
631+
*
632+
* When opline to be recorded is JIT'ed:
633+
*
634+
* opline trace flags
635+
* +----------+----------+----------+
636+
* | LOOP | ENTER | RETURN |
637+
* +========+==========+==========+==========+
638+
* | LOOP | COMPILED | LINK | LINK |
639+
* +--------+----------+----------+----------+
640+
* | ENTER | LINK | LINK | LINK |
641+
* start +--------+----------+----------+----------+
642+
* flags | RETURN | LINK | | LINK |
643+
* +--------+----------+----------+----------+
644+
* | SIDE | LINK | LINK | LINK |
645+
* +--------+----------+----------+----------+
646+
*
647+
*
630648
*
631649
* loop: LOOP if "cycle" and level == 0, otherwise INNER_LOOP
632650
* INNER_LOOP: abort recording and start new one (wait for loop)
@@ -637,7 +655,7 @@ static int zend_jit_trace_subtrace(zend_jit_trace_rec *trace_buffer, int start,
637655
* return: RETURN if level == 0
638656
* rec_ret: RECURSIVE_RET if "cycle" and ret_level > N, otherwise continue
639657
* side_ret: RETURN if level == 0 && ret_level == ret_depth, otherwise continue
640-
*
658+
* LINK: stop recording. End of new trace jumps to the other one.
641659
*/
642660

643661
zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex,

0 commit comments

Comments
 (0)