diff options
author | Moonchild <mcwerewolf@gmail.com> | 2018-08-13 18:58:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-13 18:58:12 +0200 |
commit | 98be5e94609a80edf35414ce1ac435bfa08de6c3 (patch) | |
tree | e9fac57664c4df42e737ed1fd5d23237c9d82ced /js/src/gc | |
parent | ba2882cf71d06e121b7a023f954388768a5964dd (diff) | |
parent | 9ac48ef8319087fcb68d9021db0af9d5cb1080af (diff) | |
download | UXP-98be5e94609a80edf35414ce1ac435bfa08de6c3.tar UXP-98be5e94609a80edf35414ce1ac435bfa08de6c3.tar.gz UXP-98be5e94609a80edf35414ce1ac435bfa08de6c3.tar.lz UXP-98be5e94609a80edf35414ce1ac435bfa08de6c3.tar.xz UXP-98be5e94609a80edf35414ce1ac435bfa08de6c3.zip |
Merge pull request #707 from trav90/class-memaccess-errors
Simplify HeapSlot to make it trivially copyable
Diffstat (limited to 'js/src/gc')
-rw-r--r-- | js/src/gc/Barrier.h | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/js/src/gc/Barrier.h b/js/src/gc/Barrier.h index effc9233e..dce3b2a20 100644 --- a/js/src/gc/Barrier.h +++ b/js/src/gc/Barrier.h @@ -667,29 +667,15 @@ class HeapSlot : public WriteBarrieredBase<Value> Element = 1 }; - explicit HeapSlot() = delete; - - explicit HeapSlot(NativeObject* obj, Kind kind, uint32_t slot, const Value& v) - : WriteBarrieredBase<Value>(v) - { - post(obj, kind, slot, v); - } - - explicit HeapSlot(NativeObject* obj, Kind kind, uint32_t slot, const HeapSlot& s) - : WriteBarrieredBase<Value>(s.value) - { - post(obj, kind, slot, s); - } - - ~HeapSlot() { - pre(); - } - void init(NativeObject* owner, Kind kind, uint32_t slot, const Value& v) { value = v; post(owner, kind, slot, v); } + void destroy() { + pre(); + } + #ifdef DEBUG bool preconditionForSet(NativeObject* owner, Kind kind, uint32_t slot) const; bool preconditionForWriteBarrierPost(NativeObject* obj, Kind kind, uint32_t slot, @@ -703,11 +689,6 @@ class HeapSlot : public WriteBarrieredBase<Value> post(owner, kind, slot, v); } - /* For users who need to manually barrier the raw types. */ - static void writeBarrierPost(NativeObject* owner, Kind kind, uint32_t slot, const Value& target) { - reinterpret_cast<HeapSlot*>(const_cast<Value*>(&target))->post(owner, kind, slot, target); - } - private: void post(NativeObject* owner, Kind kind, uint32_t slot, const Value& target) { MOZ_ASSERT(preconditionForWriteBarrierPost(owner, kind, slot, target)); |