Revert "Trace function return values after function-exit."

This reverts commit 85cc1bece7.

Reason for revert: ends up not being useful after all

Original change's description:
> Trace function return values after function-exit.
>
> This will allow function return values to be easily seen when stepping
> "over." This has the unexpected side benefit of generating slightly
> fewer ops when a function has unoptimizable conditional returns.
>
> Change-Id: I48d23de635d3caaddff91aa595593d0371dfcdcb
> Bug: skia:12708
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/481076
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>

Bug: skia:12708
Change-Id: I61ebb175b60d2060f6ad21b170238b37557b80be
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/482458
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This commit is contained in:
John Stiles 2021-12-10 09:52:36 -05:00 committed by SkCQ
parent f693b20c37
commit b1a97caf71
8 changed files with 1374 additions and 1360 deletions

View File

@ -554,14 +554,6 @@ size_t SkVMGenerator::writeFunction(const FunctionDefinition& function,
if (fDebugTrace) {
fBuilder->trace_exit(fTraceHookID, this->mask(), fTraceMask, funcIndex);
if (fProgram.fConfig->fSettings.fAllowTraceVarInSkVMDebugTrace) {
size_t nslots = function.declaration().returnType().slotCount();
for (size_t i = 0; i < nslots; ++i) {
fBuilder->trace_var(fTraceHookID, this->mask(), fTraceMask,
returnSlot + i, i32(fSlots[returnSlot + i].val));
}
}
}
return returnSlot;
@ -1871,8 +1863,10 @@ void SkVMGenerator::writeReturnStatement(const ReturnStatement& r) {
size_t slot = currentFunction().fReturnSlot;
size_t nslots = r.expression()->type().slotCount();
for (size_t i = 0; i < nslots; ++i) {
fSlots[slot + i].val = this->writeConditionalStore(fSlots[slot + i].val, val[i],
returnsHere);
fSlots[slot + i].writtenTo = false;
skvm::Val conditionalStore = this->writeConditionalStore(fSlots[slot + i].val, val[i],
returnsHere);
this->writeToSlot(slot + i, conditionalStore);
}
}

View File

@ -579,11 +579,11 @@ enter half4 main(float2 p)
val.x = 0
val.y = 1
line 4
[main].result.x = 0
[main].result.y = 1
[main].result.z = 0
[main].result.w = 1
exit half4 main(float2 p)
[main].result.x = 0
[main].result.y = 1
[main].result.z = 0
[main].result.w = 1
)",
"Trace output does not match expectation:\n%.*s\n",
(int)dump.size(), dump.data());

View File

@ -1078,8 +1078,8 @@ enter int main()
comparison = true
line 3
line 4
[less_than].result = true
exit bool less_than(float left, int right)
[less_than].result = true
function_result = true
line 12
loop = 20
@ -1107,8 +1107,8 @@ enter int main()
comparison = false
line 3
line 6
[less_than].result = false
exit bool less_than(float left, int right)
[less_than].result = false
function_result = false
line 12
loop = 30
@ -1136,12 +1136,12 @@ enter int main()
comparison = false
line 3
line 6
[less_than].result = false
exit bool less_than(float left, int right)
[less_than].result = false
function_result = false
line 12
line 18
[main].result = 40
exit int main()
[main].result = 40
)", "Trace output does not match expectation:\n%.*s\n", (int)trace.size(), trace.data());
}

View File

@ -139,8 +139,8 @@ loop:
86 trace_line 0 r53 r53 L38
87 trace_enter 0 r53 r53 F1
88 trace_line 0 r53 r53 L5
89 trace_exit 0 r53 r53 F1
90 trace_var 0 r53 r53 $34 = r1
89 trace_var 0 r53 r53 $34 = r1
90 trace_exit 0 r53 r53 F1
91 trace_enter 0 r53 r53 F2
92 trace_line 0 r53 r53 L10
93 trace_var 0 r53 r53 $36 = r29
@ -162,8 +162,8 @@ loop:
109 trace_var 0 r53 r53 $36 = r37
110 trace_line 0 r53 r53 L11
111 trace_line 0 r53 r53 L14
112 trace_exit 0 r53 r53 F2
113 trace_var 0 r53 r53 $35 = r37
112 trace_var 0 r53 r53 $35 = r37
113 trace_exit 0 r53 r53 F2
114 trace_enter 0 r53 r53 F3
115 trace_line 0 r53 r53 L19
116 trace_var 0 r53 r53 $39 = r38
@ -185,8 +185,8 @@ loop:
132 trace_var 0 r53 r53 $39 = r41
133 trace_line 0 r53 r53 L20
134 trace_line 0 r53 r53 L23
135 trace_exit 0 r53 r53 F3
136 trace_var 0 r53 r53 $38 = r41
135 trace_var 0 r53 r53 $38 = r41
136 trace_exit 0 r53 r53 F3
137 trace_enter 0 r53 r53 F4
138 trace_line 0 r53 r53 L28
139 trace_var 0 r53 r53 $42 = r29
@ -218,13 +218,13 @@ loop:
165 trace_line 0 r53 r53 L30
166 trace_line 0 r53 r53 L29
167 trace_line 0 r53 r53 L34
168 trace_exit 0 r53 r53 F4
169 trace_var 0 r53 r53 $41 = r50
170 trace_exit 0 r53 r53 F0
171 trace_var 0 r53 r53 $28 = r1
172 trace_var 0 r53 r53 $29 = r37
173 trace_var 0 r53 r53 $30 = r41
174 trace_var 0 r53 r53 $31 = r50
168 trace_var 0 r53 r53 $41 = r50
169 trace_exit 0 r53 r53 F4
170 trace_var 0 r53 r53 $28 = r1
171 trace_var 0 r53 r53 $29 = r37
172 trace_var 0 r53 r53 $30 = r41
173 trace_var 0 r53 r53 $31 = r50
174 trace_exit 0 r53 r53 F0
175 store32 ptr1 r1
176 store32 ptr2 r37
177 store32 ptr3 r41

