Remove the dynamic selector-state-machine from the parser class

Instead, use a plain-old switch-case.

Performance boost (along with the character token changes) about 6% (reference to baseline)
This commit is contained in:
iska
2015-04-12 19:45:50 +02:00
parent c524b25051
commit 4ddf8e60fd
3 changed files with 48 additions and 33 deletions
-12
View File
@@ -30,8 +30,6 @@
MODE_ENTRY( HTMLInsertionModeAfterFrameset, ) \
MODE_ENTRY( HTMLInsertionModeAfterAfterBody, ) \
MODE_ENTRY( HTMLInsertionModeAfterAfterFrameset, ) \
MODE_ENTRY( HTMLInsertionModeCurrentTemplate, ) \
MODE_ENTRY( HTMLInsertionModesCount, )
typedef NS_ENUM(NSUInteger, HTMLInsertionMode)
{
@@ -39,13 +37,3 @@ typedef NS_ENUM(NSUInteger, HTMLInsertionMode)
INSERTION_MODES
#undef MODE_ENTRY
};
static NSString * HTMLInsertionModesTable[] = {
#define LITERAL(X) #X
#define STRINGIFY(X) LITERAL(X)
#define MODE_ENTRY( name, value ) [name] = @#name STRINGIFY(:),
INSERTION_MODES
#undef MODE_ENTRY
#undef STRINGIFY
#undef LITERAL
};