Bug 392074: JS_IS_VALID_TRACE_KIND no longer refers to the removed JSTRACE_ATOM. r=brendan
authorigor@mir2.org
Mon, 13 Aug 2007 13:23:34 -0700
changeset 4573 a5312b6766843f7f3f1281a7ca0e2519bcbf0262
parent 4572 76e63cbe4d5ea891ea4f8620f4da709a447bb240
child 4574 13fe21f354eae59fe348f503b568f9484a39d279
push idunknown
push userunknown
push dateunknown
reviewersbrendan
bugs392074
milestone1.9a8pre
Bug 392074: JS_IS_VALID_TRACE_KIND no longer refers to the removed JSTRACE_ATOM. r=brendan
js/src/jsgc.h
--- a/js/src/jsgc.h
+++ b/js/src/jsgc.h
@@ -163,34 +163,40 @@ js_LockGCThingRT(JSRuntime *rt, void *th
 extern JSBool
 js_UnlockGCThingRT(JSRuntime *rt, void *thing);
 
 extern JSBool
 js_IsAboutToBeFinalized(JSContext *cx, void *thing);
 
 /*
  * Macro to test if a traversal is the marking phase of GC to avoid exposing
- * JSAtom and ScriptFilenameEntry to traversal implementations.
+ * ScriptFilenameEntry to traversal implementations.
  */
 #define IS_GC_MARKING_TRACER(trc) ((trc)->callback == NULL)
 
 JS_STATIC_ASSERT(JSTRACE_STRING == 2);
 
 #define JSTRACE_FUNCTION    3
 #define JSTRACE_NAMESPACE   4
 #define JSTRACE_QNAME       5
 #define JSTRACE_XML         6
 
 #if JS_HAS_XML_SUPPORT
 # define JS_IS_VALID_TRACE_KIND(kind) ((uint32)(kind) <= JSTRACE_XML)
 #else
-# define JS_IS_VALID_TRACE_KIND(kind) ((uint32)(kind) <= JSTRACE_ATOM)
+# define JS_IS_VALID_TRACE_KIND(kind) ((uint32)(kind) <= JSTRACE_FUNCTION)
 #endif
 
 /*
+ * JS_IS_VALID_TRACE_KIND assumes that JSTRACE_FUNCTION is the last non-xml
+ * trace kind when JS_HAS_XML_SUPPORT is false.
+ */
+JS_STATIC_ASSERT(JSTRACE_FUNCTION + 1 == JSTRACE_NAMESPACE);
+
+/*
  * Trace jsval when JSVAL_IS_OBJECT(v) can be an arbitrary GC thing casted as
  * JSVAL_OBJECT and js_GetGCThingFlags has to be used to find the real type
  * behind v.
  */
 extern void
 js_CallValueTracerIfGCThing(JSTracer *trc, jsval v);
 
 extern void