jit.inc 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. JITed y_inline. Needs to be done ahead of time (much like the old version).
  3. Basic process:
  4. 1) Find everything that is an inline function, this will need pattern
  5. searching again as in the old version. Slow at startup, but not
  6. terrible, and fine afterwards. Note that I already scan the AMX for
  7. certain patterns, so I can scan for this too at the same time maybe.
  8. 2) Rewrite the code. The new version reads the stack at run time, this
  9. version can't so will need some more cunning method.
  10. */
  11. static stock const
  12. YSI_g_scParameterCounts[Opcode] =
  13. {
  14. 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  15. 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1,
  16. 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1,
  17. 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1,
  18. 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1,
  19. 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, 0, 1, -1, 0, 0, 1, 0, 1, 1, 0,
  20. cellmin
  21. };
  22. static stock
  23. YSI_g_sScanPatterns[128],
  24. YSI_g_sScanIndexes[8],
  25. YSI_g_sScanners = 0;
  26. stock Scanner_AddPattern(...)
  27. {
  28. if (YSI_g_sScanners == sizeof (YSI_g_sScanIndexes) - 1) return -1;
  29. new
  30. idx = YSI_g_sScanIndexes[YSI_g_sScanners],
  31. codes = numargs();
  32. }