Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Copyright 2015 the V8 project authors. All rights reserved.
- // Use of this source code is governed by a BSD-style license that can be
- // found in the LICENSE file.
- #include "src/execution/isolate.h"
- #include "src/objects/objects-inl.h"
- using namespace v8::internal;
- static void* ToWaitLocation(Tagged<JSArrayBuffer> array_buffer, size_t addr)
- {
- return static_cast<uint8_t*>(array_buffer->backing_store()) + addr;
- }
- void WaitSync(Isolate* isolate, Handle<JSArrayBuffer> 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._Z8WaitSyncPN2v88internal7IsolateENS0_6HandleINS0_13JSArrayBufferEEEjx:
- 00000000 <_Z8WaitSyncPN2v88internal7IsolateENS0_6HandleINS0_13JSArrayBufferEEEjx>:
- {
- return static_cast<uint8_t*>(array_buffer->backing_store()) + addr;
- }
- void WaitSync(Isolate* isolate, Handle<JSArrayBuffer> array_buffer, size_t addr, int64_t value)
- {
- 0: e52db004 push {fp} @ (str fp, [sp, #-4]!)
- 4: e28db000 add fp, sp, #0
- 8: e5913000 ldr r3, [r1]
- c: e5933017 ldr r3, [r3, #23]
- 10: f57ff05b dmb ish
- 14: e18320d2 ldrd r2, [r3, r2]
- 18: 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();
- }
- 1c: e28bd000 add sp, fp, #0
- 20: e49db004 pop {fp} @ (ldr fp, [sp], #4)
- 24: e12fff1e bx lr
Advertisement
Add Comment
Please, Sign In to add comment