1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: set ts=8 sts=2 et sw=2 tw=80:
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "vm/TaggedProto.h"
9 #include "gc/Barrier.h"
10 #include "vm/JSObject.h"
14 /* static */ void InternalBarrierMethods
<TaggedProto
>::preBarrier(
16 InternalBarrierMethods
<JSObject
*>::preBarrier(proto
.toObjectOrNull());
19 /* static */ void InternalBarrierMethods
<TaggedProto
>::postBarrier(
20 TaggedProto
* vp
, TaggedProto prev
, TaggedProto next
) {
21 JSObject
* prevObj
= prev
.isObject() ? prev
.toObject() : nullptr;
22 JSObject
* nextObj
= next
.isObject() ? next
.toObject() : nullptr;
23 InternalBarrierMethods
<JSObject
*>::postBarrier(
24 reinterpret_cast<JSObject
**>(vp
), prevObj
, nextObj
);
27 /* static */ void InternalBarrierMethods
<TaggedProto
>::readBarrier(
28 const TaggedProto
& proto
) {
29 InternalBarrierMethods
<JSObject
*>::readBarrier(proto
.toObjectOrNull());
32 void TaggedProto::trace(JSTracer
* trc
) { TraceRoot(trc
, this, "TaggedProto"); }