asm_amd64.s 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // +build !noasm,amd64 !appengine,amd64
  2. #include "go_asm.h"
  3. #include "funcdata.h"
  4. #include "textflag.h"
  5. TEXT ·MoreStack(SB), NOSPLIT, $0 - 8
  6. NO_LOCAL_POINTERS
  7. _entry:
  8. MOVQ (TLS), R14
  9. MOVQ size+0(FP), R12
  10. NOTQ R12
  11. LEAQ (SP)(R12*1), R12
  12. CMPQ R12, 16(R14)
  13. JBE _stack_grow
  14. RET
  15. _stack_grow:
  16. CALL runtime·morestack_noctxt<>(SB)
  17. JMP _entry
  18. TEXT ·StopProf(SB), NOSPLIT, $0-0
  19. NO_LOCAL_POINTERS
  20. CMPB github·com∕bytedance∕sonic∕internal∕rt·StopProfiling(SB), $0
  21. JEQ _ret_1
  22. MOVL $1, AX
  23. LEAQ github·com∕bytedance∕sonic∕internal∕rt·yieldCount(SB), CX
  24. LOCK
  25. XADDL AX, (CX)
  26. MOVL runtime·prof+4(SB), AX
  27. TESTL AX, AX
  28. JEQ _ret_1
  29. MOVL AX, github·com∕bytedance∕sonic∕internal∕rt·oldHz(SB)
  30. MOVL $0, runtime·prof+4(SB)
  31. _ret_1:
  32. RET
  33. TEXT ·StartProf(SB), NOSPLIT, $0-0
  34. NO_LOCAL_POINTERS
  35. CMPB github·com∕bytedance∕sonic∕internal∕rt·StopProfiling(SB), $0
  36. JEQ _ret_2
  37. MOVL $-1, AX
  38. LEAQ github·com∕bytedance∕sonic∕internal∕rt·yieldCount(SB), CX
  39. LOCK
  40. XADDL AX, (CX)
  41. CMPL github·com∕bytedance∕sonic∕internal∕rt·yieldCount(SB), $0
  42. JNE _ret_2
  43. CMPL runtime·prof+4(SB), $0
  44. JNE _ret_2
  45. CMPL github·com∕bytedance∕sonic∕internal∕rt·oldHz(SB), $0
  46. JNE _branch_1
  47. MOVL $100, github·com∕bytedance∕sonic∕internal∕rt·oldHz(SB)
  48. _branch_1:
  49. MOVL github·com∕bytedance∕sonic∕internal∕rt·oldHz(SB), AX
  50. MOVL AX, runtime·prof+4(SB)
  51. _ret_2:
  52. RET