Bug 1848473 - Part 2: Remove IDPART from CommonPropertyNames. r=anba

Depends on D186220

Differential Revision: https://phabricator.services.mozilla.com/D186222
This commit is contained in:
Tooru Fujisawa 2023-08-15 12:34:25 +00:00
Родитель 0ae3fb0db5
Коммит 8f38393e3c
7 изменённых файлов: 619 добавлений и 655 удалений

Просмотреть файл

@ -32,7 +32,7 @@ namespace js {
namespace frontend { namespace frontend {
JSAtom* GetWellKnownAtom(JSContext* cx, WellKnownAtomId atomId) { JSAtom* GetWellKnownAtom(JSContext* cx, WellKnownAtomId atomId) {
#define ASSERT_OFFSET_(_, NAME, _2) \ #define ASSERT_OFFSET_(NAME, _) \
static_assert(offsetof(JSAtomState, NAME) == \ static_assert(offsetof(JSAtomState, NAME) == \
int32_t(WellKnownAtomId::NAME) * \ int32_t(WellKnownAtomId::NAME) * \
sizeof(js::ImmutableTenuredPtr<PropertyName*>)); sizeof(js::ImmutableTenuredPtr<PropertyName*>));
@ -1279,7 +1279,7 @@ bool WellKnownParserAtoms::init() {
// Add well-known strings to the HashMap. The HashMap is used for dynamic // Add well-known strings to the HashMap. The HashMap is used for dynamic
// lookups later and does not change once this init method is complete. // lookups later and does not change once this init method is complete.
#define COMMON_NAME_INIT_(_, NAME, _2) \ #define COMMON_NAME_INIT_(NAME, _) \
if (!initSingle(GetWellKnownAtomInfo(WellKnownAtomId::NAME), \ if (!initSingle(GetWellKnownAtomInfo(WellKnownAtomId::NAME), \
TaggedParserAtomIndex::WellKnown::NAME())) { \ TaggedParserAtomIndex::WellKnown::NAME())) { \
return false; \ return false; \

Просмотреть файл

@ -136,7 +136,7 @@ class TaggedParserAtomIndex {
MOZ_ASSERT(uint32_t(index) < SmallIndexLimit); MOZ_ASSERT(uint32_t(index) < SmallIndexLimit);
// Length1Static/Length2Static string shouldn't use WellKnownAtomId. // Length1Static/Length2Static string shouldn't use WellKnownAtomId.
#define CHECK_(_, NAME, _2) MOZ_ASSERT(index != WellKnownAtomId::NAME); #define CHECK_(NAME, _) MOZ_ASSERT(index != WellKnownAtomId::NAME);
FOR_EACH_NON_EMPTY_TINY_PROPERTYNAME(CHECK_) FOR_EACH_NON_EMPTY_TINY_PROPERTYNAME(CHECK_)
#undef CHECK_ #undef CHECK_
} }
@ -149,7 +149,7 @@ class TaggedParserAtomIndex {
class WellKnown { class WellKnown {
public: public:
#define METHOD_(_, NAME, _2) \ #define METHOD_(NAME, _) \
static constexpr TaggedParserAtomIndex NAME() { \ static constexpr TaggedParserAtomIndex NAME() { \
return TaggedParserAtomIndex(WellKnownAtomId::NAME); \ return TaggedParserAtomIndex(WellKnownAtomId::NAME); \
} }
@ -170,14 +170,14 @@ class TaggedParserAtomIndex {
JS_FOR_EACH_WELL_KNOWN_SYMBOL(METHOD_) JS_FOR_EACH_WELL_KNOWN_SYMBOL(METHOD_)
#undef METHOD_ #undef METHOD_
#define METHOD_(_, NAME, STR) \ #define METHOD_(NAME, STR) \
static constexpr TaggedParserAtomIndex NAME() { \ static constexpr TaggedParserAtomIndex NAME() { \
return TaggedParserAtomIndex(Length1StaticParserString((STR)[0])); \ return TaggedParserAtomIndex(Length1StaticParserString((STR)[0])); \
} }
FOR_EACH_LENGTH1_PROPERTYNAME(METHOD_) FOR_EACH_LENGTH1_PROPERTYNAME(METHOD_)
#undef METHOD_ #undef METHOD_
#define METHOD_(_, NAME, STR) \ #define METHOD_(NAME, STR) \
static constexpr TaggedParserAtomIndex NAME() { \ static constexpr TaggedParserAtomIndex NAME() { \
return TaggedParserAtomIndex(Length2StaticParserString( \ return TaggedParserAtomIndex(Length2StaticParserString( \
(StaticStrings::getLength2IndexStatic((STR)[0], (STR)[1])))); \ (StaticStrings::getLength2IndexStatic((STR)[0], (STR)[1])))); \
@ -194,7 +194,7 @@ class TaggedParserAtomIndex {
// For using in switch-case. // For using in switch-case.
class WellKnownRawData { class WellKnownRawData {
public: public:
#define METHOD_(_, NAME, _2) \ #define METHOD_(NAME, _) \
static constexpr uint32_t NAME() { \ static constexpr uint32_t NAME() { \
return uint32_t(WellKnownAtomId::NAME) | WellKnownTag | WellKnownSubTag; \ return uint32_t(WellKnownAtomId::NAME) | WellKnownTag | WellKnownSubTag; \
} }
@ -215,14 +215,14 @@ class TaggedParserAtomIndex {
JS_FOR_EACH_WELL_KNOWN_SYMBOL(METHOD_) JS_FOR_EACH_WELL_KNOWN_SYMBOL(METHOD_)
#undef METHOD_ #undef METHOD_
#define METHOD_(_, NAME, STR) \ #define METHOD_(NAME, STR) \
static constexpr uint32_t NAME() { \ static constexpr uint32_t NAME() { \
return uint32_t((STR)[0]) | WellKnownTag | Length1StaticSubTag; \ return uint32_t((STR)[0]) | WellKnownTag | Length1StaticSubTag; \
} }
FOR_EACH_LENGTH1_PROPERTYNAME(METHOD_) FOR_EACH_LENGTH1_PROPERTYNAME(METHOD_)
#undef METHOD_ #undef METHOD_
#define METHOD_(_, NAME, STR) \ #define METHOD_(NAME, STR) \
static constexpr uint32_t NAME() { \ static constexpr uint32_t NAME() { \
return uint32_t( \ return uint32_t( \
StaticStrings::getLength2IndexStatic((STR)[0], (STR)[1])) | \ StaticStrings::getLength2IndexStatic((STR)[0], (STR)[1])) | \

Просмотреть файл

@ -3648,7 +3648,7 @@ void frontend::DumpTaggedParserAtomIndex(js::JSONPrinter& json,
json.property("atom", ""); json.property("atom", "");
break; break;
# define CASE_(_, name, _2) case WellKnownAtomId::name: # define CASE_(name, _) case WellKnownAtomId::name:
FOR_EACH_NONTINY_COMMON_PROPERTYNAME(CASE_) FOR_EACH_NONTINY_COMMON_PROPERTYNAME(CASE_)
# undef CASE_ # undef CASE_
@ -3726,7 +3726,7 @@ void frontend::DumpTaggedParserAtomIndexNoQuote(
out.put("#<zero-length name>"); out.put("#<zero-length name>");
break; break;
# define CASE_(_, name, _2) case WellKnownAtomId::name: # define CASE_(name, _) case WellKnownAtomId::name:
FOR_EACH_NONTINY_COMMON_PROPERTYNAME(CASE_) FOR_EACH_NONTINY_COMMON_PROPERTYNAME(CASE_)
# undef CASE_ # undef CASE_

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -18,7 +18,7 @@ class PropertyName;
/* Various built-in or commonly-used names pinned on first context. */ /* Various built-in or commonly-used names pinned on first context. */
struct JSAtomState { struct JSAtomState {
#define PROPERTYNAME_FIELD(idpart, id, text) \ #define PROPERTYNAME_FIELD(id, text) \
js::ImmutableTenuredPtr<js::PropertyName*> id; js::ImmutableTenuredPtr<js::PropertyName*> id;
FOR_EACH_COMMON_PROPERTYNAME(PROPERTYNAME_FIELD) FOR_EACH_COMMON_PROPERTYNAME(PROPERTYNAME_FIELD)
#undef PROPERTYNAME_FIELD #undef PROPERTYNAME_FIELD

Просмотреть файл

@ -7,8 +7,8 @@
#include "vm/WellKnownAtom.h" #include "vm/WellKnownAtom.h"
js::WellKnownAtomInfo js::wellKnownAtomInfos[] = { js::WellKnownAtomInfo js::wellKnownAtomInfos[] = {
#define ENUM_ENTRY_(_, _2, TEXT) \ #define ENUM_ENTRY_(_, TEXT) \
{uint32_t(sizeof(TEXT) - 1), \ {uint32_t(sizeof(TEXT) - 1), \
mozilla::HashStringKnownLength(TEXT, sizeof(TEXT) - 1), TEXT}, mozilla::HashStringKnownLength(TEXT, sizeof(TEXT) - 1), TEXT},
FOR_EACH_COMMON_PROPERTYNAME(ENUM_ENTRY_) FOR_EACH_COMMON_PROPERTYNAME(ENUM_ENTRY_)
#undef ENUM_ENTRY_ #undef ENUM_ENTRY_

Просмотреть файл

@ -22,7 +22,7 @@ namespace js {
// GetWellKnownAtom in ParserAtom.cpp relies on the fact that // GetWellKnownAtom in ParserAtom.cpp relies on the fact that
// JSAtomState fields and this enum variants use the same order. // JSAtomState fields and this enum variants use the same order.
enum class WellKnownAtomId : uint32_t { enum class WellKnownAtomId : uint32_t {
#define ENUM_ENTRY_(_, NAME, _2) NAME, #define ENUM_ENTRY_(NAME, _) NAME,
FOR_EACH_COMMON_PROPERTYNAME(ENUM_ENTRY_) FOR_EACH_COMMON_PROPERTYNAME(ENUM_ENTRY_)
#undef ENUM_ENTRY_ #undef ENUM_ENTRY_