View File

@ -32,11 +32,11 @@ loop:
17 trace_var 0 r7 r7 $2 = r5
18 trace_exit 0 r7 r7 F1
19 trace_line 0 r7 r7 L13
20 trace_exit 0 r7 r7 F0
21 trace_var 0 r7 r7 $3 = r1
22 trace_var 0 r7 r7 $4 = r5
23 trace_var 0 r7 r7 $5 = r1
24 trace_var 0 r7 r7 $6 = r5
20 trace_var 0 r7 r7 $3 = r1
21 trace_var 0 r7 r7 $4 = r5
22 trace_var 0 r7 r7 $5 = r1
23 trace_var 0 r7 r7 $6 = r5
24 trace_exit 0 r7 r7 F0
25 store32 ptr1 r1
26 store32 ptr2 r5
27 store32 ptr3 r1

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -224,8 +224,8 @@ loop:
64 trace_line 0 r21 r21 L9
65 trace_var 0 r21 r21 $34 = r14
66 trace_line 0 r21 r21 L11
67 trace_exit 0 r21 r21 F1
68 trace_var 0 r21 r21 $30 = r10
67 trace_var 0 r21 r21 $30 = r10
68 trace_exit 0 r21 r21 F1
69 trace_enter 0 r21 r21 F2
70 trace_line 0 r21 r21 L15
71 trace_var 0 r21 r21 $36 = r15
@ -276,8 +276,8 @@ loop:
116 trace_var 0 r21 r21 $70 = r19
117 trace_var 0 r21 r21 $71 = r19
118 trace_line 0 r21 r21 L29
119 trace_exit 0 r21 r21 F2
120 trace_var 0 r21 r21 $35 = r10
119 trace_var 0 r21 r21 $35 = r10
120 trace_exit 0 r21 r21 F2
121 trace_enter 0 r21 r21 F3
122 trace_line 0 r21 r21 L34
123 trace_var 0 r21 r21 $73 = r15
@ -344,8 +344,8 @@ loop:
184 trace_var 0 r21 r21 $129 = r9
185 trace_var 0 r21 r21 $130 = r17
186 trace_line 0 r21 r21 L41
187 trace_exit 0 r21 r21 F3
188 trace_var 0 r21 r21 $72 = r10
187 trace_var 0 r21 r21 $72 = r10
188 trace_exit 0 r21 r21 F3
189 trace_enter 0 r21 r21 F4
190 trace_line 0 r21 r21 L45
191 trace_var 0 r21 r21 $132 = r9
@ -376,28 +376,28 @@ loop:
216 trace_var 0 r21 r21 $140 = r15
217 trace_var 0 r21 r21 $141 = r16
218 trace_line 0 r21 r21 L50
219 trace_exit 0 r21 r21 F4
220 trace_var 0 r21 r21 $131 = r10
219 trace_var 0 r21 r21 $131 = r10
220 trace_exit 0 r21 r21 F4
221 trace_enter 0 r21 r21 F5
222 trace_var 0 r21 r21 $143 = r13
223 trace_line 0 r21 r21 L53
224 trace_exit 0 r21 r21 F5
225 trace_var 0 r21 r21 $142 = r10
224 trace_var 0 r21 r21 $142 = r10
225 trace_exit 0 r21 r21 F5
226 trace_enter 0 r21 r21 F6
227 trace_var 0 r21 r21 $145 = r15
228 trace_line 0 r21 r21 L54
229 trace_exit 0 r21 r21 F6
230 trace_var 0 r21 r21 $144 = r10
229 trace_var 0 r21 r21 $144 = r10
230 trace_exit 0 r21 r21 F6
231 trace_enter 0 r21 r21 F7
232 trace_var 0 r21 r21 $147 = r16
233 trace_line 0 r21 r21 L55
234 trace_exit 0 r21 r21 F7
235 trace_var 0 r21 r21 $146 = r10
236 trace_exit 0 r21 r21 F0
237 trace_var 0 r21 r21 $8 = r1
238 trace_var 0 r21 r21 $9 = r2
239 trace_var 0 r21 r21 $10 = r3
240 trace_var 0 r21 r21 $11 = r4
234 trace_var 0 r21 r21 $146 = r10
235 trace_exit 0 r21 r21 F7
236 trace_var 0 r21 r21 $8 = r1
237 trace_var 0 r21 r21 $9 = r2
238 trace_var 0 r21 r21 $10 = r3
239 trace_var 0 r21 r21 $11 = r4
240 trace_exit 0 r21 r21 F0
241 store32 ptr1 r1
242 store32 ptr2 r2
243 store32 ptr3 r3