Bug 1090537, part 4 - Take NativeSet private. No change in behavior. r=efaust.
authorJason Orendorff <jorendorff@mozilla.com>
Wed, 15 Oct 2014 12:08:37 -0500
changeset 226122 be9e874aea12cbb0d4b3cc67e7870530d245439b
parent 226121 eeb6ee106d15f08ac943068d7ca9a55ebbc7feac
child 226123 9317cf955dc77e6dbd914b0afd47303087d31dc5
push id36
push userdburns@mozilla.com
push dateMon, 10 Nov 2014 15:14:02 +0000
reviewersefaust
bugs1090537
milestone36.0a1
Bug 1090537, part 4 - Take NativeSet private. No change in behavior. r=efaust.
js/src/vm/NativeObject.cpp
js/src/vm/NativeObject.h
--- a/js/src/vm/NativeObject.cpp
+++ b/js/src/vm/NativeObject.cpp
@@ -1187,16 +1187,22 @@ UpdateShapeTypeAndValue(typename Executi
         } else {
             types::MarkTypePropertyNonWritable(cx->asExclusiveContext(), obj, id);
         }
     }
     return true;
 }
 
 template <ExecutionMode mode>
+static bool
+NativeSet(typename ExecutionModeTraits<mode>::ContextType cx,
+          HandleNativeObject obj, HandleObject receiver,
+          HandleShape shape, bool strict, MutableHandleValue vp);
+
+template <ExecutionMode mode>
 static inline bool
 DefinePropertyOrElement(typename ExecutionModeTraits<mode>::ExclusiveContextType cx,
                         HandleNativeObject obj, HandleId id,
                         PropertyOp getter, StrictPropertyOp setter,
                         unsigned attrs, HandleValue value,
                         bool callSetterAfterwards, bool setterIsStrict)
 {
     /* Use dense storage for new indexed properties where possible. */
@@ -1657,20 +1663,19 @@ NativeGetInline(JSContext *cx,
 bool
 js::NativeGet(JSContext *cx, HandleObject obj, HandleNativeObject pobj, HandleShape shape,
               MutableHandleValue vp)
 {
     return NativeGetInline<CanGC>(cx, obj, obj, pobj, shape, vp);
 }
 
 template <ExecutionMode mode>
-bool
-js::NativeSet(typename ExecutionModeTraits<mode>::ContextType cxArg,
-              HandleNativeObject obj, Handle<JSObject*> receiver,
-              HandleShape shape, bool strict, MutableHandleValue vp)
+static bool
+NativeSet(typename ExecutionModeTraits<mode>::ContextType cxArg, HandleNativeObject obj,
+          HandleObject receiver, HandleShape shape, bool strict, MutableHandleValue vp)
 {
     MOZ_ASSERT(cxArg->isThreadLocal(obj));
     MOZ_ASSERT(obj->isNative());
 
     if (shape->hasSlot()) {
         /* If shape has a stub setter, just store vp. */
         if (shape->hasDefaultSetter()) {
             if (mode == ParallelExecution) {
@@ -1718,25 +1723,16 @@ js::NativeSet(typename ExecutionModeTrai
          obj->contains(cx, shape)))
     {
         obj->setSlot(shape->slot(), vp);
     }
 
     return true;
 }
 
-template bool
-js::NativeSet<SequentialExecution>(JSContext *cx,
-                                   HandleNativeObject obj, HandleObject receiver,
-                                   HandleShape shape, bool strict, MutableHandleValue vp);
-template bool
-js::NativeSet<ParallelExecution>(ForkJoinContext *cx,
-                                 HandleNativeObject obj, HandleObject receiver,
-                                 HandleShape shape, bool strict, MutableHandleValue vp);
-
 /*
  * Given pc pointing after a property accessing bytecode, return true if the
  * access is "object-detecting" in the sense used by web scripts, e.g., when
  * checking whether document.all is defined.
  */
 static bool
 Detecting(JSContext *cx, JSScript *script, jsbytecode *pc)
 {
--- a/js/src/vm/NativeObject.h
+++ b/js/src/vm/NativeObject.h
@@ -1343,22 +1343,16 @@ DefineNativeProperty(ExclusiveContext *c
 extern bool
 LookupNativeProperty(ExclusiveContext *cx, HandleNativeObject obj, HandleId id,
                      js::MutableHandleObject objp, js::MutableHandleShape propp);
 
 bool
 NativeGet(JSContext *cx, HandleObject obj, HandleNativeObject pobj,
           HandleShape shape, MutableHandle<Value> vp);
 
-template <ExecutionMode mode>
-bool
-NativeSet(typename ExecutionModeTraits<mode>::ContextType cx,
-          HandleNativeObject obj, HandleObject receiver,
-          HandleShape shape, bool strict, MutableHandleValue vp);
-
 /*
  * If obj has an already-resolved data property for id, return true and
  * store the property value in *vp.
  */
 extern bool
 HasDataProperty(JSContext *cx, NativeObject *obj, jsid id, Value *vp);
 
 inline bool