Bug 790349 - Allow atoms to be referred to by |cx->names().foo| where |foo| is the text of the atom (except in cases where the text of the atom isn't a C++ identifier). r=jorendorff
☠☠ backed out by 9a68d6ed4bd4 ☠ ☠
authorJeff Walden <jwalden@mit.edu>
Mon, 10 Sep 2012 13:27:19 -0700
changeset 113558 2cdc9370922f1263344bd88312f727b181efb10b
parent 113557 9eadf573bb384c43adf67e63ebffd17c6cb3906f
child 113559 cf239b55242a63ce52186cedbcfe6dcebda815ed
push idunknown
push userunknown
push dateunknown
reviewersjorendorff
bugs790349
milestone18.0a1
Bug 790349 - Allow atoms to be referred to by |cx->names().foo| where |foo| is the text of the atom (except in cases where the text of the atom isn't a C++ identifier). r=jorendorff
js/src/frontend/Parser.cpp
js/src/jsatom.cpp
js/src/jsatom.h
js/src/jsbool.cpp
js/src/jscntxt.h
js/src/jsexn.cpp
js/src/jsproxy.cpp
js/src/vm/CommonPropertyNames.h
js/src/vm/Debugger.cpp
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -4035,19 +4035,19 @@ Parser::statement()
       {
         if (!allowsXML())
             return expressionStatement();
 
         pn = UnaryNode::create(PNK_DEFXMLNS, this);
         if (!pn)
             return NULL;
         if (!tokenStream.matchToken(TOK_NAME) ||
-            tokenStream.currentToken().name() != context->runtime->atomState.xmlAtom ||
+            tokenStream.currentToken().name() != context->names().xml ||
             !tokenStream.matchToken(TOK_NAME) ||
-            tokenStream.currentToken().name() != context->runtime->atomState.namespaceAtom ||
+            tokenStream.currentToken().name() != context->names().namespace_ ||
             !tokenStream.matchToken(TOK_ASSIGN))
         {
             reportError(NULL, JSMSG_BAD_DEFAULT_XML_NAMESPACE);
             return NULL;
         }
 
         JS_ASSERT(tokenStream.currentToken().t_op == JSOP_NOP);
 
--- a/js/src/jsatom.cpp
+++ b/js/src/jsatom.cpp
@@ -56,17 +56,17 @@ const char * js::TypeStrings[] = {
     js_null_str,
     js_xml_str,
 };
 
 #define DEFINE_PROTO_STRING(name,code,init) const char js_##name##_str[] = #name;
 JS_FOR_EACH_PROTOTYPE(DEFINE_PROTO_STRING)
 #undef DEFINE_PROTO_STRING
 
-#define CONST_CHAR_STR(id, text)      const char js_##id##_str[] = text;
+#define CONST_CHAR_STR(idpart, id, text) const char js_##idpart##_str[] = text;
 FOR_EACH_COMMON_PROPERTYNAME(CONST_CHAR_STR)
 #undef CONST_CHAR_STR
 
 /* Constant strings that are not atomized. */
 const char js_break_str[]           = "break";
 const char js_case_str[]            = "case";
 const char js_catch_str[]           = "catch";
 const char js_class_str[]           = "class";
@@ -146,17 +146,17 @@ struct CommonNameInfo
     const char *str;
     size_t length;
 };
 
 bool
 js::InitCommonNames(JSContext *cx)
 {
     static const CommonNameInfo cachedNames[] = {
-#define COMMON_NAME_INFO(id, text) { js_##id##_str, sizeof(text) - 1 },
+#define COMMON_NAME_INFO(idpart, id, text) { js_##idpart##_str, sizeof(text) - 1 },
         FOR_EACH_COMMON_PROPERTYNAME(COMMON_NAME_INFO)
 #undef COMMON_NAME_INFO
 #define COMMON_NAME_INFO(name, code, init) { js_##name##_str, sizeof(#name) - 1 },
         JS_FOR_EACH_PROTOTYPE(COMMON_NAME_INFO)
 #undef COMMON_NAME_INFO
     };
 
     PropertyName **names = &cx->runtime->firstCachedName;
--- a/js/src/jsatom.h
+++ b/js/src/jsatom.h
@@ -149,17 +149,17 @@ class PropertyName;
 extern bool
 AtomIsInterned(JSContext *cx, JSAtom *atom);
 
 /* Well-known predefined C strings. */
 #define DECLARE_PROTO_STR(name,code,init) extern const char js_##name##_str[];
 JS_FOR_EACH_PROTOTYPE(DECLARE_PROTO_STR)
 #undef DECLARE_PROTO_STR
 
-#define DECLARE_CONST_CHAR_STR(id, text)  extern const char js_##id##_str[];
+#define DECLARE_CONST_CHAR_STR(idpart, id, text)  extern const char js_##idpart##_str[];
 FOR_EACH_COMMON_PROPERTYNAME(DECLARE_CONST_CHAR_STR)
 #undef DECLARE_CONST_CHAR_STR
 
 /* Constant strings that are not atomized. */
 extern const char js_break_str[];
 extern const char js_case_str[];
 extern const char js_catch_str[];
 extern const char js_class_str[];
--- a/js/src/jsbool.cpp
+++ b/js/src/jsbool.cpp
@@ -183,17 +183,17 @@ js_InitBooleanClass(JSContext *cx, JSObj
         return NULL;
 
     return booleanProto;
 }
 
 JSString *
 js_BooleanToString(JSContext *cx, JSBool b)
 {
-    return b ? cx->runtime->atomState.trueAtom : cx->runtime->atomState.falseAtom;
+    return b ? cx->runtime->atomState.true_ : cx->runtime->atomState.false_;
 }
 
 namespace js {
 
 JS_PUBLIC_API(bool)
 ToBooleanSlow(const Value &v)
 {
     JS_ASSERT(v.isString());
--- a/js/src/jscntxt.h
+++ b/js/src/jscntxt.h
@@ -377,25 +377,27 @@ class FreeOp : public JSFreeOp {
 
 namespace JS {
 struct RuntimeSizes;
 }
 
 /* Various built-in or commonly-used names pinned on first context. */
 struct JSAtomState
 {
-#define PROPERTYNAME_FIELD(id, text)          js::PropertyName *id##Atom;
+#define PROPERTYNAME_FIELD(idpart, id, text) \
+    union { js::PropertyName *idpart##Atom; js::PropertyName *id; };
     FOR_EACH_COMMON_PROPERTYNAME(PROPERTYNAME_FIELD)
 #undef PROPERTYNAME_FIELD
-#define PROPERTYNAME_FIELD(name, code, init)  js::PropertyName *name##Atom;
+#define PROPERTYNAME_FIELD(name, code, init) \
+    union { js::PropertyName *name##Atom; js::PropertyName *name; };
     JS_FOR_EACH_PROTOTYPE(PROPERTYNAME_FIELD)
 #undef PROPERTYNAME_FIELD
 };
 
-#define ATOM(name) js::HandlePropertyName::fromMarkedLocation(&cx->runtime->atomState.name##Atom)
+#define ATOM(name) js::HandlePropertyName::fromMarkedLocation(&cx->names().name)
 
 #define NAME_OFFSET(name)       offsetof(JSAtomState, name##Atom)
 #define OFFSET_TO_NAME(rt,off)  (*(js::PropertyName **)((char*)&(rt)->atomState + (off)))
 
 struct JSRuntime : js::RuntimeFriendFields
 {
     /* Default compartment. */
     JSCompartment       *atomsCompartment;
@@ -1534,16 +1536,18 @@ struct JSContext : js::ContextFriendFiel
 
     void setPendingException(js::Value v);
 
     void clearPendingException() {
         throwing = false;
         exception.setUndefined();
     }
 
+    JSAtomState & names() { return runtime->atomState; }
+
 #ifdef DEBUG
     /*
      * Controls whether a quadratic-complexity assertion is performed during
      * stack iteration; defaults to true.
      */
     bool stackIterAssertionEnabled;
 #endif
 
--- a/js/src/jsexn.cpp
+++ b/js/src/jsexn.cpp
@@ -263,17 +263,17 @@ InitExnPrivate(JSContext *cx, HandleObje
     Vector<JSStackTraceStackElem> frames(cx);
     {
         SuppressErrorsGuard seg(cx);
         for (NonBuiltinScriptFrameIter i(cx); !i.done(); ++i) {
 
             /* Ask the crystal CAPS ball whether we can see across compartments. */
             if (checkAccess && i.isNonEvalFunctionFrame()) {
                 RootedValue v(cx);
-                RootedId callerid(cx, NameToId(cx->runtime->atomState.callerAtom));
+                RootedId callerid(cx, NameToId(cx->names().caller));
                 RootedObject obj(cx, i.callee());
                 if (!checkAccess(cx, obj, callerid, JSACC_READ, &v))
                     break;
             }
 
             if (!frames.growBy(1))
                 return false;
             JSStackTraceStackElem &frame = frames.back();
@@ -405,58 +405,58 @@ exn_resolve(JSContext *cx, HandleObject 
     jsval v;
     unsigned attrs;
 
     objp.set(NULL);
     priv = GetExnPrivate(obj);
     if (priv && JSID_IS_ATOM(id)) {
         str = JSID_TO_STRING(id);
 
-        atom = cx->runtime->atomState.messageAtom;
+        atom = cx->names().message;
         if (str == atom) {
             prop = js_message_str;
 
             /*
              * Per ES5 15.11.1.1, if Error is called with no argument or with
              * undefined as the argument, it returns an Error object with no
              * own message property.
              */
             if (!priv->message)
                 return true;
 
             v = STRING_TO_JSVAL(priv->message);
             attrs = 0;
             goto define;
         }
 
-        atom = cx->runtime->atomState.fileNameAtom;
+        atom = cx->names().fileName;
         if (str == atom) {
             prop = js_fileName_str;
             v = STRING_TO_JSVAL(priv->filename);
             attrs = JSPROP_ENUMERATE;
             goto define;
         }
 
-        atom = cx->runtime->atomState.lineNumberAtom;
+        atom = cx->names().lineNumber;
         if (str == atom) {
             prop = js_lineNumber_str;
             v = UINT_TO_JSVAL(priv->lineno);
             attrs = JSPROP_ENUMERATE;
             goto define;
         }
 
-        atom = cx->runtime->atomState.columnNumberAtom;
+        atom = cx->names().columnNumber;
         if (str == atom) {
             prop = js_columnNumber_str;
             v = UINT_TO_JSVAL(priv->column);
             attrs = JSPROP_ENUMERATE;
             goto define;
         }
 
-        atom = cx->runtime->atomState.stackAtom;
+        atom = cx->names().stack;
         if (str == atom) {
             stack = StackTraceToString(cx, priv);
             if (!stack)
                 return false;
 
             prop = js_stack_str;
             v = STRING_TO_JSVAL(stack);
             attrs = JSPROP_ENUMERATE;
@@ -541,17 +541,17 @@ Exception(JSContext *cx, unsigned argc, 
      * ECMA ed. 3, 15.11.1 requires Error, etc., to construct even when
      * called as functions, without operator new.  But as we do not give
      * each constructor a distinct JSClass, whose .name member is used by
      * NewNativeClassInstance to find the class prototype, we must get the
      * class prototype ourselves.
      */
     RootedObject callee(cx, &args.callee());
     RootedValue protov(cx);
-    if (!JSObject::getProperty(cx, callee, callee, cx->runtime->atomState.classPrototypeAtom, &protov))
+    if (!JSObject::getProperty(cx, callee, callee, cx->names().classPrototype, &protov))
         return false;
 
     if (!protov.isObject()) {
         JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_BAD_PROTOTYPE, "Error");
         return false;
     }
 
     JSObject *errProto = &protov.toObject();
@@ -624,47 +624,47 @@ exn_toString(JSContext *cx, unsigned arg
         return false;
     }
 
     /* Step 1. */
     RootedObject obj(cx, &args.thisv().toObject());
 
     /* Step 3. */
     RootedValue nameVal(cx);
-    if (!JSObject::getProperty(cx, obj, obj, cx->runtime->atomState.nameAtom, &nameVal))
+    if (!JSObject::getProperty(cx, obj, obj, cx->names().name, &nameVal))
         return false;
 
     /* Step 4. */
     RootedString name(cx);
     if (nameVal.isUndefined()) {
-        name = cx->runtime->atomState.ErrorAtom;
+        name = cx->names().Error;
     } else {
         name = ToString(cx, nameVal);
         if (!name)
             return false;
     }
 
     /* Step 5. */
     RootedValue msgVal(cx);
-    if (!JSObject::getProperty(cx, obj, obj, cx->runtime->atomState.messageAtom, &msgVal))
+    if (!JSObject::getProperty(cx, obj, obj, cx->names().message, &msgVal))
         return false;
 
     /* Step 6. */
     JSString *message;
     if (msgVal.isUndefined()) {
         message = cx->runtime->emptyString;
     } else {
         message = ToString(cx, msgVal);
         if (!message)
             return false;
     }
 
     /* Step 7. */
     if (name->empty() && message->empty()) {
-        args.rval().setString(cx->runtime->atomState.ErrorAtom);
+        args.rval().setString(cx->names().Error);
         return true;
     }
 
     /* Step 8. */
     if (name->empty()) {
         args.rval().setString(message);
         return true;
     }
@@ -698,41 +698,41 @@ exn_toSource(JSContext *cx, unsigned arg
     CallArgs args = CallArgsFromVp(argc, vp);
 
     RootedObject obj(cx, ToObject(cx, args.thisv()));
     if (!obj)
         return false;
 
     RootedValue nameVal(cx);
     RootedString name(cx);
-    if (!JSObject::getProperty(cx, obj, obj, cx->runtime->atomState.nameAtom, &nameVal) ||
+    if (!JSObject::getProperty(cx, obj, obj, cx->names().name, &nameVal) ||
         !(name = ToString(cx, nameVal)))
     {
         return false;
     }
 
     RootedValue messageVal(cx);
     RootedString message(cx);
-    if (!JSObject::getProperty(cx, obj, obj, cx->runtime->atomState.messageAtom, &messageVal) ||
+    if (!JSObject::getProperty(cx, obj, obj, cx->names().message, &messageVal) ||
         !(message = js_ValueToSource(cx, messageVal)))
     {
         return false;
     }
 
     RootedValue filenameVal(cx);
     RootedString filename(cx);
-    if (!JSObject::getProperty(cx, obj, obj, cx->runtime->atomState.fileNameAtom, &filenameVal) ||
+    if (!JSObject::getProperty(cx, obj, obj, cx->names().fileName, &filenameVal) ||
         !(filename = js_ValueToSource(cx, filenameVal)))
     {
         return false;
     }
 
     RootedValue linenoVal(cx);
     uint32_t lineno;
-    if (!JSObject::getProperty(cx, obj, obj, cx->runtime->atomState.lineNumberAtom, &linenoVal) ||
+    if (!JSObject::getProperty(cx, obj, obj, cx->names().lineNumber, &linenoVal) ||
         !ToUint32(cx, linenoVal, &lineno))
     {
         return false;
     }
 
     StringBuffer sb(cx);
     if (!sb.append("(new ") || !sb.append(name) || !sb.append("("))
         return false;
@@ -792,21 +792,21 @@ InitErrorClass(JSContext *cx, Handle<Glo
     RootedAtom name(cx, ClassName(key, cx));
     RootedObject errorProto(cx, global->createBlankPrototypeInheriting(cx, &ErrorClass, *proto));
     if (!errorProto)
         return NULL;
 
     RootedValue nameValue(cx, StringValue(name));
     RootedValue zeroValue(cx, Int32Value(0));
     RootedValue empty(cx, StringValue(cx->runtime->emptyString));
-    RootedId nameId(cx, NameToId(cx->runtime->atomState.nameAtom));
-    RootedId messageId(cx, NameToId(cx->runtime->atomState.messageAtom));
-    RootedId fileNameId(cx, NameToId(cx->runtime->atomState.fileNameAtom));
-    RootedId lineNumberId(cx, NameToId(cx->runtime->atomState.lineNumberAtom));
-    RootedId columnNumberId(cx, NameToId(cx->runtime->atomState.columnNumberAtom));
+    RootedId nameId(cx, NameToId(cx->names().name));
+    RootedId messageId(cx, NameToId(cx->names().message));
+    RootedId fileNameId(cx, NameToId(cx->names().fileName));
+    RootedId lineNumberId(cx, NameToId(cx->names().lineNumber));
+    RootedId columnNumberId(cx, NameToId(cx->names().columnNumber));
     if (!DefineNativeProperty(cx, errorProto, nameId, nameValue,
                               JS_PropertyStub, JS_StrictPropertyStub, 0, 0, 0) ||
         !DefineNativeProperty(cx, errorProto, messageId, empty,
                               JS_PropertyStub, JS_StrictPropertyStub, 0, 0, 0) ||
         !DefineNativeProperty(cx, errorProto, fileNameId, empty,
                               JS_PropertyStub, JS_StrictPropertyStub, JSPROP_ENUMERATE, 0, 0) ||
         !DefineNativeProperty(cx, errorProto, lineNumberId, zeroValue,
                               JS_PropertyStub, JS_StrictPropertyStub, JSPROP_ENUMERATE, 0, 0) ||
--- a/js/src/jsproxy.cpp
+++ b/js/src/jsproxy.cpp
@@ -862,17 +862,17 @@ ScriptedIndirectProxyHandler::getOwnProp
 }
 
 bool
 ScriptedIndirectProxyHandler::delete_(JSContext *cx, JSObject *proxy, jsid id_, bool *bp)
 {
     RootedObject handler(cx, GetIndirectProxyHandlerObject(cx, proxy));
     RootedId id(cx, id_);
     RootedValue fval(cx), value(cx);
-    return GetFundamentalTrap(cx, handler, ATOM(delete), &fval) &&
+    return GetFundamentalTrap(cx, handler, ATOM(delete_), &fval) &&
            Trap1(cx, handler, fval, id, value.address()) &&
            ValueToBool(cx, value, bp);
 }
 
 bool
 ScriptedIndirectProxyHandler::enumerate(JSContext *cx, JSObject *proxy, AutoIdVector &props)
 {
     RootedObject handler(cx, GetIndirectProxyHandlerObject(cx, proxy));
--- a/js/src/vm/CommonPropertyNames.h
+++ b/js/src/vm/CommonPropertyNames.h
@@ -10,140 +10,140 @@
 #ifndef CommonPropertyNames_h__
 #define CommonPropertyNames_h__
 
 #include "jsprototypes.h"
 #include "jsversion.h"
 
 #if JS_HAS_XML_SUPPORT
 #define FOR_EACH_XML_ONLY_NAME(macro) \
-    macro(etago, "</") \
-    macro(functionNamespaceURI, "@mozilla.org/js/function") \
-    macro(namespace, "namespace") \
-    macro(ptagc, "/>") \
-    macro(qualifier, "::") \
-    macro(space, " ") \
-    macro(stago, "<") \
-    macro(star, "*") \
-    macro(starQualifier, "*::") \
-    macro(tagc, ">") \
-    macro(XMLList, "XMLList")
+    macro(etago, etago, "</") \
+    macro(functionNamespaceURI, functionNamespaceURI, "@mozilla.org/js/function") \
+    macro(namespace, namespace_, "namespace") \
+    macro(ptagc, ptagc, "/>") \
+    macro(qualifier, qualifier, "::") \
+    macro(space, space, " ") \
+    macro(stago, stago, "<") \
+    macro(star, star, "*") \
+    macro(starQualifier, starQualifier, "*::") \
+    macro(tagc, tagc, ">") \
+    macro(XMLList, XMLList, "XMLList")
 #else
 #define FOR_EACH_XML_ONLY_NAME(macro) /* nothing */
 #endif /* JS_HAS_XML_SUPPORT */
 
 #define FOR_EACH_COMMON_PROPERTYNAME(macro) \
-    macro(anonymous, "anonymous") \
-    macro(apply, "apply") \
-    macro(arguments, "arguments") \
-    macro(buffer, "buffer") \
-    macro(builder, "builder") \
-    macro(byteLength, "byteLength") \
-    macro(byteOffset, "byteOffset") \
-    macro(BYTES_PER_ELEMENT, "BYTES_PER_ELEMENT") \
-    macro(call, "call") \
-    macro(callee, "callee") \
-    macro(caller, "caller") \
-    macro(_CallFunction, "_CallFunction") \
-    macro(classPrototype, "prototype") \
-    macro(columnNumber, "columnNumber") \
-    macro(configurable, "configurable") \
-    macro(construct, "construct") \
-    macro(constructor, "constructor") \
-    macro(decodeURI, "decodeURI") \
-    macro(decodeURIComponent, "decodeURIComponent") \
-    macro(defineProperty, "defineProperty") \
-    macro(defineGetter, "__defineGetter__") \
-    macro(defineSetter, "__defineSetter__") \
-    macro(delete, "delete") \
-    macro(deleteProperty, "deleteProperty") \
-    macro(each, "each") \
-    macro(empty, "") \
-    macro(encodeURI, "encodeURI") \
-    macro(encodeURIComponent, "encodeURIComponent") \
-    macro(enumerable, "enumerable") \
-    macro(enumerate, "enumerate") \
-    macro(escape, "escape") \
-    macro(eval, "eval") \
-    macro(false, "false") \
-    macro(fileName, "fileName") \
-    macro(fix, "fix") \
-    macro(get, "get") \
-    macro(getOwnPropertyDescriptor, "getOwnPropertyDescriptor") \
-    macro(getOwnPropertyNames, "getOwnPropertyNames") \
-    macro(getPropertyDescriptor, "getPropertyDescriptor") \
-    macro(global, "global") \
-    macro(has, "has") \
-    macro(hasOwn, "hasOwn") \
-    macro(hasOwnProperty, "hasOwnProperty") \
-    macro(ignoreCase, "ignoreCase") \
-    macro(index, "index") \
-    macro(innermost, "innermost") \
-    macro(input, "input") \
-    macro(isFinite, "isFinite") \
-    macro(isNaN, "isNaN") \
-    macro(isPrototypeOf, "isPrototypeOf") \
-    macro(isXMLName, "isXMLName") \
-    macro(iterate, "iterate") \
-    macro(Infinity, "Infinity") \
-    macro(iterator, "iterator") \
-    macro(iteratorIntrinsic, "__iterator__") \
-    macro(join, "join") \
-    macro(keys, "keys") \
-    macro(lastIndex, "lastIndex") \
-    macro(length, "length") \
-    macro(line, "line") \
-    macro(lineNumber, "lineNumber") \
-    macro(loc, "loc") \
-    macro(lookupGetter, "__lookupGetter__") \
-    macro(lookupSetter, "__lookupSetter__") \
-    macro(message, "message") \
-    macro(multiline, "multiline") \
-    macro(name, "name") \
-    macro(NaN, "NaN") \
-    macro(next, "next") \
-    macro(noSuchMethod, "__noSuchMethod__") \
-    macro(objectNull, "[object Null]") \
-    macro(objectUndefined, "[object Undefined]") \
-    macro(of, "of") \
-    macro(parseFloat, "parseFloat") \
-    macro(parseInt, "parseInt") \
-    macro(propertyIsEnumerable, "propertyIsEnumerable") \
-    macro(proto, "__proto__") \
-    macro(return, "return") \
-    macro(set, "set") \
-    macro(shape, "shape") \
-    macro(source, "source") \
-    macro(stack, "stack") \
-    macro(sticky, "sticky") \
-    macro(test, "test") \
-    macro(throw, "throw") \
-    macro(toGMTString, "toGMTString") \
-    macro(toISOString, "toISOString") \
-    macro(toJSON, "toJSON") \
-    macro(toLocaleString, "toLocaleString") \
-    macro(toSource, "toSource") \
-    macro(toString, "toString") \
-    macro(toUTCString, "toUTCString") \
-    macro(true, "true") \
-    macro(unescape, "unescape") \
-    macro(uneval, "uneval") \
-    macro(unwatch, "unwatch") \
-    macro(url, "url") \
-    macro(useStrict, "use strict") \
-    macro(value, "value") \
-    macro(valueOf, "valueOf") \
-    macro(var, "var") \
-    macro(void0, "(void 0)") \
-    macro(watch, "watch") \
-    macro(writable, "writable") \
+    macro(anonymous, anonymous, "anonymous") \
+    macro(apply, apply, "apply") \
+    macro(arguments, arguments, "arguments") \
+    macro(buffer, buffer, "buffer") \
+    macro(builder, builder, "builder") \
+    macro(byteLength, byteLength, "byteLength") \
+    macro(byteOffset, byteOffset, "byteOffset") \
+    macro(BYTES_PER_ELEMENT, BYTES_PER_ELEMENT, "BYTES_PER_ELEMENT") \
+    macro(call, call, "call") \
+    macro(callee, callee, "callee") \
+    macro(caller, caller, "caller") \
+    macro(_CallFunction, _CallFunction, "_CallFunction") \
+    macro(classPrototype, classPrototype, "prototype") \
+    macro(columnNumber, columnNumber, "columnNumber") \
+    macro(configurable, configurable, "configurable") \
+    macro(construct, construct, "construct") \
+    macro(constructor, constructor, "constructor") \
+    macro(decodeURI, decodeURI, "decodeURI") \
+    macro(decodeURIComponent, decodeURIComponent, "decodeURIComponent") \
+    macro(defineProperty, defineProperty, "defineProperty") \
+    macro(defineGetter, defineGetter, "__defineGetter__") \
+    macro(defineSetter, defineSetter, "__defineSetter__") \
+    macro(delete, delete_, "delete") \
+    macro(deleteProperty, deleteProperty, "deleteProperty") \
+    macro(each, each, "each") \
+    macro(empty, empty, "") \
+    macro(encodeURI, encodeURI, "encodeURI") \
+    macro(encodeURIComponent, encodeURIComponent, "encodeURIComponent") \
+    macro(enumerable, enumerable, "enumerable") \
+    macro(enumerate, enumerate, "enumerate") \
+    macro(escape, escape, "escape") \
+    macro(eval, eval, "eval") \
+    macro(false, false_, "false") \
+    macro(fileName, fileName, "fileName") \
+    macro(fix, fix, "fix") \
+    macro(get, get, "get") \
+    macro(getOwnPropertyDescriptor, getOwnPropertyDescriptor, "getOwnPropertyDescriptor") \
+    macro(getOwnPropertyNames, getOwnPropertyNames, "getOwnPropertyNames") \
+    macro(getPropertyDescriptor, getPropertyDescriptor, "getPropertyDescriptor") \
+    macro(global, global, "global") \
+    macro(has, has, "has") \
+    macro(hasOwn, hasOwn, "hasOwn") \
+    macro(hasOwnProperty, hasOwnProperty, "hasOwnProperty") \
+    macro(ignoreCase, ignoreCase, "ignoreCase") \
+    macro(index, index, "index") \
+    macro(innermost, innermost, "innermost") \
+    macro(input, input, "input") \
+    macro(isFinite, isFinite, "isFinite") \
+    macro(isNaN, isNaN, "isNaN") \
+    macro(isPrototypeOf, isPrototypeOf, "isPrototypeOf") \
+    macro(isXMLName, isXMLName, "isXMLName") \
+    macro(iterate, iterate, "iterate") \
+    macro(Infinity, Infinity, "Infinity") \
+    macro(iterator, iterator, "iterator") \
+    macro(iteratorIntrinsic, iteratorIntrinsic, "__iterator__") \
+    macro(join, join, "join") \
+    macro(keys, keys, "keys") \
+    macro(lastIndex, lastIndex, "lastIndex") \
+    macro(length, length, "length") \
+    macro(line, line, "line") \
+    macro(lineNumber, lineNumber, "lineNumber") \
+    macro(loc, loc, "loc") \
+    macro(lookupGetter, lookupGetter, "__lookupGetter__") \
+    macro(lookupSetter, lookupSetter, "__lookupSetter__") \
+    macro(message, message, "message") \
+    macro(multiline, multiline, "multiline") \
+    macro(name, name, "name") \
+    macro(NaN, NaN, "NaN") \
+    macro(next, next, "next") \
+    macro(noSuchMethod, noSuchMethod, "__noSuchMethod__") \
+    macro(objectNull, objectNull, "[object Null]") \
+    macro(objectUndefined, objectUndefined, "[object Undefined]") \
+    macro(of, of, "of") \
+    macro(parseFloat, parseFloat, "parseFloat") \
+    macro(parseInt, parseInt, "parseInt") \
+    macro(propertyIsEnumerable, propertyIsEnumerable, "propertyIsEnumerable") \
+    macro(proto, proto, "__proto__") \
+    macro(return, return_, "return") \
+    macro(set, set, "set") \
+    macro(shape, shape, "shape") \
+    macro(source, source, "source") \
+    macro(stack, stack, "stack") \
+    macro(sticky, sticky, "sticky") \
+    macro(test, test, "test") \
+    macro(throw, throw_, "throw") \
+    macro(toGMTString, toGMTString, "toGMTString") \
+    macro(toISOString, toISOString, "toISOString") \
+    macro(toJSON, toJSON, "toJSON") \
+    macro(toLocaleString, toLocaleString, "toLocaleString") \
+    macro(toSource, toSource, "toSource") \
+    macro(toString, toString, "toString") \
+    macro(toUTCString, toUTCString, "toUTCString") \
+    macro(true, true_, "true") \
+    macro(unescape, unescape, "unescape") \
+    macro(uneval, uneval, "uneval") \
+    macro(unwatch, unwatch, "unwatch") \
+    macro(url, url, "url") \
+    macro(useStrict, useStrict, "use strict") \
+    macro(value, value, "value") \
+    macro(valueOf, valueOf, "valueOf") \
+    macro(var, var, "var") \
+    macro(void0, void0, "(void 0)") \
+    macro(watch, watch, "watch") \
+    macro(writable, writable, "writable") \
     /* Type names must be contiguous and ordered; see js::TypeName. */ \
-    macro(undefined, "undefined") \
-    macro(object, "object") \
-    macro(function, "function") \
-    macro(string, "string") \
-    macro(number, "number") \
-    macro(boolean, "boolean") \
-    macro(null, "null") \
-    macro(xml, "xml") \
+    macro(undefined, undefined, "undefined") \
+    macro(object, object, "object") \
+    macro(function, function, "function") \
+    macro(string, string, "string") \
+    macro(number, number, "number") \
+    macro(boolean, boolean, "boolean") \
+    macro(null, null, "null") \
+    macro(xml, xml, "xml") \
     FOR_EACH_XML_ONLY_NAME(macro)
 
 #endif /* CommonPropertyNames_h__ */
--- a/js/src/vm/Debugger.cpp
+++ b/js/src/vm/Debugger.cpp
@@ -773,21 +773,21 @@ Debugger::newCompletionValue(JSContext *
      */
     assertSameCompartment(cx, object.get());
 
     RootedId key(cx);
     RootedValue value(cx, value_);
 
     switch (status) {
       case JSTRAP_RETURN:
-        key = NameToId(cx->runtime->atomState.returnAtom);
+        key = NameToId(cx->names().return_);
         break;
 
       case JSTRAP_THROW:
-        key = NameToId(cx->runtime->atomState.throwAtom);
+        key = NameToId(cx->names().throw_);
         break;
 
       case JSTRAP_ERROR:
         result->setNull();
         return true;
 
       default:
         JS_NOT_REACHED("bad status passed to Debugger::newCompletionValue");
@@ -834,18 +834,18 @@ Debugger::parseResumptionValue(Maybe<Aut
         ac.destroy();
         return JSTRAP_ERROR;
     }
 
     /* Check that rv is {return: val} or {throw: val}. */
     JSContext *cx = ac.ref().context();
     Rooted<JSObject*> obj(cx);
     Shape *shape;
-    jsid returnId = NameToId(cx->runtime->atomState.returnAtom);
-    jsid throwId = NameToId(cx->runtime->atomState.throwAtom);
+    jsid returnId = NameToId(cx->names().return_);
+    jsid throwId = NameToId(cx->names().throw_);
     bool okResumption = rv.isObject();
     if (okResumption) {
         obj = &rv.toObject();
         okResumption = obj->isObject();
     }
     if (okResumption) {
         shape = obj->lastProperty();
         okResumption = shape->previous() &&