Backed out changeset 2450366cf7ca (bug 1891629) for causing win msix mochitest failures
[gecko.git] / js / src / vm / TaggedProto.cpp
blob558d569a004b0fc5fbe20efe4715536d7e07b50a
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"
12 namespace js {
14 /* static */ void InternalBarrierMethods<TaggedProto>::preBarrier(
15 TaggedProto& proto) {
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"); }
34 } // namespace js