From b297eab2c2e57205245d657d16a606643f91ea59 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Mon, 26 Aug 2013 17:09:27 -0700 Subject: [PATCH] Bug 909171 (part 1) - Add JS_ prefixes to macros missing them in jsversion.h. r=luke. --HG-- extra : rebase_source : f8afce8bbed7a940e9168f4f851d18c5d30620e7 --- js/src/builtin/Object.cpp | 6 +++--- js/src/jsapi.cpp | 2 +- js/src/jsfriendapi.h | 2 +- js/src/jsobj.h | 2 +- js/src/jsversion.h | 10 +++++----- js/src/vm/ObjectImpl.cpp | 12 ++++++------ js/src/vm/ObjectImpl.h | 6 +++--- js/src/vm/TypedArrayObject.cpp | 4 ++-- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/js/src/builtin/Object.cpp b/js/src/builtin/Object.cpp index 970f40eac88..e449f51087b 100644 --- a/js/src/builtin/Object.cpp +++ b/js/src/builtin/Object.cpp @@ -341,7 +341,7 @@ obj_valueOf(JSContext *cx, unsigned argc, Value *vp) return true; } -#if OLD_GETTER_SETTER_METHODS +#if JS_OLD_GETTER_SETTER_METHODS enum DefineType { Getter, Setter }; @@ -479,7 +479,7 @@ obj_lookupSetter(JSContext *cx, unsigned argc, Value *vp) } return true; } -#endif /* OLD_GETTER_SETTER_METHODS */ +#endif /* JS_OLD_GETTER_SETTER_METHODS */ /* ES5 15.2.3.2. */ bool @@ -977,7 +977,7 @@ const JSFunctionSpec js::object_methods[] = { JS_FN(js_hasOwnProperty_str, obj_hasOwnProperty, 1,0), JS_FN(js_isPrototypeOf_str, obj_isPrototypeOf, 1,0), JS_FN(js_propertyIsEnumerable_str, obj_propertyIsEnumerable, 1,0), -#if OLD_GETTER_SETTER_METHODS +#if JS_OLD_GETTER_SETTER_METHODS JS_FN(js_defineGetter_str, js::obj_defineGetter, 2,0), JS_FN(js_defineSetter_str, js::obj_defineSetter, 2,0), JS_FN(js_lookupGetter_str, obj_lookupGetter, 1,0), diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index c19e3e1b0c4..a5fd20920da 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -1480,7 +1480,7 @@ static const JSStdName object_prototype_names[] = { {js_InitObjectClass, EAGER_ATOM(hasOwnProperty), &JSObject::class_}, {js_InitObjectClass, EAGER_ATOM(isPrototypeOf), &JSObject::class_}, {js_InitObjectClass, EAGER_ATOM(propertyIsEnumerable), &JSObject::class_}, -#if OLD_GETTER_SETTER_METHODS +#if JS_OLD_GETTER_SETTER_METHODS {js_InitObjectClass, EAGER_ATOM(defineGetter), &JSObject::class_}, {js_InitObjectClass, EAGER_ATOM(defineSetter), &JSObject::class_}, {js_InitObjectClass, EAGER_ATOM(lookupGetter), &JSObject::class_}, diff --git a/js/src/jsfriendapi.h b/js/src/jsfriendapi.h index b76c3cf3631..7e7b7d2ce2f 100644 --- a/js/src/jsfriendapi.h +++ b/js/src/jsfriendapi.h @@ -240,7 +240,7 @@ typedef bool extern JS_FRIEND_API(void) DumpHeapComplete(JSRuntime *rt, FILE *fp); -#ifdef OLD_GETTER_SETTER_METHODS +#ifdef JS_OLD_GETTER_SETTER_METHODS JS_FRIEND_API(bool) obj_defineGetter(JSContext *cx, unsigned argc, js::Value *vp); JS_FRIEND_API(bool) obj_defineSetter(JSContext *cx, unsigned argc, js::Value *vp); #endif diff --git a/js/src/jsobj.h b/js/src/jsobj.h index 2247915a47e..68ca2f78c1b 100644 --- a/js/src/jsobj.h +++ b/js/src/jsobj.h @@ -1112,7 +1112,7 @@ extern const char js_hasOwnProperty_str[]; extern const char js_isPrototypeOf_str[]; extern const char js_propertyIsEnumerable_str[]; -#ifdef OLD_GETTER_SETTER_METHODS +#ifdef JS_OLD_GETTER_SETTER_METHODS extern const char js_defineGetter_str[]; extern const char js_defineSetter_str[]; extern const char js_lookupGetter_str[]; diff --git a/js/src/jsversion.h b/js/src/jsversion.h index 1780616a32a..52a5405d7e3 100644 --- a/js/src/jsversion.h +++ b/js/src/jsversion.h @@ -52,15 +52,15 @@ * Feature for Object.prototype.__{define,lookup}{G,S}etter__ legacy support; * support likely to be made opt-in at some future time. */ -#define OLD_GETTER_SETTER_METHODS 1 +#define JS_OLD_GETTER_SETTER_METHODS 1 /* A kill-switch for bug 586842. Embedders shouldn't touch this! */ -#define USE_NEW_OBJECT_REPRESENTATION 0 +#define JS_USE_NEW_OBJECT_REPRESENTATION 0 -#if USE_NEW_OBJECT_REPRESENTATION -# define NEW_OBJECT_REPRESENTATION_ONLY() ((void)0) +#if JS_USE_NEW_OBJECT_REPRESENTATION +# define JS_NEW_OBJECT_REPRESENTATION_ONLY() ((void)0) #else -# define NEW_OBJECT_REPRESENTATION_ONLY() \ +# define JS_NEW_OBJECT_REPRESENTATION_ONLY() \ MOZ_ASSUME_UNREACHABLE("don't call this! to be used in the new object representation") #endif diff --git a/js/src/vm/ObjectImpl.cpp b/js/src/vm/ObjectImpl.cpp index 6af57a94423..2fe3fb912dd 100644 --- a/js/src/vm/ObjectImpl.cpp +++ b/js/src/vm/ObjectImpl.cpp @@ -561,7 +561,7 @@ bool js::GetOwnProperty(JSContext *cx, Handle obj, PropertyId pid_, unsigned resolveFlags, PropDesc *desc) { - NEW_OBJECT_REPRESENTATION_ONLY(); + JS_NEW_OBJECT_REPRESENTATION_ONLY(); JS_CHECK_RECURSION(cx, return false); @@ -651,7 +651,7 @@ bool js::GetProperty(JSContext *cx, Handle obj, Handle receiver, Handle pid, unsigned resolveFlags, MutableHandle vp) { - NEW_OBJECT_REPRESENTATION_ONLY(); + JS_NEW_OBJECT_REPRESENTATION_ONLY(); MOZ_ASSERT(receiver); @@ -714,7 +714,7 @@ bool js::GetElement(JSContext *cx, Handle obj, Handle receiver, uint32_t index, unsigned resolveFlags, Value *vp) { - NEW_OBJECT_REPRESENTATION_ONLY(); + JS_NEW_OBJECT_REPRESENTATION_ONLY(); Rooted current(cx, obj); @@ -777,7 +777,7 @@ bool js::HasElement(JSContext *cx, Handle obj, uint32_t index, unsigned resolveFlags, bool *found) { - NEW_OBJECT_REPRESENTATION_ONLY(); + JS_NEW_OBJECT_REPRESENTATION_ONLY(); Rooted current(cx, obj); @@ -811,7 +811,7 @@ bool js::DefineElement(JSContext *cx, Handle obj, uint32_t index, const PropDesc &desc, bool shouldThrow, unsigned resolveFlags, bool *succeeded) { - NEW_OBJECT_REPRESENTATION_ONLY(); + JS_NEW_OBJECT_REPRESENTATION_ONLY(); ElementsHeader &header = obj->elementsHeader(); @@ -937,7 +937,7 @@ bool js::SetElement(JSContext *cx, Handle obj, Handle receiver, uint32_t index, const Value &v, unsigned resolveFlags, bool *succeeded) { - NEW_OBJECT_REPRESENTATION_ONLY(); + JS_NEW_OBJECT_REPRESENTATION_ONLY(); Rooted current(cx, obj); RootedValue setter(cx); diff --git a/js/src/vm/ObjectImpl.h b/js/src/vm/ObjectImpl.h index e0e9f647b62..68464c7a1ef 100644 --- a/js/src/vm/ObjectImpl.h +++ b/js/src/vm/ObjectImpl.h @@ -1284,7 +1284,7 @@ class ObjectImpl : public gc::Cell } bool makeElementsSparse(JSContext *cx) { - NEW_OBJECT_REPRESENTATION_ONLY(); + JS_NEW_OBJECT_REPRESENTATION_ONLY(); MOZ_ASSUME_UNREACHABLE("NYI"); } @@ -1412,7 +1412,7 @@ class ObjectImpl : public gc::Cell DenseElementsResult ensureDenseElementsInitialized(JSContext *cx, uint32_t index, uint32_t extra) { - NEW_OBJECT_REPRESENTATION_ONLY(); + JS_NEW_OBJECT_REPRESENTATION_ONLY(); MOZ_ASSUME_UNREACHABLE("NYI"); } @@ -1623,7 +1623,7 @@ class ObjectImpl : public gc::Cell } ElementsHeader & elementsHeader() const { - NEW_OBJECT_REPRESENTATION_ONLY(); + JS_NEW_OBJECT_REPRESENTATION_ONLY(); return *ElementsHeader::fromElements(elements); } diff --git a/js/src/vm/TypedArrayObject.cpp b/js/src/vm/TypedArrayObject.cpp index ad8c7a4287a..67a54bdd89c 100644 --- a/js/src/vm/TypedArrayObject.cpp +++ b/js/src/vm/TypedArrayObject.cpp @@ -43,7 +43,7 @@ #include "vm/GlobalObject-inl.h" -#if USE_NEW_OBJECT_REPRESENTATION +#if JS_USE_NEW_OBJECT_REPRESENTATION // See the comment above OldObjectRepresentationHack. # error "TypedArray support for new object representation unimplemented." #endif @@ -294,7 +294,7 @@ PostBarrierTypedArrayObject(JSObject *obj) // the slots are already being used for the element storage and the private // field is used for a delegate object. The ObjectElements header has space // for it, but I don't want to mess around with adding unions to it with -// USE_NEW_OBJECT_REPRESENTATION pending, since it will solve this much +// JS_USE_NEW_OBJECT_REPRESENTATION pending, since it will solve this much // more cleanly. struct OldObjectRepresentationHack { uint32_t capacity;