Bug 1689892 - Part 26: Remove JSContext::parserNames. r=tcampbell
authorTooru Fujisawa <arai_a@mac.com>
Mon, 08 Feb 2021 16:19:36 +0000
changeset 566381 4d70abf6192232a19fe3e3bb2ede835737fad198
parent 566380 458d73fd55704a1c2decde4fb96d00b051e7f44d
child 566382 c2b234ffef9a5e0dc320014d12cd4cbeeab2f533
push id38182
push usernbeleuzu@mozilla.com
push dateMon, 08 Feb 2021 21:48:00 +0000
treeherdermozilla-central@566f81bfa373 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstcampbell
bugs1689892
milestone87.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 1689892 - Part 26: Remove JSContext::parserNames. r=tcampbell Differential Revision: https://phabricator.services.mozilla.com/D104040
js/src/jsapi-tests/testParserAtom.cpp
js/src/vm/JSContext.h
js/src/wasm/AsmJS.cpp
--- a/js/src/jsapi-tests/testParserAtom.cpp
+++ b/js/src/jsapi-tests/testParserAtom.cpp
@@ -55,29 +55,29 @@ BEGIN_TEST(testParserAtom_tiny1) {
   const char ascii[] = {'a'};
   JS::Latin1Char latin1[] = {'a'};
   const mozilla::Utf8Unit utf8[] = {mozilla::Utf8Unit('a')};
   char16_t char16[] = {'a'};
 
   const uint8_t bytes[] = {'a', 0};
   const js::LittleEndianChars leTwoByte(bytes);
 
-  auto ref = cx->parserNames().lookupTiny(&a, 1);
+  auto ref = cx->runtime()->commonParserNames->lookupTiny(&a, 1);
   CHECK(ref);
-  auto refIndex = cx->parserNames().lookupTinyIndex(&a, 1);
+  auto refIndex = cx->runtime()->commonParserNames->lookupTinyIndex(&a, 1);
   CHECK(refIndex);
   CHECK(atomTable.internAscii(cx, ascii, 1) == refIndex);
   CHECK(atomTable.internLatin1(cx, latin1, 1) == refIndex);
   CHECK(atomTable.internUtf8(cx, utf8, 1) == refIndex);
   CHECK(atomTable.internChar16(cx, char16, 1) == refIndex);
 
   // Note: If Latin1-Extended characters become supported, then UTF-8 behaviour
   // should be tested.
   char16_t ae = 0x00E6;
-  CHECK(cx->parserNames().lookupTiny(&ae, 1) == nullptr);
+  CHECK(cx->runtime()->commonParserNames->lookupTiny(&ae, 1) == nullptr);
 
   return true;
 }
 END_TEST(testParserAtom_tiny1)
 
 // Test length-2 fast-path is consistent across entry points.
 BEGIN_TEST(testParserAtom_tiny2) {
   using js::frontend::ParserAtom;
@@ -91,27 +91,27 @@ BEGIN_TEST(testParserAtom_tiny2) {
   JS::Latin1Char latin1[] = {'a', '0'};
   const mozilla::Utf8Unit utf8[] = {mozilla::Utf8Unit('a'),
                                     mozilla::Utf8Unit('0')};
   char16_t char16[] = {'a', '0'};
 
   const uint8_t bytes[] = {'a', 0, '0', 0};
   const js::LittleEndianChars leTwoByte(bytes);
 
-  auto refIndex = cx->parserNames().lookupTinyIndex(ascii, 2);
+  auto refIndex = cx->runtime()->commonParserNames->lookupTinyIndex(ascii, 2);
   CHECK(refIndex);
   CHECK(atomTable.internAscii(cx, ascii, 2) == refIndex);
   CHECK(atomTable.internLatin1(cx, latin1, 2) == refIndex);
   CHECK(atomTable.internUtf8(cx, utf8, 2) == refIndex);
   CHECK(atomTable.internChar16(cx, char16, 2) == refIndex);
 
   // Note: If Latin1-Extended characters become supported, then UTF-8 behaviour
   // should be tested.
   char16_t ae0[] = {0x00E6, '0'};
-  CHECK(cx->parserNames().lookupTiny(ae0, 2) == nullptr);
+  CHECK(cx->runtime()->commonParserNames->lookupTiny(ae0, 2) == nullptr);
 
   return true;
 }
 END_TEST(testParserAtom_tiny2)
 
 // "æ"    U+00E6
 // "π"    U+03C0
 // "🍕"   U+1F355
--- a/js/src/vm/JSContext.h
+++ b/js/src/vm/JSContext.h
@@ -277,19 +277,16 @@ struct JS_PUBLIC_API JSContext : public 
   uint32_t getAndResetAllocsThisZoneSinceMinorGC() {
     uint32_t allocs = allocsThisZoneSinceMinorGC_;
     allocsThisZoneSinceMinorGC_ = 0;
     return allocs;
   }
 
   // Accessors for immutable runtime data.
   JSAtomState& names() { return *runtime_->commonNames; }
-  js::frontend::WellKnownParserAtoms& parserNames() {
-    return *runtime_->commonParserNames;
-  }
   js::StaticStrings& staticStrings() { return *runtime_->staticStrings; }
   js::SharedImmutableStringsCache& sharedImmutableStrings() {
     return runtime_->sharedImmutableStrings();
   }
   bool permanentAtomsPopulated() { return runtime_->permanentAtomsPopulated(); }
   const js::FrozenAtomSet& permanentAtoms() {
     return *runtime_->permanentAtoms();
   }
--- a/js/src/wasm/AsmJS.cpp
+++ b/js/src/wasm/AsmJS.cpp
@@ -6480,17 +6480,16 @@ static bool GetDataProperty(JSContext* c
   }
 
   return GetDataProperty(cx, objVal, field, v);
 }
 
 static bool GetDataProperty(JSContext* cx, HandleValue objVal,
                             const ImmutablePropertyNamePtr& field,
                             MutableHandleValue v) {
-  // Help the conversion along for all the cx->parserNames().* users.
   HandlePropertyName fieldHandle = field;
   return GetDataProperty(cx, objVal, fieldHandle, v);
 }
 
 static bool HasObjectValueOfMethodPure(JSObject* obj, JSContext* cx) {
   Value v;
   if (!GetPropertyPure(cx, obj, NameToId(cx->names().valueOf), &v)) {
     return false;