Posted to tcl by miguel at Sat Nov 24 12:37:35 GMT 2007view raw

  1. % proc moo {} {
  2. set apa {a {}b c d}
  3. catch {dict append apa a 5}
  4. }
  5. % tcl::unsupported::disassemble proc moo
  6. ByteCode 0x0x81e9e58, refCt 1, epoch 3, interp 0x0x81854f8 (epoch 3)
  7. Source "\n set apa {a {}b c d}\n "
  8. Cmds 3, src 105, inst 47, litObjs 3, aux 0, stkDepth 2, code/src 2.02
  9. Code 212 = header 104+inst 47+litObj 12+exc 28+aux 0+cmdMap 12
  10. Proc 0x0x81a9438, refCt 1, args 0, compiled locals 2
  11. slot 0, scalar, "apa"
  12. slot 1, scalar, "a"
  13. Exception ranges 1, depth 1:
  14. 0: level 0, catch, pc 19-38, catch 44
  15. Commands 3:
  16. 1: pc 0-4, src 20-38 2: pc 5-45, src 59-87
  17. 3: pc 19-38, src 66-86
  18. Command 1: "set apa {a {}b c d}"
  19. (0) push1 0 # "a {}b c d"
  20. (2) storeScalar1 %v0 # var "apa"
  21. (4) pop
  22. Command 2: "catch {dict append apa a 5}"
  23. (5) startCommand +41 1 # next cmd at pc 46
  24. (14) beginCatch4 0
  25. Command 3: "dict append apa a 5"
  26. (19) startCommand +20 1 # next cmd at pc 39
  27. (28) push1 1 # "5"
  28. (30) push1 1 # "5"
  29. (32) concat1 2
  30. (34) dictAppend %v1 # var "a"
  31. (39) pop
  32. (40) push1 2 # "0"
  33. (42) jump1 +3 # pc 45
  34. (44) pushReturnCode
  35. (45) endCatch
  36. (46) done