Commit 57bca06b authored by Steve Fink's avatar Steve Fink
Browse files

Backed out changeset 901b1c651c98 (bug 1246804)

--HG--
extra : rebase_source : d80a34f467275bf74672b87fd09a254b39ee20a1
parent 5097fa6f
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@

#include <stdarg.h>

#include "js/GCAnnotations.h"
#include "js/Value.h"
#include "nscore.h"
#include "nsStringGlue.h"
+1 −2
Original line number Diff line number Diff line
@@ -9,7 +9,6 @@

#include "mozilla/Vector.h"

#include "js/GCAnnotations.h"
#include "js/HeapAPI.h"
#include "js/UniquePtr.h"

@@ -582,7 +581,7 @@ class JS_PUBLIC_API(AutoCheckCannotGC) : public AutoAssertOnGC
  public:
    AutoCheckCannotGC() : AutoAssertOnGC() {}
    explicit AutoCheckCannotGC(JSRuntime* rt) : AutoAssertOnGC(rt) {}
} JS_HAZ_GC_INVALIDATED;
};

/**
 * Unsets the gray bit for anything reachable from |thing|. |kind| should not be

js/public/GCAnnotations.h

deleted100644 → 0
+0 −53
Original line number Diff line number Diff line
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=8 sts=4 et sw=4 tw=99:
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef js_GCAnnotations_h
#define js_GCAnnotations_h

// Set of annotations for the rooting hazard analysis, used to categorize types
// and functions.
#ifdef XGILL_PLUGIN

// Mark a type as being a GC thing (eg js::gc::Cell has this annotation).
# define JS_HAZ_GC_THING __attribute__((tag("GC Thing")))

// Mark a type as holding a pointer to a GC thing (eg JS::Value has this
// annotation.)
# define JS_HAZ_GC_POINTER __attribute__((tag("GC Pointer")))

// Mark a type as a rooted pointer, suitable for use on the stack (eg all
// Rooted<T> instantiations should have this.)
# define JS_HAZ_ROOTED __attribute__((tag("Rooted Pointer")))

// Mark a type as something that should not be held live across a GC, but which
// is itself not a GC pointer.
# define JS_HAZ_GC_INVALIDATED __attribute__((tag("Invalidated by GC")))

// Mark a type that would otherwise be considered a GC Pointer (eg because it
// contains a JS::Value field) as a non-GC pointer. It is handled almost the
// same in the analysis as a rooted pointer, except it will not be reported as
// an unnecessary root if used across a GC call. This should rarely be used,
// but makes sense for something like ErrorResult, which only contains a GC
// pointer when it holds an exception (and it does its own rooting,
// conditionally.)
# define JS_HAZ_NON_GC_POINTER __attribute__((tag("Suppressed GC Pointer")))

// Mark a function as something that runs a garbage collection, potentially
// invalidating GC pointers.
# define JS_HAZ_GC_CALL __attribute__((tag("GC Call")))

#else

# define JS_HAZ_GC_THING
# define JS_HAZ_GC_POINTER
# define JS_HAZ_ROOTED
# define JS_HAZ_GC_INVALIDATED
# define JS_HAZ_NON_GC_POINTER
# define JS_HAZ_GC_CALL

#endif

#endif /* js_GCAnnotations_h */
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ struct jsid
    size_t asBits;
    bool operator==(jsid rhs) const { return asBits == rhs.asBits; }
    bool operator!=(jsid rhs) const { return asBits != rhs.asBits; }
} JS_HAZ_GC_POINTER;
};
#define JSID_BITS(id) (id.asBits)

#define JSID_TYPE_STRING                 0x0
+2 −3
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

#include "jspubtd.h"

#include "js/GCAnnotations.h"
#include "js/GCAPI.h"
#include "js/GCPolicyAPI.h"
#include "js/HeapAPI.h"
@@ -708,7 +707,7 @@ class MOZ_RAII Rooted : public js::RootedBase<T>
    MaybeWrapped ptr;

    Rooted(const Rooted&) = delete;
} JS_HAZ_ROOTED;
};

} /* namespace JS */

@@ -1054,7 +1053,7 @@ class PersistentRooted : public js::PersistentRootedBase<T>,
        T>::Type;

    MaybeWrapped ptr;
} JS_HAZ_ROOTED;
};

class JS_PUBLIC_API(ObjectPtr)
{
Loading