public class JsLiteralInterner extends Object
Modifier and Type | Field and Description |
---|---|
static int |
INTERN_ALL |
static int |
INTERN_ARRAY_LITERALS
Flags to control what type of literals to intern.
|
static int |
INTERN_NUMBERS |
static int |
INTERN_OBJECT_LITERALS |
static int |
INTERN_REGEXES |
static int |
INTERN_STRINGS |
Modifier and Type | Method and Description |
---|---|
static Map<JsName,JsLiteral> |
exec(JProgram jprogram,
JsProgram program,
int 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 int INTERN_ARRAY_LITERALS
public static final int INTERN_NUMBERS
public static final int INTERN_OBJECT_LITERALS
public static final int INTERN_REGEXES
public static final int INTERN_STRINGS
public static final int INTERN_ALL
public static Map<JsName,JsLiteral> exec(JProgram jprogram, JsProgram program, int 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.