Bug 584305 Define no extern "C" version ObjectOps to fix build issue with Solaris Studio r=brendan
authorGinn Chen <ginn.chen@sun.com>
Tue, 28 Sep 2010 17:59:25 +0800
changeset 54746 20ebb001f3a9ffe830589fcc1e7986f91d982ce1
parent 54745 407db742ce46e42e6e8d6f98d799fae3b7fcfe65
child 54747 4109d15945e5d3c618721a8bf643f8aeeee16e27
push id16011
push userrsayre@mozilla.com
push dateWed, 29 Sep 2010 06:01:57 +0000
treeherdermozilla-central@d7e659b4f80c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbrendan
bugs584305
milestone2.0b7pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 584305 Define no extern "C" version ObjectOps to fix build issue with Solaris Studio r=brendan
js/src/jsgcinlines.h
js/src/jsobj.cpp
js/src/jsobj.h
js/src/jsvalue.h
--- a/js/src/jsgcinlines.h
+++ b/js/src/jsgcinlines.h
@@ -190,32 +190,32 @@ MarkChildren(JSTracer *trc, JSObject *ob
     if (JSObject *proto = obj->getProto())
         MarkObject(trc, *proto, "proto");
     if (JSObject *parent = obj->getParent())
         MarkObject(trc, *parent, "parent");
     if (obj->emptyShape)
         obj->emptyShape->trace(trc);
 
     /* Delegate to ops or the native marking op. */
-    JSTraceOp op = obj->getOps()->trace;
+    TraceOp op = obj->getOps()->trace;
     (op ? op : js_TraceObject)(trc, obj);
 }
 
 static inline void
 MarkChildren(JSTracer *trc, JSFunction *fun)
 {
     JSObject *obj = reinterpret_cast<JSObject *>(fun);
     if (!obj->map)
         return;
     if (JSObject *proto = obj->getProto())
         MarkObject(trc, *proto, "proto");
 
     if (JSObject *parent = obj->getParent())
         MarkObject(trc, *parent, "parent");
-    JSTraceOp op = obj->getOps()->trace;
+    TraceOp op = obj->getOps()->trace;
     (op ? op : js_TraceObject)(trc, obj);
 }
 
 static inline void
 MarkChildren(JSTracer *trc, JSString *str)
 {
     if (str->isDependent())
         MarkString(trc, str->dependentBase(), "base");
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -1384,17 +1384,17 @@ static JSBool
 obj_hasOwnProperty(JSContext *cx, uintN argc, Value *vp)
 {
     JSObject *obj = ComputeThisFromVp(cx, vp);
     return obj &&
            js_HasOwnPropertyHelper(cx, obj->getOps()->lookupProperty, argc, vp);
 }
 
 JSBool
-js_HasOwnPropertyHelper(JSContext *cx, JSLookupPropOp lookup, uintN argc,
+js_HasOwnPropertyHelper(JSContext *cx, LookupPropOp lookup, uintN argc,
                         Value *vp)
 {
     jsid id;
     if (!ValueToId(cx, argc != 0 ? vp[2] : UndefinedValue(), &id))
         return JS_FALSE;
 
     JSObject *obj = ComputeThisFromVp(cx, vp);
     JSObject *obj2;
@@ -1415,17 +1415,17 @@ js_HasOwnPropertyHelper(JSContext *cx, J
         obj2->dropProperty(cx, prop);
     } else {
         vp->setBoolean(false);
     }
     return JS_TRUE;
 }
 
 JSBool
-js_HasOwnProperty(JSContext *cx, JSLookupPropOp lookup, JSObject *obj, jsid id,
+js_HasOwnProperty(JSContext *cx, LookupPropOp lookup, JSObject *obj, jsid id,
                   JSObject **objp, JSProperty **propp)
 {
     JSAutoResolveFlags rf(cx, JSRESOLVE_QUALIFIED | JSRESOLVE_DETECTING);
     if (!(lookup ? lookup : js_LookupProperty)(cx, obj, id, objp, propp))
         return false;
     if (!*propp)
         return true;
 
--- a/js/src/jsobj.h
+++ b/js/src/jsobj.h
@@ -1051,17 +1051,17 @@ struct JSObject : js::gc::Cell {
 
     /* Remove the property named by id from this object. */
     bool removeProperty(JSContext *cx, jsid id);
 
     /* Clear the scope, making it empty. */
     void clear(JSContext *cx);
 
     JSBool lookupProperty(JSContext *cx, jsid id, JSObject **objp, JSProperty **propp) {
-        JSLookupPropOp op = getOps()->lookupProperty;
+        js::LookupPropOp op = getOps()->lookupProperty;
         return (op ? op : js_LookupProperty)(cx, this, id, objp, propp);
     }
 
     JSBool defineProperty(JSContext *cx, jsid id, const js::Value &value,
                           js::PropertyOp getter = js::PropertyStub,
                           js::PropertyOp setter = js::PropertyStub,
                           uintN attrs = JSPROP_ENUMERATE) {
         js::DefinePropOp op = getOps()->defineProperty;
@@ -1074,37 +1074,37 @@ struct JSObject : js::gc::Cell {
     }
 
     JSBool setProperty(JSContext *cx, jsid id, js::Value *vp, JSBool strict) {
         js::StrictPropertyIdOp op = getOps()->setProperty;
         return (op ? op : js_SetProperty)(cx, this, id, vp, strict);
     }
 
     JSBool getAttributes(JSContext *cx, jsid id, uintN *attrsp) {
-        JSAttributesOp op = getOps()->getAttributes;
+        js::AttributesOp op = getOps()->getAttributes;
         return (op ? op : js_GetAttributes)(cx, this, id, attrsp);
     }
 
     JSBool setAttributes(JSContext *cx, jsid id, uintN *attrsp) {
-        JSAttributesOp op = getOps()->setAttributes;
+        js::AttributesOp op = getOps()->setAttributes;
         return (op ? op : js_SetAttributes)(cx, this, id, attrsp);
     }
 
     JSBool deleteProperty(JSContext *cx, jsid id, js::Value *rval, JSBool strict) {
         js::StrictPropertyIdOp op = getOps()->deleteProperty;
         return (op ? op : js_DeleteProperty)(cx, this, id, rval, strict);
     }
 
     JSBool enumerate(JSContext *cx, JSIterateOp iterop, js::Value *statep, jsid *idp) {
         js::NewEnumerateOp op = getOps()->enumerate;
         return (op ? op : js_Enumerate)(cx, this, iterop, statep, idp);
     }
 
     JSType typeOf(JSContext *cx) {
-        JSTypeOfOp op = getOps()->typeOf;
+        js::TypeOfOp op = getOps()->typeOf;
         return (op ? op : js_TypeOf)(cx, this);
     }
 
     JSObject *wrappedObject(JSContext *cx) const;
 
     /* These four are time-optimized to avoid stub calls. */
     JSObject *thisObject(JSContext *cx) {
         JSObjectOp op = getOps()->thisObject;
@@ -1330,21 +1330,21 @@ js_LeaveSharpObject(JSContext *cx, JSIdA
 /*
  * Mark objects stored in map if GC happens between js_EnterSharpObject
  * and js_LeaveSharpObject. GC calls this when map->depth > 0.
  */
 extern void
 js_TraceSharpMap(JSTracer *trc, JSSharpObjectMap *map);
 
 extern JSBool
-js_HasOwnPropertyHelper(JSContext *cx, JSLookupPropOp lookup, uintN argc,
+js_HasOwnPropertyHelper(JSContext *cx, js::LookupPropOp lookup, uintN argc,
                         js::Value *vp);
 
 extern JSBool
-js_HasOwnProperty(JSContext *cx, JSLookupPropOp lookup, JSObject *obj, jsid id,
+js_HasOwnProperty(JSContext *cx, js::LookupPropOp lookup, JSObject *obj, jsid id,
                   JSObject **objp, JSProperty **propp);
 
 extern JSBool
 js_NewPropertyDescriptorObject(JSContext *cx, jsid id, uintN attrs,
                                const js::Value &getter, const js::Value &setter,
                                const js::Value &value, js::Value *vp);
 
 extern JSBool
--- a/js/src/jsvalue.h
+++ b/js/src/jsvalue.h
@@ -876,16 +876,29 @@ typedef JSBool
 (* DefinePropOp)(JSContext *cx, JSObject *obj, jsid id, const Value *value,
                  PropertyOp getter, PropertyOp setter, uintN attrs);
 typedef JSBool
 (* PropertyIdOp)(JSContext *cx, JSObject *obj, jsid id, Value *vp);
 typedef JSBool
 (* StrictPropertyIdOp)(JSContext *cx, JSObject *obj, jsid id, Value *vp, JSBool strict);
 typedef JSBool
 (* CallOp)(JSContext *cx, uintN argc, Value *vp);
+typedef JSBool
+(* LookupPropOp)(JSContext *cx, JSObject *obj, jsid id, JSObject **objp,
+                 JSProperty **propp);
+typedef JSBool
+(* AttributesOp)(JSContext *cx, JSObject *obj, jsid id, uintN *attrsp);
+typedef JSType
+(* TypeOfOp)(JSContext *cx, JSObject *obj);
+typedef void
+(* TraceOp)(JSTracer *trc, JSObject *obj);
+typedef JSObject *
+(* ObjectOp)(JSContext *cx, JSObject *obj);
+typedef void
+(* FinalizeOp)(JSContext *cx, JSObject *obj);
 
 class AutoIdVector;
 
 /*
  * Prepare to make |obj| non-extensible; in particular, fully resolve its properties.
  * On error, return false.
  * If |obj| is now ready to become non-extensible, set |*fixed| to true and return true.
  * If |obj| refuses to become non-extensible, set |*fixed| to false and return true; the
@@ -954,29 +967,29 @@ struct ClassExtension {
     JSIteratorOp        iteratorObject;
     JSObjectOp          wrappedObject;  /* NB: infallible, null returns are
                                            treated as the original object */
 };
 
 #define JS_NULL_CLASS_EXT   {NULL,NULL,NULL,NULL,NULL}
 
 struct ObjectOps {
-    JSLookupPropOp          lookupProperty;
+    js::LookupPropOp        lookupProperty;
     js::DefinePropOp        defineProperty;
     js::PropertyIdOp        getProperty;
     js::StrictPropertyIdOp  setProperty;
-    JSAttributesOp          getAttributes;
-    JSAttributesOp          setAttributes;
+    js::AttributesOp        getAttributes;
+    js::AttributesOp        setAttributes;
     js::StrictPropertyIdOp  deleteProperty;
     js::NewEnumerateOp      enumerate;
-    JSTypeOfOp              typeOf;
-    JSTraceOp               trace;
+    js::TypeOfOp            typeOf;
+    js::TraceOp             trace;
     js::FixOp               fix;
-    JSObjectOp              thisObject;
-    JSFinalizeOp            clear;
+    js::ObjectOp            thisObject;
+    js::FinalizeOp          clear;
 };
 
 #define JS_NULL_OBJECT_OPS  {NULL,NULL,NULL,NULL,NULL,NULL, NULL,NULL,NULL,NULL,NULL,NULL}
 
 struct Class {
     JS_CLASS_MEMBERS;
     ClassExtension      ext;
     ObjectOps           ops;