Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <atomic>
- #include <stdint.h>
- void* ToWaitLocation(uint8_t *array_buffer, size_t addr)
- {
- return array_buffer + addr;
- }
- void WaitSync(void* isolate, uint8_t *array_buffer, size_t addr, int64_t value)
- {
- void* wait_location = ToWaitLocation(array_buffer, addr);
- std::atomic<int64_t>* p = reinterpret_cast<std::atomic<int64_t>*>(wait_location);
- p->load();
- }
- --------------------------------------------------------------------------------
- Disassembly of section .text._Z14ToWaitLocationPhj:
- 00000000 <_Z14ToWaitLocationPhj>:
- #include <atomic>
- #include <stdint.h>
- void* ToWaitLocation(uint8_t *array_buffer, size_t addr)
- {
- 0: e52db004 push {fp} @ (str fp, [sp, #-4]!)
- 4: e28db000 add fp, sp, #0
- return array_buffer + addr;
- }
- 8: e0800001 add r0, r0, r1
- c: e28bd000 add sp, fp, #0
- 10: e49db004 pop {fp} @ (ldr fp, [sp], #4)
- 14: e12fff1e bx lr
- Disassembly of section .text._Z8WaitSyncPvPhjx:
- 00000000 <_Z8WaitSyncPvPhjx>:
- void WaitSync(void* isolate, uint8_t *array_buffer, size_t addr, int64_t value)
- {
- 0: e52db004 push {fp} @ (str fp, [sp, #-4]!)
- 4: e28db000 add fp, sp, #0
- 8: f57ff05b dmb ish
- c: e18120d2 ldrd r2, [r1, r2]
- 10: f57ff05b dmb ish
- void* wait_location = ToWaitLocation(array_buffer, addr);
- std::atomic<int64_t>* p = reinterpret_cast<std::atomic<int64_t>*>(wait_location);
- p->load();
- }
- 14: e28bd000 add sp, fp, #0
- 18: e49db004 pop {fp} @ (ldr fp, [sp], #4)
- 1c: e12fff1e bx lr
Advertisement
Add Comment
Please, Sign In to add comment