diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2020-01-18 16:30:42 -0500 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2020-01-26 15:50:36 -0500 |
commit | 41e477e2ce2d00a793adc6f8ba85540e02275e5f (patch) | |
tree | a21556dd199b6163eecda8032066e7532ff88ecb /parser/html/java/htmlparser/src | |
parent | e5557d43d6934918c018a527f3bae1f7049b9ef1 (diff) | |
download | UXP-41e477e2ce2d00a793adc6f8ba85540e02275e5f.tar UXP-41e477e2ce2d00a793adc6f8ba85540e02275e5f.tar.gz UXP-41e477e2ce2d00a793adc6f8ba85540e02275e5f.tar.lz UXP-41e477e2ce2d00a793adc6f8ba85540e02275e5f.tar.xz UXP-41e477e2ce2d00a793adc6f8ba85540e02275e5f.zip |
Bug 1358037 - Inline the methods of nsHtml5ElementName and nsHtml5AttributeName.
Tag UXP Issue #1344
Diffstat (limited to 'parser/html/java/htmlparser/src')
-rw-r--r-- | parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/AttributeName.java | 8 | ||||
-rw-r--r-- | parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/ElementName.java | 17 |
2 files changed, 14 insertions, 11 deletions
diff --git a/parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/AttributeName.java b/parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/AttributeName.java index 24f89ddb0..667e8eb93 100644 --- a/parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/AttributeName.java +++ b/parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/AttributeName.java @@ -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; diff --git a/parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/ElementName.java b/parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/ElementName.java index e961c4397..cc363acde 100644 --- a/parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/ElementName.java +++ b/parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/ElementName.java @@ -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); |