public class JsLiteralInterner extends Object
Modifier and Type | Field and Description |
---|---|
static byte |
INTERN_ALL |
static byte |
INTERN_ARRAY_LITERALS
Flags to control what type of literals to intern.
|
static byte |
INTERN_NUMBERS |
static byte |
INTERN_OBJECT_LITERALS |
static byte |
INTERN_REGEXES |
static byte |
INTERN_STRINGS |
Modifier and Type | Method and Description |
---|---|
static Map<JsName,JsLiteral> |
exec(JProgram jprogram,
JsProgram program,
byte whatToIntern)
Apply interning of literals to a JsProgram.
|
static boolean |
exec(JsProgram program,
JsBlock block,
JsScope scope,
boolean alwaysIntern)
Intern literals that occur within a JsBlock.
|
public static final byte INTERN_ARRAY_LITERALS
public static final byte INTERN_NUMBERS
public static final byte INTERN_OBJECT_LITERALS
public static final byte INTERN_REGEXES
public static final byte INTERN_STRINGS
public static final byte INTERN_ALL
public static Map<JsName,JsLiteral> exec(JProgram jprogram, JsProgram program, byte whatToIntern)
jprogram
- the JProgram that has fragment dependency data for program
program
- the JsProgramwhatToIntern
- a byte mask indicating what types of literals are interned.public static boolean exec(JsProgram program, JsBlock block, JsScope scope, boolean alwaysIntern)
block
- the block to visit.scope
- the JsScope in which to reserve the new identifiers.alwaysIntern
- whether to intern all literals regardless of their occurrence count.true
if any changes were made to the block.Copyright © 2018. All rights reserved.