Commit 15cceca
committed
op_dump(): display names of variables for pad ops.
Make op_dump(), as used by 'perl -Dx', display the names of pad
variables when dumping pad ops.
The runtime perl -Dt already does this (note the $x, $y etc appearing in
the op name displays):
$ perl -Dt -e'my ($x, $y); $y = 1+$x'
(-e:0) enter
(-e:0) nextstate
(-e:1) padrange($x,$y)
(-e:1) nextstate
(-e:1) const(IV(1))
(-e:1) padsv($x)
(-e:1) add($y)
(-e:1) leave
While the (typically compile-time) -Dx detailed optree dumping didn't.
Here are some 'before this commit' and 'after' examples of how some of
those ops were/are now displayed. Note the changes in the 'TARG = N'
lines for the following code:
$ perl -Dx -e'my ($x, $y); $y = 1+$x'
Before:
4 | +--padrange OP(0x31b08960) ===> 6 [nextstate 0x31b09fc0]
| | TARG = 1
| | FLAGS = (VOID,MOD,SLABBED,MORESIB)
| | PRIVATE = (LVINTRO,range=0x2)
10 +--add BINOP(0x31b0a060) ===> 1 [leave 0x31b08880]
TARG = 2
FLAGS = (VOID,KIDS,SLABBED)
PRIVATE = (TARGMY,0x2)
11 +--padsv OP(0x31b0a0a0) ===> 10 [add 0x31b0a060]
TARG = 1
FLAGS = (SCALAR,SLABBED)
After:
4 | +--padrange OP(0x18ffe920) ===> 6 [nextstate 0x18ffff80]
| | TARG = 1 ($x,$y)
| | FLAGS = (VOID,MOD,SLABBED,MORESIB)
| | PRIVATE = (LVINTRO,range=0x2)
10 +--add BINOP(0x19000020) ===> 1 [leave 0x18ffe840]
TARG = 2 ($y)
FLAGS = (VOID,KIDS,SLABBED)
PRIVATE = (TARGMY,0x2)
11 +--padsv OP(0x19000060) ===> 10 [add 0x19000020]
TARG = 1 ($x)
FLAGS = (SCALAR,SLABBED)1 parent dcabdfc commit 15cceca
1 file changed
+36
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1285 | 1285 | | |
1286 | 1286 | | |
1287 | 1287 | | |
1288 | | - | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
1289 | 1291 | | |
1290 | 1292 | | |
1291 | 1293 | | |
| |||
1379 | 1381 | | |
1380 | 1382 | | |
1381 | 1383 | | |
1382 | | - | |
1383 | | - | |
1384 | | - | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
1385 | 1417 | | |
1386 | 1418 | | |
1387 | 1419 | | |
| |||
0 commit comments