Guest User

Untitled

a guest
May 13th, 2025
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. #include <atomic>
  2. #include <stdint.h>
  3.  
  4. void* ToWaitLocation(uint8_t *array_buffer, size_t addr)
  5. {
  6. return array_buffer + addr;
  7. }
  8.  
  9. void WaitSync(void* isolate, uint8_t *array_buffer, size_t addr, int64_t value)
  10. {
  11. void* wait_location = ToWaitLocation(array_buffer, addr);
  12. std::atomic<int64_t>* p = reinterpret_cast<std::atomic<int64_t>*>(wait_location);
  13. p->load();
  14. }
  15.  
  16. --------------------------------------------------------------------------------
  17. Disassembly of section .text._Z14ToWaitLocationPhj:
  18.  
  19. 00000000 <_Z14ToWaitLocationPhj>:
  20. #include <atomic>
  21. #include <stdint.h>
  22.  
  23. void* ToWaitLocation(uint8_t *array_buffer, size_t addr)
  24. {
  25. 0: e52db004 push {fp} @ (str fp, [sp, #-4]!)
  26. 4: e28db000 add fp, sp, #0
  27. return array_buffer + addr;
  28. }
  29. 8: e0800001 add r0, r0, r1
  30. c: e28bd000 add sp, fp, #0
  31. 10: e49db004 pop {fp} @ (ldr fp, [sp], #4)
  32. 14: e12fff1e bx lr
  33.  
  34. Disassembly of section .text._Z8WaitSyncPvPhjx:
  35.  
  36. 00000000 <_Z8WaitSyncPvPhjx>:
  37.  
  38. void WaitSync(void* isolate, uint8_t *array_buffer, size_t addr, int64_t value)
  39. {
  40. 0: e52db004 push {fp} @ (str fp, [sp, #-4]!)
  41. 4: e28db000 add fp, sp, #0
  42. 8: f57ff05b dmb ish
  43. c: e18120d2 ldrd r2, [r1, r2]
  44. 10: f57ff05b dmb ish
  45. void* wait_location = ToWaitLocation(array_buffer, addr);
  46. std::atomic<int64_t>* p = reinterpret_cast<std::atomic<int64_t>*>(wait_location);
  47. p->load();
  48. }
  49. 14: e28bd000 add sp, fp, #0
  50. 18: e49db004 pop {fp} @ (ldr fp, [sp], #4)
  51. 1c: e12fff1e bx lr
  52.  
Advertisement
Add Comment
Please, Sign In to add comment