Posted to tcl by kbk at Thu Apr 04 17:19:09 GMT 2019view raw

  1. % proc one {a b} { expr {$a < $b} } ; tcl::unsupported::disassemble proc one
  2. ByteCode 0x0x2228390, refCt 1, epoch 15, interp 0x0x21f77f0 (epoch 15)
  3. Source " expr {$a < $b} "
  4. Cmds 1, src 16, inst 6, litObjs 0, aux 0, stkDepth 2, code/src 0.00
  5. Proc 0x0x224d5c0, refCt 1, args 2, compiled locals 2
  6. slot 0, scalar, arg, "a"
  7. slot 1, scalar, arg, "b"
  8. Commands 1:
  9. 1: pc 0-4, src 1-15
  10. Command 1: "expr {$a < $b} "
  11. (0) loadScalar1 %v0 # var "a"
  12. (2) loadScalar1 %v1 # var "b"
  13. (4) lt
  14. (5) done
  15.  
  16. % proc two {a b} { < $a $b } ; tcl::unsupported::disassemble proc two
  17. ByteCode 0x0x2228490, refCt 1, epoch 15, interp 0x0x21f77f0 (epoch 15)
  18. Source " < $a $b "
  19. Cmds 1, src 9, inst 9, litObjs 1, aux 0, stkDepth 3, code/src 0.00
  20. Proc 0x0x2259c70, refCt 1, args 2, compiled locals 2
  21. slot 0, scalar, arg, "a"
  22. slot 1, scalar, arg, "b"
  23. Commands 1:
  24. 1: pc 0-7, src 1-8
  25. Command 1: "< $a $b "
  26. (0) push1 0 # "<"
  27. (2) loadScalar1 %v0 # var "a"
  28. (4) loadScalar1 %v1 # var "b"
  29. (6) invokeStk1 3
  30. (8) done
  31.  

Comments

Posted by kbk at Thu Apr 04 17:25:49 GMT 2019 [text] [code]

I'm wrong, mistyped tcl::mathop in the [namespace path] % proc two {a b} { < $a $b } ; tcl::unsupported::disassemble proc two ByteCode 0x0x2228490, refCt 1, epoch 15, interp 0x0x21f77f0 (epoch 15) Source " < $a $b " Cmds 1, src 9, inst 6, litObjs 0, aux 0, stkDepth 2, code/src 0.00 Proc 0x0x2259ef0, refCt 1, args 2, compiled locals 2 slot 0, scalar, arg, "a" slot 1, scalar, arg, "b" Commands 1: 1: pc 0-4, src 1-8 Command 1: "< $a $b " (0) loadScalar1 %v0 # var "a" (2) loadScalar1 %v1 # var "b" (4) lt (5) done