Bug 1090537, part 4 - Take NativeSet private. No change in behavior. r=efaust.
--- 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