From b2775a71f022ce5c84845dbde9612007b3f9fd76 Mon Sep 17 00:00:00 2001 From: Jeff Walden Date: Fri, 25 Mar 2011 17:23:05 -0700 Subject: [PATCH] Fix a compiler warning that occurs when jsgcinlines.h is included before jsobjinlines.h. r=warning-patrol --- js/src/jsgcinlines.h | 31 +++++++++++++++++++++++++++++++ js/src/jsobjinlines.h | 25 ------------------------- 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/js/src/jsgcinlines.h b/js/src/jsgcinlines.h index 1ac24c7436a..448ec2bb935 100644 --- a/js/src/jsgcinlines.h +++ b/js/src/jsgcinlines.h @@ -347,6 +347,37 @@ MarkShape(JSTracer *trc, const Shape *shape, const char *name) Mark(trc, shape); } +} // namespace gc +} // namespace js + +inline void +JSObject::trace(JSTracer *trc) +{ + if (!isNative()) + return; + + JSContext *cx = trc->context; + js::Shape *shape = lastProp; + + MarkShape(trc, shape, "shape"); + + if (IS_GC_MARKING_TRACER(trc) && cx->runtime->gcRegenShapes) { + /* + * MarkShape will regenerate the shape if need be. However, we need to + * regenerate our shape if hasOwnShape() is true. + */ + uint32 newShape = shape->shape; + if (hasOwnShape()) { + newShape = js_RegenerateShapeForGC(cx->runtime); + JS_ASSERT(newShape != shape->shape); + } + objShape = newShape; + } +} + +namespace js { +namespace gc { + void MarkObjectSlots(JSTracer *trc, JSObject *obj); diff --git a/js/src/jsobjinlines.h b/js/src/jsobjinlines.h index cd4e54c56a6..daffca326d6 100644 --- a/js/src/jsobjinlines.h +++ b/js/src/jsobjinlines.h @@ -125,31 +125,6 @@ JSObject::syncSpecialEquality() flags |= JSObject::HAS_EQUALITY; } -inline void -JSObject::trace(JSTracer *trc) -{ - if (!isNative()) - return; - - JSContext *cx = trc->context; - js::Shape *shape = lastProp; - - MarkShape(trc, shape, "shape"); - - if (IS_GC_MARKING_TRACER(trc) && cx->runtime->gcRegenShapes) { - /* - * MarkShape will regenerate the shape if need be. However, we need to - * regenerate our shape if hasOwnShape() is true. - */ - uint32 newShape = shape->shape; - if (hasOwnShape()) { - newShape = js_RegenerateShapeForGC(cx->runtime); - JS_ASSERT(newShape != shape->shape); - } - objShape = newShape; - } -} - inline void JSObject::finalize(JSContext *cx) {