Bug 1358037 - Inline the methods of nsHtml5ElementName and nsHtml5AttributeName.

Tag UXP Issue #1344
This commit is contained in:
Gaming4JC
2020-01-18 16:30:42 -05:00
parent e5557d43d6
commit 41e477e2ce
7 changed files with 72 additions and 80 deletions
@@ -272,7 +272,7 @@ public final class AttributeName
* whether to check ncnameness
* @return an <code>AttributeName</code> corresponding to the argument data
*/
static AttributeName nameByBuffer(@NoLength char[] buf, int offset,
@Inline static AttributeName nameByBuffer(@NoLength char[] buf, int offset,
int length
, Interner interner) {
// XXX deal with offset
@@ -282,7 +282,7 @@ public final class AttributeName
return null;
}
AttributeName attributeName = AttributeName.ATTRIBUTE_NAMES[index];
@Local String name = attributeName.getLocal(AttributeName.HTML);
@Local String name = attributeName.getLocal(0);
if (!Portability.localEqualsBuffer(name, buf, offset, length)) {
return null;
}
@@ -418,11 +418,11 @@ public final class AttributeName
// CPPONLY: this.custom = true;
// CPPONLY: }
// CPPONLY:
// CPPONLY: public boolean isInterned() {
// CPPONLY: @Inline public boolean isInterned() {
// CPPONLY: return !custom;
// CPPONLY: }
// CPPONLY:
// CPPONLY: public void setNameForNonInterned(@Local String name) {
// CPPONLY: @Inline public void setNameForNonInterned(@Local String name) {
// CPPONLY: assert custom;
// CPPONLY: local[0] = name;
// CPPONLY: local[1] = name;
@@ -107,15 +107,15 @@ public final class ElementName
return flags;
}
public int getGroup() {
return flags & GROUP_MASK;
@Inline public int getGroup() {
return flags & ElementName.GROUP_MASK;
}
public boolean isInterned() {
return (flags & NOT_INTERNED) == 0;
@Inline public boolean isInterned() {
return (flags & ElementName.NOT_INTERNED) == 0;
}
static ElementName elementNameByBuffer(@NoLength char[] buf, int offset, int length, Interner interner) {
@Inline static ElementName elementNameByBuffer(@NoLength char[] buf, int offset, int length, Interner interner) {
@Unsigned int hash = ElementName.bufToHash(buf, length);
int index = Arrays.binarySearch(ElementName.ELEMENT_HASHES, hash);
if (index < 0) {
@@ -184,12 +184,15 @@ public final class ElementName
// The translator adds refcount debug code here.
}
public void setNameForNonInterned(@Local String name) {
@Inline public void setNameForNonInterned(@Local String name) {
// No need to worry about refcounting the local name, because in the
// C++ case the scoped atom table remembers its own atoms.
this.name = name;
this.camelCaseName = name;
assert this.flags == (TreeBuilder.OTHER | NOT_INTERNED);
// The assertion below relies on TreeBuilder.OTHER being zero!
// TreeBuilder.OTHER isn't referenced here, because it would create
// a circular C++ header dependency given that this method is inlined.
assert this.flags == ElementName.NOT_INTERNED;
}
// CPPONLY: public static final ElementName ISINDEX = new ElementName("isindex", "isindex", TreeBuilder.ISINDEX | SPECIAL);