Bug 853028 - Add JSID_VOIDHANDLE and JSID_EMPTYHANDLE r=terrence
authorJon Coppeard <jcoppeard@mozilla.com>
Thu, 21 Mar 2013 12:56:39 +0000
changeset 125743 71d22cbf207fb3c87f43e4cf3158a016928517e8
parent 125742 431d49245e29bcc60af88c7ba4032e91f95a0bf9
child 125744 14865f4247b826da653ce400c69409aa59d22838
push id25090
push userjcoppeard@mozilla.com
push dateThu, 21 Mar 2013 13:13:00 +0000
treeherdermozilla-inbound@14865f4247b8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
bugs853028
milestone22.0a1
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 853028 - Add JSID_VOIDHANDLE and JSID_EMPTYHANDLE r=terrence
js/src/jsapi.cpp
js/src/jsapi.h
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -172,16 +172,21 @@ jsid JSID_EMPTY = { size_t(JSID_TYPE_OBJ
 
 const jsval JSVAL_NULL  = IMPL_TO_JSVAL(BUILD_JSVAL(JSVAL_TAG_NULL,      0));
 const jsval JSVAL_ZERO  = IMPL_TO_JSVAL(BUILD_JSVAL(JSVAL_TAG_INT32,     0));
 const jsval JSVAL_ONE   = IMPL_TO_JSVAL(BUILD_JSVAL(JSVAL_TAG_INT32,     1));
 const jsval JSVAL_FALSE = IMPL_TO_JSVAL(BUILD_JSVAL(JSVAL_TAG_BOOLEAN,   JS_FALSE));
 const jsval JSVAL_TRUE  = IMPL_TO_JSVAL(BUILD_JSVAL(JSVAL_TAG_BOOLEAN,   JS_TRUE));
 const jsval JSVAL_VOID  = IMPL_TO_JSVAL(BUILD_JSVAL(JSVAL_TAG_UNDEFINED, 0));
 
+const jsid voidIdValue = JSID_VOID;
+const jsid emptyIdValue = JSID_EMPTY;
+const HandleId JS::JSID_VOIDHANDLE = HandleId::fromMarkedLocation(&voidIdValue);
+const HandleId JS::JSID_EMPTYHANDLE = HandleId::fromMarkedLocation(&emptyIdValue);
+
 /* Make sure that jschar is two bytes unsigned integer */
 JS_STATIC_ASSERT((jschar)-1 > 0);
 JS_STATIC_ASSERT(sizeof(jschar) == 2);
 
 JS_PUBLIC_API(int64_t)
 JS_Now()
 {
     return PRMJ_Now();
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -4948,16 +4948,23 @@ JS_EncodeInterpretedFunction(JSContext *
 extern JS_PUBLIC_API(JSScript *)
 JS_DecodeScript(JSContext *cx, const void *data, uint32_t length,
                 JSPrincipals *principals, JSPrincipals *originPrincipals);
 
 extern JS_PUBLIC_API(JSObject *)
 JS_DecodeInterpretedFunction(JSContext *cx, const void *data, uint32_t length,
                              JSPrincipals *principals, JSPrincipals *originPrincipals);
 
+namespace JS {
+
+extern JS_PUBLIC_DATA(const HandleId) JSID_VOIDHANDLE;
+extern JS_PUBLIC_DATA(const HandleId) JSID_EMPTYHANDLE;
+
+};
+
 namespace js {
 
 /*
  * Import some JS:: names into the js namespace so we can make unqualified
  * references to them.
  */
 
 using JS::Value;