@@ -613,20 +613,38 @@ static int zend_jit_trace_subtrace(zend_jit_trace_rec *trace_buffer, int start,
613
613
* Trace Linking Rules
614
614
* ===================
615
615
*
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
+ *
630
648
*
631
649
* loop: LOOP if "cycle" and level == 0, otherwise INNER_LOOP
632
650
* 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,
637
655
* return: RETURN if level == 0
638
656
* rec_ret: RECURSIVE_RET if "cycle" and ret_level > N, otherwise continue
639
657
* 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.
641
659
*/
642
660
643
661
zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute (zend_execute_data * ex ,
0 commit comments